49. File Comparison Report

Produced on Mon May 12 13:04:35 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

49.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin memb_levels.php Mon Dec 24 09:44:18 2007 UTC
2 Dolphin-v.6.1.0\admin memb_levels.php Sat Apr 19 12:05:02 2008 UTC

49.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 5 1826
Changed 3 11
Inserted 0 0
Removed 1 1

49.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

49.4 Active regular expressions

No regular expressions were active.

49.5 Comparison detail

1   <?   1   <?
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
12   * http://c reativecom mons.org/l icenses/by /3.0/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   require_on ce( '../in c/header.i nc.php' );   21   require_on ce( '../in c/header.i nc.php' );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofile_dis p.inc.php'  );    
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );
26     25  
27   $IDNonMemb er = 1;   26   $IDNonMemb er = 1;
28     27  
29   // Check i f admin is  logged in  and save  this info  into $logg ed var.   28   // Check i f admin is  logged in  and save  this info  into $logg ed var.
30   $logged['a dmin']   =   member_aut h(1
);
  29   $logged['a dmin']   =   member_aut h(   1 ,   true,   true   );
31   $_page['cs s_name'] =  'memb_lev els.css';   30   $_page['cs s_name'] =  'memb_lev els.css';
32     31  
33   $_page['he ader'] = ' Manage Mem bership Ty pes'; // S et page ti tle.   32   $_page['he ader'] = ' Manage Mem bership Ty pes'; // S et page ti tle.
34     33  
35   function d isplayOpti ons()   34   function d isplayOpti ons()
36   {   35   {
37       $sCat  = "`kateg`  IN ('5',' 7') ";   36       $sCat  = "`kateg`  IN ('5',' 7') ";
38          37       
39       $sClea r = '   38       $sClea r = '
40           <d iv style="   39           <d iv style="
41                position :relative;   40                position :relative;
42                clear:bo th;   41                clear:bo th;
43                height:0 px;   42                height:0 px;
44                line-hei ght:0px;   43                line-hei ght:0px;
45                margin:0 px;   44                margin:0 px;
46                padding: 0px;   45                padding: 0px;
47                font-siz e:0px;">   46                font-siz e:0px;">
48           </ div>';   47           </ div>';
49          48       
50       $sMain  = 'positi on:relativ e; float:l eft;';   49       $sMain  = 'positi on:relativ e; float:l eft;';
51          50       
52       $sQuer y = "SELEC T   51       $sQuer y = "SELEC T
53                         `GlParams` .`Name`,   52                         `GlParams` .`Name`,
54                         `VALUE` as  `Value`,   53                         `VALUE` as  `Value`,
55                         `desc`,   54                         `desc`,
56                         `Type`,   55                         `Type`,
57                         `GlParamsK ateg`.`nam e` AS `kat egName`,   56                         `GlParamsK ateg`.`nam e` AS `kat egName`,
58                         `order_in_ kateg` as  `Order`   57                         `order_in_ kateg` as  `Order`
59                FROM   58                FROM
60                         `GlParams`   59                         `GlParams`
61                LEFT JOI N `GlParam sKateg` ON  `GlParams Kateg`.`ID ` = `GlPar ams`.`kate g`   60                LEFT JOI N `GlParam sKateg` ON  `GlParams Kateg`.`ID ` = `GlPar ams`.`kate g`
62                WHERE   61                WHERE
63                         ".$sCat."  AND `GlPar ams`.`Name ` NOT LIKE  '%_subjec t' OR `GlP arams`.`Na me` = 'fre e_mode' OR DER BY `ka teg`,`orde r_in_kateg ` ASC";   62                         ".$sCat."  AND `GlPar ams`.`Name ` NOT LIKE  '%_subjec t' OR `GlP arams`.`Na me` = 'fre e_mode' OR DER BY `ka teg`,`orde r_in_kateg ` ASC";
64          63       
65       $sCode  = '<form  method="po st" action ="'. $_SER VER['SCRIP T_NAME'].' ">   64       $sCode  = '<form  method="po st" action ="'. $_SER VER['SCRIP T_NAME'].' ">
66           <i nput type= "hidden" n ame="save_ settings"  value="yes ">   65           <i nput type= "hidden" n ame="save_ settings"  value="yes ">
67           <i nput type= "hidden" n ame="categ ory" value ="'.$iCat. '">   66           <i nput type= "hidden" n ame="categ ory" value ="'.$iCat. '">
68           <d iv>';   67           <d iv>';
69          68       
70       $rData  = db_res( $sQuery);   69       $rData  = db_res( $sQuery);
71       while( $aData = m ysql_fetch _assoc($rD ata))   70       while( $aData = m ysql_fetch _assoc($rD ata))
72       {   71       {
73           $s Field = '' ;   72           $s Field = '' ;
74           $s Code .= '< div style= "margin: 1 0px 10px 1 0px 10px;" >';   73           $s Code .= '< div style= "margin: 1 0px 10px 1 0px 10px;" >';
75           $s Code .= '< div style= "'.$sMain. 'width:400 px; height :20px;">'. $aData['de sc'].'</di v>';   74           $s Code .= '< div style= "'.$sMain. 'width:400 px; height :20px;">'. $aData['de sc'].'</di v>';
76     75  
77           sw itch($aDat a['Type'])   76           sw itch($aDat a['Type'])
78           {   77           {
79                case 'ch eckbox':   78                case 'ch eckbox':
80                    $sFi eld = '<di v style="' .$sMain.'t ext-align: right; wid th:170px;" >   79                    $sFi eld = '<di v style="' .$sMain.'t ext-align: right; wid th:170px;" >
81                         <input typ e="checkbo x" name="' .$aData['N ame'].'"'.  ('on' ==  $aData['Va lue'] ? 'c hecked="ch ecked"' :  '').'"></d iv>';   80                         <input typ e="checkbo x" name="' .$aData['N ame'].'"'.  ('on' ==  $aData['Va lue'] ? 'c hecked="ch ecked"' :  '').'"></d iv>';
82                    brea k;   81                    brea k;
83                case 'di git':   82                case 'di git':
84                    $sFi eld = '<di v style="' .$sMain.'t ext-align: right; wid th:170px;" >   83                    $sFi eld = '<di v style="' .$sMain.'t ext-align: right; wid th:170px;" >
85                         <input typ e="text" n ame="'.$aD ata['Name' ].'" size= "15" value ="'.$aData ['Value']. '" />   84                         <input typ e="text" n ame="'.$aD ata['Name' ].'" size= "15" value ="'.$aData ['Value']. '" />
86                    </di v>';   85                    </di v>';
87                    brea k;   86                    brea k;
88                default:   87                default:
89           }   88           }
90              89           
91           $s Code .= $s Field.$sCl ear.'</div >';   90           $s Code .= $s Field.$sCl ear.'</div >';
92       }   91       }
93          92       
94       $sCode  .= '</div >';   93       $sCode  .= '</div >';
95          94       
96       $sCode  .= '<div  style="tex t-align: c enter;">   95       $sCode  .= '<div  style="tex t-align: c enter;">
97       <input  type="sub mit" value ="Save Cha nges" clas s="text" n ame="saveM emSet"></f orm></div> ';   96       <input  type="sub mit" value ="Save Cha nges" clas s="text" n ame="saveM emSet"></f orm></div> ';
98          97       
99       return  $sCode;   98       return  $sCode;
100   }   99   }
101     100  
102   function s aveMemSett ings()   101   function s aveMemSett ings()
103   {   102   {
104       $aDigi t = array( 'expire_no tification _days','pr omotion_me mbership_d ays');   103       $aDigi t = array( 'expire_no tification _days','pr omotion_me mbership_d ays');
105          104       
106       $aChec k = array( 'expire_no tify_once' ,'enable_p romotion_m embership' ,'free_mod e');   105       $aChec k = array( 'expire_no tify_once' ,'enable_p romotion_m embership' ,'free_mod e');
107          106       
108          107       
109       foreac h ($aDigit  as $i =>  $sVal)   108       foreac h ($aDigit  as $i =>  $sVal)
110       {   109       {
111           if  ($_POST[$ sVal])   110           if  ($_POST[$ sVal])
112           {   111           {
113                setparam ($sVal, ht mlspecialc hars_adv($ _POST[$sVa l]));   112                setparam ($sVal, ht mlspecialc hars_adv($ _POST[$sVa l]));
114           }   113           }
115       }   114       }
116          115       
117       foreac h ($aCheck  as $i =>  $sVal)   116       foreac h ($aCheck  as $i =>  $sVal)
118       {   117       {
119           if  ('on' ==  $_POST[$sV al])   118           if  ('on' ==  $_POST[$sV al])
120           {   119           {
121                setparam ($sVal, 'o n');   120                setparam ($sVal, 'o n');
122           }   121           }
123           el se   122           el se
124           {   123           {
125                setparam ($sVal, '' );   124                setparam ($sVal, '' );
126           }   125           }
127       }   126       }
128   }   127   }
129     128  
130   function a ddMembersh ip($member shipName)   129   function a ddMembersh ip($member shipName)
131   {   130   {
132       $membe rshipName  = trim($me mbershipNa me);   131       $membe rshipName  = trim($me mbershipNa me);
133     132  
134       if(!$m embershipN ame) retur n '';   133       if(!$m embershipN ame) retur n '';
135     134  
136       if(!ge t_magic_qu otes_gpc() ) $members hipName =  addslashes ($membersh ipName);   135       if(!ge t_magic_qu otes_gpc() ) $members hipName =  addslashes ($membersh ipName);
137     136  
138       @mysql _query("IN SERT INTO  MemLevels  (Name) VAL UES ('$mem bershipNam e')");   137       @mysql _query("IN SERT INTO  MemLevels  (Name) VAL UES ('$mem bershipNam e')");
139     138  
140       if(mys ql_affecte d_rows() >  0) {   139       if(mys ql_affecte d_rows() >  0) {
141           if (!get_magi c_quotes_g pc()) $mem bershipNam e = strips lashes($me mbershipNa me);   140           if (!get_magi c_quotes_g pc()) $mem bershipNam e = strips lashes($me mbershipNa me);
142           re turn "\n<d iv class=\ "actionSuc cess\"> '" .htmlspeci alchars($m embershipN ame)."' me mbership h as been ad ded</div>" ;   141           re turn "\n<d iv class=\ "actionSuc cess\"> '" .htmlspeci alchars($m embershipN ame)."' me mbership h as been ad ded</div>" ;
143       }   142       }
144     143  
145       return  "\n<div c lass=\"act ionFailure \">Error:  membership  has not b een added< /div>";   144       return  "\n<div c lass=\"act ionFailure \">Error:  membership  has not b een added< /div>";
146   }   145   }
147     146  
148   function d eleteMembe rship($mem bershipID)   147   function d eleteMembe rship($mem bershipID)
149   {   148   {
150       $membe rshipID =  (int)$memb ershipID;   149       $membe rshipID =  (int)$memb ershipID;
151     150  
152       if($me mbershipID  <= 0) ret urn '';   151       if($me mbershipID  <= 0) ret urn '';
153     152  
154       $resMe mLevel = m ysql_query ("SELECT R emovable F ROM MemLev els WHERE  ID = $memb ershipID") ;   153       $resMe mLevel = m ysql_query ("SELECT R emovable F ROM MemLev els WHERE  ID = $memb ershipID") ;
155     154  
156       if(mys ql_num_row s($resMemL evel) < 1)  {   155       if(mys ql_num_row s($resMemL evel) < 1)  {
157           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";   156           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";
158       }   157       }
159     158  
160       //chec k if membe rship can  be removed   159       //chec k if membe rship can  be removed
161     160  
162       $remov able = mys ql_fetch_a ssoc($resM emLevel);   161       $remov able = mys ql_fetch_a ssoc($resM emLevel);
163       $remov able = $re movable['R emovable']  == 'yes'  ? true : f alse;   162       $remov able = $re movable['R emovable']  == 'yes'  ? true : f alse;
164     163  
165       if(!$r emovable)  {   164       if(!$r emovable)  {
166           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  removed</d iv>";   165           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  removed</d iv>";
167       }   166       }
168     167  
169       //chec k if there  are still  members u sing this  membership   168       //chec k if there  are still  members u sing this  membership
170     169  
171       $resMa xDateExpir es = @mysq l_query("   170       $resMa xDateExpir es = @mysq l_query("
172           SE LECT UNIX_ TIMESTAMP( MAX(DateEx pires)) as  MaxDateEx pires   171           SE LECT UNIX_ TIMESTAMP( MAX(DateEx pires)) as  MaxDateEx pires
173           FR OM Profile MemLevels  WHERE IDLe vel = $mem bershipID" );   172           FR OM Profile MemLevels  WHERE IDLe vel = $mem bershipID" );
174     173  
175       //mysq l_num_rows () for the  query abo ve is alwa ys 1   174       //mysq l_num_rows () for the  query abo ve is alwa ys 1
176     175  
177       $maxDa teExpires  = mysql_fe tch_assoc( $resMaxDat eExpires);   176       $maxDa teExpires  = mysql_fe tch_assoc( $resMaxDat eExpires);
178       $maxDa teExpires  = $maxDate Expires['M axDateExpi res'];   177       $maxDa teExpires  = $maxDate Expires['M axDateExpi res'];
179     178  
180       if($ma xDateExpir es > time( )) {   179       if($ma xDateExpir es > time( )) {
181           re turn "\n   180           re turn "\n
182           <d iv class=\ "actionFai lure\">   181           <d iv class=\ "actionFai lure\">
183                There ar e currentl y members  using this  membershi p so it ca nnot be de leted.<br>   182                There ar e currentl y members  using this  membershi p so it ca nnot be de leted.<br>
184                If you w ant to del ete this m embership,  please ma ke it inac tive and w ait until   183                If you w ant to del ete this m embership,  please ma ke it inac tive and w ait until
185                it expir es for all  members c urrently u sing it (" .date("F j , Y, g:i a ", $maxDat eExpires). ").   184                it expir es for all  members c urrently u sing it (" .date("F j , Y, g:i a ", $maxDat eExpires). ").
186           </ div>";   185           </ div>";
187       }   186       }
188     187  
189       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID");   188       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID");
190       @mysql _query("DE LETE FROM  MemLevelAc tions WHER E IDLevel  = $members hipID");   189       @mysql _query("DE LETE FROM  MemLevelAc tions WHER E IDLevel  = $members hipID");
191       @mysql _query("DE LETE FROM  MemLevels  WHERE ID =  $membersh ipID");   190       @mysql _query("DE LETE FROM  MemLevels  WHERE ID =  $membersh ipID");
192     191  
193       if(mys ql_affecte d_rows() >  0) {   192       if(mys ql_affecte d_rows() >  0) {
194           re turn "\n<d iv class=\ "actionSuc cess\">Mem bership ha s been del eted</div> ";   193           re turn "\n<d iv class=\ "actionSuc cess\">Mem bership ha s been del eted</div> ";
195       }   194       }
196     195  
197       return  "\n<div c lass=\"act ionFailure \">Error:  membership  has not b een delete d</div>";   196       return  "\n<div c lass=\"act ionFailure \">Error:  membership  has not b een delete d</div>";
198   }   197   }
199     198  
200   function a ctivateMem bership($m embershipI D, $active )   199   function a ctivateMem bership($m embershipI D, $active )
201   {   200   {
202       $membe rshipID =  (int)$memb ershipID;   201       $membe rshipID =  (int)$memb ershipID;
203       if($ac tive != 'y es' && $ac tive != 'n o') return  '';   202       if($ac tive != 'y es' && $ac tive != 'n o') return  '';
204     203  
205       if($me mbershipID  <= 0) ret urn '';   204       if($me mbershipID  <= 0) ret urn '';
206     205  
207       $resMe mLevel = m ysql_query ("SELECT P urchasable  FROM MemL evels WHER E ID = $me mbershipID ");   206       $resMe mLevel = m ysql_query ("SELECT P urchasable  FROM MemL evels WHER E ID = $me mbershipID ");
208     207  
209       if(mys ql_num_row s($resMemL evel) < 1)  {   208       if(mys ql_num_row s($resMemL evel) < 1)  {
210           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";   209           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";
211       }   210       }
212     211  
213       //chec k if membe rship can  be purchas ed   212       //chec k if membe rship can  be purchas ed
214     213  
215       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;   214       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;
216       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;   215       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;
217     216  
218       if(!$p urchasable ) {   217       if(!$p urchasable ) {
219           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  (de)activa ted becaus e it's not  purchasab le.</div>" ;   218           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  (de)activa ted becaus e it's not  purchasab le.</div>" ;
220       }   219       }
221     220  
222       @mysql _query("UP DATE MemLe vels SET A ctive = '$ active' WH ERE ID = $ membership ID");   221       @mysql _query("UP DATE MemLe vels SET A ctive = '$ active' WH ERE ID = $ membership ID");
223     222  
224       if(mys ql_affecte d_rows() < = 0){   223       if(mys ql_affecte d_rows() < = 0){
225           $d e = $activ e ? '' : ' de';   224           $d e = $activ e ? '' : ' de';
226           re turn "\n<d iv class=\ "actionFai lure\">Err or: member ship has n ot been {$ de}activat ed</div>";   225           re turn "\n<d iv class=\ "actionFai lure\">Err or: member ship has n ot been {$ de}activat ed</div>";
227       }   226       }
228     227  
229       return  '';   228       return  '';
230   }   229   }
231     230  
232   function m embershipL ist()   231   function m embershipL ist()
233   {   232   {
234       $editL evel = (in t)$_GET['e dit_level' ];   233       $editL evel = (in t)$_GET['e dit_level' ];
235     234  
236       ob_sta rt();   235       ob_sta rt();
237     236  
238   //ContentB lockHead(" Manage Mem bership Ty pes");   237   //ContentB lockHead(" Manage Mem bership Ty pes");
239   ?>   238   ?>
240   <!--   239   <!--
241   <div class ="sectionH eader">Man age Member ship Types </div>   240   <div class ="sectionH eader">Man age Member ship Types </div>
242   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->   241   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->
243       <?= ad dMembershi p($_POST[' add_member ship']) ?>   242       <?= ad dMembershi p($_POST[' add_member ship']) ?>
244       <?= de leteMember ship($_POS T['delete_ membership ']) ?>   243       <?= de leteMember ship($_POS T['delete_ membership ']) ?>
245       <?= ac tivateMemb ership($_P OST['activ ate_member ship_id'],  $_POST['a ctivate_me mbership_a ctive']) ? >   244       <?= ac tivateMemb ership($_P OST['activ ate_member ship_id'],  $_POST['a ctivate_me mbership_a ctive']) ? >
246       <div a lign="righ t">   245       <div a lign="righ t">
247           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>" method ="POST">   246           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>" method ="POST">
248                New memb ership:   247                New memb ership:
249                <input t ype="text"  name="add _membershi p" />   248                <input t ype="text"  name="add _membershi p" />
250                <input t ype="submi t" value=" Add" />   249                <input t ype="submi t" value=" Add" />
251           </ form>   250           </ form>
252       </div>   251       </div>
253     252  
254       <table  class="me mbershipLi st" cellsp acing="0"  align="cen ter">   253       <table  class="me mbershipLi st" cellsp acing="0"  align="cen ter">
255           <t r class="h eaderRow">   254           <t r class="h eaderRow">
256                <td></td >   255                <td></td >
257                <td>   256                <td>
258                    Memb ership Typ es   257                    Memb ership Typ es
259                </td>   258                </td>
260           </ tr>   259           </ tr>
261           <t r>   260           <t r>
262                <td cols pan="5" cl ass="space r"></td>   261                <td cols pan="5" cl ass="space r"></td>
263           </ tr>   262           </ tr>
264   <?   263   <?
265       $resMe mLevels =  db_res ( " SELECT ID,  Name, Act ive, Purch asable, Re movable FR OM MemLeve ls ORDER B Y ID" );   264       $resMe mLevels =  db_res ( " SELECT ID,  Name, Act ive, Purch asable, Re movable FR OM MemLeve ls ORDER B Y ID" );
266     265  
267       if (my sql_num_ro ws($resMem Levels) <=  0) {   266       if (my sql_num_ro ws($resMem Levels) <=  0) {
268   ?>   267   ?>
269           <t r>   268           <t r>
270                <td alig n="center" >   269                <td alig n="center" >
271                    Ther e are no m embership  levels ava ilable at  the moment   270                    Ther e are no m embership  levels ava ilable at  the moment
272                </td>   271                </td>
273           </ tr>   272           </ tr>
274   <?   273   <?
275       } else  {   274       } else  {
276           wh ile($arrMe mLevel = m ysql_fetch _assoc($re sMemLevels ))   275           wh ile($arrMe mLevel = m ysql_fetch _assoc($re sMemLevels ))
277           {   276           {
278                $ID = $a rrMemLevel ['ID'];   277                $ID = $a rrMemLevel ['ID'];
279     278  
280                $selecte dRow = $ed itLevel ==  $ID ? 'cl ass="activ eRow"' : ' ';   279                $selecte dRow = $ed itLevel ==  $ID ? 'cl ass="activ eRow"' : ' ';
281   ?>   280   ?>
282           <t r <?= $sel ectedRow ? >>   281           <t r <?= $sel ectedRow ? >>
283   <?   282   <?
284                //print  'Active/In active' ce ll   283                //print  'Active/In active' ce ll
285     284  
286                if ($arr MemLevel[' Purchasabl e'] == 'ye s')   285                if ($arr MemLevel[' Purchasabl e'] == 'ye s')
287                {   286                {
288                    $mem bershipAct ive = $arr MemLevel[' Active'] = = 'yes' ?  true : fal se;   287                    $mem bershipAct ive = $arr MemLevel[' Active'] = = 'yes' ?  true : fal se;
289   ?>   288   ?>
290                <td clas s="<?= $me mbershipAc tive ? 'de activate'  : 'activat e' ?>">   289                <td clas s="<?= $me mbershipAc tive ? 'de activate'  : 'activat e' ?>">
291                    <for m name="fo rmActivate <?= $ID ?> " action=" <?= $_SERV ER['SCRIPT _NAME'] ?> " method=" post" styl e="margin:  0">   290                    <for m name="fo rmActivate <?= $ID ?> " action=" <?= $_SERV ER['SCRIPT _NAME'] ?> " method=" post" styl e="margin:  0">
292                         <input typ e="hidden"  name="act ivate_memb ership_id"  value="<? = $ID ?>"  />   291                         <input typ e="hidden"  name="act ivate_memb ership_id"  value="<? = $ID ?>"  />
293                         <input typ e="hidden"  name="act ivate_memb ership_act ive" value ="<?= $mem bershipAct ive ? 'no'  : 'yes' ? >" />   292                         <input typ e="hidden"  name="act ivate_memb ership_act ive" value ="<?= $mem bershipAct ive ? 'no'  : 'yes' ? >" />
294                    </fo rm>   293                    </fo rm>
295                    <a h ref="javas cript:void (0)" oncli ck="docume nt.forms[' formActiva te<?= $ID  ?>'].submi t(); retur n false;">   294                    <a h ref="javas cript:void (0)" oncli ck="docume nt.forms[' formActiva te<?= $ID  ?>'].submi t(); retur n false;">
296                         <?= $membe rshipActiv e ? '[&nbs p;Active&n bsp;]' : ' [Inactive] '; ?>   295                         <?= $membe rshipActiv e ? '[&nbs p;Active&n bsp;]' : ' [Inactive] '; ?>
297                    </a>   296                    </a>
298                </td>   297                </td>
299   <?   298   <?
300                }else{   299                }else{
301   ?>   300   ?>
302                <td clas s="activat e"></td>   301                <td clas s="activat e"></td>
303   <?   302   <?
304                }   303                }
305   ?>   304   ?>
306                <td clas s="name">   305                <td clas s="name">
307                    <a h ref="<?= $ _SERVER['S CRIPT_NAME '] ?>?edit =actions&e dit_level= <?= $ID ?> ">   306                    <a h ref="<?= $ _SERVER['S CRIPT_NAME '] ?>?edit =actions&e dit_level= <?= $ID ?> ">
308                         <div style ="padding:  0; margin : 0; width : 100%; cu rsor: poin ter">   307                         <div style ="padding:  0; margin : 0; width : 100%; cu rsor: poin ter">
309                             <?= ht mlspecialc hars($arrM emLevel['N ame']) ?>   308                             <?= ht mlspecialc hars($arrM emLevel['N ame']) ?>
310                         </div>   309                         </div>
311                    </a>   310                    </a>
312                </td>   311                </td>
313   <?   312   <?
314                if ($arr MemLevel[' Purchasabl e'] == 'ye s')   313                if ($arr MemLevel[' Purchasabl e'] == 'ye s')
315                {   314                {
316   ?>   315   ?>
317                <td clas s="pricing ">   316                <td clas s="pricing ">
318                    <a h ref="<?= $ _SERVER['S CRIPT_NAME '] ?>?edit =pricing&e dit_level= <?= $ID ?> ">   317                    <a h ref="<?= $ _SERVER['S CRIPT_NAME '] ?>?edit =pricing&e dit_level= <?= $ID ?> ">
319                         Pricing   318                         Pricing
320                    </a>   319                    </a>
321                </td>   320                </td>
322                <td clas s="delete" >   321                <td clas s="delete" >
323                    <for m name="fo rmDelete<? = $ID ?>"  action="<? = $_SERVER ['SCRIPT_N AME'] ?>"  method="PO ST" style= "margin: 0 ">   322                    <for m name="fo rmDelete<? = $ID ?>"  action="<? = $_SERVER ['SCRIPT_N AME'] ?>"  method="PO ST" style= "margin: 0 ">
324                         <input typ e="hidden"  name="del ete_member ship" valu e="<?= $ID  ?>" />   323                         <input typ e="hidden"  name="del ete_member ship" valu e="<?= $ID  ?>" />
325                    </fo rm>   324                    </fo rm>
326                    <a h ref="javas cript:void (0)" oncli ck="confir mAndSubmit ('formDele te<?= $ID  ?>', 'Plea se confirm  membershi p deletion .'); retur n false;"> Delete</a>   325                    <a h ref="javas cript:void (0)" oncli ck="confir mAndSubmit ('formDele te<?= $ID  ?>', 'Plea se confirm  membershi p deletion .'); retur n false;"> Delete</a>
327                </td>   326                </td>
328   <?   327   <?
329                } else {   328                } else {
330   ?>   329   ?>
331                <td clas s="pricing "></td><td  class="de lete"></td >   330                <td clas s="pricing "></td><td  class="de lete"></td >
332   <?   331   <?
333                }   332                }
334   ?>   333   ?>
335           </ tr>   334           </ tr>
336           <t r>   335           <t r>
337                <td cols pan="4" cl ass="space r"></td>   336                <td cols pan="4" cl ass="space r"></td>
338           </ tr>   337           </ tr>
339   <?   338   <?
340           }   339           }
341       }   340       }
342   ?>   341   ?>
343       </tabl e>   342       </tabl e>
344     343  
345   <?   344   <?
346   //ContentB lockFoot() ;   345   //ContentB lockFoot() ;
347        $cont e n t   =   ob_get_c ont e
n ts ();
  346        r e
t urn   ob_get_c l e a n
();
348       ob_end _clean();    
349       return  $content;    
350   }   347   }
351     348  
352   function a ddPaymentO ption($mem bershipID,  $days, $p rice)   349   function a ddPaymentO ption($mem bershipID,  $days, $p rice)
353   {   350   {
354       $membe rshipID =  (int)$memb ershipID;   351       $membe rshipID =  (int)$memb ershipID;
355       $days  = (int)$da ys;   352       $days  = (int)$da ys;
356       $price  = round(( float)$pri ce, 2);   353       $price  = round(( float)$pri ce, 2);
357     354  
358       if( $m embershipI D <= 0 ||  $days < 0  || $price  <= 0 ) ret urn '';   355       if( $m embershipI D <= 0 ||  $days < 0  || $price  <= 0 ) ret urn '';
359     356  
360       if($da ys < 0 ||  $price <=  0) return  "\n<div cl ass=\"acti onFailure\ ">Error: p ayment opt ion has no t been add ed</div>";   357       if($da ys < 0 ||  $price <=  0) return  "\n<div cl ass=\"acti onFailure\ ">Error: p ayment opt ion has no t been add ed</div>";
361     358  
362       @mysql _query("IN SERT INTO  MemLevelPr ices (IDLe vel, Days,  Price) VA LUES ($mem bershipID,  $days, $p rice)");   359       @mysql _query("IN SERT INTO  MemLevelPr ices (IDLe vel, Days,  Price) VA LUES ($mem bershipID,  $days, $p rice)");
363     360  
364       if(mys ql_affecte d_rows() >  0)   361       if(mys ql_affecte d_rows() >  0)
365       {   362       {
366           if  ( $days >  0 )   363           if  ( $days >  0 )
367           {   364           {
368                return " \n<div cla ss=\"actio nSuccess\" >{$days}-d ay payment  option ad ded succes sfully</di v>";   365                return " \n<div cla ss=\"actio nSuccess\" >{$days}-d ay payment  option ad ded succes sfully</di v>";
369           }   366           }
370           el se   367           el se
371           {   368           {
372                return " \n<div cla ss=\"actio nSuccess\" >Lifetime  membership  payment o ption adde d successf ully</div> ";   369                return " \n<div cla ss=\"actio nSuccess\" >Lifetime  membership  payment o ption adde d successf ully</div> ";
373           }   370           }
374       }   371       }
375     372  
376       return  "\n<div c lass=\"act ionFailure \">Error:  payment op tion has n ot been ad ded</div>" ;   373       return  "\n<div c lass=\"act ionFailure \">Error:  payment op tion has n ot been ad ded</div>" ;
377   }   374   }
378     375  
379   function d eletePayme ntOption($ membership ID, $days)   376   function d eletePayme ntOption($ membership ID, $days)
380   {   377   {
381       $membe rshipID =  (int)$memb ershipID;   378       $membe rshipID =  (int)$memb ershipID;
382       $days  = (int)$da ys;   379       $days  = (int)$da ys;
383     380  
384       if($me mbershipID  <= 0 || $ days < 0)  return '';   381       if($me mbershipID  <= 0 || $ days < 0)  return '';
385     382  
386       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID AND D ays = $day s");   383       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID AND D ays = $day s");
387     384  
388       if(mys ql_affecte d_rows() >  0)   385       if(mys ql_affecte d_rows() >  0)
389       {   386       {
390           if  ( $days >  0 )   387           if  ( $days >  0 )
391           {   388           {
392                return " \n<div cla ss=\"actio nSuccess\" >{$days}-d ay payment  option de leted succ essfully</ div>";   389                return " \n<div cla ss=\"actio nSuccess\" >{$days}-d ay payment  option de leted succ essfully</ div>";
393           }   390           }
394           el se   391           el se
395           {   392           {
396                return " \n<div cla ss=\"actio nSuccess\" >Lifetime  membership  payment o ption dele ted succes sfully</di v>";   393                return " \n<div cla ss=\"actio nSuccess\" >Lifetime  membership  payment o ption dele ted succes sfully</di v>";
397           }   394           }
398       }   395       }
399     396  
400       return  "\n<div c lass=\"act ionFailure \">Error:  payment op tion has n ot been de leted</div >";   397       return  "\n<div c lass=\"act ionFailure \">Error:  payment op tion has n ot been de leted</div >";
401   }   398   }
402     399  
403   function m embershipP ricing($me mbershipID )   400   function m embershipP ricing($me mbershipID )
404   {   401   {
405       $membe rshipID =  (int)$memb ershipID;   402       $membe rshipID =  (int)$memb ershipID;
406       if($me mbershipID  <= 0) ret urn '';   403       if($me mbershipID  <= 0) ret urn '';
407     404  
408       //chec k if membe rship can  be purchas ed   405       //chec k if membe rship can  be purchas ed
409     406  
410       $resMe mLevel = m ysql_query ("SELECT P urchasable  FROM MemL evels WHER E ID = $me mbershipID ");   407       $resMe mLevel = m ysql_query ("SELECT P urchasable  FROM MemL evels WHER E ID = $me mbershipID ");
411     408  
412       if(mys ql_num_row s($resMemL evel) < 1)  {   409       if(mys ql_num_row s($resMemL evel) < 1)  {
413           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";   410           re turn "\n<d iv class=\ "actionFai lure\">Err or: no suc h membersh ip</div>";
414       }   411       }
415     412  
416       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;   413       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;
417       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;   414       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;
418     415  
419       if(!$p urchasable ) {   416       if(!$p urchasable ) {
420           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  purchased< /div>";   417           re turn "\n<d iv class=\ "actionFai lure\">Err or: this m embership  cannot be  purchased< /div>";
421       }   418       }
422     419  
423       ob_sta rt();   420       ob_sta rt();
424     421  
425   ContentBlo ckHead("Pr icing");   422   ContentBlo ckHead("Pr icing");
426   ?>   423   ?>
427   <!--   424   <!--
428   <div class ="sectionH eader">Pri cing</div>   425   <div class ="sectionH eader">Pri cing</div>
429   <div class ="sectionB ody"><div  style="pad ding: 10px ">   426   <div class ="sectionB ody"><div  style="pad ding: 10px ">
430   -->   427   -->
431   <?   428   <?
432       if($_P OST['add_p ayment_opt ion']) ech o addPayme ntOption($ membership ID, $_POST ['payment_ days'], $_ POST['paym ent_price' ]);   429       if($_P OST['add_p ayment_opt ion']) ech o addPayme ntOption($ membership ID, $_POST ['payment_ days'], $_ POST['paym ent_price' ]);
433       if($_P OST['delet e_payment_ option'])  echo delet ePaymentOp tion($memb ershipID,  $_POST['de lete_payme nt_days']) ;   430       if($_P OST['delet e_payment_ option'])  echo delet ePaymentOp tion($memb ershipID,  $_POST['de lete_payme nt_days']) ;
434     431  
435       $resLe velPrices  = db_res(" SELECT Day s, Price F ROM MemLev elPrices W HERE IDLev el = $memb ershipID O RDER BY Da ys");   432       $resLe velPrices  = db_res(" SELECT Day s, Price F ROM MemLev elPrices W HERE IDLev el = $memb ershipID O RDER BY Da ys");
436   ?>   433   ?>
437       <div a lign="righ t">   434       <div a lign="righ t">
438           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>?edit=pr icing&edit _level=<?=  $membersh ipID ?>" m ethod="POS T">   435           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>?edit=pr icing&edit _level=<?=  $membersh ipID ?>" m ethod="POS T">
439                <input t ype="hidde n" name="a dd_payment _option" v alue="yes" >   436                <input t ype="hidde n" name="a dd_payment _option" v alue="yes" >
440                Number o f days (0  = life-tim e membersh ip):   437                Number o f days (0  = life-tim e membersh ip):
441                <input t ype="text"  size="4"  name="paym ent_days">   438                <input t ype="text"  size="4"  name="paym ent_days">
442                Price:   439                Price:
443                <input t ype="text"  size="7"  name="paym ent_price" >   440                <input t ype="text"  size="7"  name="paym ent_price" >
444                <input t ype="submi t" value=" Add paymen t option">   441                <input t ype="submi t" value=" Add paymen t option">
445           </ form>   442           </ form>
446       </div>   443       </div>
447       <table  align="ce nter" cell spacing="0 " class="p riceList">   444       <table  align="ce nter" cell spacing="0 " class="p riceList">
448           <t r class="h eaderRow">   445           <t r class="h eaderRow">
449                <td>   446                <td>
450                    Days   447                    Days
451                </td>   448                </td>
452                <td>   449                <td>
453                    Pric e   450                    Pric e
454                </td>   451                </td>
455           </ tr>   452           </ tr>
456           <t r>   453           <t r>
457                <td cols pan="3" cl ass="space r"></td>   454                <td cols pan="3" cl ass="space r"></td>
458           </ tr>   455           </ tr>
459   <?   456   <?
460       if(!my sql_num_ro ws($resLev elPrices))  {   457       if(!my sql_num_ro ws($resLev elPrices))  {
461   ?>   458   ?>
462           <t r>   459           <t r>
463                <td cols pan="2">   460                <td cols pan="2">
464                         There are  no payment  options d efined for  this memb ership   461                         There are  no payment  options d efined for  this memb ership
465                </td>   462                </td>
466           </ tr>   463           </ tr>
467   <?   464   <?
468       }   465       }
469     466  
470       while( $arrPaymen tOption =  mysql_fetc h_assoc($r esLevelPri ces)) {   467       while( $arrPaymen tOption =  mysql_fetc h_assoc($r esLevelPri ces)) {
471   ?>   468   ?>
472           <t r>   469           <t r>
473                <td>   470                <td>
474                    <?=  $arrPaymen tOption['D ays'] > 0  ? $arrPaym entOption[ 'Days'] :  'Life-Time  Membershi p' ?>   471                    <?=  $arrPaymen tOption['D ays'] > 0  ? $arrPaym entOption[ 'Days'] :  'Life-Time  Membershi p' ?>
475                </td>   472                </td>
476                <td>   473                <td>
477                    <?=  getParam(" currency_s ign").$arr PaymentOpt ion['Price '] ?>   474                    <?=  getParam(" currency_s ign").$arr PaymentOpt ion['Price '] ?>
478                </td>   475                </td>
479                <td clas s="deleteC ell">   476                <td clas s="deleteC ell">
480                    <for m id="form DeletePaym entOption< ?= $arrPay mentOption ['Days'] ? >" action= "<?= $_SER VER['SCRIP T_NAME'] ? >?edit=pri cing&edit_ level=<?=  $membershi pID ?>" me thod="POST ">   477                    <for m id="form DeletePaym entOption< ?= $arrPay mentOption ['Days'] ? >" action= "<?= $_SER VER['SCRIP T_NAME'] ? >?edit=pri cing&edit_ level=<?=  $membershi pID ?>" me thod="POST ">
481                         <input typ e="hidden"  name="del ete_paymen t_option"  value="yes " />   478                         <input typ e="hidden"  name="del ete_paymen t_option"  value="yes " />
482                         <input typ e="hidden"  name="del ete_paymen t_days" va lue="<?= $ arrPayment Option['Da ys'] ?>" / >   479                         <input typ e="hidden"  name="del ete_paymen t_days" va lue="<?= $ arrPayment Option['Da ys'] ?>" / >
483                    </fo rm>   480                    </fo rm>
484                    <a h ref="javas cript:void (0)" oncli ck="docume nt.forms[' formDelete PaymentOpt ion<?= $ar rPaymentOp tion['Days '] ?>'].su bmit(); re turn false ;">   481                    <a h ref="javas cript:void (0)" oncli ck="docume nt.forms[' formDelete PaymentOpt ion<?= $ar rPaymentOp tion['Days '] ?>'].su bmit(); re turn false ;">
485                         Delete   482                         Delete
486                    </a>   483                    </a>
487                </td>   484                </td>
488           </ tr>   485           </ tr>
489   <?   486   <?
490       }   487       }
491   ?>   488   ?>
492       </tabl e>   489       </tabl e>
493     490  
494       <!--   491       <!--
495       </div> </div>   492       </div> </div>
496     493  
497   <div style ="padding:  0"><img s rc="images /foot_bloc k_green.gi f" height= "6" width= "602"></di v>   494   <div style ="padding:  0"><img s rc="images /foot_bloc k_green.gi f" height= "6" width= "602"></di v>
498   -->   495   -->
499   <?   496   <?
500   ContentBlo ckFoot();   497   ContentBlo ckFoot();
501       $conte nt = ob_ge t_contents ();   498  
502       ob_end _clean();   499        return  
o b_ge t _cl e a n () ;
503        return   $c o n t
e
n t ;
   
504   }   500   }
505     501  
506   function a ddMembersh ipAction($ membership ID, $actio nID)   502   function a ddMembersh ipAction($ membership ID, $actio nID)
507   {   503   {
508       $membe rshipID =  (int)$memb ershipID;   504       $membe rshipID =  (int)$memb ershipID;
509       $actio nID = (int )$actionID ;   505       $actio nID = (int )$actionID ;
510     506  
511       $msgNo tAdded = " \n<div cla ss=\"actio nFailure\" >Error: me mbership a ction has  not been a dded</div> ";   507       $msgNo tAdded = " \n<div cla ss=\"actio nFailure\" >Error: me mbership a ction has  not been a dded</div> ";
512       $msgAd ded = "\n< div class= \"actionSu ccess\"> M embership  action has  been adde d</div>";   508       $msgAd ded = "\n< div class= \"actionSu ccess\"> M embership  action has  been adde d</div>";
513     509  
514       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   510       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
515     511  
516       @mysql _query("IN SERT INTO  MemLevelAc tions   512       @mysql _query("IN SERT INTO  MemLevelAc tions
517                      (I DLevel, ID Action, Al lowedCount , AllowedP eriodLen,  AllowedPer iodStart,  AllowedPer iodEnd)   513                      (I DLevel, ID Action, Al lowedCount , AllowedP eriodLen,  AllowedPer iodStart,  AllowedPer iodEnd)
518                      VA LUES ($mem bershipID,  $actionID , NULL, NU LL, NULL,  NULL)");   514                      VA LUES ($mem bershipID,  $actionID , NULL, NU LL, NULL,  NULL)");
519     515  
520       if(mys ql_affecte d_rows() >  0)   516       if(mys ql_affecte d_rows() >  0)
521           re turn $msgA dded;   517           re turn $msgA dded;
522       else   518       else
523           re turn $msgN otAdded;   519           re turn $msgN otAdded;
524   }   520   }
525     521  
526   function d eleteMembe rshipActio n($members hipID, $ac tionID)   522   function d eleteMembe rshipActio n($members hipID, $ac tionID)
527   {   523   {
528       $membe rshipID =  (int)$memb ershipID;   524       $membe rshipID =  (int)$memb ershipID;
529       $actio nID = (int )$actionID ;   525       $actio nID = (int )$actionID ;
530     526  
531       $msgNo tDeleted =  "\n<div c lass=\"act ionFailure \">Error:  membership  action ha s not been  deleted</ div>";   527       $msgNo tDeleted =  "\n<div c lass=\"act ionFailure \">Error:  membership  action ha s not been  deleted</ div>";
532       $msgDe leted = "\ n<div clas s=\"action Success\">  Membershi p action h as been de leted</div >";   528       $msgDe leted = "\ n<div clas s=\"action Success\">  Membershi p action h as been de leted</div >";
533     529  
534       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   530       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
535     531  
536       @mysql _query("DE LETE FROM  MemLevelAc tions WHER E IDLevel  = $members hipID AND  IDAction =  $actionID ");   532       @mysql _query("DE LETE FROM  MemLevelAc tions WHER E IDLevel  = $members hipID AND  IDAction =  $actionID ");
537     533  
538       if(mys ql_affecte d_rows() >  0)   534       if(mys ql_affecte d_rows() >  0)
539           re turn $msgD eleted;   535           re turn $msgD eleted;
540       else   536       else
541           re turn $msgN otDeleted;   537           re turn $msgN otDeleted;
542   }   538   }
543     539  
544   function u pdateMembe rshipActio n($members hipID, $ac tionID, $c nt, $perio dLen, $per iodStart,  $periodEnd , $additio nalParam=' ')   540   function u pdateMembe rshipActio n($members hipID, $ac tionID, $c nt, $perio dLen, $per iodStart,  $periodEnd , $additio nalParam=' ')
545   {   541   {
546       $membe rshipID =  (int)$memb ershipID;   542       $membe rshipID =  (int)$memb ershipID;
547       $actio nID = (int )$actionID ;   543       $actio nID = (int )$actionID ;
548     544  
549       $msgNo tUpdated =  "\n<div c lass=\"act ionFailure \">Error:  action has  not been  updated</d iv>";   545       $msgNo tUpdated =  "\n<div c lass=\"act ionFailure \">Error:  action has  not been  updated</d iv>";
550       $msgUp dated = "\ n<div clas s=\"action Success\">  Action se ttings hav e been upd ated</div> ";   546       $msgUp dated = "\ n<div clas s=\"action Success\">  Action se ttings hav e been upd ated</div> ";
551     547  
552       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   548       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
553     549  
554       $cnt =  (int)$cnt ;   550       $cnt =  (int)$cnt ;
555       $perio dLen = (in t)$periodL en;   551       $perio dLen = (in t)$periodL en;
556     552  
557       if($cn t <= 0) $c nt = 'NULL ';   553       if($cn t <= 0) $c nt = 'NULL ';
558       if($pe riodLen <=  0) $perio dLen = 'NU LL';   554       if($pe riodLen <=  0) $perio dLen = 'NU LL';
559     555  
560       if($pe riodStart  == '')   556       if($pe riodStart  == '')
561           $p eriodStart  = 'NULL';   557           $p eriodStart  = 'NULL';
562       else   558       else
563           $p eriodStart  = strtoti me($period Start);   559           $p eriodStart  = strtoti me($period Start);
564     560  
565       if($pe riodEnd ==  '')   561       if($pe riodEnd ==  '')
566           $p eriodEnd =  'NULL';   562           $p eriodEnd =  'NULL';
567       else   563       else
568           $p eriodEnd =  strtotime ($periodEn d);   564           $p eriodEnd =  strtotime ($periodEn d);
569     565  
570       if($ad ditionalPa ram == '')  {   566       if($ad ditionalPa ram == '')  {
571           $a dditionalP aram = 'NU LL';   567           $a dditionalP aram = 'NU LL';
572       } else  {   568       } else  {
573           if (!get_magi c_quotes_g pc()) $add itionalPar am = addsl ashes($add itionalPar am);   569           if (!get_magi c_quotes_g pc()) $add itionalPar am = addsl ashes($add itionalPar am);
574           $a dditionalP aram = "'" .$addition alParam."' ";   570           $a dditionalP aram = "'" .$addition alParam."' ";
575       }   571       }
576     572  
577       if($pe riodStart  == -1 || $ periodEnd  == -1) ret urn $msgNo tUpdated;   573       if($pe riodStart  == -1 || $ periodEnd  == -1) ret urn $msgNo tUpdated;
578     574  
579       $perio dStart = " FROM_UNIXT IME($perio dStart)";   575       $perio dStart = " FROM_UNIXT IME($perio dStart)";
580       $perio dEnd = "FR OM_UNIXTIM E($periodE nd)";   576       $perio dEnd = "FR OM_UNIXTIM E($periodE nd)";
581     577  
582       @mysql _query("   578       @mysql _query("
583           UP DATE  MemL evelAction s   579           UP DATE  MemL evelAction s
584           SE T     Allo wedCount =  $cnt,   580           SE T     Allo wedCount =  $cnt,
585                    Allo wedPeriodL en = $peri odLen,   581                    Allo wedPeriodL en = $peri odLen,
586                    Allo wedPeriodS tart = $pe riodStart,   582                    Allo wedPeriodS tart = $pe riodStart,
587                    Allo wedPeriodE nd = $peri odEnd,   583                    Allo wedPeriodE nd = $peri odEnd,
588                    Addi tionalPara mValue = $ additional Param   584                    Addi tionalPara mValue = $ additional Param
589           WH ERE IDLeve l = $membe rshipID AN D IDAction  = $action ID");   585           WH ERE IDLeve l = $membe rshipID AN D IDAction  = $action ID");
590     586  
591       if(mys ql_affecte d_rows() >  0) {   587       if(mys ql_affecte d_rows() >  0) {
592           re turn $msgU pdated;   588           re turn $msgU pdated;
593       }else  {   589       }else  {
594           if (mysql_err no() == 0)   590           if (mysql_err no() == 0)
595                return ' ';   591                return ' ';
596           re turn $msgN otUpdated;   592           re turn $msgN otUpdated;
597       }   593       }
598   }   594   }
599     595  
600   function m embershipA ctions($me mbershipID )   596   function m embershipA ctions($me mbershipID )
601   {   597   {
602       global  $IDNonMem ber;   598       global  $IDNonMem ber;
603       global  $site;   599       global  $site;
604     600  
605       $membe rshipID =  (int)$memb ershipID;   601       $membe rshipID =  (int)$memb ershipID;
606     602  
607       if($me mbershipID  <= 0) ret urn '';   603       if($me mbershipID  <= 0) ret urn '';
608       ob_sta rt();   604       ob_sta rt();
609   ContentBlo ckHead("Me mbership A ctions");   605   ContentBlo ckHead("Me mbership A ctions");
610   ?>   606   ?>
611   <!-- <div  class="sec tionHeader ">Membersh ip Actions </div>   607   <!-- <div  class="sec tionHeader ">Membersh ip Actions </div>
612   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->   608   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->
613   <?   609   <?
614       $resAc tions = db _res("SELE CT ID, Nam e FROM Mem Actions OR DER BY Nam e");   610       $resAc tions = db _res("SELE CT ID, Nam e FROM Mem Actions OR DER BY Nam e");
615     611  
616       $arrAc tions = ar ray();   612       $arrAc tions = ar ray();
617     613  
618       while  (list($ID,  $desc) =  mysql_fetc h_row($res Actions))   614       while  (list($ID,  $desc) =  mysql_fetc h_row($res Actions))
619       {   615       {
620           $a rrActions[ (int)$ID]  = $desc;   616           $a rrActions[ (int)$ID]  = $desc;
621       }   617       }
622     618  
623   ?>   619   ?>
624       <div a lign="left ">   620       <div a lign="left ">
625           <? = $_POST[' add_action '] ? addMe mbershipAc tion($memb ershipID,  $_POST['ad d_action_i d']) : ''  ?>   621           <? = $_POST[' add_action '] ? addMe mbershipAc tion($memb ershipID,  $_POST['ad d_action_i d']) : ''  ?>
626           <? = $_POST[' update_act ion'] ? up dateMember shipAction ($membersh ipID,   622           <? = $_POST[' update_act ion'] ? up dateMember shipAction ($membersh ipID,
627                                                                      $_POST['u pdate_acti on_id'],   623                                                                      $_POST['u pdate_acti on_id'],
628                                                                      $_POST['a llowedCnt' ],   624                                                                      $_POST['a llowedCnt' ],
629                                                                      $_POST['p eriod'],   625                                                                      $_POST['p eriod'],
630                                                                      $_POST['d ateStart'] ,   626                                                                      $_POST['d ateStart'] ,
631                                                                      $_POST['d ateEnd'],   627                                                                      $_POST['d ateEnd'],
632                                                                      $_POST['a dditionalP aramValue' ]) : '';?>   628                                                                      $_POST['a dditionalP aramValue' ]) : '';?>
633           <? = $_POST[' delete_act ion'] ? de leteMember shipAction ($membersh ipID, $_PO ST['delete _action_id ']) : '' ? >   629           <? = $_POST[' delete_act ion'] ? de leteMember shipAction ($membersh ipID, $_PO ST['delete _action_id ']) : '' ? >
634       </div>   630       </div>
635   <?   631   <?
636     632  
637       $resLe velActions  = db_res( "   633       $resLe velActions  = db_res( "
638           SE LECT  IDAc tion,   634           SE LECT  IDAc tion,
639                    Allo wedCount,   635                    Allo wedCount,
640                    Allo wedPeriodL en,   636                    Allo wedPeriodL en,
641                    Allo wedPeriodS tart,   637                    Allo wedPeriodS tart,
642                    Allo wedPeriodE nd,   638                    Allo wedPeriodE nd,
643                    Addi tionalPara mName,   639                    Addi tionalPara mName,
644                    Addi tionalPara mValue   640                    Addi tionalPara mValue
645           FR OM    MemL evelAction s   641           FR OM    MemL evelAction s
646                    INNE R JOIN Mem Actions   642                    INNE R JOIN Mem Actions
647                    ON M emLevelAct ions.IDAct ion = MemA ctions.ID   643                    ON M emLevelAct ions.IDAct ion = MemA ctions.ID
648           WH ERE MemLev elActions. IDLevel =  $membershi pID   644           WH ERE MemLev elActions. IDLevel =  $membershi pID
649           OR DER BY Mem Actions.Na me");   645           OR DER BY Mem Actions.Na me");
650     646  
651       $arrLe velActions  = array() ;   647       $arrLe velActions  = array() ;
652     648  
653       while  ($arr = my sql_fetch_ assoc($res LevelActio ns))   649       while  ($arr = my sql_fetch_ assoc($res LevelActio ns))
654       {   650       {
655           $I D = $arr[' IDAction'] ;   651           $I D = $arr[' IDAction'] ;
656           un set($arr[' IDAction'] );   652           un set($arr[' IDAction'] );
657           $a rrLevelAct ions[(int) $ID] = $ar r;   653           $a rrLevelAct ions[(int) $ID] = $ar r;
658       }   654       }
659     655  
660       $optio nsText = " ";   656       $optio nsText = " ";
661       foreac h ($arrAct ions as $I D => $desc )   657       foreac h ($arrAct ions as $I D => $desc )
662       {   658       {
663           if ( !$arrLev elActions[ $ID] )   659           if ( !$arrLev elActions[ $ID] )
664                $options Text .= "\ n<option v alue=\"$ID \">$desc</ option>";   660                $options Text .= "\ n<option v alue=\"$ID \">$desc</ option>";
665       }   661       }
666     662  
667       if ( s trlen($opt ionsText)  )   663       if ( s trlen($opt ionsText)  )
668       {   664       {
669   ?>   665   ?>
670       <div a lign="righ t">   666       <div a lign="righ t">
671           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>?edit=ac tions&edit _level=<?=  $membersh ipID ?>" m ethod="POS T">   667           <f orm action ="<?= $_SE RVER['SCRI PT_NAME']  ?>?edit=ac tions&edit _level=<?=  $membersh ipID ?>" m ethod="POS T">
672                <input t ype="hidde n" name="a dd_action"  value="ye s" />   668                <input t ype="hidde n" name="a dd_action"  value="ye s" />
673                <select  name="add_ action_id" >   669                <select  name="add_ action_id" >
674                    <?=  $optionsTe xt ?>   670                    <?=  $optionsTe xt ?>
675                </select >   671                </select >
676                <input t ype="submi t" value=" Add action " />   672                <input t ype="submi t" value=" Add action " />
677           </ form>   673           </ form>
678       </div>   674       </div>
679   <?   675   <?
680       }   676       }
681     677  
682       foreac h ($arrLev elActions  as $ID =>  $arrAction ) {   678       foreac h ($arrLev elActions  as $ID =>  $arrAction ) {
683   ?>   679   ?>
684       <div c lass="acti onRowHeade r">   680       <div c lass="acti onRowHeade r">
685           <t able width ="100%" st yle="heigh t: 100%" c ellpadding ="0" cells pacing="0" >   681           <t able width ="100%" st yle="heigh t: 100%" c ellpadding ="0" cells pacing="0" >
686                <tr>   682                <tr>
687                    <td  valign="mi ddle" alig n="left" w idth="100% "><b><?= $ arrActions [$ID] ?></ b></td>   683                    <td  valign="mi ddle" alig n="left" w idth="100% "><b><?= $ arrActions [$ID] ?></ b></td>
688                    <td  valign="mi ddle" alig n="right"  style="pad ding-right : 5px;">   684                    <td  valign="mi ddle" alig n="right"  style="pad ding-right : 5px;">
689                         <a id="sho wHide<?= $ ID ?>" hre f="" oncli ck="showHi de('showHi de<?= $ID  ?>', 'acti onRow<?= $ ID ?>'); r eturn fals e;">Show</ a>   685                         <a id="sho wHide<?= $ ID ?>" hre f="" oncli ck="showHi de('showHi de<?= $ID  ?>', 'acti onRow<?= $ ID ?>'); r eturn fals e;">Show</ a>
690                    </td >   686                    </td >
691                    <td>   687                    <td>
692                         <form acti on="<?= $_ SERVER['SC RIPT_NAME' ] ?>?edit= actions&ed it_level=< ?= $member shipID ?>"  method="P OST" style ="padding: 0; margin: 0;">   688                         <form acti on="<?= $_ SERVER['SC RIPT_NAME' ] ?>?edit= actions&ed it_level=< ?= $member shipID ?>"  method="P OST" style ="padding: 0; margin: 0;">
693                             <input  type="hid den" name= "delete_ac tion" valu e="yes" />   689                             <input  type="hid den" name= "delete_ac tion" valu e="yes" />
694                             <input  type="hid den" name= "delete_ac tion_id" v alue="<?=  $ID ?>" />   690                             <input  type="hid den" name= "delete_ac tion_id" v alue="<?=  $ID ?>" />
695                             <input  style="wi dth: 57px"  type="sub mit" value ="Delete"  />   691                             <input  style="wi dth: 57px"  type="sub mit" value ="Delete"  />
696                         </form>   692                         </form>
697                    </td >   693                    </td >
698                </tr>   694                </tr>
699           </ table>   695           </ table>
700       </div>   696       </div>
701       <div c lass="acti onRow" id= "actionRow <?= $ID ?> ">   697       <div c lass="acti onRow" id= "actionRow <?= $ID ?> ">
702           <f orm id="up dateAction Form<?= $I D ?>" acti on="<?= $_ SERVER['SC RIPT_NAME' ] ?>?edit= actions&ed it_level=< ?= $member shipID ?>"  method="P OST" style ="padding: 0; margin: 0">   698           <f orm id="up dateAction Form<?= $I D ?>" acti on="<?= $_ SERVER['SC RIPT_NAME' ] ?>?edit= actions&ed it_level=< ?= $member shipID ?>"  method="P OST" style ="padding: 0; margin: 0">
703           <i nput type= "hidden" n ame="updat e_action"  value="yes " />   699           <i nput type= "hidden" n ame="updat e_action"  value="yes " />
704           <i nput type= "hidden" n ame="updat e_action_i d" value=" <?= $ID ?> " />   700           <i nput type= "hidden" n ame="updat e_action_i d" value=" <?= $ID ?> " />
705           <t able class ="actionFo rm">   701           <t able class ="actionFo rm">
706                <tr>   702                <tr>
707                    <td  class="cap tion">Numb er of allo wed action s:</td>   703                    <td  class="cap tion">Numb er of allo wed action s:</td>
708                    <td  class="all owedCnt">   704                    <td  class="all owedCnt">
709                         <input id= "allowedCn t<?= $ID ? >" name="a llowedCnt"  value="<? = $arrActi on['Allowe dCount'] ?   $arrActi on['Allowe dCount'] :  'no limit ' ?>" onfo cus="clear Unlimited( 'allowedCn t<?= $ID ? >')" onblu r="fillUnl imited('al lowedCnt<? = $ID ?>') " <?= $mem bershipID  == $IDNonM ember ? 'd isabled' :  '' ?> />   705                         <input id= "allowedCn t<?= $ID ? >" name="a llowedCnt"  value="<? = $arrActi on['Allowe dCount'] ?   $arrActi on['Allowe dCount'] :  'no limit ' ?>" onfo cus="clear Unlimited( 'allowedCn t<?= $ID ? >')" onblu r="fillUnl imited('al lowedCnt<? = $ID ?>') " <?= $mem bershipID  == $IDNonM ember ? 'd isabled' :  '' ?> />
710                    </td >   706                    </td >
711                </tr>   707                </tr>
712                <tr>   708                <tr>
713                    <td  class="cap tion">Numb er of acti ons is res et every:< /td>   709                    <td  class="cap tion">Numb er of acti ons is res et every:< /td>
714                    <td  class="per iod">   710                    <td  class="per iod">
715                         <input id= "period<?=  $ID ?>" n ame="perio d" value=" <?= $arrAc tion['Allo wedPeriodL en'] ?  $a rrAction[' AllowedPer iodLen'] :  'no limit ' ?>" onfo cus="clear Unlimited( 'period<?=  $ID ?>')"  onblur="f illUnlimit ed('period <?= $ID ?> ')" <?= $m embershipI D == $IDNo nMember ?  'disabled'  : '' ?> / >   711                         <input id= "period<?=  $ID ?>" n ame="perio d" value=" <?= $arrAc tion['Allo wedPeriodL en'] ?  $a rrAction[' AllowedPer iodLen'] :  'no limit ' ?>" onfo cus="clear Unlimited( 'period<?=  $ID ?>')"  onblur="f illUnlimit ed('period <?= $ID ?> ')" <?= $m embershipI D == $IDNo nMember ?  'disabled'  : '' ?> / >
716                         &nbsp;hour s   712                         &nbsp;hour s
717                    </td >   713                    </td >
718                </tr>   714                </tr>
719                <tr>   715                <tr>
720                    <td  class="cap tion">This  action is  available  since:</t d>   716                    <td  class="cap tion">This  action is  available  since:</t d>
721                    <td  class="dat eStart">   717                    <td  class="dat eStart">
722                         <table cel lpadding=" 0" cellspa cing="0" b order="0">   718                         <table cel lpadding=" 0" cellspa cing="0" b order="0">
723                             <tr>   719                             <tr>
724                                 <t d>   720                                 <t d>
725                                      <input s tyle="widt h: 130px"  id="dateSt art<?= $ID  ?>" name= "dateStart " value="< ?= $arrAct ion['Allow edPeriodSt art'] ?  $ arrAction[ 'AllowedPe riodStart' ] : 'no li mit' ?>" o nfocus="cl earUnlimit ed('dateSt art<?= $ID  ?>')" onb lur="fillU nlimited(' dateStart< ?= $ID ?>' )" />   721                                      <input s tyle="widt h: 130px"  id="dateSt art<?= $ID  ?>" name= "dateStart " value="< ?= $arrAct ion['Allow edPeriodSt art'] ?  $ arrAction[ 'AllowedPe riodStart' ] : 'no li mit' ?>" o nfocus="cl earUnlimit ed('dateSt art<?= $ID  ?>')" onb lur="fillU nlimited(' dateStart< ?= $ID ?>' )" />
726                                 </ td>   722                                 </ td>
727                                 <t d>   723                                 <t d>
728                                      <input s tyle="widt h: 70px" t ype="butto n" id="dat eStart<?=  $ID ?>trig ger" value ="Choose"/ >   724                                      <input s tyle="widt h: 70px" t ype="butto n" id="dat eStart<?=  $ID ?>trig ger" value ="Choose"/ >
729                                 </ td>   725                                 </ td>
730                                 <t d>   726                                 <t d>
731                                      <input s tyle="widt h: 70px" t ype="butto n" onclick ="document .getElemen tById('dat eStart<?=  $ID ?>').v alue = 'no  limit'" v alue="Clea r"/>   727                                      <input s tyle="widt h: 70px" t ype="butto n" onclick ="document .getElemen tById('dat eStart<?=  $ID ?>').v alue = 'no  limit'" v alue="Clea r"/>
732                                 </ td>   728                                 </ td>
733                             </tr>   729                             </tr>
734                         </table>   730                         </table>
735                    </td >   731                    </td >
736                </tr>   732                </tr>
737                <tr>   733                <tr>
738                    <td  class="cap tion">This  action is  available  until:</t d>   734                    <td  class="cap tion">This  action is  available  until:</t d>
739                    <td  class="dat eEnd">   735                    <td  class="dat eEnd">
740                         <table cel lpadding=" 0" cellspa cing="0" b order="0">   736                         <table cel lpadding=" 0" cellspa cing="0" b order="0">
741                             <tr>   737                             <tr>
742                                 <t d>   738                                 <t d>
743                                      <input s tyle="widt h: 130px"  id="dateEn d<?= $ID ? >" name="d ateEnd" va lue="<?= $ arrAction[ 'AllowedPe riodEnd']  ?  $arrAct ion['Allow edPeriodEn d'] : 'no  limit' ?>"  onfocus=" clearUnlim ited('date End<?= $ID  ?>')" onb lur="fillU nlimited(' dateEnd<?=  $ID ?>')"  />   739                                      <input s tyle="widt h: 130px"  id="dateEn d<?= $ID ? >" name="d ateEnd" va lue="<?= $ arrAction[ 'AllowedPe riodEnd']  ?  $arrAct ion['Allow edPeriodEn d'] : 'no  limit' ?>"  onfocus=" clearUnlim ited('date End<?= $ID  ?>')" onb lur="fillU nlimited(' dateEnd<?=  $ID ?>')"  />
744                                 </ td>   740                                 </ td>
745                                 <t d>   741                                 <t d>
746                                      <input s tyle="widt h: 70px" t ype="butto n" id="dat eEnd<?= $I D ?>trigge r" value=" Choose"/>   742                                      <input s tyle="widt h: 70px" t ype="butto n" id="dat eEnd<?= $I D ?>trigge r" value=" Choose"/>
747                                 </ td>   743                                 </ td>
748                                 <t d>   744                                 <t d>
749                                      <input s tyle="widt h: 70px" t ype="butto n" onclick ="document .getElemen tById('dat eEnd<?= $I D ?>').val ue = 'no l imit'" val ue="Clear" />   745                                      <input s tyle="widt h: 70px" t ype="butto n" onclick ="document .getElemen tById('dat eEnd<?= $I D ?>').val ue = 'no l imit'" val ue="Clear" />
750                                 </ td>   746                                 </ td>
751                             </tr>   747                             </tr>
752                         </table>   748                         </table>
753                    </td >   749                    </td >
754                </tr>   750                </tr>
755   <?   751   <?
756           if (!is_null( $arrAction ['Addition alParamNam e'])) {   752           if (!is_null( $arrAction ['Addition alParamNam e'])) {
757   ?>   753   ?>
758                <tr>   754                <tr>
759                    <td  class="cap tion"><?=  htmlspecia lchars($ar rAction['A dditionalP aramName'] )?></td>   755                    <td  class="cap tion"><?=  htmlspecia lchars($ar rAction['A dditionalP aramName'] )?></td>
760                    <td  class="add itionalPar am">   756                    <td  class="add itionalPar am">
761                         <input sty le="width:  130px" ty pe="text"  name="addi tionalPara mValue" va lue="<?= h tmlspecial chars($arr Action['Ad ditionalPa ramValue'] ) ?>" />   757                         <input sty le="width:  130px" ty pe="text"  name="addi tionalPara mValue" va lue="<?= h tmlspecial chars($arr Action['Ad ditionalPa ramValue'] ) ?>" />
762                    </td >   758                    </td >
763                </tr>   759                </tr>
764   <?   760   <?
765           }   761           }
766   ?>   762   ?>
767           <t r>   763           <t r>
768                <td cols pan="2" al ign="cente r">   764                <td cols pan="2" al ign="cente r">
769                    <inp ut style=" width: 160 px" type=" submit" va lue="Save  action set tings" onc lick="clea rFormUnlim ited('upda teActionFo rm<?= $ID  ?>')"/>   765                    <inp ut style=" width: 160 px" type=" submit" va lue="Save  action set tings" onc lick="clea rFormUnlim ited('upda teActionFo rm<?= $ID  ?>')"/>
770                </td>   766                </td>
771           </ tr>   767           </ tr>
772           </ table>   768           </ table>
773       </div>   769       </div>
774   <script ty pe="text/j avascript" >   770   <script ty pe="text/j avascript" >
775   //<![CDATA [   771   //<![CDATA [
776         Zapa tec.Calend ar.setup({   772         Zapa tec.Calend ar.setup({
777           fi rstDay           : 1,   773           fi rstDay           : 1,
778           we ekNumbers        : tr ue,   774           we ekNumbers        : tr ue,
779           sh owOthers         : tr ue,   775           sh owOthers         : tr ue,
780           sh owsTime          : tr ue,   776           sh owsTime          : tr ue,
781           ti meFormat         : "2 4",   777           ti meFormat         : "2 4",
782           st ep               : 2,   778           st ep               : 2,
783           ra nge              : [1 900.01, 29 99.12],   779           ra nge              : [1 900.01, 29 99.12],
784           el ectric           : fa lse,   780           el ectric           : fa lse,
785           si ngleClick        : tr ue,   781           si ngleClick        : tr ue,
786           in putField         : "d ateStart<? = $ID ?>",   782           in putField         : "d ateStart<? = $ID ?>",
787           bu tton             : "d ateStart<? = $ID ?>tr igger",   783           bu tton             : "d ateStart<? = $ID ?>tr igger",
788           if Format           : "% Y-%m-%d %H :%M:%S",   784           if Format           : "% Y-%m-%d %H :%M:%S",
789           da Format           : "% Y/%m/%d",   785           da Format           : "% Y/%m/%d",
790           al ign              : "B r"   786           al ign              : "B r"
791         });   787         });
792         Zapa tec.Calend ar.setup({   788         Zapa tec.Calend ar.setup({
793           fi rstDay           : 1,   789           fi rstDay           : 1,
794           we ekNumbers        : tr ue,   790           we ekNumbers        : tr ue,
795           sh owOthers         : tr ue,   791           sh owOthers         : tr ue,
796           sh owsTime          : tr ue,   792           sh owsTime          : tr ue,
797           ti meFormat         : "2 4",   793           ti meFormat         : "2 4",
798           st ep               : 2,   794           st ep               : 2,
799           ra nge              : [1 900.01, 29 99.12],   795           ra nge              : [1 900.01, 29 99.12],
800           el ectric           : fa lse,   796           el ectric           : fa lse,
801           si ngleClick        : tr ue,   797           si ngleClick        : tr ue,
802           in putField         : "d ateEnd<?=  $ID ?>",   798           in putField         : "d ateEnd<?=  $ID ?>",
803           bu tton             : "d ateEnd<?=  $ID ?>trig ger",   799           bu tton             : "d ateEnd<?=  $ID ?>trig ger",
804           if Format           : "% Y-%m-%d %H :%M:%S",   800           if Format           : "% Y-%m-%d %H :%M:%S",
805           da Format           : "% Y/%m/%d",   801           da Format           : "% Y/%m/%d",
806           al ign              : "B r"   802           al ign              : "B r"
807         });   803         });
808   //]]>   804   //]]>
809   </script>   805   </script>
810       </form >   806       </form >
811   <?   807   <?
812       }   808       }
813       if (!c ount($arrL evelAction s)){   809       if (!c ount($arrL evelAction s)){
814   ?>   810   ?>
815           <d iv align=" center">No  actions a llowed for  this memb ership</di v>   811           <d iv align=" center">No  actions a llowed for  this memb ership</di v>
816   <?   812   <?
817       }   813       }
818   ?>   814   ?>
819   <!--   815   <!--
820   </div></di v>   816   </div></di v>
821   <div style ="padding:  0"><img s rc="images /foot_bloc k_green.gi f" height= "6" width= "602"></di v>   817   <div style ="padding:  0"><img s rc="images /foot_bloc k_green.gi f" height= "6" width= "602"></di v>
822   -->   818   -->
823   <?   819   <?
824     820  
825   ContentBlo ckFoot();   821   ContentBlo ckFoot();
826       $conte nts = ob_g et_content s();   822       $conte nts = ob_g et_content s();
827       ob_end _clean();   823       ob_end _clean();
828       return  $contents ;   824       return  $contents ;
829   }   825   }
830     826  
831   TopCodeAdm in();   827   TopCodeAdm in();
832   ?>   828   ?>
833   <!-- Loadi ng Calenda r JavaScri pt files - ->   829   <!-- Loadi ng Calenda r JavaScri pt files - ->
834       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/utils .js"></scr ipt>   830       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/utils .js"></scr ipt>
835       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar.js"></ script>   831       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar.js"></ script>
836       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar-setup. js"></scri pt>   832       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar-setup. js"></scri pt>
837     833  
838   <!-- Loadi ng languag e definiti on file -- >   834   <!-- Loadi ng languag e definiti on file -- >
839       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _lang/cale ndar-en.js "></script >   835       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _lang/cale ndar-en.js "></script >
840   <script ty pe="text/j avascript" >   836   <script ty pe="text/j avascript" >
841   function c onfirmAndS ubmit(strF ormName, s trConfirma tionMessag e)   837   function c onfirmAndS ubmit(strF ormName, s trConfirma tionMessag e)
842   {   838   {
843       var re sult = con firm(strCo nfirmation Message);   839       var re sult = con firm(strCo nfirmation Message);
844       if(res ult == tru e) documen t.forms[st rFormName] .submit();   840       if(res ult == tru e) documen t.forms[st rFormName] .submit();
845   }   841   }
846     842  
847   function c learUnlimi ted(textCo ntrolID)   843   function c learUnlimi ted(textCo ntrolID)
848   {   844   {
849       textCo ntrol = do cument.get ElementByI d(textCont rolID);   845       textCo ntrol = do cument.get ElementByI d(textCont rolID);
850     846  
851       if(tex tControl.v alue == 'n o limit')   847       if(tex tControl.v alue == 'n o limit')
852       {   848       {
853           te xtControl. value = '' ;   849           te xtControl. value = '' ;
854       }   850       }
855   }   851   }
856     852  
857   function f illUnlimit ed(textCon trolID)   853   function f illUnlimit ed(textCon trolID)
858   {   854   {
859       textCo ntrol = do cument.get ElementByI d(textCont rolID);   855       textCo ntrol = do cument.get ElementByI d(textCont rolID);
860     856  
861       if(tex tControl.v alue == '' )   857       if(tex tControl.v alue == '' )
862       {   858       {
863           te xtControl. value = 'n o limit';   859           te xtControl. value = 'n o limit';
864       }   860       }
865   }   861   }
866     862  
867   function c learFormUn limited(st rFormID)   863   function c learFormUn limited(st rFormID)
868   {   864   {
869       form =  document. getElement ById(strFo rmID);   865       form =  document. getElement ById(strFo rmID);
870     866  
871       inputT ags = form .getElemen tsByTagNam e('input') ;   867       inputT ags = form .getElemen tsByTagNam e('input') ;
872     868  
873       for(i= 0; i < inp utTags.len gth; i++)   869       for(i= 0; i < inp utTags.len gth; i++)
874       {   870       {
875           if (inputTags [i].value  == 'no lim it')   871           if (inputTags [i].value  == 'no lim it')
876                inputTag s[i].value  = '';   872                inputTag s[i].value  = '';
877       }   873       }
878   }   874   }
879     875  
880   function s howHide(st rLabelID,  strDivID)   876   function s howHide(st rLabelID,  strDivID)
881   {   877   {
882       div =  document.g etElementB yId(strDiv ID);   878       div =  document.g etElementB yId(strDiv ID);
883       label  = document .getElemen tById(strL abelID);   879       label  = document .getElemen tById(strL abelID);
884     880  
885       if(div .style.dis play == '' )   881       if(div .style.dis play == '' )
886           di v.style.di splay = 'n one';   882           di v.style.di splay = 'n one';
887     883  
888       if(div .style.dis play == 'n one'){   884       if(div .style.dis play == 'n one'){
889           di v.style.di splay = 'b lock';   885           di v.style.di splay = 'b lock';
890           la bel.innerH TML = 'Hid e';   886           la bel.innerH TML = 'Hid e';
891       }else{   887       }else{
892           di v.style.di splay = 'n one';   888           di v.style.di splay = 'n one';
893           la bel.innerH TML = 'Sho w';   889           la bel.innerH TML = 'Sho w';
894       }   890       }
895   }   891   }
896   </script>   892   </script>
897   <?   893   <?
898     894  
899   if(isset($ _POST['sav eMemSet'])  && isset( $_POST['ca tegory']))   895   if(isset($ _POST['sav eMemSet'])  && isset( $_POST['ca tegory']))
900   {   896   {
901       saveMe mSettings( );   897       saveMe mSettings( );
902   }   898   }
903     899  
904   echo Conte ntBlockHea d("Members hip settin gs");   900   echo Conte ntBlockHea d("Members hip settin gs");
905   echo displ ayOptions( );   901   echo displ ayOptions( );
906   echo Conte ntBlockFoo t();   902   echo Conte ntBlockFoo t();
907     903  
908     904  
909   echo Conte ntBlockHea d("Manage  Membership  Types");   905   echo Conte ntBlockHea d("Manage  Membership  Types");
910   echo membe rshipList( );   906   echo membe rshipList( );
911   echo Conte ntBlockFoo t();   907   echo Conte ntBlockFoo t();
912     908  
913   switch ($_ GET['edit' ])   909   switch ($_ GET['edit' ])
914   {   910   {
915       case ' pricing':  echo membe rshipPrici ng($_GET[' edit_level ']);   911       case ' pricing':  echo membe rshipPrici ng($_GET[' edit_level ']);
916       break;   912       break;
917     913  
918       case ' actions':  echo membe rshipActio ns($_GET[' edit_level ']);   914       case ' actions':  echo membe rshipActio ns($_GET[' edit_level ']);
919   }   915   }
920   BottomCode ();   916   BottomCode ();
921   ?>   917   ?>