13. File Comparison Report

Produced on Wed Jun 18 08:01:26 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.

13.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\admin memb_levels.php Sat Apr 19 12:05:02 2008 UTC
2 Dolphin-v.6.1.2\admin memb_levels.php Tue Jun 10 06:10:52 2008 UTC

13.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 12 1812
Changed 11 22
Inserted 0 0
Removed 0 0

13.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
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

13.4 Active regular expressions

No regular expressions were active.

13.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 . 'a dmin_desig n.inc.php'  );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );
25     25  
26   $IDNonMemb er = 1;   26   $IDNonMemb er = 1;
27     27  
28   // 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.
29   $logged['a dmin'] = m ember_auth ( 1, true,  true );   29   $logged['a dmin'] = m ember_auth ( 1, true,  true );
30   $_page['cs s_name'] =  'memb_lev els.css';   30   $_page['cs s_name'] =  'memb_lev els.css';
31     31  
32   $_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.
33     33  
34   function d isplayOpti ons()   34   function d isplayOpti ons()
35   {   35   {
36       $sCat  = "`kateg`  IN ('5',' 7') ";   36       $sCat  = "`kateg`  IN ('5',' 7') ";
37          37       
38       $sClea r = '   38       $sClea r = '
39           <d iv style="   39           <d iv style="
40                position :relative;   40                position :relative;
41                clear:bo th;   41                clear:bo th;
42                height:0 px;   42                height:0 px;
43                line-hei ght:0px;   43                line-hei ght:0px;
44                margin:0 px;   44                margin:0 px;
45                padding: 0px;   45                padding: 0px;
46                font-siz e:0px;">   46                font-siz e:0px;">
47           </ div>';   47           </ div>';
48          48       
49       $sMain  = 'positi on:relativ e; float:l eft;';   49       $sMain  = 'positi on:relativ e; float:l eft;';
50          50       
51       $sQuer y = "SELEC T   51       $sQuer y = "SELEC T
52                         `GlParams` .`Name`,   52                         `GlParams` .`Name`,
53                         `VALUE` as  `Value`,   53                         `VALUE` as  `Value`,
54                         `desc`,   54                         `desc`,
55                         `Type`,   55                         `Type`,
56                         `GlParamsK ateg`.`nam e` AS `kat egName`,   56                         `GlParamsK ateg`.`nam e` AS `kat egName`,
57                         `order_in_ kateg` as  `Order`   57                         `order_in_ kateg` as  `Order`
58                FROM   58                FROM
59                         `GlParams`   59                         `GlParams`
60                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`
61                WHERE   61                WHERE
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";   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";
63          63       
64        $sCode   =   '<form   method="po st"   action="'.   $_SERVER[' SCRI P T _ NAM E
'].'">
  64        $sCode   =   '<form   method="po st"   action="'.   $_SERVER['
P HP _ S E LF '].'">
65           <i nput type= "hidden" n ame="save_ settings"  value="yes ">   65           <i nput type= "hidden" n ame="save_ settings"  value="yes ">
66           <i nput type= "hidden" n ame="categ ory" value ="'.$iCat. '">   66           <i nput type= "hidden" n ame="categ ory" value ="'.$iCat. '">
67           <d iv>';   67           <d iv>';
68          68       
69       $rData  = db_res( $sQuery);   69       $rData  = db_res( $sQuery);
70       while( $aData = m ysql_fetch _assoc($rD ata))   70       while( $aData = m ysql_fetch _assoc($rD ata))
71       {   71       {
72           $s Field = '' ;   72           $s Field = '' ;
73           $s Code .= '< div style= "margin: 1 0px 10px 1 0px 10px;" >';   73           $s Code .= '< div style= "margin: 1 0px 10px 1 0px 10px;" >';
74           $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>';
75     75  
76           sw itch($aDat a['Type'])   76           sw itch($aDat a['Type'])
77           {   77           {
78                case 'ch eckbox':   78                case 'ch eckbox':
79                    $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;" >
80                         <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>';
81                    brea k;   81                    brea k;
82                case 'di git':   82                case 'di git':
83                    $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;" >
84                         <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']. '" />
85                    </di v>';   85                    </di v>';
86                    brea k;   86                    brea k;
87                default:   87                default:
88           }   88           }
89              89           
90           $s Code .= $s Field.$sCl ear.'</div >';   90           $s Code .= $s Field.$sCl ear.'</div >';
91       }   91       }
92          92       
93       $sCode  .= '</div >';   93       $sCode  .= '</div >';
94          94       
95       $sCode  .= '<div  style="tex t-align: c enter;">   95       $sCode  .= '<div  style="tex t-align: c enter;">
96       <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> ';
97          97       
98       return  $sCode;   98       return  $sCode;
99   }   99   }
100     100  
101   function s aveMemSett ings()   101   function s aveMemSett ings()
102   {   102   {
103       $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');
104          104       
105       $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');
106          106       
107          107       
108       foreac h ($aDigit  as $i =>  $sVal)   108       foreac h ($aDigit  as $i =>  $sVal)
109       {   109       {
110           if  ($_POST[$ sVal])   110           if  ($_POST[$ sVal])
111           {   111           {
112                setparam ($sVal, ht mlspecialc hars_adv($ _POST[$sVa l]));   112                setparam ($sVal, ht mlspecialc hars_adv($ _POST[$sVa l]));
113           }   113           }
114       }   114       }
115          115       
116       foreac h ($aCheck  as $i =>  $sVal)   116       foreac h ($aCheck  as $i =>  $sVal)
117       {   117       {
118           if  ('on' ==  $_POST[$sV al])   118           if  ('on' ==  $_POST[$sV al])
119           {   119           {
120                setparam ($sVal, 'o n');   120                setparam ($sVal, 'o n');
121           }   121           }
122           el se   122           el se
123           {   123           {
124                setparam ($sVal, '' );   124                setparam ($sVal, '' );
125           }   125           }
126       }   126       }
127   }   127   }
128     128  
129   function a ddMembersh ip($member shipName)   129   function a ddMembersh ip($member shipName)
130   {   130   {
131       $membe rshipName  = trim($me mbershipNa me);   131       $membe rshipName  = trim($me mbershipNa me);
132     132  
133       if(!$m embershipN ame) retur n '';   133       if(!$m embershipN ame) retur n '';
134     134  
135       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);
136     136  
137       @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')");
138     138  
139       if(mys ql_affecte d_rows() >  0) {   139       if(mys ql_affecte d_rows() >  0) {
140           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);
141           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>" ;
142       }   142       }
143     143  
144       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>";
145   }   145   }
146     146  
147   function d eleteMembe rship($mem bershipID)   147   function d eleteMembe rship($mem bershipID)
148   {   148   {
149       $membe rshipID =  (int)$memb ershipID;   149       $membe rshipID =  (int)$memb ershipID;
150     150  
151       if($me mbershipID  <= 0) ret urn '';   151       if($me mbershipID  <= 0) ret urn '';
152     152  
153       $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") ;
154     154  
155       if(mys ql_num_row s($resMemL evel) < 1)  {   155       if(mys ql_num_row s($resMemL evel) < 1)  {
156           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>";
157       }   157       }
158     158  
159       //chec k if membe rship can  be removed   159       //chec k if membe rship can  be removed
160     160  
161       $remov able = mys ql_fetch_a ssoc($resM emLevel);   161       $remov able = mys ql_fetch_a ssoc($resM emLevel);
162       $remov able = $re movable['R emovable']  == 'yes'  ? true : f alse;   162       $remov able = $re movable['R emovable']  == 'yes'  ? true : f alse;
163     163  
164       if(!$r emovable)  {   164       if(!$r emovable)  {
165           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>";
166       }   166       }
167     167  
168       //chec k if there  are still  members u sing this  membership   168       //chec k if there  are still  members u sing this  membership
169     169  
170       $resMa xDateExpir es = @mysq l_query("   170       $resMa xDateExpir es = @mysq l_query("
171           SE LECT UNIX_ TIMESTAMP( MAX(DateEx pires)) as  MaxDateEx pires   171           SE LECT UNIX_ TIMESTAMP( MAX(DateEx pires)) as  MaxDateEx pires
172           FR OM Profile MemLevels  WHERE IDLe vel = $mem bershipID" );   172           FR OM Profile MemLevels  WHERE IDLe vel = $mem bershipID" );
173     173  
174       //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
175     175  
176       $maxDa teExpires  = mysql_fe tch_assoc( $resMaxDat eExpires);   176       $maxDa teExpires  = mysql_fe tch_assoc( $resMaxDat eExpires);
177       $maxDa teExpires  = $maxDate Expires['M axDateExpi res'];   177       $maxDa teExpires  = $maxDate Expires['M axDateExpi res'];
178     178  
179       if($ma xDateExpir es > time( )) {   179       if($ma xDateExpir es > time( )) {
180           re turn "\n   180           re turn "\n
181           <d iv class=\ "actionFai lure\">   181           <d iv class=\ "actionFai lure\">
182                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>
183                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
184                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). ").
185           </ div>";   185           </ div>";
186       }   186       }
187     187  
188       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID");   188       @mysql _query("DE LETE FROM  MemLevelPr ices WHERE  IDLevel =  $membersh ipID");
189       @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");
190       @mysql _query("DE LETE FROM  MemLevels  WHERE ID =  $membersh ipID");   190       @mysql _query("DE LETE FROM  MemLevels  WHERE ID =  $membersh ipID");
191     191  
192       if(mys ql_affecte d_rows() >  0) {   192       if(mys ql_affecte d_rows() >  0) {
193           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> ";
194       }   194       }
195     195  
196       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>";
197   }   197   }
198     198  
199   function a ctivateMem bership($m embershipI D, $active )   199   function a ctivateMem bership($m embershipI D, $active )
200   {   200   {
201       $membe rshipID =  (int)$memb ershipID;   201       $membe rshipID =  (int)$memb ershipID;
202       if($ac tive != 'y es' && $ac tive != 'n o') return  '';   202       if($ac tive != 'y es' && $ac tive != 'n o') return  '';
203     203  
204       if($me mbershipID  <= 0) ret urn '';   204       if($me mbershipID  <= 0) ret urn '';
205     205  
206       $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 ");
207     207  
208       if(mys ql_num_row s($resMemL evel) < 1)  {   208       if(mys ql_num_row s($resMemL evel) < 1)  {
209           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>";
210       }   210       }
211     211  
212       //chec k if membe rship can  be purchas ed   212       //chec k if membe rship can  be purchas ed
213     213  
214       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;   214       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;
215       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;   215       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;
216     216  
217       if(!$p urchasable ) {   217       if(!$p urchasable ) {
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>" ;   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>" ;
219       }   219       }
220     220  
221       @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");
222     222  
223       if(mys ql_affecte d_rows() < = 0){   223       if(mys ql_affecte d_rows() < = 0){
224           $d e = $activ e ? '' : ' de';   224           $d e = $activ e ? '' : ' de';
225           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>";
226       }   226       }
227     227  
228       return  '';   228       return  '';
229   }   229   }
230     230  
231   function m embershipL ist()   231   function m embershipL ist()
232   {   232   {
233       $editL evel = (in t)$_GET['e dit_level' ];   233       $editL evel = (in t)$_GET['e dit_level' ];
234     234  
235       ob_sta rt();   235       ob_sta rt();
236     236  
237   //ContentB lockHead(" Manage Mem bership Ty pes");   237   //ContentB lockHead(" Manage Mem bership Ty pes");
238   ?>   238   ?>
239   <!--   239   <!--
240   <div class ="sectionH eader">Man age Member ship Types </div>   240   <div class ="sectionH eader">Man age Member ship Types </div>
241   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->   241   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->
242       <?= ad dMembershi p($_POST[' add_member ship']) ?>   242       <?= ad dMembershi p($_POST[' add_member ship']) ?>
243       <?= de leteMember ship($_POS T['delete_ membership ']) ?>   243       <?= de leteMember ship($_POS T['delete_ membership ']) ?>
244       <?= 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']) ? >
245       <div a lign="righ t">   245       <div a lign="righ t">
246            <form   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>"   method="PO ST">
  246            <form   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>"   method="PO ST">
247                New memb ership:   247                New memb ership:
248                <input t ype="text"  name="add _membershi p" />   248                <input t ype="text"  name="add _membershi p" />
249                <input t ype="submi t" value=" Add" />   249                <input t ype="submi t" value=" Add" />
250           </ form>   250           </ form>
251       </div>   251       </div>
252     252  
253       <table  class="me mbershipLi st" cellsp acing="0"  align="cen ter">   253       <table  class="me mbershipLi st" cellsp acing="0"  align="cen ter">
254           <t r class="h eaderRow">   254           <t r class="h eaderRow">
255                <td></td >   255                <td></td >
256                <td>   256                <td>
257                    Memb ership Typ es   257                    Memb ership Typ es
258                </td>   258                </td>
259           </ tr>   259           </ tr>
260           <t r>   260           <t r>
261                <td cols pan="5" cl ass="space r"></td>   261                <td cols pan="5" cl ass="space r"></td>
262           </ tr>   262           </ tr>
263   <?   263   <?
264       $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" );
265     265  
266       if (my sql_num_ro ws($resMem Levels) <=  0) {   266       if (my sql_num_ro ws($resMem Levels) <=  0) {
267   ?>   267   ?>
268           <t r>   268           <t r>
269                <td alig n="center" >   269                <td alig n="center" >
270                    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
271                </td>   271                </td>
272           </ tr>   272           </ tr>
273   <?   273   <?
274       } else  {   274       } else  {
275           wh ile($arrMe mLevel = m ysql_fetch _assoc($re sMemLevels ))   275           wh ile($arrMe mLevel = m ysql_fetch _assoc($re sMemLevels ))
276           {   276           {
277                $ID = $a rrMemLevel ['ID'];   277                $ID = $a rrMemLevel ['ID'];
278     278  
279                $selecte dRow = $ed itLevel ==  $ID ? 'cl ass="activ eRow"' : ' ';   279                $selecte dRow = $ed itLevel ==  $ID ? 'cl ass="activ eRow"' : ' ';
280   ?>   280   ?>
281           <t r <?= $sel ectedRow ? >>   281           <t r <?= $sel ectedRow ? >>
282   <?   282   <?
283                //print  'Active/In active' ce ll   283                //print  'Active/In active' ce ll
284     284  
285                if ($arr MemLevel[' Purchasabl e'] == 'ye s')   285                if ($arr MemLevel[' Purchasabl e'] == 'ye s')
286                {   286                {
287                    $mem bershipAct ive = $arr MemLevel[' Active'] = = 'yes' ?  true : fal se;   287                    $mem bershipAct ive = $arr MemLevel[' Active'] = = 'yes' ?  true : fal se;
288   ?>   288   ?>
289                <td clas s="<?= $me mbershipAc tive ? 'de activate'  : 'activat e' ?>">   289                <td clas s="<?= $me mbershipAc tive ? 'de activate'  : 'activat e' ?>">
290                     <form   name="form Activate<? =   $ID   ?>"   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>"   method="po st"   style="mar gin:   0">
  290                     <form   name="form Activate<? =   $ID   ?>"   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>"   method="po st"   style="mar gin:   0">
291                         <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 ?>"  />
292                         <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' ? >" />
293                    </fo rm>   293                    </fo rm>
294                    <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;">
295                         <?= $membe rshipActiv e ? '[&nbs p;Active&n bsp;]' : ' [Inactive] '; ?>   295                         <?= $membe rshipActiv e ? '[&nbs p;Active&n bsp;]' : ' [Inactive] '; ?>
296                    </a>   296                    </a>
297                </td>   297                </td>
298   <?   298   <?
299                }else{   299                }else{
300   ?>   300   ?>
301                <td clas s="activat e"></td>   301                <td clas s="activat e"></td>
302   <?   302   <?
303                }   303                }
304   ?>   304   ?>
305                <td clas s="name">   305                <td clas s="name">
306                     <a   href="<?=   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=ac tions&edit _level=<?=   $ID   ?>">
  306                     <a   href="<?=   $_SERVER['
P HP _ S E LF ']   ?>?edit=ac tions&edit _level=<?=   $ID   ?>">
307                         <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">
308                             <?= ht mlspecialc hars($arrM emLevel['N ame']) ?>   308                             <?= ht mlspecialc hars($arrM emLevel['N ame']) ?>
309                         </div>   309                         </div>
310                    </a>   310                    </a>
311                </td>   311                </td>
312   <?   312   <?
313                if ($arr MemLevel[' Purchasabl e'] == 'ye s')   313                if ($arr MemLevel[' Purchasabl e'] == 'ye s')
314                {   314                {
315   ?>   315   ?>
316                <td clas s="pricing ">   316                <td clas s="pricing ">
317                     <a   href="<?=   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=pr icing&edit _level=<?=   $ID   ?>">
  317                     <a   href="<?=   $_SERVER['
P HP _ S E LF ']   ?>?edit=pr icing&edit _level=<?=   $ID   ?>">
318                         Pricing   318                         Pricing
319                    </a>   319                    </a>
320                </td>   320                </td>
321                <td clas s="delete" >   321                <td clas s="delete" >
322                     <form   name="form Delete<?=   $ID   ?>"   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>"   method="PO ST"   style="mar gin:   0">
  322                     <form   name="form Delete<?=   $ID   ?>"   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>"   method="PO ST"   style="mar gin:   0">
323                         <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  ?>" />
324                    </fo rm>   324                    </fo rm>
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>   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>
326                </td>   326                </td>
327   <?   327   <?
328                } else {   328                } else {
329   ?>   329   ?>
330                <td clas s="pricing "></td><td  class="de lete"></td >   330                <td clas s="pricing "></td><td  class="de lete"></td >
331   <?   331   <?
332                }   332                }
333   ?>   333   ?>
334           </ tr>   334           </ tr>
335           <t r>   335           <t r>
336                <td cols pan="4" cl ass="space r"></td>   336                <td cols pan="4" cl ass="space r"></td>
337           </ tr>   337           </ tr>
338   <?   338   <?
339           }   339           }
340       }   340       }
341   ?>   341   ?>
342       </tabl e>   342       </tabl e>
343     343  
344   <?   344   <?
345   //ContentB lockFoot() ;   345   //ContentB lockFoot() ;
346       return  ob_get_cl ean();   346       return  ob_get_cl ean();
347   }   347   }
348     348  
349   function a ddPaymentO ption($mem bershipID,  $days, $p rice)   349   function a ddPaymentO ption($mem bershipID,  $days, $p rice)
350   {   350   {
351       $membe rshipID =  (int)$memb ershipID;   351       $membe rshipID =  (int)$memb ershipID;
352       $days  = (int)$da ys;   352       $days  = (int)$da ys;
353       $price  = round(( float)$pri ce, 2);   353       $price  = round(( float)$pri ce, 2);
354     354  
355       if( $m embershipI D <= 0 ||  $days < 0  || $price  <= 0 ) ret urn '';   355       if( $m embershipI D <= 0 ||  $days < 0  || $price  <= 0 ) ret urn '';
356     356  
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>";   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>";
358     358  
359       @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)");
360     360  
361       if(mys ql_affecte d_rows() >  0)   361       if(mys ql_affecte d_rows() >  0)
362       {   362       {
363           if  ( $days >  0 )   363           if  ( $days >  0 )
364           {   364           {
365                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>";
366           }   366           }
367           el se   367           el se
368           {   368           {
369                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> ";
370           }   370           }
371       }   371       }
372     372  
373       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>" ;
374   }   374   }
375     375  
376   function d eletePayme ntOption($ membership ID, $days)   376   function d eletePayme ntOption($ membership ID, $days)
377   {   377   {
378       $membe rshipID =  (int)$memb ershipID;   378       $membe rshipID =  (int)$memb ershipID;
379       $days  = (int)$da ys;   379       $days  = (int)$da ys;
380     380  
381       if($me mbershipID  <= 0 || $ days < 0)  return '';   381       if($me mbershipID  <= 0 || $ days < 0)  return '';
382     382  
383       @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");
384     384  
385       if(mys ql_affecte d_rows() >  0)   385       if(mys ql_affecte d_rows() >  0)
386       {   386       {
387           if  ( $days >  0 )   387           if  ( $days >  0 )
388           {   388           {
389                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>";
390           }   390           }
391           el se   391           el se
392           {   392           {
393                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>";
394           }   394           }
395       }   395       }
396     396  
397       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 >";
398   }   398   }
399     399  
400   function m embershipP ricing($me mbershipID )   400   function m embershipP ricing($me mbershipID )
401   {   401   {
402       $membe rshipID =  (int)$memb ershipID;   402       $membe rshipID =  (int)$memb ershipID;
403       if($me mbershipID  <= 0) ret urn '';   403       if($me mbershipID  <= 0) ret urn '';
404     404  
405       //chec k if membe rship can  be purchas ed   405       //chec k if membe rship can  be purchas ed
406     406  
407       $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 ");
408     408  
409       if(mys ql_num_row s($resMemL evel) < 1)  {   409       if(mys ql_num_row s($resMemL evel) < 1)  {
410           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>";
411       }   411       }
412     412  
413       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;   413       $purch asable = m ysql_fetch _assoc($re sMemLevel) ;
414       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;   414       $purch asable = $ purchasabl e['Purchas able'] ==  'yes' ? tr ue : false ;
415     415  
416       if(!$p urchasable ) {   416       if(!$p urchasable ) {
417           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>";
418       }   418       }
419     419  
420       ob_sta rt();   420       ob_sta rt();
421     421  
422   ContentBlo ckHead("Pr icing");   422   ContentBlo ckHead("Pr icing");
423   ?>   423   ?>
424   <!--   424   <!--
425   <div class ="sectionH eader">Pri cing</div>   425   <div class ="sectionH eader">Pri cing</div>
426   <div class ="sectionB ody"><div  style="pad ding: 10px ">   426   <div class ="sectionB ody"><div  style="pad ding: 10px ">
427   -->   427   -->
428   <?   428   <?
429       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' ]);
430       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']) ;
431     431  
432       $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");
433   ?>   433   ?>
434       <div a lign="righ t">   434       <div a lign="righ t">
435            <form   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=pr icing&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
  435            <form   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>?edit=pr icing&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
436                <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" >
437                Number o f days (0  = life-tim e membersh ip):   437                Number o f days (0  = life-tim e membersh ip):
438                <input t ype="text"  size="4"  name="paym ent_days">   438                <input t ype="text"  size="4"  name="paym ent_days">
439                Price:   439                Price:
440                <input t ype="text"  size="7"  name="paym ent_price" >   440                <input t ype="text"  size="7"  name="paym ent_price" >
441                <input t ype="submi t" value=" Add paymen t option">   441                <input t ype="submi t" value=" Add paymen t option">
442           </ form>   442           </ form>
443       </div>   443       </div>
444       <table  align="ce nter" cell spacing="0 " class="p riceList">   444       <table  align="ce nter" cell spacing="0 " class="p riceList">
445           <t r class="h eaderRow">   445           <t r class="h eaderRow">
446                <td>   446                <td>
447                    Days   447                    Days
448                </td>   448                </td>
449                <td>   449                <td>
450                    Pric e   450                    Pric e
451                </td>   451                </td>
452           </ tr>   452           </ tr>
453           <t r>   453           <t r>
454                <td cols pan="3" cl ass="space r"></td>   454                <td cols pan="3" cl ass="space r"></td>
455           </ tr>   455           </ tr>
456   <?   456   <?
457       if(!my sql_num_ro ws($resLev elPrices))  {   457       if(!my sql_num_ro ws($resLev elPrices))  {
458   ?>   458   ?>
459           <t r>   459           <t r>
460                <td cols pan="2">   460                <td cols pan="2">
461                         There are  no payment  options d efined for  this memb ership   461                         There are  no payment  options d efined for  this memb ership
462                </td>   462                </td>
463           </ tr>   463           </ tr>
464   <?   464   <?
465       }   465       }
466     466  
467       while( $arrPaymen tOption =  mysql_fetc h_assoc($r esLevelPri ces)) {   467       while( $arrPaymen tOption =  mysql_fetc h_assoc($r esLevelPri ces)) {
468   ?>   468   ?>
469           <t r>   469           <t r>
470                <td>   470                <td>
471                    <?=  $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' ?>
472                </td>   472                </td>
473                <td>   473                <td>
474                    <?=  getParam(" currency_s ign").$arr PaymentOpt ion['Price '] ?>   474                    <?=  getParam(" currency_s ign").$arr PaymentOpt ion['Price '] ?>
475                </td>   475                </td>
476                <td clas s="deleteC ell">   476                <td clas s="deleteC ell">
477                     <form   id="formDe letePaymen tOption<?=   $arrPaymen tOption['D ays']   ?>"   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=pr icing&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
  477                     <form   id="formDe letePaymen tOption<?=   $arrPaymen tOption['D ays']   ?>"   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>?edit=pr icing&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
478                         <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 " />
479                         <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'] ?>" / >
480                    </fo rm>   480                    </fo rm>
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 ;">   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 ;">
482                         Delete   482                         Delete
483                    </a>   483                    </a>
484                </td>   484                </td>
485           </ tr>   485           </ tr>
486   <?   486   <?
487       }   487       }
488   ?>   488   ?>
489       </tabl e>   489       </tabl e>
490     490  
491       <!--   491       <!--
492       </div> </div>   492       </div> </div>
493     493  
494   <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>
495   -->   495   -->
496   <?   496   <?
497   ContentBlo ckFoot();   497   ContentBlo ckFoot();
498     498  
499       return  ob_get_cl ean();   499       return  ob_get_cl ean();
500   }   500   }
501     501  
502   function a ddMembersh ipAction($ membership ID, $actio nID)   502   function a ddMembersh ipAction($ membership ID, $actio nID)
503   {   503   {
504       $membe rshipID =  (int)$memb ershipID;   504       $membe rshipID =  (int)$memb ershipID;
505       $actio nID = (int )$actionID ;   505       $actio nID = (int )$actionID ;
506     506  
507       $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> ";
508       $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>";
509     509  
510       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   510       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
511     511  
512       @mysql _query("IN SERT INTO  MemLevelAc tions   512       @mysql _query("IN SERT INTO  MemLevelAc tions
513                      (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)
514                      VA LUES ($mem bershipID,  $actionID , NULL, NU LL, NULL,  NULL)");   514                      VA LUES ($mem bershipID,  $actionID , NULL, NU LL, NULL,  NULL)");
515     515  
516       if(mys ql_affecte d_rows() >  0)   516       if(mys ql_affecte d_rows() >  0)
517           re turn $msgA dded;   517           re turn $msgA dded;
518       else   518       else
519           re turn $msgN otAdded;   519           re turn $msgN otAdded;
520   }   520   }
521     521  
522   function d eleteMembe rshipActio n($members hipID, $ac tionID)   522   function d eleteMembe rshipActio n($members hipID, $ac tionID)
523   {   523   {
524       $membe rshipID =  (int)$memb ershipID;   524       $membe rshipID =  (int)$memb ershipID;
525       $actio nID = (int )$actionID ;   525       $actio nID = (int )$actionID ;
526     526  
527       $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>";
528       $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 >";
529     529  
530       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   530       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
531     531  
532       @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 ");
533     533  
534       if(mys ql_affecte d_rows() >  0)   534       if(mys ql_affecte d_rows() >  0)
535           re turn $msgD eleted;   535           re turn $msgD eleted;
536       else   536       else
537           re turn $msgN otDeleted;   537           re turn $msgN otDeleted;
538   }   538   }
539     539  
540   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=' ')
541   {   541   {
542       $membe rshipID =  (int)$memb ershipID;   542       $membe rshipID =  (int)$memb ershipID;
543       $actio nID = (int )$actionID ;   543       $actio nID = (int )$actionID ;
544     544  
545       $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>";
546       $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> ";
547     547  
548       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';   548       if($me mbershipID  <= 0 || $ actionID < = 0) retur n '';
549     549  
550       $cnt =  (int)$cnt ;   550       $cnt =  (int)$cnt ;
551       $perio dLen = (in t)$periodL en;   551       $perio dLen = (in t)$periodL en;
552     552  
553       if($cn t <= 0) $c nt = 'NULL ';   553       if($cn t <= 0) $c nt = 'NULL ';
554       if($pe riodLen <=  0) $perio dLen = 'NU LL';   554       if($pe riodLen <=  0) $perio dLen = 'NU LL';
555     555  
556       if($pe riodStart  == '')   556       if($pe riodStart  == '')
557           $p eriodStart  = 'NULL';   557           $p eriodStart  = 'NULL';
558       else   558       else
559           $p eriodStart  = strtoti me($period Start);   559           $p eriodStart  = strtoti me($period Start);
560     560  
561       if($pe riodEnd ==  '')   561       if($pe riodEnd ==  '')
562           $p eriodEnd =  'NULL';   562           $p eriodEnd =  'NULL';
563       else   563       else
564           $p eriodEnd =  strtotime ($periodEn d);   564           $p eriodEnd =  strtotime ($periodEn d);
565     565  
566       if($ad ditionalPa ram == '')  {   566       if($ad ditionalPa ram == '')  {
567           $a dditionalP aram = 'NU LL';   567           $a dditionalP aram = 'NU LL';
568       } else  {   568       } else  {
569           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);
570           $a dditionalP aram = "'" .$addition alParam."' ";   570           $a dditionalP aram = "'" .$addition alParam."' ";
571       }   571       }
572     572  
573       if($pe riodStart  == -1 || $ periodEnd  == -1) ret urn $msgNo tUpdated;   573       if($pe riodStart  == -1 || $ periodEnd  == -1) ret urn $msgNo tUpdated;
574     574  
575       $perio dStart = " FROM_UNIXT IME($perio dStart)";   575       $perio dStart = " FROM_UNIXT IME($perio dStart)";
576       $perio dEnd = "FR OM_UNIXTIM E($periodE nd)";   576       $perio dEnd = "FR OM_UNIXTIM E($periodE nd)";
577     577  
578       @mysql _query("   578       @mysql _query("
579           UP DATE  MemL evelAction s   579           UP DATE  MemL evelAction s
580           SE T     Allo wedCount =  $cnt,   580           SE T     Allo wedCount =  $cnt,
581                    Allo wedPeriodL en = $peri odLen,   581                    Allo wedPeriodL en = $peri odLen,
582                    Allo wedPeriodS tart = $pe riodStart,   582                    Allo wedPeriodS tart = $pe riodStart,
583                    Allo wedPeriodE nd = $peri odEnd,   583                    Allo wedPeriodE nd = $peri odEnd,
584                    Addi tionalPara mValue = $ additional Param   584                    Addi tionalPara mValue = $ additional Param
585           WH ERE IDLeve l = $membe rshipID AN D IDAction  = $action ID");   585           WH ERE IDLeve l = $membe rshipID AN D IDAction  = $action ID");
586     586  
587       if(mys ql_affecte d_rows() >  0) {   587       if(mys ql_affecte d_rows() >  0) {
588           re turn $msgU pdated;   588           re turn $msgU pdated;
589       }else  {   589       }else  {
590           if (mysql_err no() == 0)   590           if (mysql_err no() == 0)
591                return ' ';   591                return ' ';
592           re turn $msgN otUpdated;   592           re turn $msgN otUpdated;
593       }   593       }
594   }   594   }
595     595  
596   function m embershipA ctions($me mbershipID )   596   function m embershipA ctions($me mbershipID )
597   {   597   {
598       global  $IDNonMem ber;   598       global  $IDNonMem ber;
599       global  $site;   599       global  $site;
600     600  
601       $membe rshipID =  (int)$memb ershipID;   601       $membe rshipID =  (int)$memb ershipID;
602     602  
603       if($me mbershipID  <= 0) ret urn '';   603       if($me mbershipID  <= 0) ret urn '';
604       ob_sta rt();   604       ob_sta rt();
605   ContentBlo ckHead("Me mbership A ctions");   605   ContentBlo ckHead("Me mbership A ctions");
606   ?>   606   ?>
607   <!-- <div  class="sec tionHeader ">Membersh ip Actions </div>   607   <!-- <div  class="sec tionHeader ">Membersh ip Actions </div>
608   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->   608   <div class ="sectionB ody"><div  style="pad ding: 10px "> -->
609   <?   609   <?
610       $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");
611     611  
612       $arrAc tions = ar ray();   612       $arrAc tions = ar ray();
613     613  
614       while  (list($ID,  $desc) =  mysql_fetc h_row($res Actions))   614       while  (list($ID,  $desc) =  mysql_fetc h_row($res Actions))
615       {   615       {
616           $a rrActions[ (int)$ID]  = $desc;   616           $a rrActions[ (int)$ID]  = $desc;
617       }   617       }
618     618  
619   ?>   619   ?>
620       <div a lign="left ">   620       <div a lign="left ">
621           <? = $_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']) : ''  ?>
622           <? = $_POST[' update_act ion'] ? up dateMember shipAction ($membersh ipID,   622           <? = $_POST[' update_act ion'] ? up dateMember shipAction ($membersh ipID,
623                                                                      $_POST['u pdate_acti on_id'],   623                                                                      $_POST['u pdate_acti on_id'],
624                                                                      $_POST['a llowedCnt' ],   624                                                                      $_POST['a llowedCnt' ],
625                                                                      $_POST['p eriod'],   625                                                                      $_POST['p eriod'],
626                                                                      $_POST['d ateStart'] ,   626                                                                      $_POST['d ateStart'] ,
627                                                                      $_POST['d ateEnd'],   627                                                                      $_POST['d ateEnd'],
628                                                                      $_POST['a dditionalP aramValue' ]) : '';?>   628                                                                      $_POST['a dditionalP aramValue' ]) : '';?>
629           <? = $_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 ']) : '' ? >
630       </div>   630       </div>
631   <?   631   <?
632     632  
633       $resLe velActions  = db_res( "   633       $resLe velActions  = db_res( "
634           SE LECT  IDAc tion,   634           SE LECT  IDAc tion,
635                    Allo wedCount,   635                    Allo wedCount,
636                    Allo wedPeriodL en,   636                    Allo wedPeriodL en,
637                    Allo wedPeriodS tart,   637                    Allo wedPeriodS tart,
638                    Allo wedPeriodE nd,   638                    Allo wedPeriodE nd,
639                    Addi tionalPara mName,   639                    Addi tionalPara mName,
640                    Addi tionalPara mValue   640                    Addi tionalPara mValue
641           FR OM    MemL evelAction s   641           FR OM    MemL evelAction s
642                    INNE R JOIN Mem Actions   642                    INNE R JOIN Mem Actions
643                    ON M emLevelAct ions.IDAct ion = MemA ctions.ID   643                    ON M emLevelAct ions.IDAct ion = MemA ctions.ID
644           WH ERE MemLev elActions. IDLevel =  $membershi pID   644           WH ERE MemLev elActions. IDLevel =  $membershi pID
645           OR DER BY Mem Actions.Na me");   645           OR DER BY Mem Actions.Na me");
646     646  
647       $arrLe velActions  = array() ;   647       $arrLe velActions  = array() ;
648     648  
649       while  ($arr = my sql_fetch_ assoc($res LevelActio ns))   649       while  ($arr = my sql_fetch_ assoc($res LevelActio ns))
650       {   650       {
651           $I D = $arr[' IDAction'] ;   651           $I D = $arr[' IDAction'] ;
652           un set($arr[' IDAction'] );   652           un set($arr[' IDAction'] );
653           $a rrLevelAct ions[(int) $ID] = $ar r;   653           $a rrLevelAct ions[(int) $ID] = $ar r;
654       }   654       }
655     655  
656       $optio nsText = " ";   656       $optio nsText = " ";
657       foreac h ($arrAct ions as $I D => $desc )   657       foreac h ($arrAct ions as $I D => $desc )
658       {   658       {
659           if ( !$arrLev elActions[ $ID] )   659           if ( !$arrLev elActions[ $ID] )
660                $options Text .= "\ n<option v alue=\"$ID \">$desc</ option>";   660                $options Text .= "\ n<option v alue=\"$ID \">$desc</ option>";
661       }   661       }
662     662  
663       if ( s trlen($opt ionsText)  )   663       if ( s trlen($opt ionsText)  )
664       {   664       {
665   ?>   665   ?>
666       <div a lign="righ t">   666       <div a lign="righ t">
667            <form   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
  667            <form   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST">
668                <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" />
669                <select  name="add_ action_id" >   669                <select  name="add_ action_id" >
670                    <?=  $optionsTe xt ?>   670                    <?=  $optionsTe xt ?>
671                </select >   671                </select >
672                <input t ype="submi t" value=" Add action " />   672                <input t ype="submi t" value=" Add action " />
673           </ form>   673           </ form>
674       </div>   674       </div>
675   <?   675   <?
676       }   676       }
677     677  
678       foreac h ($arrLev elActions  as $ID =>  $arrAction ) {   678       foreac h ($arrLev elActions  as $ID =>  $arrAction ) {
679   ?>   679   ?>
680       <div c lass="acti onRowHeade r">   680       <div c lass="acti onRowHeade r">
681           <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" >
682                <tr>   682                <tr>
683                    <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>
684                    <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;">
685                         <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>
686                    </td >   686                    </td >
687                    <td>   687                    <td>
688                         <form   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST"   style="pad ding:0;   margin:0;" >
  688                         <form   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST"   style="pad ding:0;   margin:0;" >
689                             <input  type="hid den" name= "delete_ac tion" valu e="yes" />   689                             <input  type="hid den" name= "delete_ac tion" valu e="yes" />
690                             <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 ?>" />
691                             <input  style="wi dth: 57px"  type="sub mit" value ="Delete"  />   691                             <input  style="wi dth: 57px"  type="sub mit" value ="Delete"  />
692                         </form>   692                         </form>
693                    </td >   693                    </td >
694                </tr>   694                </tr>
695           </ table>   695           </ table>
696       </div>   696       </div>
697       <div c lass="acti onRow" id= "actionRow <?= $ID ?> ">   697       <div c lass="acti onRow" id= "actionRow <?= $ID ?> ">
698            <form   id="update ActionForm <?=   $ID   ?>"   action="<? =   $_SERVER[' SCRI P T _ NAM E
']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST"   style="pad ding:0;   margin:0">
  698            <form   id="update ActionForm <?=   $ID   ?>"   action="<? =   $_SERVER['
P HP _ S E LF ']   ?>?edit=ac tions&edit _level=<?=   $membershi pID   ?>"   method="PO ST"   style="pad ding:0;   margin:0">
699           <i nput type= "hidden" n ame="updat e_action"  value="yes " />   699           <i nput type= "hidden" n ame="updat e_action"  value="yes " />
700           <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 ?> " />
701           <t able class ="actionFo rm">   701           <t able class ="actionFo rm">
702                <tr>   702                <tr>
703                    <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>
704                    <td  class="all owedCnt">   704                    <td  class="all owedCnt">
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' :  '' ?> />   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' :  '' ?> />
706                    </td >   706                    </td >
707                </tr>   707                </tr>
708                <tr>   708                <tr>
709                    <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>
710                    <td  class="per iod">   710                    <td  class="per iod">
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'  : '' ?> / >   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'  : '' ?> / >
712                         &nbsp;hour s   712                         &nbsp;hour s
713                    </td >   713                    </td >
714                </tr>   714                </tr>
715                <tr>   715                <tr>
716                    <td  class="cap tion">This  action is  available  since:</t d>   716                    <td  class="cap tion">This  action is  available  since:</t d>
717                    <td  class="dat eStart">   717                    <td  class="dat eStart">
718                         <table cel lpadding=" 0" cellspa cing="0" b order="0">   718                         <table cel lpadding=" 0" cellspa cing="0" b order="0">
719                             <tr>   719                             <tr>
720                                 <t d>   720                                 <t d>
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 ?>' )" />   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 ?>' )" />
722                                 </ td>   722                                 </ td>
723                                 <t d>   723                                 <t d>
724                                      <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"/ >
725                                 </ td>   725                                 </ td>
726                                 <t d>   726                                 <t d>
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"/>   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"/>
728                                 </ td>   728                                 </ td>
729                             </tr>   729                             </tr>
730                         </table>   730                         </table>
731                    </td >   731                    </td >
732                </tr>   732                </tr>
733                <tr>   733                <tr>
734                    <td  class="cap tion">This  action is  available  until:</t d>   734                    <td  class="cap tion">This  action is  available  until:</t d>
735                    <td  class="dat eEnd">   735                    <td  class="dat eEnd">
736                         <table cel lpadding=" 0" cellspa cing="0" b order="0">   736                         <table cel lpadding=" 0" cellspa cing="0" b order="0">
737                             <tr>   737                             <tr>
738                                 <t d>   738                                 <t d>
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 ?>')"  />   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 ?>')"  />
740                                 </ td>   740                                 </ td>
741                                 <t d>   741                                 <t d>
742                                      <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"/>
743                                 </ td>   743                                 </ td>
744                                 <t d>   744                                 <t d>
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" />   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" />
746                                 </ td>   746                                 </ td>
747                             </tr>   747                             </tr>
748                         </table>   748                         </table>
749                    </td >   749                    </td >
750                </tr>   750                </tr>
751   <?   751   <?
752           if (!is_null( $arrAction ['Addition alParamNam e'])) {   752           if (!is_null( $arrAction ['Addition alParamNam e'])) {
753   ?>   753   ?>
754                <tr>   754                <tr>
755                    <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>
756                    <td  class="add itionalPar am">   756                    <td  class="add itionalPar am">
757                         <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'] ) ?>" />
758                    </td >   758                    </td >
759                </tr>   759                </tr>
760   <?   760   <?
761           }   761           }
762   ?>   762   ?>
763           <t r>   763           <t r>
764                <td cols pan="2" al ign="cente r">   764                <td cols pan="2" al ign="cente r">
765                    <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  ?>')"/>
766                </td>   766                </td>
767           </ tr>   767           </ tr>
768           </ table>   768           </ table>
769       </div>   769       </div>
770   <script ty pe="text/j avascript" >   770   <script ty pe="text/j avascript" >
771   //<![CDATA [   771   //<![CDATA [
772         Zapa tec.Calend ar.setup({   772         Zapa tec.Calend ar.setup({
773           fi rstDay           : 1,   773           fi rstDay           : 1,
774           we ekNumbers        : tr ue,   774           we ekNumbers        : tr ue,
775           sh owOthers         : tr ue,   775           sh owOthers         : tr ue,
776           sh owsTime          : tr ue,   776           sh owsTime          : tr ue,
777           ti meFormat         : "2 4",   777           ti meFormat         : "2 4",
778           st ep               : 2,   778           st ep               : 2,
779           ra nge              : [1 900.01, 29 99.12],   779           ra nge              : [1 900.01, 29 99.12],
780           el ectric           : fa lse,   780           el ectric           : fa lse,
781           si ngleClick        : tr ue,   781           si ngleClick        : tr ue,
782           in putField         : "d ateStart<? = $ID ?>",   782           in putField         : "d ateStart<? = $ID ?>",
783           bu tton             : "d ateStart<? = $ID ?>tr igger",   783           bu tton             : "d ateStart<? = $ID ?>tr igger",
784           if Format           : "% Y-%m-%d %H :%M:%S",   784           if Format           : "% Y-%m-%d %H :%M:%S",
785           da Format           : "% Y/%m/%d",   785           da Format           : "% Y/%m/%d",
786           al ign              : "B r"   786           al ign              : "B r"
787         });   787         });
788         Zapa tec.Calend ar.setup({   788         Zapa tec.Calend ar.setup({
789           fi rstDay           : 1,   789           fi rstDay           : 1,
790           we ekNumbers        : tr ue,   790           we ekNumbers        : tr ue,
791           sh owOthers         : tr ue,   791           sh owOthers         : tr ue,
792           sh owsTime          : tr ue,   792           sh owsTime          : tr ue,
793           ti meFormat         : "2 4",   793           ti meFormat         : "2 4",
794           st ep               : 2,   794           st ep               : 2,
795           ra nge              : [1 900.01, 29 99.12],   795           ra nge              : [1 900.01, 29 99.12],
796           el ectric           : fa lse,   796           el ectric           : fa lse,
797           si ngleClick        : tr ue,   797           si ngleClick        : tr ue,
798           in putField         : "d ateEnd<?=  $ID ?>",   798           in putField         : "d ateEnd<?=  $ID ?>",
799           bu tton             : "d ateEnd<?=  $ID ?>trig ger",   799           bu tton             : "d ateEnd<?=  $ID ?>trig ger",
800           if Format           : "% Y-%m-%d %H :%M:%S",   800           if Format           : "% Y-%m-%d %H :%M:%S",
801           da Format           : "% Y/%m/%d",   801           da Format           : "% Y/%m/%d",
802           al ign              : "B r"   802           al ign              : "B r"
803         });   803         });
804   //]]>   804   //]]>
805   </script>   805   </script>
806       </form >   806       </form >
807   <?   807   <?
808       }   808       }
809       if (!c ount($arrL evelAction s)){   809       if (!c ount($arrL evelAction s)){
810   ?>   810   ?>
811           <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>
812   <?   812   <?
813       }   813       }
814   ?>   814   ?>
815   <!--   815   <!--
816   </div></di v>   816   </div></di v>
817   <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>
818   -->   818   -->
819   <?   819   <?
820     820  
821   ContentBlo ckFoot();   821   ContentBlo ckFoot();
822       $conte nts = ob_g et_content s();   822       $conte nts = ob_g et_content s();
823       ob_end _clean();   823       ob_end _clean();
824       return  $contents ;   824       return  $contents ;
825   }   825   }
826     826  
827   TopCodeAdm in();   827   TopCodeAdm in();
828   ?>   828   ?>
829   <!-- Loadi ng Calenda r JavaScri pt files - ->   829   <!-- Loadi ng Calenda r JavaScri pt files - ->
830       <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>
831       <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>
832       <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>
833     833  
834   <!-- Loadi ng languag e definiti on file -- >   834   <!-- Loadi ng languag e definiti on file -- >
835       <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 >
836   <script ty pe="text/j avascript" >   836   <script ty pe="text/j avascript" >
837   function c onfirmAndS ubmit(strF ormName, s trConfirma tionMessag e)   837   function c onfirmAndS ubmit(strF ormName, s trConfirma tionMessag e)
838   {   838   {
839       var re sult = con firm(strCo nfirmation Message);   839       var re sult = con firm(strCo nfirmation Message);
840       if(res ult == tru e) documen t.forms[st rFormName] .submit();   840       if(res ult == tru e) documen t.forms[st rFormName] .submit();
841   }   841   }
842     842  
843   function c learUnlimi ted(textCo ntrolID)   843   function c learUnlimi ted(textCo ntrolID)
844   {   844   {
845       textCo ntrol = do cument.get ElementByI d(textCont rolID);   845       textCo ntrol = do cument.get ElementByI d(textCont rolID);
846     846  
847       if(tex tControl.v alue == 'n o limit')   847       if(tex tControl.v alue == 'n o limit')
848       {   848       {
849           te xtControl. value = '' ;   849           te xtControl. value = '' ;
850       }   850       }
851   }   851   }
852     852  
853   function f illUnlimit ed(textCon trolID)   853   function f illUnlimit ed(textCon trolID)
854   {   854   {
855       textCo ntrol = do cument.get ElementByI d(textCont rolID);   855       textCo ntrol = do cument.get ElementByI d(textCont rolID);
856     856  
857       if(tex tControl.v alue == '' )   857       if(tex tControl.v alue == '' )
858       {   858       {
859           te xtControl. value = 'n o limit';   859           te xtControl. value = 'n o limit';
860       }   860       }
861   }   861   }
862     862  
863   function c learFormUn limited(st rFormID)   863   function c learFormUn limited(st rFormID)
864   {   864   {
865       form =  document. getElement ById(strFo rmID);   865       form =  document. getElement ById(strFo rmID);
866     866  
867       inputT ags = form .getElemen tsByTagNam e('input') ;   867       inputT ags = form .getElemen tsByTagNam e('input') ;
868     868  
869       for(i= 0; i < inp utTags.len gth; i++)   869       for(i= 0; i < inp utTags.len gth; i++)
870       {   870       {
871           if (inputTags [i].value  == 'no lim it')   871           if (inputTags [i].value  == 'no lim it')
872                inputTag s[i].value  = '';   872                inputTag s[i].value  = '';
873       }   873       }
874   }   874   }
875     875  
876   function s howHide(st rLabelID,  strDivID)   876   function s howHide(st rLabelID,  strDivID)
877   {   877   {
878       div =  document.g etElementB yId(strDiv ID);   878       div =  document.g etElementB yId(strDiv ID);
879       label  = document .getElemen tById(strL abelID);   879       label  = document .getElemen tById(strL abelID);
880     880  
881       if(div .style.dis play == '' )   881       if(div .style.dis play == '' )
882           di v.style.di splay = 'n one';   882           di v.style.di splay = 'n one';
883     883  
884       if(div .style.dis play == 'n one'){   884       if(div .style.dis play == 'n one'){
885           di v.style.di splay = 'b lock';   885           di v.style.di splay = 'b lock';
886           la bel.innerH TML = 'Hid e';   886           la bel.innerH TML = 'Hid e';
887       }else{   887       }else{
888           di v.style.di splay = 'n one';   888           di v.style.di splay = 'n one';
889           la bel.innerH TML = 'Sho w';   889           la bel.innerH TML = 'Sho w';
890       }   890       }
891   }   891   }
892   </script>   892   </script>
893   <?   893   <?
894     894  
895   if(isset($ _POST['sav eMemSet'])  && isset( $_POST['ca tegory']))   895   if(isset($ _POST['sav eMemSet'])  && isset( $_POST['ca tegory']))
896   {   896   {
897       saveMe mSettings( );   897       saveMe mSettings( );
898   }   898   }
899     899  
900   echo Conte ntBlockHea d("Members hip settin gs");   900   echo Conte ntBlockHea d("Members hip settin gs");
901   echo displ ayOptions( );   901   echo displ ayOptions( );
902   echo Conte ntBlockFoo t();   902   echo Conte ntBlockFoo t();
903     903  
904     904  
905   echo Conte ntBlockHea d("Manage  Membership  Types");   905   echo Conte ntBlockHea d("Manage  Membership  Types");
906   echo membe rshipList( );   906   echo membe rshipList( );
907   echo Conte ntBlockFoo t();   907   echo Conte ntBlockFoo t();
908     908  
909   switch ($_ GET['edit' ])   909   switch ($_ GET['edit' ])
910   {   910   {
911       case ' pricing':  echo membe rshipPrici ng($_GET[' edit_level ']);   911       case ' pricing':  echo membe rshipPrici ng($_GET[' edit_level ']);
912       break;   912       break;
913     913  
914       case ' actions':  echo membe rshipActio ns($_GET[' edit_level ']);   914       case ' actions':  echo membe rshipActio ns($_GET[' edit_level ']);
915   }   915   }
916   BottomCode ();   916   BottomCode ();
917   ?>   917   ?>