18. File Comparison Report

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

18.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\admin sdating_admin.php Sat Apr 19 12:05:02 2008 UTC
2 Dolphin-v.6.1.2\admin sdating_admin.php Mon May 19 07:27:15 2008 UTC

18.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 4232
Changed 0 0
Inserted 2 3
Removed 0 0

18.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

18.4 Active regular expressions

No regular expressions were active.

18.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 . 'a dmin_desig n.inc.php'  );   23   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 . 'u tils.inc.p hp' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );   25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'i mages.inc. php' );   27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'i mages.inc. php' );
28   require_on ce( BX_DIR ECTORY_PAT H_INC . 's dating.inc .php' );   28   require_on ce( BX_DIR ECTORY_PAT H_INC . 's dating.inc .php' );
29     29  
30   $logged['a dmin'] = m ember_auth ( 1, true,  true );   30   $logged['a dmin'] = m ember_auth ( 1, true,  true );
31     31  
32   $navigatio nStep = 10 ; // count  of events  to show p er page   32   $navigatio nStep = 10 ; // count  of events  to show p er page
33     33  
34   $_page['he ader'] = " Events";   34   $_page['he ader'] = " Events";
35   $_page['he ader_text' ] = "Manag e Events";   35   $_page['he ader_text' ] = "Manag e Events";
36   $_page['cs s_name'] =  'sdating_ admin.css' ;   36   $_page['cs s_name'] =  'sdating_ admin.css' ;
37     37  
38   /**   38   /**
39    * Adds ne w event in to the dat abase   39    * Adds ne w event in to the dat abase
40    *   40    *
41    * @return  int                             - zero on  success, n on-zero on  fail   41    * @return  int                             - zero on  success, n on-zero on  fail
42    *   42    *
43    *   43    *
44    */   44    */
45   function S DAddEvent( )   45   function S DAddEvent( )
46   {   46   {
47       global  $dir;   47       global  $dir;
48       global  $sdatingT humbWidth;   48       global  $sdatingT humbWidth;
49       global  $sdatingT humbHeight ;   49       global  $sdatingT humbHeight ;
50     50  
51       // com mon   51       // com mon
52       $event Title = pr ocess_db_i nput( $_PO ST['event_ title'] );   52       $event Title = pr ocess_db_i nput( $_PO ST['event_ title'] );
53       $event Desc = pro cess_db_in put( $_POS T['event_d esc'] );   53       $event Desc = pro cess_db_in put( $_POS T['event_d esc'] );
54       switch  ( $_POST[ 'event_sta tus'] )   54       switch  ( $_POST[ 'event_sta tus'] )
55       {   55       {
56           ca se 'active ':   56           ca se 'active ':
57                $eventSt atus = 'Ac tive';   57                $eventSt atus = 'Ac tive';
58                break;   58                break;
59           ca se 'inacti ve':   59           ca se 'inacti ve':
60                $eventSt atus = 'In active';   60                $eventSt atus = 'In active';
61                break;   61                break;
62           ca se 'cancel ed':   62           ca se 'cancel ed':
63                $eventSt atus = 'Ca nceled';   63                $eventSt atus = 'Ca nceled';
64                break;   64                break;
65           de fault:   65           de fault:
66                $eventSt atus = 'Ac tive';   66                $eventSt atus = 'Ac tive';
67       }   67       }
68       $event StatusMess age = proc ess_db_inp ut( $_POST ['event_st atusmsg']  );   68       $event StatusMess age = proc ess_db_inp ut( $_POST ['event_st atusmsg']  );
69     69  
70       // eve nt place   70       // eve nt place
71       $event Country =  process_db _input( $_ POST['even t_country' ] );   71       $event Country =  process_db _input( $_ POST['even t_country' ] );
72       $event City = pro cess_db_in put( $_POS T['event_c ity'] );   72       $event City = pro cess_db_in put( $_POS T['event_c ity'] );
73       $event Place = pr ocess_db_i nput( $_PO ST['event_ place'] );   73       $event Place = pr ocess_db_i nput( $_PO ST['event_ place'] );
74     74  
75       $pictu reName = $ _FILES['ev ent_photo' ]['name'];   75       $pictu reName = $ _FILES['ev ent_photo' ]['name'];
76       $thumb Name = get ThumbNameB yPictureNa me( $pictu reName );   76       $thumb Name = get ThumbNameB yPictureNa me( $pictu reName );
77     77  
78       $scan  = getimage size( $_FI LES['event _photo'][' tmp_name']  );   78       $scan  = getimage size( $_FI LES['event _photo'][' tmp_name']  );
79     79  
80       if ( (  1 == $sca n[2] || 2  == $scan[2 ] || 3 ==  $scan[2] | | 6 == $sc an[2] )   80       if ( (  1 == $sca n[2] || 2  == $scan[2 ] || 3 ==  $scan[2] | | 6 == $sc an[2] )
81           &&  move_uplo aded_file(  $_FILES[' event_phot o']['tmp_n ame'], $di r['tmp'] .  $pictureN ame ) )   81           &&  move_uplo aded_file(  $_FILES[' event_phot o']['tmp_n ame'], $di r['tmp'] .  $pictureN ame ) )
82       {   82       {
83           $r esizeWidth  = (int)$_ POST['even t_photo_wi dth'];   83           $r esizeWidth  = (int)$_ POST['even t_photo_wi dth'];
84           $r esizeHeigh t = (int)$ _POST['eve nt_photo_h eight'];   84           $r esizeHeigh t = (int)$ _POST['eve nt_photo_h eight'];
85           //  resize fo r thumbnai l   85           //  resize fo r thumbnai l
86           $r es = image Resize( $d ir['tmp']  . $picture Name, $dir ['sdatingI mage'] . $ thumbName,  $sdatingT humbWidth,  $sdatingT humbHeight  );   86           $r es = image Resize( $d ir['tmp']  . $picture Name, $dir ['sdatingI mage'] . $ thumbName,  $sdatingT humbWidth,  $sdatingT humbHeight  );
87           if  ( $res !=  IMAGE_ERR OR_SUCCESS  )   87           if  ( $res !=  IMAGE_ERR OR_SUCCESS  )
88                return S DATING_ERR OR_PHOTO_P ROCESS;   88                return S DATING_ERR OR_PHOTO_P ROCESS;
89           //  if width  and height  specified  then resi ze picture   89           //  if width  and height  specified  then resi ze picture
90           if  ( $resize Width && $ resizeHeig ht )   90           if  ( $resize Width && $ resizeHeig ht )
91           {   91           {
92                $res = i mageResize ( $dir['tm p'] . $pic tureName,  $dir['sdat ingImage']  . $pictur eName, $re sizeWidth,  $resizeHe ight );   92                $res = i mageResize ( $dir['tm p'] . $pic tureName,  $dir['sdat ingImage']  . $pictur eName, $re sizeWidth,  $resizeHe ight );
93                if ( $re s != IMAGE _ERROR_SUC CESS )   93                if ( $re s != IMAGE _ERROR_SUC CESS )
94                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   94                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
95                unlink(  $dir['tmp' ] . $pictu reName );   95                unlink(  $dir['tmp' ] . $pictu reName );
96           }   96           }
97           el se   97           el se
98           {   98           {
99                $res = r ename( $di r['tmp'] .  $pictureN ame, $dir[ 'sdatingIm age'] . $p ictureName  );   99                $res = r ename( $di r['tmp'] .  $pictureN ame, $dir[ 'sdatingIm age'] . $p ictureName  );
100                if ( !$r es )   100                if ( !$r es )
101                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   101                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
102           }   102           }
103           ch mod( $dir[ 'sdatingIm age'] . $p ictureName , 0644 );   103           ch mod( $dir[ 'sdatingIm age'] . $p ictureName , 0644 );
104           $e ventPhotoF ilename =  process_db _input( $p ictureName  );   104           $e ventPhotoF ilename =  process_db _input( $p ictureName  );
105       }   105       }
106       else   106       else
107       {   107       {
108           $e ventPhotoF ilename =  '';   108           $e ventPhotoF ilename =  '';
109       }   109       }
110     110  
111       // eve nt date   111       // eve nt date
112       $event Start = st rtotime( $ _POST['eve nt_start']  );   112       $event Start = st rtotime( $ _POST['eve nt_start']  );
113       if ( $ eventStart  == -1 )   113       if ( $ eventStart  == -1 )
114           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   114           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
115       $event End = strt otime( $_P OST['event _end'] );   115       $event End = strt otime( $_P OST['event _end'] );
116       if ( $ eventEnd = = -1 )   116       if ( $ eventEnd = = -1 )
117           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   117           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
118       $event SaleStart  = strtotim e( $_POST[ 'event_sal e_start']  );   118       $event SaleStart  = strtotim e( $_POST[ 'event_sal e_start']  );
119       if ( $ eventSaleS tart == -1  )   119       if ( $ eventSaleS tart == -1  )
120           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   120           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
121       $event SaleEnd =  strtotime(  $_POST['e vent_sale_ end'] );   121       $event SaleEnd =  strtotime(  $_POST['e vent_sale_ end'] );
122       if ( $ eventSaleE nd == -1 )   122       if ( $ eventSaleE nd == -1 )
123           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   123           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
124       if ( $ eventEnd <  $eventSta rt || $eve ntSaleEnd  < $eventSa leStart ||  $eventSta rt < $even tSaleStart  )   124       if ( $ eventEnd <  $eventSta rt || $eve ntSaleEnd  < $eventSa leStart ||  $eventSta rt < $even tSaleStart  )
125           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   125           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
126     126  
127       // eve nt respons ible   127       // eve nt respons ible
128       $event RespName =  process_d b_input( $ _POST['eve nt_resp_na me'] );   128       $event RespName =  process_d b_input( $ _POST['eve nt_resp_na me'] );
129       $event RespEmail  = process_ db_input(  $_POST['ev ent_resp_e mail'] );   129       $event RespEmail  = process_ db_input(  $_POST['ev ent_resp_e mail'] );
130       $event RespPhone  = process_ db_input(  $_POST['ev ent_resp_p hone'] );   130       $event RespPhone  = process_ db_input(  $_POST['ev ent_resp_p hone'] );
131     131  
132       // eve nt partici pants   132       // eve nt partici pants
133       $event SexFilter  = '';   133       $event SexFilter  = '';
134       if ( $ _POST['eve nt_sex_fem ale'] == ' on' )   134       if ( $ _POST['eve nt_sex_fem ale'] == ' on' )
135           $e ventSexFil ter .= 'fe male';   135           $e ventSexFil ter .= 'fe male';
136       if ( $ _POST['eve nt_sex_mal e'] == 'on ' )   136       if ( $ _POST['eve nt_sex_mal e'] == 'on ' )
137           $e ventSexFil ter .= str len($event SexFilter)  ? ',male'  : 'male';   137           $e ventSexFil ter .= str len($event SexFilter)  ? ',male'  : 'male';
138     138  
139       $event AgeLowerFi lter = (in t)$_POST[' event_age_ start'];   139       $event AgeLowerFi lter = (in t)$_POST[' event_age_ start'];
140       $event AgeUpperFi lter = (in t)$_POST[' event_age_ end'];   140       $event AgeUpperFi lter = (in t)$_POST[' event_age_ end'];
141     141  
142       $event Membership Filter = ' ';   142       $event Membership Filter = ' ';
143       foreac h ( $_POST ['event_me mbership']  as $membe rshipID )   143       foreac h ( $_POST ['event_me mbership']  as $membe rshipID )
144       {   144       {
145           $e ventMember shipFilter  .= strlen ($eventMem bershipFil ter) ? ",\ '{$members hipID}\'"  : "\'{$mem bershipID} \'";   145           $e ventMember shipFilter  .= strlen ($eventMem bershipFil ter) ? ",\ '{$members hipID}\'"  : "\'{$mem bershipID} \'";
146       }   146       }
147     147  
148       $event CountF = ( int)$_POST ['event_co unt_female '];   148       $event CountF = ( int)$_POST ['event_co unt_female '];
149       $event CountM = ( int)$_POST ['event_co unt_male'] ;   149       $event CountM = ( int)$_POST ['event_co unt_male'] ;
150     150  
151       // tic ket prices   151       // tic ket prices
152       if ( i sset($_POS T['event_p rice_free' ]) && $_PO ST['event_ price_free '] == 'on'  )   152       if ( i sset($_POS T['event_p rice_free' ]) && $_PO ST['event_ price_free '] == 'on'  )
153       {   153       {
154           $e ventPriceF  = '0.00';   154           $e ventPriceF  = '0.00';
155           $e ventPriceM  = '0.00';   155           $e ventPriceM  = '0.00';
156           $e ventPriceC  = '0.00';   156           $e ventPriceC  = '0.00';
157       }   157       }
158       else   158       else
159       {   159       {
160           $e ventPriceF  = (float) $_POST['ev ent_price_ female'];   160           $e ventPriceF  = (float) $_POST['ev ent_price_ female'];
161           $e ventPriceM  = (float) $_POST['ev ent_price_ male'];   161           $e ventPriceM  = (float) $_POST['ev ent_price_ male'];
162       }   162       }
163     163  
164       // cho ose option s   164       // cho ose option s
165       $event ChoosePeri od = (int) $_POST['ev ent_choose _period'];   165       $event ChoosePeri od = (int) $_POST['ev ent_choose _period'];
166     166  
167       // all ow to view  participa nts   167       // all ow to view  participa nts
168       $event AllowView  = $_POST[' event_allo w_view'] = = 'on' ? ' 1' : '0';   168       $event AllowView  = $_POST[' event_allo w_view'] = = 'on' ? ' 1' : '0';
169     169  
    170       $sNewU ri = uriGe nerate($ev entTitle,  'SDatingEv ents', 'En tryUri', 1 00);
    171  
170       $res =  db_res( " INSERT INT O `SDating Events` SE T   172       $res =  db_res( " INSERT INT O `SDating Events` SE T
171                         `Title` =  '$eventTit le',   173                         `Title` =  '$eventTit le',
    174                         `EntryUri`  = '{$sNew Uri}',
172                         `Descripti on` = '$ev entDesc',   175                         `Descripti on` = '$ev entDesc',
173                         `Status` =  '$eventSt atus',   176                         `Status` =  '$eventSt atus',
174                         `StatusMes sage` = '$ eventStatu sMessage',   177                         `StatusMes sage` = '$ eventStatu sMessage',
175                         `Country`  = '$eventC ountry',   178                         `Country`  = '$eventC ountry',
176                         `City` = ' $eventCity ',   179                         `City` = ' $eventCity ',
177                         `Place` =  '$eventPla ce',   180                         `Place` =  '$eventPla ce',
178                         `PhotoFile name` = '$ eventPhoto Filename',   181                         `PhotoFile name` = '$ eventPhoto Filename',
179                         `EventStar t` = FROM_ UNIXTIME(  $eventStar t ),   182                         `EventStar t` = FROM_ UNIXTIME(  $eventStar t ),
180                         `EventEnd`  = FROM_UN IXTIME( $e ventEnd ),   183                         `EventEnd`  = FROM_UN IXTIME( $e ventEnd ),
181                         `TicketSal eStart` =  FROM_UNIXT IME( $even tSaleStart  ),   184                         `TicketSal eStart` =  FROM_UNIXT IME( $even tSaleStart  ),
182                         `TicketSal eEnd` = FR OM_UNIXTIM E( $eventS aleEnd ),   185                         `TicketSal eEnd` = FR OM_UNIXTIM E( $eventS aleEnd ),
183                         `Responsib leName` =  '$eventRes pName',   186                         `Responsib leName` =  '$eventRes pName',
184                         `Responsib leEmail` =  '$eventRe spEmail',   187                         `Responsib leEmail` =  '$eventRe spEmail',
185                         `Responsib lePhone` =  '$eventRe spPhone',   188                         `Responsib lePhone` =  '$eventRe spPhone',
186                         `EventSexF ilter` = ' $eventSexF ilter',   189                         `EventSexF ilter` = ' $eventSexF ilter',
187                         `EventAgeL owerFilter ` = $event AgeLowerFi lter,   190                         `EventAgeL owerFilter ` = $event AgeLowerFi lter,
188                         `EventAgeU pperFilter ` = $event AgeUpperFi lter,   191                         `EventAgeU pperFilter ` = $event AgeUpperFi lter,
189                         `EventMemb ershipFilt er` = '$ev entMembers hipFilter' ,   192                         `EventMemb ershipFilt er` = '$ev entMembers hipFilter' ,
190                         `TicketCou ntFemale`  = $eventCo untF,   193                         `TicketCou ntFemale`  = $eventCo untF,
191                         `TicketCou ntMale` =  $eventCoun tM,   194                         `TicketCou ntMale` =  $eventCoun tM,
192                         `TicketPri ceFemale`  = $eventPr iceF,   195                         `TicketPri ceFemale`  = $eventPr iceF,
193                         `TicketPri ceMale` =  $eventPric eM,   196                         `TicketPri ceMale` =  $eventPric eM,
194                         `ChoosePer iod` = $ev entChooseP eriod,   197                         `ChoosePer iod` = $ev entChooseP eriod,
195                         `AllowView Participan ts` = $eve ntAllowVie w" );   198                         `AllowView Participan ts` = $eve ntAllowVie w" );
196       if ( ! $res )   199       if ( ! $res )
197           re turn SDATI NG_ERROR_Q UERY_ERROR ;   200           re turn SDATI NG_ERROR_Q UERY_ERROR ;
198       if ( m ysql_affec ted_rows()  == 0 )   201       if ( m ysql_affec ted_rows()  == 0 )
199           re turn SDATI NG_ERROR_N OT_AFFECTE D;   202           re turn SDATI NG_ERROR_N OT_AFFECTE D;
200       return  SDATING_E RROR_SUCCE SS;   203       return  SDATING_E RROR_SUCCE SS;
201   }   204   }
202     205  
203   /**   206   /**
204    * Updates  event inf ormation i n the data base   207    * Updates  event inf ormation i n the data base
205    *   208    *
206    * @param  int $event Id                    - update e vent ID   209    * @param  int $event Id                    - update e vent ID
207    *   210    *
208    * @return  int                             - zero on  success, n on-zero on  fail   211    * @return  int                             - zero on  success, n on-zero on  fail
209    *   212    *
210    *   213    *
211    */   214    */
212   function S DUpdateEve nt( $event Id )   215   function S DUpdateEve nt( $event Id )
213   {   216   {
214       global  $dir;   217       global  $dir;
215       global  $sdatingT humbWidth;   218       global  $sdatingT humbWidth;
216       global  $sdatingT humbHeight ;   219       global  $sdatingT humbHeight ;
217     220  
218       $event ExistArr =  db_arr( " SELECT `ID `, `Title` , `Descrip tion`, `St atus`, `St atusMessag e`, `Count ry`, `City `, `Place` , `PhotoFi lename`, ` EventStart `, `EventE nd`, `Tick etSaleStar t`, `Ticke tSaleEnd`,  `Responsi bleName`,  `Responsib leEmail`,  `Responsib lePhone`,  `EventSexF ilter`, `E ventAgeLow erFilter`,  `EventAge UpperFilte r`, `Event Membership Filter`, ` TicketCoun tFemale`,  `TicketCou ntMale`, ` TicketPric eFemale`,  `TicketPri ceMale`, ` ChoosePeri od`, `Allo wViewParti cipants` F ROM `SDati ngEvents`  WHERE `ID`  = $eventI d" );   221       $event ExistArr =  db_arr( " SELECT `ID `, `Title` , `Descrip tion`, `St atus`, `St atusMessag e`, `Count ry`, `City `, `Place` , `PhotoFi lename`, ` EventStart `, `EventE nd`, `Tick etSaleStar t`, `Ticke tSaleEnd`,  `Responsi bleName`,  `Responsib leEmail`,  `Responsib lePhone`,  `EventSexF ilter`, `E ventAgeLow erFilter`,  `EventAge UpperFilte r`, `Event Membership Filter`, ` TicketCoun tFemale`,  `TicketCou ntMale`, ` TicketPric eFemale`,  `TicketPri ceMale`, ` ChoosePeri od`, `Allo wViewParti cipants` F ROM `SDati ngEvents`  WHERE `ID`  = $eventI d" );
219     222  
220       // com mon   223       // com mon
221       $event Title = pr ocess_db_i nput( $_PO ST['event_ title'] );   224       $event Title = pr ocess_db_i nput( $_PO ST['event_ title'] );
222       $event Desc = pro cess_db_in put( $_POS T['event_d esc'] );   225       $event Desc = pro cess_db_in put( $_POS T['event_d esc'] );
223       switch  ( $_POST[ 'event_sta tus'] )   226       switch  ( $_POST[ 'event_sta tus'] )
224       {   227       {
225           ca se 'active ':   228           ca se 'active ':
226                $eventSt atus = 'Ac tive';   229                $eventSt atus = 'Ac tive';
227                break;   230                break;
228           ca se 'inacti ve':   231           ca se 'inacti ve':
229                $eventSt atus = 'In active';   232                $eventSt atus = 'In active';
230                break;   233                break;
231           ca se 'cancel ed':   234           ca se 'cancel ed':
232                $eventSt atus = 'Ca nceled';   235                $eventSt atus = 'Ca nceled';
233                break;   236                break;
234           de fault:   237           de fault:
235                $eventSt atus = 'Ac tive';   238                $eventSt atus = 'Ac tive';
236       }   239       }
237       $event StatusMess age = proc ess_db_inp ut( $_POST ['event_st atusmsg']  );   240       $event StatusMess age = proc ess_db_inp ut( $_POST ['event_st atusmsg']  );
238     241  
239       // eve nt place   242       // eve nt place
240       $event Country =  process_db _input( $_ POST['even t_country' ] );   243       $event Country =  process_db _input( $_ POST['even t_country' ] );
241       $event City = pro cess_db_in put( $_POS T['event_c ity'] );   244       $event City = pro cess_db_in put( $_POS T['event_c ity'] );
242       $event Place = pr ocess_db_i nput( $_PO ST['event_ place'] );   245       $event Place = pr ocess_db_i nput( $_PO ST['event_ place'] );
243     246  
244       $pictu reName = $ _FILES['ev ent_photo' ]['name'];   247       $pictu reName = $ _FILES['ev ent_photo' ]['name'];
245       $thumb Name = get ThumbNameB yPictureNa me( $pictu reName );   248       $thumb Name = get ThumbNameB yPictureNa me( $pictu reName );
246     249  
247       $scan  = getimage size( $_FI LES['event _photo'][' tmp_name']  );   250       $scan  = getimage size( $_FI LES['event _photo'][' tmp_name']  );
248     251  
249       if ( (  1 == $sca n[2] || 2  == $scan[2 ] || 3 ==  $scan[2] | | 6 == $sc an[2] )   252       if ( (  1 == $sca n[2] || 2  == $scan[2 ] || 3 ==  $scan[2] | | 6 == $sc an[2] )
250           &&  move_uplo aded_file(  $_FILES[' event_phot o']['tmp_n ame'], $di r['tmp'] .  $pictureN ame ) )   253           &&  move_uplo aded_file(  $_FILES[' event_phot o']['tmp_n ame'], $di r['tmp'] .  $pictureN ame ) )
251       {   254       {
252           if  ( strlen(  $eventExi stArr['Pho toFilename '] ) && fi le_exists(  $dir['sda tingImage' ] . $event ExistArr[' PhotoFilen ame'] ) )   255           if  ( strlen(  $eventExi stArr['Pho toFilename '] ) && fi le_exists(  $dir['sda tingImage' ] . $event ExistArr[' PhotoFilen ame'] ) )
253           {   256           {
254                unlink(  $dir['sdat ingImage']  . $eventE xistArr['P hotoFilena me'] );   257                unlink(  $dir['sdat ingImage']  . $eventE xistArr['P hotoFilena me'] );
255           }   258           }
256           $r esizeWidth  = (int)$_ POST['even t_photo_wi dth'];   259           $r esizeWidth  = (int)$_ POST['even t_photo_wi dth'];
257           $r esizeHeigh t = (int)$ _POST['eve nt_photo_h eight'];   260           $r esizeHeigh t = (int)$ _POST['eve nt_photo_h eight'];
258           //  resize fo r thumbnai l   261           //  resize fo r thumbnai l
259           $r es = image Resize( $d ir['tmp']  . $picture Name, $dir ['sdatingI mage'] . $ thumbName,  $sdatingT humbWidth,  $sdatingT humbHeight  );   262           $r es = image Resize( $d ir['tmp']  . $picture Name, $dir ['sdatingI mage'] . $ thumbName,  $sdatingT humbWidth,  $sdatingT humbHeight  );
260           if  ( $res !=  IMAGE_ERR OR_SUCCESS  )   263           if  ( $res !=  IMAGE_ERR OR_SUCCESS  )
261                return S DATING_ERR OR_PHOTO_P ROCESS;   264                return S DATING_ERR OR_PHOTO_P ROCESS;
262           //  if width  and height  specified  then resi ze picture   265           //  if width  and height  specified  then resi ze picture
263           if  ( $resize Width && $ resizeHeig ht )   266           if  ( $resize Width && $ resizeHeig ht )
264           {   267           {
265                $res = i mageResize ( $dir['tm p'] . $pic tureName,  $dir['sdat ingImage']  . $pictur eName, $re sizeWidth,  $resizeHe ight );   268                $res = i mageResize ( $dir['tm p'] . $pic tureName,  $dir['sdat ingImage']  . $pictur eName, $re sizeWidth,  $resizeHe ight );
266                if ( $re s != IMAGE _ERROR_SUC CESS )   269                if ( $re s != IMAGE _ERROR_SUC CESS )
267                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   270                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
268                unlink(  $dir['tmp' ] . $pictu reName );   271                unlink(  $dir['tmp' ] . $pictu reName );
269           }   272           }
270           el se   273           el se
271           {   274           {
272                $res = r ename( $di r['tmp'] .  $pictureN ame, $dir[ 'sdatingIm age'] . $p ictureName  );   275                $res = r ename( $di r['tmp'] .  $pictureN ame, $dir[ 'sdatingIm age'] . $p ictureName  );
273                if ( !$r es )   276                if ( !$r es )
274                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   277                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
275           }   278           }
276           ch mod( $dir[ 'sdatingIm age'] . $p ictureName , 0644 );   279           ch mod( $dir[ 'sdatingIm age'] . $p ictureName , 0644 );
277           $e ventPhotoF ilename =  process_db _input( $p ictureName  );   280           $e ventPhotoF ilename =  process_db _input( $p ictureName  );
278       }   281       }
279       else   282       else
280       {   283       {
281           $e ventPhotoF ilename =  $eventExis tArr['Phot oFilename' ];   284           $e ventPhotoF ilename =  $eventExis tArr['Phot oFilename' ];
282       }   285       }
283     286  
284       // eve nt date   287       // eve nt date
285       $event Start = st rtotime( $ _POST['eve nt_start']  );   288       $event Start = st rtotime( $ _POST['eve nt_start']  );
286       if ( $ eventStart  == -1 )   289       if ( $ eventStart  == -1 )
287           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   290           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
288       $event End = strt otime( $_P OST['event _end'] );   291       $event End = strt otime( $_P OST['event _end'] );
289       if ( $ eventEnd = = -1 )   292       if ( $ eventEnd = = -1 )
290           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   293           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
291       $event SaleStart  = strtotim e( $_POST[ 'event_sal e_start']  );   294       $event SaleStart  = strtotim e( $_POST[ 'event_sal e_start']  );
292       if ( $ eventSaleS tart == -1  )   295       if ( $ eventSaleS tart == -1  )
293           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   296           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
294       $event SaleEnd =  strtotime(  $_POST['e vent_sale_ end'] );   297       $event SaleEnd =  strtotime(  $_POST['e vent_sale_ end'] );
295       if ( $ eventSaleE nd == -1 )   298       if ( $ eventSaleE nd == -1 )
296           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   299           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
297       if ( $ eventEnd <  $eventSta rt || $eve ntSaleEnd  < $eventSa leStart ||  $eventSta rt < $even tSaleStart  )   300       if ( $ eventEnd <  $eventSta rt || $eve ntSaleEnd  < $eventSa leStart ||  $eventSta rt < $even tSaleStart  )
298           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;   301           re turn SDATI NG_ERROR_W RONG_DATE_ FORMAT;
299     302  
300       // eve nt respons ible   303       // eve nt respons ible
301       $event RespName =  process_d b_input( $ _POST['eve nt_resp_na me'] );   304       $event RespName =  process_d b_input( $ _POST['eve nt_resp_na me'] );
302       $event RespEmail  = process_ db_input(  $_POST['ev ent_resp_e mail'] );   305       $event RespEmail  = process_ db_input(  $_POST['ev ent_resp_e mail'] );
303       $event RespPhone  = process_ db_input(  $_POST['ev ent_resp_p hone'] );   306       $event RespPhone  = process_ db_input(  $_POST['ev ent_resp_p hone'] );
304     307  
305       // eve nt partici pants   308       // eve nt partici pants
306       $event SexFilter  = '';   309       $event SexFilter  = '';
307       if ( $ _POST['eve nt_sex_fem ale'] == ' on' )   310       if ( $ _POST['eve nt_sex_fem ale'] == ' on' )
308           $e ventSexFil ter .= 'fe male';   311           $e ventSexFil ter .= 'fe male';
309       if ( $ _POST['eve nt_sex_mal e'] == 'on ' )   312       if ( $ _POST['eve nt_sex_mal e'] == 'on ' )
310           $e ventSexFil ter .= str len($event SexFilter)  ? ',male'  : 'male';   313           $e ventSexFil ter .= str len($event SexFilter)  ? ',male'  : 'male';
311     314  
312       $event AgeLowerFi lter = (in t)$_POST[' event_age_ start'];   315       $event AgeLowerFi lter = (in t)$_POST[' event_age_ start'];
313       $event AgeUpperFi lter = (in t)$_POST[' event_age_ end'];   316       $event AgeUpperFi lter = (in t)$_POST[' event_age_ end'];
314     317  
315       $event Membership Filter = ' ';   318       $event Membership Filter = ' ';
316       foreac h ( $_POST ['event_me mbership']  as $membe rshipID )   319       foreac h ( $_POST ['event_me mbership']  as $membe rshipID )
317       {   320       {
318           $e ventMember shipFilter  .= strlen ($eventMem bershipFil ter) ? ",\ '{$members hipID}\'"  : "\'{$mem bershipID} \'";   321           $e ventMember shipFilter  .= strlen ($eventMem bershipFil ter) ? ",\ '{$members hipID}\'"  : "\'{$mem bershipID} \'";
319       }   322       }
320     323  
321       $event CountF = ( int)$_POST ['event_co unt_female '];   324       $event CountF = ( int)$_POST ['event_co unt_female '];
322       $event CountM = ( int)$_POST ['event_co unt_male'] ;   325       $event CountM = ( int)$_POST ['event_co unt_male'] ;
323     326  
324       // tic ket prices   327       // tic ket prices
325       if ( i sset($_POS T['event_p rice_free' ]) && $_PO ST['event_ price_free '] == 'on'  )   328       if ( i sset($_POS T['event_p rice_free' ]) && $_PO ST['event_ price_free '] == 'on'  )
326       {   329       {
327           $e ventPriceF  = '0.00';   330           $e ventPriceF  = '0.00';
328           $e ventPriceM  = '0.00';   331           $e ventPriceM  = '0.00';
329           $e ventPriceC  = '0.00';   332           $e ventPriceC  = '0.00';
330       }   333       }
331       else   334       else
332       {   335       {
333           $e ventPriceF  = (float) $_POST['ev ent_price_ female'];   336           $e ventPriceF  = (float) $_POST['ev ent_price_ female'];
334           $e ventPriceM  = (float) $_POST['ev ent_price_ male'];   337           $e ventPriceM  = (float) $_POST['ev ent_price_ male'];
335       }   338       }
336     339  
337       // cho ose option s   340       // cho ose option s
338       $event ChoosePeri od = (int) $_POST['ev ent_choose _period'];   341       $event ChoosePeri od = (int) $_POST['ev ent_choose _period'];
339     342  
340       // all ow to view  participa nts   343       // all ow to view  participa nts
341       $event AllowView  = $_POST[' event_allo w_view'] = = 'on' ? ' 1' : '0';   344       $event AllowView  = $_POST[' event_allo w_view'] = = 'on' ? ' 1' : '0';
342     345  
343       $res =  db_res( " UPDATE `SD atingEvent s` SET   346       $res =  db_res( " UPDATE `SD atingEvent s` SET
344                         `Title` =  '$eventTit le',   347                         `Title` =  '$eventTit le',
345                         `Descripti on` = '$ev entDesc',   348                         `Descripti on` = '$ev entDesc',
346                         `Status` =  '$eventSt atus',   349                         `Status` =  '$eventSt atus',
347                         `StatusMes sage` = '$ eventStatu sMessage',   350                         `StatusMes sage` = '$ eventStatu sMessage',
348                         `Country`  = '$eventC ountry',   351                         `Country`  = '$eventC ountry',
349                         `City` = ' $eventCity ',   352                         `City` = ' $eventCity ',
350                         `Place` =  '$eventPla ce',   353                         `Place` =  '$eventPla ce',
351                         `PhotoFile name` = '$ eventPhoto Filename',   354                         `PhotoFile name` = '$ eventPhoto Filename',
352                         `EventStar t` = FROM_ UNIXTIME(  $eventStar t ),   355                         `EventStar t` = FROM_ UNIXTIME(  $eventStar t ),
353                         `EventEnd`  = FROM_UN IXTIME( $e ventEnd ),   356                         `EventEnd`  = FROM_UN IXTIME( $e ventEnd ),
354                         `TicketSal eStart` =  FROM_UNIXT IME( $even tSaleStart  ),   357                         `TicketSal eStart` =  FROM_UNIXT IME( $even tSaleStart  ),
355                         `TicketSal eEnd` = FR OM_UNIXTIM E( $eventS aleEnd ),   358                         `TicketSal eEnd` = FR OM_UNIXTIM E( $eventS aleEnd ),
356                         `Responsib leName` =  '$eventRes pName',   359                         `Responsib leName` =  '$eventRes pName',
357                         `Responsib leEmail` =  '$eventRe spEmail',   360                         `Responsib leEmail` =  '$eventRe spEmail',
358                         `Responsib lePhone` =  '$eventRe spPhone',   361                         `Responsib lePhone` =  '$eventRe spPhone',
359                         `EventSexF ilter` = ' $eventSexF ilter',   362                         `EventSexF ilter` = ' $eventSexF ilter',
360                         `EventAgeL owerFilter ` = $event AgeLowerFi lter,   363                         `EventAgeL owerFilter ` = $event AgeLowerFi lter,
361                         `EventAgeU pperFilter ` = $event AgeUpperFi lter,   364                         `EventAgeU pperFilter ` = $event AgeUpperFi lter,
362                         `EventMemb ershipFilt er` = '$ev entMembers hipFilter' ,   365                         `EventMemb ershipFilt er` = '$ev entMembers hipFilter' ,
363                         `TicketCou ntFemale`  = $eventCo untF,   366                         `TicketCou ntFemale`  = $eventCo untF,
364                         `TicketCou ntMale` =  $eventCoun tM,   367                         `TicketCou ntMale` =  $eventCoun tM,
365                         `TicketPri ceFemale`  = $eventPr iceF,   368                         `TicketPri ceFemale`  = $eventPr iceF,
366                         `TicketPri ceMale` =  $eventPric eM,   369                         `TicketPri ceMale` =  $eventPric eM,
367                         `ChoosePer iod` = $ev entChooseP eriod,   370                         `ChoosePer iod` = $ev entChooseP eriod,
368                         `AllowView Participan ts` = $eve ntAllowVie w   371                         `AllowView Participan ts` = $eve ntAllowVie w
369                         WHERE `ID`  = $eventI d" );   372                         WHERE `ID`  = $eventI d" );
370       if ( ! $res )   373       if ( ! $res )
371           re turn SDATI NG_ERROR_Q UERY_ERROR ;   374           re turn SDATI NG_ERROR_Q UERY_ERROR ;
372       if ( m ysql_affec ted_rows()  == 0 )   375       if ( m ysql_affec ted_rows()  == 0 )
373           re turn SDATI NG_ERROR_N OT_AFFECTE D;   376           re turn SDATI NG_ERROR_N OT_AFFECTE D;
374       return  SDATING_E RROR_SUCCE SS;   377       return  SDATING_E RROR_SUCCE SS;
375   }   378   }
376     379  
377   /**   380   /**
378    * Deletes  event fro m the data base   381    * Deletes  event fro m the data base
379    *   382    *
380    * @param  int $event Id                    - delete e vent ID   383    * @param  int $event Id                    - delete e vent ID
381    *   384    *
382    * @return  bool                            - true on  success, f alse on fa il   385    * @return  bool                            - true on  success, f alse on fa il
383    *   386    *
384    *   387    *
385    */   388    */
386   function S DDeleteEve nt( $event Id )   389   function S DDeleteEve nt( $event Id )
387   {   390   {
388       return  db_res( " DELETE FRO M `SDating Events` WH ERE `ID` =  $eventId"  );   391       return  db_res( " DELETE FRO M `SDating Events` WH ERE `ID` =  $eventId"  );
389   }   392   }
390     393  
391   /**   394   /**
392    * Prints  brief info rmation fo r specifie d event. U ses for pr inting eve nts lists   395    * Prints  brief info rmation fo r specifie d event. U ses for pr inting eve nts lists
393    *   396    *
394    * @param  array $eve ntArr                     - arra y with eve nt data ob tained fro m the data base   397    * @param  array $eve ntArr                     - arra y with eve nt data ob tained fro m the data base
395    *   398    *
396    *   399    *
397    */   400    */
398   function S DPrintEven tRow( $eve ntArr )   401   function S DPrintEven tRow( $eve ntArr )
399   {   402   {
400       global  $dir;   403       global  $dir;
401       global  $site;   404       global  $site;
402       global  $aPreValu es;   405       global  $aPreValu es;
403     406  
404       $aPost edBy = get ProfileInf o($eventAr r['Respons ibleID']);   407       $aPost edBy = get ProfileInf o($eventAr r['Respons ibleID']);
405       $sPost edBy = $aP ostedBy['N ickName'];   408       $sPost edBy = $aP ostedBy['N ickName'];
406   ?>   409   ?>
407   <div style ="padding:  2px; widt h: 540px;  overflow:  auto;">   410   <div style ="padding:  2px; widt h: 540px;  overflow:  auto;">
408       <table  cellpaddi ng="2" cel lspacing=" 2" border= "0" class= "text" wid th="100%">   411       <table  cellpaddi ng="2" cel lspacing=" 2" border= "0" class= "text" wid th="100%">
409           <t r>   412           <t r>
410                <td alig n="center"  rowspan=" 2" width=" 208">   413                <td alig n="center"  rowspan=" 2" width=" 208">
411   <?   414   <?
412       if ( s trlen(trim ($eventArr ['PhotoFil ename']))  && file_ex ists($dir[ 'sdatingIm age'] . $e ventArr['P hotoFilena me']) )   415       if ( s trlen(trim ($eventArr ['PhotoFil ename']))  && file_ex ists($dir[ 'sdatingIm age'] . $e ventArr['P hotoFilena me']) )
413       {   416       {
414           ec ho "   417           ec ho "
415                    <img  src=\"{$s ite['sdati ngImage']} {$eventArr ['PhotoFil ename']}\"  border=\" 0\" alt=\" {$eventArr ['Title']}  photo\" / >";   418                    <img  src=\"{$s ite['sdati ngImage']} {$eventArr ['PhotoFil ename']}\"  border=\" 0\" alt=\" {$eventArr ['Title']}  photo\" / >";
416       }   419       }
417       else   420       else
418       {   421       {
419           ec ho "   422           ec ho "
420                    <div  align=\"c enter\" cl ass=\"text \" style=\ "width: 20 0px; heigh t: 150px;  vertical-a lign: midd le; line-h eight: 150 px; border : 1px soli d silver;\ ">No photo </div>";   423                    <div  align=\"c enter\" cl ass=\"text \" style=\ "width: 20 0px; heigh t: 150px;  vertical-a lign: midd le; line-h eight: 150 px; border : 1px soli d silver;\ ">No photo </div>";
421       }   424       }
422   ?>   425   ?>
423                </td>   426                </td>
424                <td alig n="center"  class="se ction_head er" style= "height: 6 px; line-h eight: 10p x; font-we ight: bold ;"><?= pro cess_line_ output($ev entArr['Ti tle']) ?>< /td>   427                <td alig n="center"  class="se ction_head er" style= "height: 6 px; line-h eight: 10p x; font-we ight: bold ;"><?= pro cess_line_ output($ev entArr['Ti tle']) ?>< /td>
425           </ tr>   428           </ tr>
426           <t r>   429           <t r>
427                <td clas s="section _row" styl e="text-al ign: left;  vertical- align: top ;">   430                <td clas s="section _row" styl e="text-al ign: left;  vertical- align: top ;">
428                    <div  style="te xt-align:  right;"><a  href="<?=  "{$_SERVE R['PHP_SEL F']}?actio n=show_edi t_form&amp ;event_id= {$eventArr ['ID']}" ? >">Edit</a >&nbsp;|&n bsp;<a hre f="javascr ipt:void(n ull);" onC lick="java script: if  ( confirm ('Are you  sure you w ant to del ete this e vent?') )  { location .href = '< ?= "{$_SER VER['PHP_S ELF']}?act ion=delete &amp;event _id={$even tArr['ID'] }" ?>'; }  return fal se; ">Dele te</a>&nbs p;|&nbsp;< a href="<? = "{$_SERV ER['PHP_SE LF']}?acti on=show_pa rt&amp;eve nt_id={$ev entArr['ID ']}" ?>">P articipant s</a>&nbsp ;|&nbsp;<a  href="<?=  "{$_SERVE R['PHP_SEL F']}?actio n=show_mat ch&amp;eve nt_id={$ev entArr['ID ']}" ?>">M atches</a> </div>   431                    <div  style="te xt-align:  right;"><a  href="<?=  "{$_SERVE R['PHP_SEL F']}?actio n=show_edi t_form&amp ;event_id= {$eventArr ['ID']}" ? >">Edit</a >&nbsp;|&n bsp;<a hre f="javascr ipt:void(n ull);" onC lick="java script: if  ( confirm ('Are you  sure you w ant to del ete this e vent?') )  { location .href = '< ?= "{$_SER VER['PHP_S ELF']}?act ion=delete &amp;event _id={$even tArr['ID'] }" ?>'; }  return fal se; ">Dele te</a>&nbs p;|&nbsp;< a href="<? = "{$_SERV ER['PHP_SE LF']}?acti on=show_pa rt&amp;eve nt_id={$ev entArr['ID ']}" ?>">P articipant s</a>&nbsp ;|&nbsp;<a  href="<?=  "{$_SERVE R['PHP_SEL F']}?actio n=show_mat ch&amp;eve nt_id={$ev entArr['ID ']}" ?>">M atches</a> </div>
429                    <b>S tatus:</b>  <?= $even tArr['Stat us'] ?><br  />   432                    <b>S tatus:</b>  <?= $even tArr['Stat us'] ?><br  />
430                    <b>S tatus mess age:</b> < ?= process _line_outp ut($eventA rr['Status Message'])  ?><br />   433                    <b>S tatus mess age:</b> < ?= process _line_outp ut($eventA rr['Status Message'])  ?><br />
431                    <b>A ppointed d ate/time:< /b> <?= $e ventArr['E ventStart' ] ?><br />   434                    <b>A ppointed d ate/time:< /b> <?= $e ventArr['E ventStart' ] ?><br />
432                    <b>P osted By:< /b> <?= '< a href='.$ site['url' ].$sPosted By.'>'.$sP ostedBy.'< /a>' ?><br  />   435                    <b>P osted By:< /b> <?= '< a href='.$ site['url' ].$sPosted By.'>'.$sP ostedBy.'< /a>' ?><br  />
433                    <b>P lace:</b>  <?= _t($aP reValues[' Country'][ $eventArr[ 'Country'] ]['LKey'])  .', '. pr ocess_line _output($e ventArr['C ity']) .',  '. proces s_line_out put($event Arr['Place ']) ?><br  />   436                    <b>P lace:</b>  <?= _t($aP reValues[' Country'][ $eventArr[ 'Country'] ]['LKey'])  .', '. pr ocess_line _output($e ventArr['C ity']) .',  '. proces s_line_out put($event Arr['Place ']) ?><br  />
434                    <b>D escription :</b> <?=  $eventArr[ 'Descripti on'] ?><br  />   437                    <b>D escription :</b> <?=  $eventArr[ 'Descripti on'] ?><br  />
435                </td>   438                </td>
436           </ tr>   439           </ tr>
437       </tabl e>   440       </tabl e>
438   </div>   441   </div>
439   <?   442   <?
440   }   443   }
441     444  
442   /**   445   /**
443    * Prints  page navig ation cont rols   446    * Prints  page navig ation cont rols
444    *   447    *
445    * @param  int $fromE vent                      - zero -based eve nt index w hich shows  current n avigation  position   448    * @param  int $fromE vent                      - zero -based eve nt index w hich shows  current n avigation  position
446    * @param  int $total Events                    - tota l count of  events in  query   449    * @param  int $total Events                    - tota l count of  events in  query
447    * @param  bool $topN avigation                 - is n avigation  bar locate d in the t op (in the  bottom ot herwise)   450    * @param  bool $topN avigation                 - is n avigation  bar locate d in the t op (in the  bottom ot herwise)
448    *   451    *
449    *   452    *
450    */   453    */
451   function S DPrintNavi gation( $f romEvent,  $totalEven ts, $topNa vigation =  true )   454   function S DPrintNavi gation( $f romEvent,  $totalEven ts, $topNa vigation =  true )
452   {   455   {
453       global  $navigati onStep;   456       global  $navigati onStep;
454     457  
455       $fromE vent = (in t)$fromEve nt;   458       $fromE vent = (in t)$fromEve nt;
456       $total Events = ( int)$total Events;   459       $total Events = ( int)$total Events;
457       $ret =  'Pages:&n bsp;';   460       $ret =  'Pages:&n bsp;';
458     461  
459       // if  count of e vents less  than page  step, the n page nav igation is n't shown   462       // if  count of e vents less  than page  step, the n page nav igation is n't shown
460       if ( $ totalEvent s <= $navi gationStep  )   463       if ( $ totalEvent s <= $navi gationStep  )
461           re turn '';   464           re turn '';
462     465  
463       // if  it's not f irst page  then show  'Prev' lin k   466       // if  it's not f irst page  then show  'Prev' lin k
464       if ( $ fromEvent  >= $naviga tionStep )   467       if ( $ fromEvent  >= $naviga tionStep )
465       {   468       {
466           $p revFrom =  (0 < ($fro mEvent - $ navigation Step)) ? ( $fromEvent  - $naviga tionStep)  : 0;   469           $p revFrom =  (0 < ($fro mEvent - $ navigation Step)) ? ( $fromEvent  - $naviga tionStep)  : 0;
467           $r et .= "<a  href=\"jav ascript:vo id(null);\ " onClick= \"javascri pt: naviga tionSubmit ({$prevFro m}); retur n false;\" >Prev</a>& nbsp;";   470           $r et .= "<a  href=\"jav ascript:vo id(null);\ " onClick= \"javascri pt: naviga tionSubmit ({$prevFro m}); retur n false;\" >Prev</a>& nbsp;";
468       }   471       }
469     472  
470       // sho w page lin ks   473       // sho w page lin ks
471       $curre ntEvent =  0;   474       $curre ntEvent =  0;
472       $curre ntPage = 1 ;   475       $curre ntPage = 1 ;
473       while  ( $current Event < $t otalEvents  )   476       while  ( $current Event < $t otalEvents  )
474       {   477       {
475           if  ( $curren tEvent ==  $fromEvent  )   478           if  ( $curren tEvent ==  $fromEvent  )
476                $ret .=  "[{$curren tPage}]&nb sp;";   479                $ret .=  "[{$curren tPage}]&nb sp;";
477           el se   480           el se
478                $ret .=  "<a href=\ "javascrip t:void(nul l);\" onCl ick=\"java script: na vigationSu bmit({$cur rentEvent} ); return  false;\">{ $currentPa ge}</a>&nb sp;";   481                $ret .=  "<a href=\ "javascrip t:void(nul l);\" onCl ick=\"java script: na vigationSu bmit({$cur rentEvent} ); return  false;\">{ $currentPa ge}</a>&nb sp;";
479           $c urrentEven t += $navi gationStep ;   482           $c urrentEven t += $navi gationStep ;
480           $c urrentPage ++;   483           $c urrentPage ++;
481       }   484       }
482     485  
483       // if  it's not l ast page t hen show ' Next' link   486       // if  it's not l ast page t hen show ' Next' link
484       if ( $ totalEvent s > $fromE vent + $na vigationSt ep )   487       if ( $ totalEvent s > $fromE vent + $na vigationSt ep )
485       {   488       {
486           $n extFrom =  $fromEvent  + $naviga tionStep;   489           $n extFrom =  $fromEvent  + $naviga tionStep;
487           $r et .= "<a  href=\"jav ascript:vo id(null);\ " onClick= \"javascri pt: naviga tionSubmit ({$nextFro m}); retur n false;\" >Next</a>" ;   490           $r et .= "<a  href=\"jav ascript:vo id(null);\ " onClick= \"javascri pt: naviga tionSubmit ({$nextFro m}); retur n false;\" >Next</a>" ;
488       }   491       }
489     492  
490       // put  navigatio n elements  into the  div   493       // put  navigatio n elements  into the  div
491       $divMa rgin = $to pNavigatio n ? 'margi n-bottom:  4px;' : 'm argin-top:  4px;';   494       $divMa rgin = $to pNavigatio n ? 'margi n-bottom:  4px;' : 'm argin-top:  4px;';
492       return  "<div sty le=\"text- align: cen ter; {$div Margin}\"> {$ret}</di v>";   495       return  "<div sty le=\"text- align: cen ter; {$div Margin}\"> {$ret}</di v>";
493   }   496   }
494     497  
495   /**   498   /**
496    * Prints  edit form  for event  editing   499    * Prints  edit form  for event  editing
497    *   500    *
498    * @param  bool $newE vent                  - if event  already e xists - th en edit, c reate new  otherwise   501    * @param  bool $newE vent                  - if event  already e xists - th en edit, c reate new  otherwise
499    * @param  array $eve ntArr                 - if event  exists th en this pa rameter sh ould conta in all eve nt data   502    * @param  array $eve ntArr                 - if event  exists th en this pa rameter sh ould conta in all eve nt data
500    *   503    *
501    *   504    *
502    */   505    */
503   function S DShowEditF orm( $newE vent, $eve ntArr = ar ray() )   506   function S DShowEditF orm( $newE vent, $eve ntArr = ar ray() )
504   {   507   {
505       global  $aPreValu es;   508       global  $aPreValu es;
506       global  $dir;   509       global  $dir;
507       global  $site;   510       global  $site;
508     511  
509       if ( $ newEvent )   512       if ( $ newEvent )
510       {   513       {
511           $e ventTitle  = '';   514           $e ventTitle  = '';
512           $e ventDesc =  '';   515           $e ventDesc =  '';
513           $e ventStatus ActiveSel  = '';   516           $e ventStatus ActiveSel  = '';
514           $e ventStatus InactiveSe l = '';   517           $e ventStatus InactiveSe l = '';
515           $e ventStatus CanceledSe l = '';   518           $e ventStatus CanceledSe l = '';
516           $e ventStatus Msg = '';   519           $e ventStatus Msg = '';
517           $e ventCity =  '';   520           $e ventCity =  '';
518           $e ventPlace  = '';   521           $e ventPlace  = '';
519           $e ventStart  = '';   522           $e ventStart  = '';
520           $e ventEnd =  '';   523           $e ventEnd =  '';
521           $e ventSaleSt art = '';   524           $e ventSaleSt art = '';
522           $e ventSaleEn d = '';   525           $e ventSaleEn d = '';
523           $e ventRespNa me = '';   526           $e ventRespNa me = '';
524           $e ventRespEm ail = '';   527           $e ventRespEm ail = '';
525           $e ventRespPh one = '';   528           $e ventRespPh one = '';
526           $e ventSexFem ale = 'che cked="chec ked"';   529           $e ventSexFem ale = 'che cked="chec ked"';
527           $e ventSexMal e = 'check ed="checke d"';   530           $e ventSexMal e = 'check ed="checke d"';
528           $e ventCountF emale = '' ;   531           $e ventCountF emale = '' ;
529           $e ventCountM ale = '';   532           $e ventCountM ale = '';
530           $e ventPriceF emale = '' ;   533           $e ventPriceF emale = '' ;
531           $e ventPriceM ale = '';   534           $e ventPriceM ale = '';
532           $e ventPriceF ree = '';   535           $e ventPriceF ree = '';
533           $e ventPriceF emaleDisab led = '';   536           $e ventPriceF emaleDisab led = '';
534           $e ventPriceM aleDisable d = '';   537           $e ventPriceM aleDisable d = '';
535           $e ventChoose Period = ' ';   538           $e ventChoose Period = ' ';
536           $e ventAllowV iew = '';   539           $e ventAllowV iew = '';
537       }   540       }
538       else   541       else
539       {   542       {
540           $e ventTitle  = htmlspec ialchars($ eventArr[' Title']);   543           $e ventTitle  = htmlspec ialchars($ eventArr[' Title']);
541           $e ventDesc =  htmlspeci alchars($e ventArr['D escription ']);   544           $e ventDesc =  htmlspeci alchars($e ventArr['D escription ']);
542           $e ventStatus ActiveSel  = '';   545           $e ventStatus ActiveSel  = '';
543           $e ventStatus InactiveSe l = '';   546           $e ventStatus InactiveSe l = '';
544           $e ventStatus CanceledSe l = '';   547           $e ventStatus CanceledSe l = '';
545           sw itch ( $ev entArr['St atus'] )   548           sw itch ( $ev entArr['St atus'] )
546           {   549           {
547                case 'Ac tive':   550                case 'Ac tive':
548                    $eve ntStatusAc tiveSel =  'selected= "selected" ';   551                    $eve ntStatusAc tiveSel =  'selected= "selected" ';
549                    brea k;   552                    brea k;
550                case 'In active':   553                case 'In active':
551                    $eve ntStatusIn activeSel  = 'selecte d="selecte d"';   554                    $eve ntStatusIn activeSel  = 'selecte d="selecte d"';
552                    brea k;   555                    brea k;
553                case 'Ca nceled':   556                case 'Ca nceled':
554                    $eve ntStatusCa nceledSel  = 'selecte d="selecte d"';   557                    $eve ntStatusCa nceledSel  = 'selecte d="selecte d"';
555                    brea k;   558                    brea k;
556           }   559           }
557           $e ventStatus Msg = html specialcha rs($eventA rr['Status Message']) ;   560           $e ventStatus Msg = html specialcha rs($eventA rr['Status Message']) ;
558           $e ventCity =  htmlspeci alchars($e ventArr['C ity']);   561           $e ventCity =  htmlspeci alchars($e ventArr['C ity']);
559           $e ventPlace  = htmlspec ialchars($ eventArr[' Place']);   562           $e ventPlace  = htmlspec ialchars($ eventArr[' Place']);
560           $e ventStart  = $eventAr r['EventSt art'];   563           $e ventStart  = $eventAr r['EventSt art'];
561           $e ventEnd =  $eventArr[ 'EventEnd' ];   564           $e ventEnd =  $eventArr[ 'EventEnd' ];
562           $e ventSaleSt art = $eve ntArr['Tic ketSaleSta rt'];   565           $e ventSaleSt art = $eve ntArr['Tic ketSaleSta rt'];
563           $e ventSaleEn d = $event Arr['Ticke tSaleEnd'] ;   566           $e ventSaleEn d = $event Arr['Ticke tSaleEnd'] ;
564           $e ventRespNa me = htmls pecialchar s($eventAr r['Respons ibleName'] );   567           $e ventRespNa me = htmls pecialchar s($eventAr r['Respons ibleName'] );
565           $e ventRespEm ail = html specialcha rs($eventA rr['Respon sibleEmail ']);   568           $e ventRespEm ail = html specialcha rs($eventA rr['Respon sibleEmail ']);
566           $e ventRespPh one = html specialcha rs($eventA rr['Respon siblePhone ']);   569           $e ventRespPh one = html specialcha rs($eventA rr['Respon siblePhone ']);
567           $e ventSexFem ale = strs tr($eventA rr['EventS exFilter'] , 'female' ) ? 'check ed="checke d"' : '';   570           $e ventSexFem ale = strs tr($eventA rr['EventS exFilter'] , 'female' ) ? 'check ed="checke d"' : '';
568           $e ventSexMal e = strstr ($eventArr ['EventSex Filter'],  'male') ?  'checked=" checked"'  : '';   571           $e ventSexMal e = strstr ($eventArr ['EventSex Filter'],  'male') ?  'checked=" checked"'  : '';
569           $e ventCountF emale = $e ventArr['T icketCount Female'];   572           $e ventCountF emale = $e ventArr['T icketCount Female'];
570           $e ventCountM ale = $eve ntArr['Tic ketCountMa le'];   573           $e ventCountM ale = $eve ntArr['Tic ketCountMa le'];
571           $e ventPriceF emale = sp rintf("%.2 f", (float )$eventArr ['TicketPr iceFemale' ]);   574           $e ventPriceF emale = sp rintf("%.2 f", (float )$eventArr ['TicketPr iceFemale' ]);
572           $e ventPriceM ale = spri ntf("%.2f" , (float)$ eventArr[' TicketPric eMale']);   575           $e ventPriceM ale = spri ntf("%.2f" , (float)$ eventArr[' TicketPric eMale']);
573           $e ventPriceF ree = ( $e ventPriceF emale == ' 0.00' && $ eventPrice Male == '0 .00' ? 'ch ecked="che cked"' : ' ' );   576           $e ventPriceF ree = ( $e ventPriceF emale == ' 0.00' && $ eventPrice Male == '0 .00' ? 'ch ecked="che cked"' : ' ' );
574           $e ventPriceF emaleDisab led = ( st rlen($even tPriceFree ) ? 'disab led="disab led"' : ''  );   577           $e ventPriceF emaleDisab led = ( st rlen($even tPriceFree ) ? 'disab led="disab led"' : ''  );
575           $e ventPriceM aleDisable d = ( strl en($eventP riceFree)  ? 'disable d="disable d"' : '' ) ;   578           $e ventPriceM aleDisable d = ( strl en($eventP riceFree)  ? 'disable d="disable d"' : '' ) ;
576           $e ventChoose Period = $ eventArr[' ChoosePeri od'];   579           $e ventChoose Period = $ eventArr[' ChoosePeri od'];
577           $e ventAllowV iew = $eve ntArr['All owViewPart icipants']  == 1 ? 'c hecked="ch ecked"' :  '';   580           $e ventAllowV iew = $eve ntArr['All owViewPart icipants']  == 1 ? 'c hecked="ch ecked"' :  '';
578       }   581       }
579   ?>   582   ?>
580     583  
581   <script la nguage="Ja vaScript"  type="text /javascrip t">   584   <script la nguage="Ja vaScript"  type="text /javascrip t">
582   <!--   585   <!--
583     586  
584       functi on trim(in putString)   587       functi on trim(in putString)
585       {   588       {
586           if  (typeof i nputString  != "strin g")   589           if  (typeof i nputString  != "strin g")
587           {   590           {
588                return i nputString ;   591                return i nputString ;
589           }   592           }
590     593  
591           va r retValue  = inputSt ring;   594           va r retValue  = inputSt ring;
592     595  
593           //  Check for  spaces at  the begin ning of th e string   596           //  Check for  spaces at  the begin ning of th e string
594           va r ch = ret Value.subs tring(0, 1 );   597           va r ch = ret Value.subs tring(0, 1 );
595           wh ile (ch ==  " ")   598           wh ile (ch ==  " ")
596           {   599           {
597                retValue  = retValu e.substrin g(1, retVa lue.length );   600                retValue  = retValu e.substrin g(1, retVa lue.length );
598                ch = ret Value.subs tring(0, 1 );   601                ch = ret Value.subs tring(0, 1 );
599           }   602           }
600     603  
601           //  Check for  spaces at  the end o f the stri ng   604           //  Check for  spaces at  the end o f the stri ng
602           ch  = retValu e.substrin g(retValue .length-1,  retValue. length);   605           ch  = retValu e.substrin g(retValue .length-1,  retValue. length);
603           wh ile (ch ==  " ")   606           wh ile (ch ==  " ")
604           {   607           {
605                retValue  = retValu e.substrin g(0, retVa lue.length -1);   608                retValue  = retValu e.substrin g(0, retVa lue.length -1);
606                ch = ret Value.subs tring(retV alue.lengt h-1, retVa lue.length );   609                ch = ret Value.subs tring(retV alue.lengt h-1, retVa lue.length );
607           }   610           }
608     611  
609           //  Note that  there are  two space s in the s tring - lo ok for mul tiple spac es within  the string   612           //  Note that  there are  two space s in the s tring - lo ok for mul tiple spac es within  the string
610           wh ile (retVa lue.indexO f("  ") !=  -1)   613           wh ile (retVa lue.indexO f("  ") !=  -1)
611           {   614           {
612                // Again , there ar e two spac es in each  of the st rings   615                // Again , there ar e two spac es in each  of the st rings
613                retValue  = retValu e.substrin g(0, retVa lue.indexO f("  ")) +  retValue. substring( retValue.i ndexOf("   ")+1, retV alue.lengt h);   616                retValue  = retValu e.substrin g(0, retVa lue.indexO f("  ")) +  retValue. substring( retValue.i ndexOf("   ")+1, retV alue.lengt h);
614           }   617           }
615     618  
616           re turn retVa lue;   619           re turn retVa lue;
617       }   620       }
618     621  
619       functi on validat eEditForm( )   622       functi on validat eEditForm( )
620       {   623       {
621           //  check tit le   624           //  check tit le
622           if  ( trim(do cument.get ElementByI d('event_t itle_id'). value).len gth == 0 )   625           if  ( trim(do cument.get ElementByI d('event_t itle_id'). value).len gth == 0 )
623           {   626           {
624                alert('P lease ente r event ti tle');   627                alert('P lease ente r event ti tle');
625                return f alse;   628                return f alse;
626           }   629           }
627           //  check des cription   630           //  check des cription
628           if  ( trim(do cument.get ElementByI d('event_d esc_id').v alue).leng th == 0 )   631           if  ( trim(do cument.get ElementByI d('event_d esc_id').v alue).leng th == 0 )
629           {   632           {
630                alert('P lease ente r event de scription' );   633                alert('P lease ente r event de scription' );
631                return f alse;   634                return f alse;
632           }   635           }
633           //  check sta tus messag e   636           //  check sta tus messag e
634           if  ( trim(do cument.get ElementByI d('event_s tatusmsg_i d').value) .length ==  0 )   637           if  ( trim(do cument.get ElementByI d('event_s tatusmsg_i d').value) .length ==  0 )
635           {   638           {
636                alert('P lease ente r event st atus messa ge');   639                alert('P lease ente r event st atus messa ge');
637                return f alse;   640                return f alse;
638           }   641           }
639           //  check cit y   642           //  check cit y
640           if  ( trim(do cument.get ElementByI d('event_c ity_id').v alue).leng th == 0 )   643           if  ( trim(do cument.get ElementByI d('event_c ity_id').v alue).leng th == 0 )
641           {   644           {
642                alert('P lease ente r event ci ty');   645                alert('P lease ente r event ci ty');
643                return f alse;   646                return f alse;
644           }   647           }
645           //  check pla ce   648           //  check pla ce
646           if  ( trim(do cument.get ElementByI d('event_p lace_id'). value).len gth == 0 )   649           if  ( trim(do cument.get ElementByI d('event_p lace_id'). value).len gth == 0 )
647           {   650           {
648                alert('P lease ente r event pl ace');   651                alert('P lease ente r event pl ace');
649                return f alse;   652                return f alse;
650           }   653           }
651           //  check sta rt date   654           //  check sta rt date
652           if  ( trim(do cument.get ElementByI d('event_s tart_id'). value).len gth == 0 )   655           if  ( trim(do cument.get ElementByI d('event_s tart_id'). value).len gth == 0 )
653           {   656           {
654                alert('P lease ente r event st art date') ;   657                alert('P lease ente r event st art date') ;
655                return f alse;   658                return f alse;
656           }   659           }
657           //  check end  date   660           //  check end  date
658           if  ( trim(do cument.get ElementByI d('event_e nd_id').va lue).lengt h == 0 )   661           if  ( trim(do cument.get ElementByI d('event_e nd_id').va lue).lengt h == 0 )
659           {   662           {
660                alert('P lease ente r event en d date');   663                alert('P lease ente r event en d date');
661                return f alse;   664                return f alse;
662           }   665           }
663           //  check sal e start da te   666           //  check sal e start da te
664           if  ( trim(do cument.get ElementByI d('event_s ale_start_ id').value ).length = = 0 )   667           if  ( trim(do cument.get ElementByI d('event_s ale_start_ id').value ).length = = 0 )
665           {   668           {
666                alert('P lease ente r event sa le start d ate');   669                alert('P lease ente r event sa le start d ate');
667                return f alse;   670                return f alse;
668           }   671           }
669           //  check sal e end date   672           //  check sal e end date
670           if  ( trim(do cument.get ElementByI d('event_s ale_end_id ').value). length ==  0 )   673           if  ( trim(do cument.get ElementByI d('event_s ale_end_id ').value). length ==  0 )
671           {   674           {
672                alert('P lease ente r event sa le end dat e');   675                alert('P lease ente r event sa le end dat e');
673                return f alse;   676                return f alse;
674           }   677           }
675           //  check if  any of sex  checkboxe s checked   678           //  check if  any of sex  checkboxe s checked
676           if  ( !docume nt.getElem entById('e vent_sex_f emale_id') .checked   679           if  ( !docume nt.getElem entById('e vent_sex_f emale_id') .checked
677                && !docu ment.getEl ementById( 'event_sex _male_id') .checked )   680                && !docu ment.getEl ementById( 'event_sex _male_id') .checked )
678           {   681           {
679                alert('A t least on e sex shou ld be chos en');   682                alert('A t least on e sex shou ld be chos en');
680                return f alse;   683                return f alse;
681           }   684           }
682           //  check if  age range  is correct   685           //  check if  age range  is correct
683           va r ageStart  = parseIn t( documen t.getEleme ntById('ev ent_age_st art_id').v alue );   686           va r ageStart  = parseIn t( documen t.getEleme ntById('ev ent_age_st art_id').v alue );
684           va r ageEnd =  parseInt(  document. getElement ById('even t_age_end_ id').value  );   687           va r ageEnd =  parseInt(  document. getElement ById('even t_age_end_ id').value  );
685           if  ( isNaN(a geStart) | | isNaN(ag eEnd) || a geEnd < ag eStart )   688           if  ( isNaN(a geStart) | | isNaN(ag eEnd) || a geEnd < ag eStart )
686           {   689           {
687                alert('P lease spec ify correc t particip ants age r ange');   690                alert('P lease spec ify correc t particip ants age r ange');
688                return f alse;   691                return f alse;
689           }   692           }
690           //  check if  any member ship level  selected   693           //  check if  any member ship level  selected
691           va r anySelec ted = fals e;   694           va r anySelec ted = fals e;
692           va r selectOp tions = do cument.get ElementByI d('event_m embership_ id').optio ns;   695           va r selectOp tions = do cument.get ElementByI d('event_m embership_ id').optio ns;
693           fo r ( i = 0;  i < selec tOptions.l ength; i++  )   696           fo r ( i = 0;  i < selec tOptions.l ength; i++  )
694           {   697           {
695                if ( sel ectOptions [i].select ed )   698                if ( sel ectOptions [i].select ed )
696                {   699                {
697                    anyS elected =  true;   700                    anyS elected =  true;
698                    brea k;   701                    brea k;
699                }   702                }
700           }   703           }
701           if  ( !anySel ected )   704           if  ( !anySel ected )
702           {   705           {
703                alert('S elect memb ership lev el(s) of p articipant s');   706                alert('S elect memb ership lev el(s) of p articipant s');
704                return f alse;   707                return f alse;
705           }   708           }
706           //  check fem ale ticket  count   709           //  check fem ale ticket  count
707           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ count_fema le_id').va lue) ) )   710           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ count_fema le_id').va lue) ) )
708           {   711           {
709                alert('P lease ente r correct  female tic ket count' );   712                alert('P lease ente r correct  female tic ket count' );
710                return f alse;   713                return f alse;
711           }   714           }
712           //  check mal e ticket c ount   715           //  check mal e ticket c ount
713           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ count_male _id').valu e) ) )   716           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ count_male _id').valu e) ) )
714           {   717           {
715                alert('P lease ente r correct  male ticke t count');   718                alert('P lease ente r correct  male ticke t count');
716                return f alse;   719                return f alse;
717           }   720           }
718           //  check if  event is f ree   721           //  check if  event is f ree
719           va r isFree =  document. getElement ById('even t_price_fr ee_id').ch ecked;   722           va r isFree =  document. getElement ById('even t_price_fr ee_id').ch ecked;
720           //  check fem ale ticket  price   723           //  check fem ale ticket  price
721           if  ( !isFree  && isNaN(  parseFloa t(document .getElemen tById('eve nt_price_f emale_id') .value) )  )   724           if  ( !isFree  && isNaN(  parseFloa t(document .getElemen tById('eve nt_price_f emale_id') .value) )  )
722           {   725           {
723                alert('P lease ente r correct  female tic ket price' );   726                alert('P lease ente r correct  female tic ket price' );
724                return f alse;   727                return f alse;
725           }   728           }
726           //  check mal e ticket p rice   729           //  check mal e ticket p rice
727           if  ( !isFree  && isNaN(  parseFloa t(document .getElemen tById('eve nt_price_m ale_id').v alue) ) )   730           if  ( !isFree  && isNaN(  parseFloa t(document .getElemen tById('eve nt_price_m ale_id').v alue) ) )
728           {   731           {
729                alert('P lease ente r correct  male ticke t price');   732                alert('P lease ente r correct  male ticke t price');
730                return f alse;   733                return f alse;
731           }   734           }
732           //  check cho ose period   735           //  check cho ose period
733           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ choose_per iod_id').v alue) ) )   736           if  ( isNaN(  parseInt(d ocument.ge tElementBy Id('event_ choose_per iod_id').v alue) ) )
734           {   737           {
735                alert('P lease ente r correct  choose per iod days') ;   738                alert('P lease ente r correct  choose per iod days') ;
736                return f alse;   739                return f alse;
737           }   740           }
738           re turn true;   741           re turn true;
739       }   742       }
740     743  
741       functi on updateP riceContro ls()   744       functi on updateP riceContro ls()
742       {   745       {
743           va r isFree =  document. getElement ById('even t_price_fr ee_id').ch ecked;   746           va r isFree =  document. getElement ById('even t_price_fr ee_id').ch ecked;
744           do cument.get ElementByI d('event_p rice_femal e_id').dis abled = is Free;   747           do cument.get ElementByI d('event_p rice_femal e_id').dis abled = is Free;
745           do cument.get ElementByI d('event_p rice_male_ id').disab led = isFr ee;   748           do cument.get ElementByI d('event_p rice_male_ id').disab led = isFr ee;
746       }   749       }
747     750  
748   -->   751   -->
749   </script>   752   </script>
750     753  
751   <form id=" editEventF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" post" enct ype="multi part/form- data" styl e="margin:  0px;">   754   <form id=" editEventF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" post" enct ype="multi part/form- data" styl e="margin:  0px;">
752   <table cel lpadding=" 4" cellspa cing="2" b order="0"  width="540 " class="t ext">   755   <table cel lpadding=" 4" cellspa cing="2" b order="0"  width="540 " class="t ext">
753       <tr>   756       <tr>
754           <t d class="s ection_hea der">Commo n</td>   757           <t d class="s ection_hea der">Commo n</td>
755       </tr>   758       </tr>
756       <tr>   759       <tr>
757           <t d class="s ection_row ">   760           <t d class="s ection_row ">
758                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   761                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
759                    <tr>   762                    <tr>
760                         <td align= "left" wid th="120">T itle <font  color="re d">*</font ></td>   763                         <td align= "left" wid th="120">T itle <font  color="re d">*</font ></td>
761                         <td align= "left">   764                         <td align= "left">
762                             <input  type="tex t" class=" no" name=" event_titl e" id="eve nt_title_i d" size="5 0" value=" <?= $event Title ?>"  />   765                             <input  type="tex t" class=" no" name=" event_titl e" id="eve nt_title_i d" size="5 0" value=" <?= $event Title ?>"  />
763                         </td>   766                         </td>
764                    </tr >   767                    </tr >
765                    <tr>   768                    <tr>
766                         <td align= "left" wid th="120" v align="top ">Descript ion <font  color="red ">*</font> </td>   769                         <td align= "left" wid th="120" v align="top ">Descript ion <font  color="red ">*</font> </td>
767                         <td align= "left">   770                         <td align= "left">
768                             <texta rea class= "no" name= "event_des c" id="eve nt_desc_id " cols="60 " rows="10 "><?= $eve ntDesc ?>< /textarea>   771                             <texta rea class= "no" name= "event_des c" id="eve nt_desc_id " cols="60 " rows="10 "><?= $eve ntDesc ?>< /textarea>
769                         </td>   772                         </td>
770                    </tr >   773                    </tr >
771                    <tr>   774                    <tr>
772                         <td align= "left" wid th="120">S tatus</td>   775                         <td align= "left" wid th="120">S tatus</td>
773                         <td align= "left">   776                         <td align= "left">
774                             <selec t class="n o" name="e vent_statu s" id="eve nt_status_ id" style= "width: 10 0px;">   777                             <selec t class="n o" name="e vent_statu s" id="eve nt_status_ id" style= "width: 10 0px;">
775                                 <o ption valu e="active"  <?= $even tStatusAct iveSel ?>  >Active</o ption>   778                                 <o ption valu e="active"  <?= $even tStatusAct iveSel ?>  >Active</o ption>
776                                 <o ption valu e="inactiv e" <?= $ev entStatusI nactiveSel  ?> >Inact ive</optio n>   779                                 <o ption valu e="inactiv e" <?= $ev entStatusI nactiveSel  ?> >Inact ive</optio n>
777                                 <o ption valu e="cancele d" <?= $ev entStatusC anceledSel  ?> >Cance led</optio n>   780                                 <o ption valu e="cancele d" <?= $ev entStatusC anceledSel  ?> >Cance led</optio n>
778                             </sele ct>   781                             </sele ct>
779                         </td>   782                         </td>
780                    </tr >   783                    </tr >
781                    <tr>   784                    <tr>
782                         <td align= "left" wid th="120">S tatus mess age <font  color="red ">*</font> </td>   785                         <td align= "left" wid th="120">S tatus mess age <font  color="red ">*</font> </td>
783                         <td align= "left">   786                         <td align= "left">
784                             <input  type="tex t" class=" no" name=" event_stat usmsg" id= "event_sta tusmsg_id"  size="60"  value="<? = $eventSt atusMsg ?> " />   787                             <input  type="tex t" class=" no" name=" event_stat usmsg" id= "event_sta tusmsg_id"  size="60"  value="<? = $eventSt atusMsg ?> " />
785                         </td>   788                         </td>
786                    </tr >   789                    </tr >
787                </table>   790                </table>
788           </ td>   791           </ td>
789       </tr>   792       </tr>
790       <tr>   793       <tr>
791           <t d class="s ection_hea der">Event  place</td >   794           <t d class="s ection_hea der">Event  place</td >
792       </tr>   795       </tr>
793       <tr>   796       <tr>
794           <t d class="s ection_row ">   797           <t d class="s ection_row ">
795                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   798                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
796                    <tr>   799                    <tr>
797                         <td align= "left" wid th="120">C ountry <fo nt color=" red">*</fo nt></td>   800                         <td align= "left" wid th="120">C ountry <fo nt color=" red">*</fo nt></td>
798                         <td align= "left">   801                         <td align= "left">
799                             <selec t class="n o" name="e vent_count ry" id="ev ent_countr y_id">   802                             <selec t class="n o" name="e vent_count ry" id="ev ent_countr y_id">
800   <?   803   <?
801       $selec tedCountry  = $newEve nt ? getPa ram( 'defa ult_countr y' ) : $ev entArr['Co untry'];   804       $selec tedCountry  = $newEve nt ? getPa ram( 'defa ult_countr y' ) : $ev entArr['Co untry'];
802       foreac h ( $aPreV alues['Cou ntry'] as  $key => $v alue )   805       foreac h ( $aPreV alues['Cou ntry'] as  $key => $v alue )
803       {   806       {
804           ec ho "   807           ec ho "
805                                 <o ption valu e=\"{$key} \" ". ( $s electedCou ntry == $k ey ? 'sele cted="sele cted"' : ' ' ) ." >".  _t($value ['LKey'])  ."</option >";   808                                 <o ption valu e=\"{$key} \" ". ( $s electedCou ntry == $k ey ? 'sele cted="sele cted"' : ' ' ) ." >".  _t($value ['LKey'])  ."</option >";
806       }   809       }
807   ?>   810   ?>
808                             </sele ct>   811                             </sele ct>
809                         </td>   812                         </td>
810                    </tr >   813                    </tr >
811                    <tr>   814                    <tr>
812                         <td align= "left" wid th="120">C ity <font  color="red ">*</font> </td>   815                         <td align= "left" wid th="120">C ity <font  color="red ">*</font> </td>
813                         <td align= "left">   816                         <td align= "left">
814                             <input  type="tex t" class=" no" name=" event_city " id="even t_city_id"  size="24"  value="<? = $eventCi ty ?>" />   817                             <input  type="tex t" class=" no" name=" event_city " id="even t_city_id"  size="24"  value="<? = $eventCi ty ?>" />
815                         </td>   818                         </td>
816                    </tr >   819                    </tr >
817                    <tr>   820                    <tr>
818                         <td align= "left" wid th="120">P lace <font  color="re d">*</font ></td>   821                         <td align= "left" wid th="120">P lace <font  color="re d">*</font ></td>
819                         <td align= "left">   822                         <td align= "left">
820                             <input  type="tex t" class=" no" name=" event_plac e" id="eve nt_place_i d" size="6 0" value=" <?= $event Place ?>"  />   823                             <input  type="tex t" class=" no" name=" event_plac e" id="eve nt_place_i d" size="6 0" value=" <?= $event Place ?>"  />
821                         </td>   824                         </td>
822                    </tr >   825                    </tr >
823   <?   826   <?
824       if ( ! $newEvent  && strlen(  $eventArr ['PhotoFil ename'] )  && file_ex ists( $dir ['sdatingI mage'] . $ eventArr[' PhotoFilen ame'] ) )   827       if ( ! $newEvent  && strlen(  $eventArr ['PhotoFil ename'] )  && file_ex ists( $dir ['sdatingI mage'] . $ eventArr[' PhotoFilen ame'] ) )
825       {   828       {
826   ?>   829   ?>
827                    <tr>   830                    <tr>
828                         <td align= "left" val ign="top"  width="120 ">Venue ph oto</td>   831                         <td align= "left" val ign="top"  width="120 ">Venue ph oto</td>
829                         <td align= "left">   832                         <td align= "left">
830                             <img s rc="<?= $s ite['sdati ngImage']  . $eventAr r['PhotoFi lename'] ? >" border= "0" alt="E vent photo " />   833                             <img s rc="<?= $s ite['sdati ngImage']  . $eventAr r['PhotoFi lename'] ? >" border= "0" alt="E vent photo " />
831                         </td>   834                         </td>
832                    </tr >   835                    </tr >
833                    <tr>   836                    <tr>
834                         <td align= "right" wi dth="120"  nowrap>upl oad new ph oto</td>   837                         <td align= "right" wi dth="120"  nowrap>upl oad new ph oto</td>
835   <?   838   <?
836       }   839       }
837       else   840       else
838       {   841       {
839   ?>   842   ?>
840                    <tr>   843                    <tr>
841                         <td align= "left" val ign="middl e" width=" 120">Venue  photo</td >   844                         <td align= "left" val ign="middl e" width=" 120">Venue  photo</td >
842   <?   845   <?
843       }   846       }
844   ?>   847   ?>
845                         <td align= "left">   848                         <td align= "left">
846                             <input  type="fil e" class=" no" name=" event_phot o" id="eve nt_photo_i d" size="4 0" />   849                             <input  type="fil e" class=" no" name=" event_phot o" id="eve nt_photo_i d" size="4 0" />
847                         </td>   850                         </td>
848                    </tr >   851                    </tr >
849                    <tr>   852                    <tr>
850                         <td align= "right" wi dth="120"  nowrap>res ize photo  to</td>   853                         <td align= "right" wi dth="120"  nowrap>res ize photo  to</td>
851                         <td align= "left">   854                         <td align= "left">
852                             <input  type="tex t" class=" no" name=" event_phot o_width" i d="event_p hoto_width _id" size= "4" value= "200" styl e="vertica l-align: m iddle;" /> &nbsp;x&nb sp;<input  type="text " class="n o" name="e vent_photo _height" i d="event_p hoto_heigh t_id" size ="4" value ="150" sty le="vertic al-align:  middle;" / >&nbsp;pix els   855                             <input  type="tex t" class=" no" name=" event_phot o_width" i d="event_p hoto_width _id" size= "4" value= "200" styl e="vertica l-align: m iddle;" /> &nbsp;x&nb sp;<input  type="text " class="n o" name="e vent_photo _height" i d="event_p hoto_heigh t_id" size ="4" value ="150" sty le="vertic al-align:  middle;" / >&nbsp;pix els
853                         </td>   856                         </td>
854                    </tr >   857                    </tr >
855                </table>   858                </table>
856           </ td>   859           </ td>
857       </tr>   860       </tr>
858       <tr>   861       <tr>
859           <t d class="s ection_hea der">Event  date</td>   862           <t d class="s ection_hea der">Event  date</td>
860       </tr>   863       </tr>
861       <tr>   864       <tr>
862           <t d class="s ection_row ">   865           <t d class="s ection_row ">
863                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   866                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
864                    <tr>   867                    <tr>
865                         <td align= "left" wid th="120">E vent start  <font col or="red">* </font></t d>   868                         <td align= "left" wid th="120">E vent start  <font col or="red">* </font></t d>
866                         <td align= "left">   869                         <td align= "left">
867                             <input  type="tex t" class=" no" name=" event_star t" id="eve nt_start_i d" size="2 0" value=" <?= $event Start ?>"  />   870                             <input  type="tex t" class=" no" name=" event_star t" id="eve nt_start_i d" size="2 0" value=" <?= $event Start ?>"  />
868                             &nbsp; <input typ e="button"  id="start _choose_id " value="C hoose" />   871                             &nbsp; <input typ e="button"  id="start _choose_id " value="C hoose" />
869                             &nbsp; <input typ e="button"  id="start _clear_id"  onClick=" document.g etElementB yId('event _start_id' ).value =  ''; " valu e="Clear"  />   872                             &nbsp; <input typ e="button"  id="start _clear_id"  onClick=" document.g etElementB yId('event _start_id' ).value =  ''; " valu e="Clear"  />
870                         </td>   873                         </td>
871                    </tr >   874                    </tr >
872                    <tr>   875                    <tr>
873                         <td align= "left" wid th="120">E vent end < font color ="red">*</ font></td>   876                         <td align= "left" wid th="120">E vent end < font color ="red">*</ font></td>
874                         <td align= "left">   877                         <td align= "left">
875                             <input  type="tex t" class=" no" name=" event_end"  id="event _end_id" s ize="20" v alue="<?=  $eventEnd  ?>" />   878                             <input  type="tex t" class=" no" name=" event_end"  id="event _end_id" s ize="20" v alue="<?=  $eventEnd  ?>" />
876                             &nbsp; <input typ e="button"  id="end_c hoose_id"  value="Cho ose" />   879                             &nbsp; <input typ e="button"  id="end_c hoose_id"  value="Cho ose" />
877                             &nbsp; <input typ e="button"  id="end_c lear_id" o nClick="do cument.get ElementByI d('event_e nd_id').va lue = '';  " value="C lear" />   880                             &nbsp; <input typ e="button"  id="end_c lear_id" o nClick="do cument.get ElementByI d('event_e nd_id').va lue = '';  " value="C lear" />
878                         </td>   881                         </td>
879                    </tr >   882                    </tr >
880                    <tr>   883                    <tr>
881                         <td align= "left" wid th="120">T icket sale  start <fo nt color=" red">*</fo nt></td>   884                         <td align= "left" wid th="120">T icket sale  start <fo nt color=" red">*</fo nt></td>
882                         <td align= "left">   885                         <td align= "left">
883                             <input  type="tex t" class=" no" name=" event_sale _start" id ="event_sa le_start_i d" size="2 0" value=" <?= $event SaleStart  ?>" />   886                             <input  type="tex t" class=" no" name=" event_sale _start" id ="event_sa le_start_i d" size="2 0" value=" <?= $event SaleStart  ?>" />
884                             &nbsp; <input typ e="button"  id="sale_ start_choo se_id" val ue="Choose " />   887                             &nbsp; <input typ e="button"  id="sale_ start_choo se_id" val ue="Choose " />
885                             &nbsp; <input typ e="button"  id="sale_ start_clea r_id" onCl ick="docum ent.getEle mentById(' event_sale _start_id' ).value =  ''; " valu e="Clear"  />   888                             &nbsp; <input typ e="button"  id="sale_ start_clea r_id" onCl ick="docum ent.getEle mentById(' event_sale _start_id' ).value =  ''; " valu e="Clear"  />
886                         </td>   889                         </td>
887                    </tr >   890                    </tr >
888                    <tr>   891                    <tr>
889                         <td align= "left" wid th="120">T icket sale  end <font  color="re d">*</font ></td>   892                         <td align= "left" wid th="120">T icket sale  end <font  color="re d">*</font ></td>
890                         <td align= "left">   893                         <td align= "left">
891                             <input  type="tex t" class=" no" name=" event_sale _end" id=" event_sale _end_id" s ize="20" v alue="<?=  $eventSale End ?>" />   894                             <input  type="tex t" class=" no" name=" event_sale _end" id=" event_sale _end_id" s ize="20" v alue="<?=  $eventSale End ?>" />
892                             &nbsp; <input typ e="button"  id="sale_ end_choose _id" value ="Choose"  />   895                             &nbsp; <input typ e="button"  id="sale_ end_choose _id" value ="Choose"  />
893                             &nbsp; <input typ e="button"  id="sale_ end_clear_ id" onClic k="documen t.getEleme ntById('ev ent_sale_e nd_id').va lue = '';  " value="C lear" />   896                             &nbsp; <input typ e="button"  id="sale_ end_clear_ id" onClic k="documen t.getEleme ntById('ev ent_sale_e nd_id').va lue = '';  " value="C lear" />
894                         </td>   897                         </td>
895                    </tr >   898                    </tr >
896                </table>   899                </table>
897           </ td>   900           </ td>
898       </tr>   901       </tr>
899       <tr>   902       <tr>
900           <t d class="s ection_hea der">Respo nsible per son or com pany</td>   903           <t d class="s ection_hea der">Respo nsible per son or com pany</td>
901       </tr>   904       </tr>
902       <tr>   905       <tr>
903           <t d class="s ection_row ">   906           <t d class="s ection_row ">
904                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   907                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
905                    <tr>   908                    <tr>
906                         <td align= "left" wid th="120">N ame</td>   909                         <td align= "left" wid th="120">N ame</td>
907                         <td align= "left">   910                         <td align= "left">
908                             <input  type="tex t" class=" no" name=" event_resp _name" id= "event_res p_name_id"  size="40"  value="<? = $eventRe spName ?>"  />   911                             <input  type="tex t" class=" no" name=" event_resp _name" id= "event_res p_name_id"  size="40"  value="<? = $eventRe spName ?>"  />
909                         </td>   912                         </td>
910                    </tr >   913                    </tr >
911                    <tr>   914                    <tr>
912                         <td align= "left" wid th="120">E -mail</td>   915                         <td align= "left" wid th="120">E -mail</td>
913                         <td align= "left">   916                         <td align= "left">
914                             <input  type="tex t" class=" no" name=" event_resp _email" id ="event_re sp_email_i d" size="4 0" value=" <?= $event RespEmail  ?>" />   917                             <input  type="tex t" class=" no" name=" event_resp _email" id ="event_re sp_email_i d" size="4 0" value=" <?= $event RespEmail  ?>" />
915                         </td>   918                         </td>
916                    </tr >   919                    </tr >
917                    <tr>   920                    <tr>
918                         <td align= "left" wid th="120">P hone</td>   921                         <td align= "left" wid th="120">P hone</td>
919                         <td align= "left">   922                         <td align= "left">
920                             <input  type="tex t" class=" no" name=" event_resp _phone" id ="event_re sp_phone_i d" size="1 6" value=" <?= $event RespPhone  ?>" />   923                             <input  type="tex t" class=" no" name=" event_resp _phone" id ="event_re sp_phone_i d" size="1 6" value=" <?= $event RespPhone  ?>" />
921                         </td>   924                         </td>
922                    </tr >   925                    </tr >
923                </table>   926                </table>
924           </ td>   927           </ td>
925       </tr>   928       </tr>
926       <tr>   929       <tr>
927           <t d class="s ection_hea der">Event  participa nts</td>   930           <t d class="s ection_hea der">Event  participa nts</td>
928       </tr>   931       </tr>
929       <tr>   932       <tr>
930           <t d class="s ection_row ">   933           <t d class="s ection_row ">
931                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   934                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
932                    <tr>   935                    <tr>
933                         <td align= "left" wid th="120">S ex</td>   936                         <td align= "left" wid th="120">S ex</td>
934                         <td align= "left">   937                         <td align= "left">
935                             <input  type="che ckbox" cla ss="no" na me="event_ sex_female " id="even t_sex_fema le_id" sty le="vertic al-align:  middle;" < ?= $eventS exFemale ? > />   938                             <input  type="che ckbox" cla ss="no" na me="event_ sex_female " id="even t_sex_fema le_id" sty le="vertic al-align:  middle;" < ?= $eventS exFemale ? > />
936                             &nbsp; <label for ="event_se x_female_i d">female< /label>   939                             &nbsp; <label for ="event_se x_female_i d">female< /label>
937                             &nbsp; <input typ e="checkbo x" class=" no" name=" event_sex_ male" id=" event_sex_ male_id" s tyle="vert ical-align : middle;"  <?= $even tSexMale ? > />   940                             &nbsp; <input typ e="checkbo x" class=" no" name=" event_sex_ male" id=" event_sex_ male_id" s tyle="vert ical-align : middle;"  <?= $even tSexMale ? > />
938                             &nbsp; <label for ="event_se x_male_id" >male</lab el>   941                             &nbsp; <label for ="event_se x_male_id" >male</lab el>
939                         </td>   942                         </td>
940                    </tr >   943                    </tr >
941                    <tr>   944                    <tr>
942                         <td align= "left" wid th="120">A ge</td>   945                         <td align= "left" wid th="120">A ge</td>
943                         <td align= "left">   946                         <td align= "left">
944                             from&n bsp;<selec t class="n o" name="e vent_age_s tart" id=" event_age_ start_id"  style="ver tical-alig n: middle; ">   947                             from&n bsp;<selec t class="n o" name="e vent_age_s tart" id=" event_age_ start_id"  style="ver tical-alig n: middle; ">
945   <?   948   <?
946       // if  it's new e vent then  show defau lt values  and show v alues from  database  otherwise   949       // if  it's new e vent then  show defau lt values  and show v alues from  database  otherwise
947       $gl_se arch_start _age = (in t)getParam ( 'search_ start_age'  );   950       $gl_se arch_start _age = (in t)getParam ( 'search_ start_age'  );
948       $gl_se arch_end_a ge = (int) getParam(  'search_en d_age' );   951       $gl_se arch_end_a ge = (int) getParam(  'search_en d_age' );
949       $ageSt artSel = $ newEvent ?  $gl_searc h_start_ag e : $event Arr['Event AgeLowerFi lter'];   952       $ageSt artSel = $ newEvent ?  $gl_searc h_start_ag e : $event Arr['Event AgeLowerFi lter'];
950       $ageEn dSel = $ne wEvent ? $ gl_search_ end_age :  $eventArr[ 'EventAgeU pperFilter '];   953       $ageEn dSel = $ne wEvent ? $ gl_search_ end_age :  $eventArr[ 'EventAgeU pperFilter '];
951       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )   954       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )
952       {   955       {
953           $s el = ($i = = $ageStar tSel ? 'se lected="se lected"' :  '');   956           $s el = ($i = = $ageStar tSel ? 'se lected="se lected"' :  '');
954           ec ho "   957           ec ho "
955                                 <o ption valu e=\"$i\" $ sel>$i</op tion>";   958                                 <o ption valu e=\"$i\" $ sel>$i</op tion>";
956       }   959       }
957   ?>   960   ?>
958                                          </se lect>   961                                          </se lect>
959                             to&nbs p;<select  class="no"  name="eve nt_age_end " id="even t_age_end_ id" style= "vertical- align: mid dle;">   962                             to&nbs p;<select  class="no"  name="eve nt_age_end " id="even t_age_end_ id" style= "vertical- align: mid dle;">
960   <?   963   <?
961       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )   964       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )
962       {   965       {
963           $s el = ($i = = $ageEndS el ? 'sele cted="sele cted"' : ' ');   966           $s el = ($i = = $ageEndS el ? 'sele cted="sele cted"' : ' ');
964           ec ho "   967           ec ho "
965                                 <o ption valu e=\"$i\" $ sel>$i</op tion>";   968                                 <o ption valu e=\"$i\" $ sel>$i</op tion>";
966       }   969       }
967   ?>   970   ?>
968                             </sele ct>   971                             </sele ct>
969                         </td>   972                         </td>
970                    </tr >   973                    </tr >
971                    <tr>   974                    <tr>
972                         <td align= "left" val ign="top"  width="120 ">Membersh ip</td>   975                         <td align= "left" val ign="top"  width="120 ">Membersh ip</td>
973                         <td align= "left">   976                         <td align= "left">
974                             <selec t class="n o" name="e vent_membe rship[]" i d="event_m embership_ id" size=" 6" multipl e style="w idth: 150p x;">   977                             <selec t class="n o" name="e vent_membe rship[]" i d="event_m embership_ id" size=" 6" multipl e style="w idth: 150p x;">
975                                 <o ption valu e="all" <? = $newEven t || strst r($eventAr r['EventMe mbershipFi lter'], '\ 'all\'') ?  'selected ="selected "' : '' ?>  >All</opt ion>   978                                 <o ption valu e="all" <? = $newEven t || strst r($eventAr r['EventMe mbershipFi lter'], '\ 'all\'') ?  'selected ="selected "' : '' ?>  >All</opt ion>
976   <?   979   <?
977       // sho w all memb ership lev els except  non-membe r   980       // sho w all memb ership lev els except  non-membe r
978       $membe rships_arr  = getMemb erships();   981       $membe rships_arr  = getMemb erships();
979       foreac h ( $membe rships_arr  as $membe rshipID =>  $membersh ipName )   982       foreac h ( $membe rships_arr  as $membe rshipID =>  $membersh ipName )
980       {   983       {
981           if  ( $member shipID ==  MEMBERSHIP _ID_NON_ME MBER )   984           if  ( $member shipID ==  MEMBERSHIP _ID_NON_ME MBER )
982                continue ;   985                continue ;
983           ec ho "   986           ec ho "
984                                 <o ption valu e=\"{$memb ershipID}\ " ". (!$ne wEvent &&  strstr($ev entArr['Ev entMembers hipFilter' ], "'{$mem bershipID} '") ? 'sel ected="sel ected"' :  '') ." >{$ membership Name}</opt ion>";   987                                 <o ption valu e=\"{$memb ershipID}\ " ". (!$ne wEvent &&  strstr($ev entArr['Ev entMembers hipFilter' ], "'{$mem bershipID} '") ? 'sel ected="sel ected"' :  '') ." >{$ membership Name}</opt ion>";
985       }   988       }
986   ?>   989   ?>
987                             </sele ct>   990                             </sele ct>
988                         </td>   991                         </td>
989                    </tr >   992                    </tr >
990                    <tr>   993                    <tr>
991                         <td align= "left" wid th="120">F emale tick et count < font color ="red">*</ font></td>   994                         <td align= "left" wid th="120">F emale tick et count < font color ="red">*</ font></td>
992                         <td align= "left">   995                         <td align= "left">
993                             <input  type="tex t" class=" no" name=" event_coun t_female"  id="event_ count_fema le_id" siz e="6" valu e="<?= $ev entCountFe male ?>" / >   996                             <input  type="tex t" class=" no" name=" event_coun t_female"  id="event_ count_fema le_id" siz e="6" valu e="<?= $ev entCountFe male ?>" / >
994                         </td>   997                         </td>
995                    </tr >   998                    </tr >
996                    <tr>   999                    <tr>
997                         <td align= "left" wid th="120">M ale ticket  count <fo nt color=" red">*</fo nt></td>   1000                         <td align= "left" wid th="120">M ale ticket  count <fo nt color=" red">*</fo nt></td>
998                         <td align= "left">   1001                         <td align= "left">
999                             <input  type="tex t" class=" no" name=" event_coun t_male" id ="event_co unt_male_i d" size="6 " value="< ?= $eventC ountMale ? >" />   1002                             <input  type="tex t" class=" no" name=" event_coun t_male" id ="event_co unt_male_i d" size="6 " value="< ?= $eventC ountMale ? >" />
1000                         </td>   1003                         </td>
1001                    </tr >   1004                    </tr >
1002                </table>   1005                </table>
1003           </ td>   1006           </ td>
1004       </tr>   1007       </tr>
1005       <tr>   1008       <tr>
1006           <t d class="s ection_hea der">Ticke t prices</ td>   1009           <t d class="s ection_hea der">Ticke t prices</ td>
1007       </tr>   1010       </tr>
1008       <tr>   1011       <tr>
1009           <t d class="s ection_row ">   1012           <t d class="s ection_row ">
1010                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   1013                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
1011                    <tr>   1014                    <tr>
1012                         <td align= "left" wid th="120">E vent is fr ee</td>   1015                         <td align= "left" wid th="120">E vent is fr ee</td>
1013                         <td align= "left">   1016                         <td align= "left">
1014                             <input  type="che ckbox" cla ss="no" na me="event_ price_free " id="even t_price_fr ee_id" sty le="vertic al-align:  middle;" o nClick="ja vascript:  updatePric eControls( );" <?= $e ventPriceF ree ?> />   1017                             <input  type="che ckbox" cla ss="no" na me="event_ price_free " id="even t_price_fr ee_id" sty le="vertic al-align:  middle;" o nClick="ja vascript:  updatePric eControls( );" <?= $e ventPriceF ree ?> />
1015                         </td>   1018                         </td>
1016                    </tr >   1019                    </tr >
1017                    <tr>   1020                    <tr>
1018                         <td align= "left" wid th="120">F emale tick et price < font color ="red">*</ font></td>   1021                         <td align= "left" wid th="120">F emale tick et price < font color ="red">*</ font></td>
1019                         <td align= "left">   1022                         <td align= "left">
1020                             <input  type="tex t" class=" no" name=" event_pric e_female"  id="event_ price_fema le_id" siz e="8" valu e="<?= $ev entPriceFe male ?>" < ?= $eventP riceFemale Disabled ? > />   1023                             <input  type="tex t" class=" no" name=" event_pric e_female"  id="event_ price_fema le_id" siz e="8" valu e="<?= $ev entPriceFe male ?>" < ?= $eventP riceFemale Disabled ? > />
1021                         </td>   1024                         </td>
1022                    </tr >   1025                    </tr >
1023                    <tr>   1026                    <tr>
1024                         <td align= "left" wid th="120">M ale ticket  price <fo nt color=" red">*</fo nt></td>   1027                         <td align= "left" wid th="120">M ale ticket  price <fo nt color=" red">*</fo nt></td>
1025                         <td align= "left">   1028                         <td align= "left">
1026                             <input  type="tex t" class=" no" name=" event_pric e_male" id ="event_pr ice_male_i d" size="8 " value="< ?= $eventP riceMale ? >" <?= $ev entPriceMa leDisabled  ?> />   1029                             <input  type="tex t" class=" no" name=" event_pric e_male" id ="event_pr ice_male_i d" size="8 " value="< ?= $eventP riceMale ? >" <?= $ev entPriceMa leDisabled  ?> />
1027                         </td>   1030                         </td>
1028                    </tr >   1031                    </tr >
1029                </table>   1032                </table>
1030           </ td>   1033           </ td>
1031       </tr>   1034       </tr>
1032       <tr>   1035       <tr>
1033           <t d class="s ection_hea der">Membe r side opt ions</td>   1036           <t d class="s ection_hea der">Membe r side opt ions</td>
1034       </tr>   1037       </tr>
1035       <tr>   1038       <tr>
1036           <t d class="s ection_row ">   1039           <t d class="s ection_row ">
1037                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">   1040                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="100%">
1038                    <tr>   1041                    <tr>
1039                         <td align= "left" wid th="120">C hoose peri od <font c olor="red" >*</font>< br />(in d ays)</td>   1042                         <td align= "left" wid th="120">C hoose peri od <font c olor="red" >*</font>< br />(in d ays)</td>
1040                         <td align= "left">   1043                         <td align= "left">
1041                             <input  type="tex t" class=" no" name=" event_choo se_period"  id="event _choose_pe riod_id" s ize="6" va lue="<?= $ eventChoos ePeriod ?> " />   1044                             <input  type="tex t" class=" no" name=" event_choo se_period"  id="event _choose_pe riod_id" s ize="6" va lue="<?= $ eventChoos ePeriod ?> " />
1042                         </td>   1045                         </td>
1043                    </tr >   1046                    </tr >
1044                    <tr>   1047                    <tr>
1045                         <td align= "left" wid th="120">A llow membe rs to view  participa nts list</ td>   1048                         <td align= "left" wid th="120">A llow membe rs to view  participa nts list</ td>
1046                         <td align= "left">   1049                         <td align= "left">
1047                             <input  type="che ckbox" cla ss="no" na me="event_ allow_view " id="even t_allow_vi ew_id" <?=  $eventAll owView ?>  />   1050                             <input  type="che ckbox" cla ss="no" na me="event_ allow_view " id="even t_allow_vi ew_id" <?=  $eventAll owView ?>  />
1048                         </td>   1051                         </td>
1049                    </tr >   1052                    </tr >
1050                </table>   1053                </table>
1051           </ td>   1054           </ td>
1052       </tr>   1055       </tr>
1053       <tr>   1056       <tr>
1054           <t d align="c enter" val ign="middl e" style=" padding-to p: 8px;">   1057           <t d align="c enter" val ign="middl e" style=" padding-to p: 8px;">
1055                <input t ype="submi t" class=" no" name=" event_save " value="S ave" style ="width: 6 0px; verti cal-align:  middle;"  onClick="j avascript:  return va lidateEdit Form();" / >   1058                <input t ype="submi t" class=" no" name=" event_save " value="S ave" style ="width: 6 0px; verti cal-align:  middle;"  onClick="j avascript:  return va lidateEdit Form();" / >
1056   <?   1059   <?
1057       if ( ! $newEvent  )   1060       if ( ! $newEvent  )
1058       {   1061       {
1059   ?>   1062   ?>
1060                &nbsp;<i nput type= "checkbox"  class="no " name="ev ent_as_new " id="even t_as_new_i d" style=" vertical-a lign: midd le;" />   1063                &nbsp;<i nput type= "checkbox"  class="no " name="ev ent_as_new " id="even t_as_new_i d" style=" vertical-a lign: midd le;" />
1061                &nbsp;<l abel for=" event_as_n ew_id">as  new</label >   1064                &nbsp;<l abel for=" event_as_n ew_id">as  new</label >
1062                <input t ype="hidde n" name="e vent_id" v alue="<?=  $eventArr[ 'ID'] ?>"  />   1065                <input t ype="hidde n" name="e vent_id" v alue="<?=  $eventArr[ 'ID'] ?>"  />
1063                <input t ype="hidde n" name="a ction" val ue="edit"  />   1066                <input t ype="hidde n" name="a ction" val ue="edit"  />
1064   <?   1067   <?
1065       }   1068       }
1066       else   1069       else
1067       {   1070       {
1068   ?>   1071   ?>
1069                <input t ype="hidde n" name="a ction" val ue="new" / >   1072                <input t ype="hidde n" name="a ction" val ue="new" / >
1070   <?   1073   <?
1071       }   1074       }
1072   ?>   1075   ?>
1073           </ td>   1076           </ td>
1074       </tr>   1077       </tr>
1075   </table>   1078   </table>
1076   </form>   1079   </form>
1077   <?   1080   <?
1078   }   1081   }
1079     1082  
1080   $show_quer y = '';   1083   $show_quer y = '';
1081   $show = ar ray();   1084   $show = ar ray();
1082   $show_matc h = array( );   1085   $show_matc h = array( );
1083   $between_d isabled =  'disabled= "disabled" ';   1086   $between_d isabled =  'disabled= "disabled" ';
1084   $country_d isabled =  'disabled= "disabled" ';   1087   $country_d isabled =  'disabled= "disabled" ';
1085     1088  
1086   switch ( $ _REQUEST[' action'] )   1089   switch ( $ _REQUEST[' action'] )
1087   {   1090   {
1088       // sho w list of  events acc ording sel ected filt er   1091       // sho w list of  events acc ording sel ected filt er
1089       case ' show':   1092       case ' show':
1090           $s how_from =  (int)$_RE QUEST['fro m'];   1093           $s how_from =  (int)$_RE QUEST['fro m'];
1091           sw itch ( $_R EQUEST['sh ow_events' ] )   1094           sw itch ( $_R EQUEST['sh ow_events' ] )
1092           {   1095           {
1093                // show  events bet ween speci fied dates   1096                // show  events bet ween speci fied dates
1094                case 'da te':   1097                case 'da te':
1095                    // F irst date  parse   1098                    // F irst date  parse
1096                    if (  $_REQUEST ['show_eve nts_betwee n1'] == 's tart' )   1099                    if (  $_REQUEST ['show_eve nts_betwee n1'] == 's tart' )
1097                         $between_d ate1 = 0;   1100                         $between_d ate1 = 0;
1098                    else if ( $_REQ UEST['show _events_be tween1'] = = 'now' )   1101                    else if ( $_REQ UEST['show _events_be tween1'] = = 'now' )
1099                         $between_d ate1 = tim e();   1102                         $between_d ate1 = tim e();
1100                    else   1103                    else
1101                         $between_d ate1 = str totime( $_ REQUEST['s how_events _between1' ] );   1104                         $between_d ate1 = str totime( $_ REQUEST['s how_events _between1' ] );
1102                    // S econd date  parse   1105                    // S econd date  parse
1103                    if (  $_REQUEST ['show_eve nts_betwee n2'] == 's tart' )   1106                    if (  $_REQUEST ['show_eve nts_betwee n2'] == 's tart' )
1104                         $between_d ate2 = 0;   1107                         $between_d ate2 = 0;
1105                    else if ( $_REQ UEST['show _events_be tween2'] = = 'now' )   1108                    else if ( $_REQ UEST['show _events_be tween2'] = = 'now' )
1106                         $between_d ate2 = tim e();   1109                         $between_d ate2 = tim e();
1107                    else   1110                    else
1108                         $between_d ate2 = str totime( $_ REQUEST['s how_events _between2' ] );   1111                         $between_d ate2 = str totime( $_ REQUEST['s how_events _between2' ] );
1109                    $sho w['between _date1'] =  process_p ass_data(  $_REQUEST[ 'show_even ts_between 1'] );   1112                    $sho w['between _date1'] =  process_p ass_data(  $_REQUEST[ 'show_even ts_between 1'] );
1110                    $sho w['between _date2'] =  process_p ass_data(  $_REQUEST[ 'show_even ts_between 2'] );   1113                    $sho w['between _date2'] =  process_p ass_data(  $_REQUEST[ 'show_even ts_between 2'] );
1111                    if (  $between_ date1 != - 1 && $betw een_date2  != -1 )   1114                    if (  $between_ date1 != - 1 && $betw een_date2  != -1 )
1112                    {   1115                    {
1113                         $show_quer y = "SELEC T `ID`, `T itle`, `De scription` , `Status` , `StatusM essage`, ` Country`,  `City`, `P lace`, `Ph otoFilenam e`, `Event Start`, `R esponsible ID`   1116                         $show_quer y = "SELEC T `ID`, `T itle`, `De scription` , `Status` , `StatusM essage`, ` Country`,  `City`, `P lace`, `Ph otoFilenam e`, `Event Start`, `R esponsible ID`
1114                                          FROM  `SDatingE vents`   1117                                          FROM  `SDatingE vents`
1115                                          WHER E ( FROM_U NIXTIME($b etween_dat e1) <= `Ev entStart`   1118                                          WHER E ( FROM_U NIXTIME($b etween_dat e1) <= `Ev entStart`
1116                                               AND FROM_U NIXTIME($b etween_dat e2) >= `Ev entStart`  )   1119                                               AND FROM_U NIXTIME($b etween_dat e2) >= `Ev entStart`  )
1117                                          ORDE R BY `Even tStart` DE SC   1120                                          ORDE R BY `Even tStart` DE SC
1118                                          LIMI T {$show_f rom}, {$na vigationSt ep}";   1121                                          LIMI T {$show_f rom}, {$na vigationSt ep}";
1119                         $total_que ry = "SELE CT COUNT(* )   1122                         $total_que ry = "SELE CT COUNT(* )
1120                                          FROM  `SDatingE vents`   1123                                          FROM  `SDatingE vents`
1121                                          WHER E ( FROM_U NIXTIME($b etween_dat e1) <= `Ev entStart`   1124                                          WHER E ( FROM_U NIXTIME($b etween_dat e1) <= `Ev entStart`
1122                                               AND FROM_U NIXTIME($b etween_dat e2) >= `Ev entStart`  )";   1125                                               AND FROM_U NIXTIME($b etween_dat e2) >= `Ev entStart`  )";
1123                    }   1126                    }
1124                    else   1127                    else
1125                    {   1128                    {
1126                         $show['err or_text']  = "Please  specify co rrect date s";   1129                         $show['err or_text']  = "Please  specify co rrect date s";
1127                    }   1130                    }
1128                    $bet ween_disab led = '';   1131                    $bet ween_disab led = '';
1129                    brea k;   1132                    brea k;
1130                // show  events in  specified  country   1133                // show  events in  specified  country
1131                case 'co untry':   1134                case 'co untry':
1132                    $sho w_query =  "SELECT `I D`, `Title `, `Descri ption`, `S tatus`, `S tatusMessa ge`, `Coun try`, `Cit y`, `Place `, `PhotoF ilename`,  `EventStar t`, `Respo nsibleID`   1135                    $sho w_query =  "SELECT `I D`, `Title `, `Descri ption`, `S tatus`, `S tatusMessa ge`, `Coun try`, `Cit y`, `Place `, `PhotoF ilename`,  `EventStar t`, `Respo nsibleID`
1133                                      FROM `SD atingEvent s`   1136                                      FROM `SD atingEvent s`
1134                                      WHERE `C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y']) ."'   1137                                      WHERE `C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y']) ."'
1135                                      ORDER BY  `EventSta rt` DESC   1138                                      ORDER BY  `EventSta rt` DESC
1136                                      LIMIT {$ show_from} , {$naviga tionStep}" ;   1139                                      LIMIT {$ show_from} , {$naviga tionStep}" ;
1137                    $tot al_query =  "SELECT C OUNT(*)   1140                    $tot al_query =  "SELECT C OUNT(*)
1138                                          FROM  `SDatingE vents`   1141                                          FROM  `SDatingE vents`
1139                                          WHER E `Country ` = '". pr ocess_db_i nput($_REQ UEST['show _events_co untry']) . "'";   1142                                          WHER E `Country ` = '". pr ocess_db_i nput($_REQ UEST['show _events_co untry']) . "'";
1140                    $sho w['country '] = proce ss_pass_da ta($_REQUE ST['show_e vents_coun try']);   1143                    $sho w['country '] = proce ss_pass_da ta($_REQUE ST['show_e vents_coun try']);
1141                    $cou ntry_disab led = '';   1144                    $cou ntry_disab led = '';
1142                    brea k;   1145                    brea k;
1143                // show  all events   1146                // show  all events
1144                case 'al l':   1147                case 'al l':
1145                default:   1148                default:
1146                    $sho w_query =  "SELECT `I D`, `Title `, `Descri ption`, `S tatus`, `S tatusMessa ge`, `Coun try`, `Cit y`, `Place `, `PhotoF ilename`,  `EventStar t`, `Respo nsibleID`   1149                    $sho w_query =  "SELECT `I D`, `Title `, `Descri ption`, `S tatus`, `S tatusMessa ge`, `Coun try`, `Cit y`, `Place `, `PhotoF ilename`,  `EventStar t`, `Respo nsibleID`
1147                                      FROM `SD atingEvent s`   1150                                      FROM `SD atingEvent s`
1148                                      ORDER BY  `EventSta rt` DESC   1151                                      ORDER BY  `EventSta rt` DESC
1149                                      LIMIT {$ show_from} , {$naviga tionStep}" ;   1152                                      LIMIT {$ show_from} , {$naviga tionStep}" ;
1150                    $tot al_query =  "SELECT C OUNT(*)   1153                    $tot al_query =  "SELECT C OUNT(*)
1151                                          FROM  `SDatingE vents`";   1154                                          FROM  `SDatingE vents`";
1152           }   1155           }
1153     1156  
1154           br eak;   1157           br eak;
1155     1158  
1156       // upd ate existi ng event o r add new  one   1159       // upd ate existi ng event o r add new  one
1157       case ' edit':   1160       case ' edit':
1158           $e vent_id =  (int)$_REQ UEST['even t_id'];   1161           $e vent_id =  (int)$_REQ UEST['even t_id'];
1159           if  ( $event_ id )   1162           if  ( $event_ id )
1160           {   1163           {
1161                if ( $_P OST['event _as_new']  == 'on' )   1164                if ( $_P OST['event _as_new']  == 'on' )
1162                    $edi t_res = SD AddEvent() ;   1165                    $edi t_res = SD AddEvent() ;
1163                else   1166                else
1164                    $edi t_res = SD UpdateEven t( $event_ id );   1167                    $edi t_res = SD UpdateEven t( $event_ id );
1165                switch (  $edit_res  )   1168                switch (  $edit_res  )
1166                {   1169                {
1167                    case  SDATING_E RROR_SUCCE SS:   1170                    case  SDATING_E RROR_SUCCE SS:
1168                         if ( $_POS T['event_a s_new'] ==  'on' )   1171                         if ( $_POS T['event_a s_new'] ==  'on' )
1169                             $show[ 'error_tex t'] = 'Eve nt was suc cessfully  added';   1172                             $show[ 'error_tex t'] = 'Eve nt was suc cessfully  added';
1170                         else   1173                         else
1171                             $show[ 'error_tex t'] = 'Eve nt was suc cessfully  updated';   1174                             $show[ 'error_tex t'] = 'Eve nt was suc cessfully  updated';
1172                         break;   1175                         break;
1173                    case  SDATING_E RROR_QUERY _ERROR:   1176                    case  SDATING_E RROR_QUERY _ERROR:
1174                         if ( $_POS T['event_a s_new'] ==  'on' )   1177                         if ( $_POS T['event_a s_new'] ==  'on' )
1175                             $show[ 'error_tex t'] = 'Ins ert query  error';   1178                             $show[ 'error_tex t'] = 'Ins ert query  error';
1176                         else   1179                         else
1177                             $show[ 'error_tex t'] = 'Upd ate query  error';   1180                             $show[ 'error_tex t'] = 'Upd ate query  error';
1178                         break;   1181                         break;
1179                    case  SDATING_E RROR_NOT_A FFECTED:   1182                    case  SDATING_E RROR_NOT_A FFECTED:
1180                         if ( $_POS T['event_a s_new'] ==  'on' )   1183                         if ( $_POS T['event_a s_new'] ==  'on' )
1181                             $show[ 'error_tex t'] = 'Eve nt wasn\'t  added';   1184                             $show[ 'error_tex t'] = 'Eve nt wasn\'t  added';
1182                         else   1185                         else
1183                             $show[ 'error_tex t'] = 'Eve nt wasn\'t  updated';   1186                             $show[ 'error_tex t'] = 'Eve nt wasn\'t  updated';
1184                         break;   1187                         break;
1185                    case  SDATING_E RROR_WRONG _DATE_FORM AT:   1188                    case  SDATING_E RROR_WRONG _DATE_FORM AT:
1186                         $show['err or_text']  = 'Wrong d ate format  or wrong  date order ';   1189                         $show['err or_text']  = 'Wrong d ate format  or wrong  date order ';
1187                         break;   1190                         break;
1188                    case  SDATING_E RROR_PHOTO _PROCESS:   1191                    case  SDATING_E RROR_PHOTO _PROCESS:
1189                         $show['err or_text']  = 'Error d uring phot o resizing ';   1192                         $show['err or_text']  = 'Error d uring phot o resizing ';
1190                         break;   1193                         break;
1191                }   1194                }
1192           }   1195           }
1193           br eak;   1196           br eak;
1194     1197  
1195       // del ete event   1198       // del ete event
1196       case ' delete':   1199       case ' delete':
1197           $e vent_id =  (int)$_REQ UEST['even t_id'];   1200           $e vent_id =  (int)$_REQ UEST['even t_id'];
1198           if  ( $event_ id )   1201           if  ( $event_ id )
1199           {   1202           {
1200                $delete_ res = SDDe leteEvent(  $event_id  );   1203                $delete_ res = SDDe leteEvent(  $event_id  );
1201                if ( $de lete_res )   1204                if ( $de lete_res )
1202                    $sho w['error_t ext'] = 'E vent was s uccessfull y deleted' ;   1205                    $sho w['error_t ext'] = 'E vent was s uccessfull y deleted' ;
1203                else   1206                else
1204                    $sho w['error_t ext'] = 'D elete quer y error';   1207                    $sho w['error_t ext'] = 'D elete quer y error';
1205           }   1208           }
1206           br eak;   1209           br eak;
1207     1210  
1208       // add  new event   1211       // add  new event
1209       case ' new':   1212       case ' new':
1210           $a dd_res = S DAddEvent( );   1213           $a dd_res = S DAddEvent( );
1211           sw itch ( $ad d_res )   1214           sw itch ( $ad d_res )
1212           {   1215           {
1213                case SDA TING_ERROR _SUCCESS:   1216                case SDA TING_ERROR _SUCCESS:
1214                    $sho w['error_t ext'] = 'E vent was s uccessfull y added';   1217                    $sho w['error_t ext'] = 'E vent was s uccessfull y added';
1215                    brea k;   1218                    brea k;
1216                case SDA TING_ERROR _QUERY_ERR OR:   1219                case SDA TING_ERROR _QUERY_ERR OR:
1217                    $sho w['error_t ext'] = 'I nsert quer y error';   1220                    $sho w['error_t ext'] = 'I nsert quer y error';
1218                    brea k;   1221                    brea k;
1219                case SDA TING_ERROR _NOT_AFFEC TED:   1222                case SDA TING_ERROR _NOT_AFFEC TED:
1220                    $sho w['error_t ext'] = 'E vent wasn\ 't added';   1223                    $sho w['error_t ext'] = 'E vent wasn\ 't added';
1221                    brea k;   1224                    brea k;
1222                case SDA TING_ERROR _WRONG_DAT E_FORMAT:   1225                case SDA TING_ERROR _WRONG_DAT E_FORMAT:
1223                    $sho w['error_t ext'] = 'W rong date  format or  wrong date  order';   1226                    $sho w['error_t ext'] = 'W rong date  format or  wrong date  order';
1224                    brea k;   1227                    brea k;
1225                case SDA TING_ERROR _PHOTO_PRO CESS:   1228                case SDA TING_ERROR _PHOTO_PRO CESS:
1226                    $sho w['error_t ext'] = 'E rror durin g photo re sizing';   1229                    $sho w['error_t ext'] = 'E rror durin g photo re sizing';
1227                    brea k;   1230                    brea k;
1228           }   1231           }
1229           br eak;   1232           br eak;
1230     1233  
1231       // sho w particip ants of sp ecified ev ent   1234       // sho w particip ants of sp ecified ev ent
1232       case ' show_part' :   1235       case ' show_part' :
1233           $e vent_id =  (int)$_REQ UEST['even t_id'];   1236           $e vent_id =  (int)$_REQ UEST['even t_id'];
1234           if  ( $event_ id )   1237           if  ( $event_ id )
1235           {   1238           {
1236                // delet e members  from event   1239                // delet e members  from event
1237                if ( $_P OST['parti cipant_can cel'] == ' Remove fro m event' )   1240                if ( $_P OST['parti cipant_can cel'] == ' Remove fro m event' )
1238                {   1241                {
1239                    $del ete_partic ipants = ' ';   1242                    $del ete_partic ipants = ' ';
1240                    fore ach ( $_PO ST as $key  => $value  )   1243                    fore ach ( $_PO ST as $key  => $value  )
1241                    {   1244                    {
1242                         if ( (int) $key && $v alue == 'o n' )   1245                         if ( (int) $key && $v alue == 'o n' )
1243                         {   1246                         {
1244                             $delet e_particip ants .= st rlen($dele te_partici pants) ? ' ,'. (int)$ key : (int )$key;   1247                             $delet e_particip ants .= st rlen($dele te_partici pants) ? ' ,'. (int)$ key : (int )$key;
1245                         }   1248                         }
1246                    }   1249                    }
1247                    if (  strlen($d elete_part icipants)  )   1250                    if (  strlen($d elete_part icipants)  )
1248                    {   1251                    {
1249                         db_res( "D ELETE FROM  `SDatingP articipant s` WHERE ` ID` IN ($d elete_part icipants)"  );   1252                         db_res( "D ELETE FROM  `SDatingP articipant s` WHERE ` ID` IN ($d elete_part icipants)"  );
1250                         db_res( "D ELETE FROM  `SDatingM atches` WH ERE `IDCho oser` IN ( $delete_pa rticipants ) OR `IDCh osen` IN ( $delete_pa rticipants )" );   1253                         db_res( "D ELETE FROM  `SDatingM atches` WH ERE `IDCho oser` IN ( $delete_pa rticipants ) OR `IDCh osen` IN ( $delete_pa rticipants )" );
1251                    }   1254                    }
1252                }   1255                }
1253     1256  
1254                // send  email to m embers   1257                // send  email to m embers
1255                if ( $_P OST['send_ message']  == 'Send m essage' )   1258                if ( $_P OST['send_ message']  == 'Send m essage' )
1256                {   1259                {
1257                    $sub ject = get Param( 't_ SDatingAdm inEmail_su bject' );   1260                    $sub ject = get Param( 't_ SDatingAdm inEmail_su bject' );
1258                    $tex t = getPar am( 't_SDa tingAdminE mail' );   1261                    $tex t = getPar am( 't_SDa tingAdminE mail' );
1259     1262  
1260                    $fai led_count  = 0;   1263                    $fai led_count  = 0;
1261                    fore ach ( $_PO ST as $key  => $value  )   1264                    fore ach ( $_PO ST as $key  => $value  )
1262                    {   1265                    {
1263                         if ( (int) $key && $v alue == 'o n' )   1266                         if ( (int) $key && $v alue == 'o n' )
1264                         {   1267                         {
1265                             $part_ arr = db_a rr( "SELEC T `Profile s`.`ID`, ` Profiles`. `NickName` , `Profile s`.`Email` , `SDating Participan ts`.`Parti cipantUID` , `SDating Events`.`T itle`, `SD atingEvent s`.`Place` , `SDating Events`.`E ventStart`  FROM `SDa tingPartic ipants`   1268                             $part_ arr = db_a rr( "SELEC T `Profile s`.`ID`, ` Profiles`. `NickName` , `Profile s`.`Email` , `SDating Participan ts`.`Parti cipantUID` , `SDating Events`.`T itle`, `SD atingEvent s`.`Place` , `SDating Events`.`E ventStart`  FROM `SDa tingPartic ipants`
1266                                                       LE FT JOIN `P rofiles` O N `SDating Participan ts`.`IDMem ber` = `Pr ofiles`.`I D`   1269                                                       LE FT JOIN `P rofiles` O N `SDating Participan ts`.`IDMem ber` = `Pr ofiles`.`I D`
1267                                                       LE FT JOIN `S DatingEven ts` ON `SD atingEvent s`.`ID` =  `SDatingPa rticipants `.`IDEvent `   1270                                                       LE FT JOIN `S DatingEven ts` ON `SD atingEvent s`.`ID` =  `SDatingPa rticipants `.`IDEvent `
1268                                                       WH ERE `SDati ngParticip ants`.`ID`  = ". (int )$key );   1271                                                       WH ERE `SDati ngParticip ants`.`ID`  = ". (int )$key );
1269     1272  
1270                             $aPlus  = array() ;   1273                             $aPlus  = array() ;
1271                             $aPlus ['NameSDat ing'] = $p art_arr['T itle'];   1274                             $aPlus ['NameSDat ing'] = $p art_arr['T itle'];
1272                             $aPlus ['PlaceSDa ting'] = $ part_arr[' Place'];   1275                             $aPlus ['PlaceSDa ting'] = $ part_arr[' Place'];
1273                             $aPlus ['WhenStar SDating']  = $part_ar r['EventSt art'];   1276                             $aPlus ['WhenStar SDating']  = $part_ar r['EventSt art'];
1274                             $aPlus ['Personal UID'] = $p art_arr['P articipant UID'];   1277                             $aPlus ['Personal UID'] = $p art_arr['P articipant UID'];
1275                             $aPlus ['LinkSDat ingEvent']  = $site[' url'] . 'e vents.php? action=sho w_info&amp ;event_id= ' . $event _id;   1278                             $aPlus ['LinkSDat ingEvent']  = $site[' url'] . 'e vents.php? action=sho w_info&amp ;event_id= ' . $event _id;
1276                             $aPlus ['MessageT ext'] = pr ocess_pass _data($_PO ST['messag e']);   1279                             $aPlus ['MessageT ext'] = pr ocess_pass _data($_PO ST['messag e']);
1277     1280  
1278                             $mail_ res = send Mail( $par t_arr['Ema il'], $sub ject, $tex t, $part_a rr['ID'],  $aPlus );   1281                             $mail_ res = send Mail( $par t_arr['Ema il'], $sub ject, $tex t, $part_a rr['ID'],  $aPlus );
1279     1282  
1280                             if ( ! $mail_res  )   1283                             if ( ! $mail_res  )
1281                                 $f ailed_coun t++;   1284                                 $f ailed_coun t++;
1282                         }   1285                         }
1283                    }   1286                    }
1284                    if (  $failed_c ount > 0 )   1287                    if (  $failed_c ount > 0 )
1285                         $show_part ['error_te xt'] = "Fa iled to se nd {$faile d_count} m essages";   1288                         $show_part ['error_te xt'] = "Fa iled to se nd {$faile d_count} m essages";
1286                    else   1289                    else
1287                         $show_part ['error_te xt'] = 'Al l messages  were succ essfully s ent';   1290                         $show_part ['error_te xt'] = 'Al l messages  were succ essfully s ent';
1288                }   1291                }
1289     1292  
1290                // list  of partici pants   1293                // list  of partici pants
1291                $part_pa ge = isset ($_REQUEST ['part_pag e']) ? (in t)$_REQUES T['part_pa ge'] : 1;   1294                $part_pa ge = isset ($_REQUEST ['part_pag e']) ? (in t)$_REQUES T['part_pa ge'] : 1;
1292                $part_p_ per_page =  isset($_R EQUEST['pa rt_p_per_p age']) ? ( int)$_REQU EST['part_ p_per_page '] : 30;   1295                $part_p_ per_page =  isset($_R EQUEST['pa rt_p_per_p age']) ? ( int)$_REQU EST['part_ p_per_page '] : 30;
1293                $limit_f irst = (in t)($part_p age - 1) *  $part_p_p er_page;   1296                $limit_f irst = (in t)($part_p age - 1) *  $part_p_p er_page;
1294                $part_so rtby = iss et($_REQUE ST['sortby ']) ? proc ess_db_inp ut($_REQUE ST['sortby ']) : 'Pro files.ID';   1297                $part_so rtby = iss et($_REQUE ST['sortby ']) ? proc ess_db_inp ut($_REQUE ST['sortby ']) : 'Pro files.ID';
1295                $part_so rtorder =  isset($_RE QUEST['sor torder'])  && $_REQUE ST['sortor der'] == ' DESC' ? 'D ESC' : 'AS C';   1298                $part_so rtorder =  isset($_RE QUEST['sor torder'])  && $_REQUE ST['sortor der'] == ' DESC' ? 'D ESC' : 'AS C';
1296                $search_ filter = ' ';   1299                $search_ filter = ' ';
1297                // add s earch filt er if need ed   1300                // add s earch filt er if need ed
1298                if ( $_R EQUEST['se arch_email '] )   1301                if ( $_R EQUEST['se arch_email '] )
1299                    $sea rch_filter  = 'AND `P rofiles`.` Email` LIK E \'%'. pr ocess_db_i nput($_REQ UEST['sear ch_filter' ]) .'%\'';   1302                    $sea rch_filter  = 'AND `P rofiles`.` Email` LIK E \'%'. pr ocess_db_i nput($_REQ UEST['sear ch_filter' ]) .'%\'';
1300                elseif (  $_REQUEST ['search_n ick'] )   1303                elseif (  $_REQUEST ['search_n ick'] )
1301                    $sea rch_filter  = 'AND `P rofiles`.` NickName`  LIKE \'%'.  process_d b_input($_ REQUEST['s earch_filt er']) .'%\ '';   1304                    $sea rch_filter  = 'AND `P rofiles`.` NickName`  LIKE \'%'.  process_d b_input($_ REQUEST['s earch_filt er']) .'%\ '';
1302                elseif (  $_REQUEST ['search_i d'] )   1305                elseif (  $_REQUEST ['search_i d'] )
1303                    $sea rch_filter  = 'AND `P rofiles`.` ID` = '. ( int)$_REQU EST['searc h_filter'] ;   1306                    $sea rch_filter  = 'AND `P rofiles`.` ID` = '. ( int)$_REQU EST['searc h_filter'] ;
1304                $part_pr ofiles_res  = db_res(  "SELECT ` Profiles`. *, `SDatin gParticipa nts`.`ID`  AS `PartID `, `SDatin gParticipa nts`.`Part icipantUID ` AS `UID`  FROM `SDa tingPartic ipants`   1307                $part_pr ofiles_res  = db_res(  "SELECT ` Profiles`. *, `SDatin gParticipa nts`.`ID`  AS `PartID `, `SDatin gParticipa nts`.`Part icipantUID ` AS `UID`  FROM `SDa tingPartic ipants`
1305                                                   LEFT J OIN `Profi les` ON `S DatingPart icipants`. `IDMember`  = `Profil es`.`ID`   1308                                                   LEFT J OIN `Profi les` ON `S DatingPart icipants`. `IDMember`  = `Profil es`.`ID`
1306                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id $searc h_filter   1309                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id $searc h_filter
1307                                                   ORDER  BY $part_s ortby $par t_sortorde r   1310                                                   ORDER  BY $part_s ortby $par t_sortorde r
1308                                                   LIMIT  $limit_fir st, $part_ p_per_page " );   1311                                                   LIMIT  $limit_fir st, $part_ p_per_page " );
1309                $total_a rr = db_ar r( "SELECT  COUNT(*)  FROM `SDat ingPartici pants`   1312                $total_a rr = db_ar r( "SELECT  COUNT(*)  FROM `SDat ingPartici pants`
1310                                               LEFT JOIN  `Profiles`  ON `SDati ngParticip ants`.`IDM ember` = ` Profiles`. `ID`   1313                                               LEFT JOIN  `Profiles`  ON `SDati ngParticip ants`.`IDM ember` = ` Profiles`. `ID`
1311                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $event_id  $search_fi lter" );   1314                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $event_id  $search_fi lter" );
1312                $part_pr ofiles_tot al = (int) $total_arr [0];   1315                $part_pr ofiles_tot al = (int) $total_arr [0];
1313                $pages_n um = ceil(  $part_pro files_tota l / $part_ p_per_page  );   1316                $pages_n um = ceil(  $part_pro files_tota l / $part_ p_per_page  );
1314                $part_ge t_url = "{ $_SERVER[' PHP_SELF'] }?action=s how_part&a mp;event_i d={$event_ id}". (iss et($_REQUE ST['part_p _per_page' ]) ? '&amp ;part_p_pe r_page='.  (int)$_REQ UEST['part _p_per_pag e'] : '');   1317                $part_ge t_url = "{ $_SERVER[' PHP_SELF'] }?action=s how_part&a mp;event_i d={$event_ id}". (iss et($_REQUE ST['part_p _per_page' ]) ? '&amp ;part_p_pe r_page='.  (int)$_REQ UEST['part _p_per_pag e'] : '');
1315                $part_pe r_page_arr ay = array (10, 15, 2 0, 30, 50,  100);   1318                $part_pe r_page_arr ay = array (10, 15, 2 0, 30, 50,  100);
1316                $part_qu ery = "SEL ECT `ID`,  `Title`, ` Descriptio n`, `Statu s`, `Statu sMessage`,  `Country` , `City`,  `Place`, ` PhotoFilen ame`, `Eve ntStart`,  `EventEnd` , `TicketS aleStart`,  `TicketSa leEnd`, `R esponsible Name`, `Re sponsibleE mail`, `Re sponsibleP hone`, `Ev entSexFilt er`, `Even tAgeLowerF ilter`, `E ventAgeUpp erFilter`,  `EventMem bershipFil ter`, `Tic ketCountFe male`, `Ti cketCountM ale`, `Tic ketPriceFe male`, `Ti cketPriceM ale`, `Cho osePeriod` , `AllowVi ewParticip ants` FROM  `SDatingE vents` WHE RE `ID` =  $event_id" ;   1319                $part_qu ery = "SEL ECT `ID`,  `Title`, ` Descriptio n`, `Statu s`, `Statu sMessage`,  `Country` , `City`,  `Place`, ` PhotoFilen ame`, `Eve ntStart`,  `EventEnd` , `TicketS aleStart`,  `TicketSa leEnd`, `R esponsible Name`, `Re sponsibleE mail`, `Re sponsibleP hone`, `Ev entSexFilt er`, `Even tAgeLowerF ilter`, `E ventAgeUpp erFilter`,  `EventMem bershipFil ter`, `Tic ketCountFe male`, `Ti cketCountM ale`, `Tic ketPriceFe male`, `Ti cketPriceM ale`, `Cho osePeriod` , `AllowVi ewParticip ants` FROM  `SDatingE vents` WHE RE `ID` =  $event_id" ;
1317           }   1320           }
1318           br eak;   1321           br eak;
1319     1322  
1320       // sho w matches  of specifi ed event   1323       // sho w matches  of specifi ed event
1321       case ' show_match ':   1324       case ' show_match ':
1322           $e vent_id =  (int)$_REQ UEST['even t_id'];   1325           $e vent_id =  (int)$_REQ UEST['even t_id'];
1323           if  ( $event_ id )   1326           if  ( $event_ id )
1324           {   1327           {
1325                // delet e member f rom chosen  list   1328                // delet e member f rom chosen  list
1326                if ( $_P OST['choos e_cancel']  == 'Remov e from cho ose list'  )   1329                if ( $_P OST['choos e_cancel']  == 'Remov e from cho ose list'  )
1327                {   1330                {
1328                    $del ete_chosen  = '';   1331                    $del ete_chosen  = '';
1329                    $del ete_choose r = (int)$ _POST['par t_id'];   1332                    $del ete_choose r = (int)$ _POST['par t_id'];
1330                    fore ach ( $_PO ST as $key  => $value  )   1333                    fore ach ( $_PO ST as $key  => $value  )
1331                    {   1334                    {
1332                         if ( (int) $key && $v alue == 'o n' )   1335                         if ( (int) $key && $v alue == 'o n' )
1333                         {   1336                         {
1334                             $delet e_chosen . = strlen($ delete_cho sen) ? ',' . (int)$ke y : (int)$ key;   1337                             $delet e_chosen . = strlen($ delete_cho sen) ? ',' . (int)$ke y : (int)$ key;
1335                         }   1338                         }
1336                    }   1339                    }
1337                    if (  strlen($d elete_chos en) )   1340                    if (  strlen($d elete_chos en) )
1338                    {   1341                    {
1339                         db_res( "D ELETE FROM  `SDatingM atches` WH ERE `IDCho oser` = $d elete_choo ser AND `I DChosen` I N ($delete _chosen)"  );   1342                         db_res( "D ELETE FROM  `SDatingM atches` WH ERE `IDCho oser` = $d elete_choo ser AND `I DChosen` I N ($delete _chosen)"  );
1340                    }   1343                    }
1341                }   1344                }
1342     1345  
1343                // send  matchmakin g emails   1346                // send  matchmakin g emails
1344                if ( $_P OST['send_ match_emai ls'] == 'o n' )   1347                if ( $_P OST['send_ match_emai ls'] == 'o n' )
1345                {   1348                {
1346                    $mat ch_email_r es = db_re s( "SELECT  `Particip antTable1` .`IDMember ` AS `Choo serMemberI D`, `Parti cipantTabl e2`.`IDMem ber` AS `C hosenMembe rID`, `SDa tingEvents `.`ID` AS  `EventID`,  `SDatingE vents`.`Ti tle`, `SDa tingEvents `.`Place`,  `SDatingE vents`.`Ev entStart`   1349                    $mat ch_email_r es = db_re s( "SELECT  `Particip antTable1` .`IDMember ` AS `Choo serMemberI D`, `Parti cipantTabl e2`.`IDMem ber` AS `C hosenMembe rID`, `SDa tingEvents `.`ID` AS  `EventID`,  `SDatingE vents`.`Ti tle`, `SDa tingEvents `.`Place`,  `SDatingE vents`.`Ev entStart`
1347                                                   FROM ` SDatingMat ches` AS ` MatchTable 1`   1350                                                   FROM ` SDatingMat ches` AS ` MatchTable 1`
1348                                                   LEFT J OIN `SDati ngMatches`  AS `Match Table2` ON  `MatchTab le2`.`IDCh ooser` = ` MatchTable 1`.`IDChos en` AND `M atchTable2 `.`IDChose n` = `Matc hTable1`.` IDChooser`   1351                                                   LEFT J OIN `SDati ngMatches`  AS `Match Table2` ON  `MatchTab le2`.`IDCh ooser` = ` MatchTable 1`.`IDChos en` AND `M atchTable2 `.`IDChose n` = `Matc hTable1`.` IDChooser`
1349                                                   LEFT J OIN `SDati ngParticip ants` AS ` Participan tTable1` O N `Partici pantTable1 `.`ID` = ` MatchTable 1`.`IDChoo ser`   1352                                                   LEFT J OIN `SDati ngParticip ants` AS ` Participan tTable1` O N `Partici pantTable1 `.`ID` = ` MatchTable 1`.`IDChoo ser`
1350                                                   LEFT J OIN `SDati ngParticip ants` AS ` Participan tTable2` O N `Partici pantTable2 `.`ID` = ` MatchTable 1`.`IDChos en`   1353                                                   LEFT J OIN `SDati ngParticip ants` AS ` Participan tTable2` O N `Partici pantTable2 `.`ID` = ` MatchTable 1`.`IDChos en`
1351                                                   LEFT J OIN `SDati ngEvents`  ON `SDatin gEvents`.` ID` = `Par ticipantTa ble1`.`IDE vent`   1354                                                   LEFT J OIN `SDati ngEvents`  ON `SDatin gEvents`.` ID` = `Par ticipantTa ble1`.`IDE vent`
1352                                                   WHERE  `Participa ntTable1`. `IDEvent`  = $event_i d   1355                                                   WHERE  `Participa ntTable1`. `IDEvent`  = $event_i d
1353                                                   AND `P articipant Table2`.`I DEvent` =  $event_id   1356                                                   AND `P articipant Table2`.`I DEvent` =  $event_id
1354                                                   AND `M atchTable2 `.`IDChoos er` IS NOT  NULL" );   1357                                                   AND `M atchTable2 `.`IDChoos er` IS NOT  NULL" );
1355     1358  
1356                    $sub ject = get Param( 't_ SDatingMat ch_subject ' );   1359                    $sub ject = get Param( 't_ SDatingMat ch_subject ' );
1357     1360  
1358                    $tex t = getPar am( 't_SDa tingMatch'  );   1361                    $tex t = getPar am( 't_SDa tingMatch'  );
1359     1362  
1360                    $fai led_count  = 0;   1363                    $fai led_count  = 0;
1361                    whil e ( $match _email_arr  = mysql_f etch_assoc ($match_em ail_res) )   1364                    whil e ( $match _email_arr  = mysql_f etch_assoc ($match_em ail_res) )
1362                    {   1365                    {
1363     1366  
1364                         $chooser_a rr = getPr ofileInfo(  $match_em ail_arr['C hooserMemb erID'] );   1367                         $chooser_a rr = getPr ofileInfo(  $match_em ail_arr['C hooserMemb erID'] );
1365     1368  
1366     1369  
1367                         $aPlus = a rray();   1370                         $aPlus = a rray();
1368                         $aPlus['Na meSDating' ] = $match _email_arr ['Title'];   1371                         $aPlus['Na meSDating' ] = $match _email_arr ['Title'];
1369                         $aPlus['Pl aceSDating '] = $matc h_email_ar r['Place'] ;   1372                         $aPlus['Pl aceSDating '] = $matc h_email_ar r['Place'] ;
1370                         $aPlus['Wh enStarSDat ing'] = $m atch_email _arr['Even tStart'];   1373                         $aPlus['Wh enStarSDat ing'] = $m atch_email _arr['Even tStart'];
1371                         $aPlus['Ma tchLink']  = $site['u rl'] . 'pr ofile.php? ID=' . $ma tch_email_ arr['Chose nMemberID' ];   1374                         $aPlus['Ma tchLink']  = $site['u rl'] . 'pr ofile.php? ID=' . $ma tch_email_ arr['Chose nMemberID' ];
1372                         $aPlus['Li nkSDatingE vent'] = $ site['url' ] . 'event s.php?acti on=show_in fo&amp;eve nt_id=' .  $match_ema il_arr['Ev entID'];   1375                         $aPlus['Li nkSDatingE vent'] = $ site['url' ] . 'event s.php?acti on=show_in fo&amp;eve nt_id=' .  $match_ema il_arr['Ev entID'];
1373     1376  
1374     1377  
1375                         $mail_res  = sendMail ( $chooser _arr['Emai l'], $subj ect, $text , $chooser _arr['ID'] , $aPlus ) ;   1378                         $mail_res  = sendMail ( $chooser _arr['Emai l'], $subj ect, $text , $chooser _arr['ID'] , $aPlus ) ;
1376     1379  
1377                         if ( !$mai l_res )   1380                         if ( !$mai l_res )
1378                             $faile d_count++;   1381                             $faile d_count++;
1379                    }   1382                    }
1380                    if (  $failed_c ount > 0 )   1383                    if (  $failed_c ount > 0 )
1381                         $show_matc h['error_t ext'] = "F ailed to s end {$fail ed_count}  notificati ons";   1384                         $show_matc h['error_t ext'] = "F ailed to s end {$fail ed_count}  notificati ons";
1382                    else   1385                    else
1383                         $show_matc h['error_t ext'] = 'A ll notific ations wer e successf ully sent' ;   1386                         $show_matc h['error_t ext'] = 'A ll notific ations wer e successf ully sent' ;
1384                }   1387                }
1385     1388  
1386                $match_p age = isse t($_REQUES T['match_p age']) ? ( int)$_REQU EST['match _page'] :  1;   1389                $match_p age = isse t($_REQUES T['match_p age']) ? ( int)$_REQU EST['match _page'] :  1;
1387                $match_p _per_page  = isset($_ REQUEST['m atch_p_per _page']) ?  (int)$_RE QUEST['mat ch_p_per_p age'] : 30 ;   1390                $match_p _per_page  = isset($_ REQUEST['m atch_p_per _page']) ?  (int)$_RE QUEST['mat ch_p_per_p age'] : 30 ;
1388                $limit_f irst = (in t)($match_ page - 1)  * $match_p _per_page;   1391                $limit_f irst = (in t)($match_ page - 1)  * $match_p _per_page;
1389                $match_p rofiles_re s = db_res ( "SELECT  `Profiles` .*, `SDati ngParticip ants`.`ID`  AS `PartI D`, `SDati ngParticip ants`.`Par ticipantUI D` AS `UID ` FROM `SD atingParti cipants`   1392                $match_p rofiles_re s = db_res ( "SELECT  `Profiles` .*, `SDati ngParticip ants`.`ID`  AS `PartI D`, `SDati ngParticip ants`.`Par ticipantUI D` AS `UID ` FROM `SD atingParti cipants`
1390                                                   LEFT J OIN `Profi les` ON `S DatingPart icipants`. `IDMember`  = `Profil es`.`ID`   1393                                                   LEFT J OIN `Profi les` ON `S DatingPart icipants`. `IDMember`  = `Profil es`.`ID`
1391                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id   1394                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id
1392                                                   ORDER  BY `SDatin gParticipa nts`.`Part icipantUID ` ASC   1395                                                   ORDER  BY `SDatin gParticipa nts`.`Part icipantUID ` ASC
1393                                                   LIMIT  $limit_fir st, $match _p_per_pag e" );   1396                                                   LIMIT  $limit_fir st, $match _p_per_pag e" );
1394                $total_a rr = db_ar r( "SELECT  COUNT(*)  FROM `SDat ingPartici pants`   1397                $total_a rr = db_ar r( "SELECT  COUNT(*)  FROM `SDat ingPartici pants`
1395                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $event_id"  );   1398                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $event_id"  );
1396                $match_c ount_arr =  db_arr( " SELECT COU NT(*) / 2  FROM `SDat ingMatches ` AS `Matc hTable1`   1399                $match_c ount_arr =  db_arr( " SELECT COU NT(*) / 2  FROM `SDat ingMatches ` AS `Matc hTable1`
1397                                                   LEFT J OIN `SDati ngMatches`  AS `Match Table2` ON  `MatchTab le2`.`IDCh ooser` = ` MatchTable 1`.`IDChos en` AND `M atchTable2 `.`IDChose n` = `Matc hTable1`.` IDChooser`   1400                                                   LEFT J OIN `SDati ngMatches`  AS `Match Table2` ON  `MatchTab le2`.`IDCh ooser` = ` MatchTable 1`.`IDChos en` AND `M atchTable2 `.`IDChose n` = `Matc hTable1`.` IDChooser`
1398                                                   LEFT J OIN `SDati ngParticip ants` ON ` SDatingPar ticipants` .`ID` = `M atchTable1 `.`IDChose n`   1401                                                   LEFT J OIN `SDati ngParticip ants` ON ` SDatingPar ticipants` .`ID` = `M atchTable1 `.`IDChose n`
1399                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id   1402                                                   WHERE  `SDatingPa rticipants `.`IDEvent ` = $event _id
1400                                                   AND `M atchTable2 `.`IDChoos er` IS NOT  NULL" );   1403                                                   AND `M atchTable2 `.`IDChoos er` IS NOT  NULL" );
1401                $match_p rofiles_to tal = (int )$total_ar r[0];   1404                $match_p rofiles_to tal = (int )$total_ar r[0];
1402                $match_c ount_total  = (int)$m atch_count _arr[0];   1405                $match_c ount_total  = (int)$m atch_count _arr[0];
1403                $pages_n um = ceil(  $match_pr ofiles_tot al / $matc h_p_per_pa ge );   1406                $pages_n um = ceil(  $match_pr ofiles_tot al / $matc h_p_per_pa ge );
1404                $match_g et_url = " {$_SERVER[ 'PHP_SELF' ]}?action= show_match &amp;event _id={$even t_id}". (i sset($_REQ UEST['matc h_p_per_pa ge']) ? '& amp;match_ p_per_page ='. (int)$ _REQUEST[' match_p_pe r_page'] :  '');   1407                $match_g et_url = " {$_SERVER[ 'PHP_SELF' ]}?action= show_match &amp;event _id={$even t_id}". (i sset($_REQ UEST['matc h_p_per_pa ge']) ? '& amp;match_ p_per_page ='. (int)$ _REQUEST[' match_p_pe r_page'] :  '');
1405                $match_p er_page_ar ray = arra y(10, 15,  20, 30, 50 , 100);   1408                $match_p er_page_ar ray = arra y(10, 15,  20, 30, 50 , 100);
1406           }   1409           }
1407           br eak;   1410           br eak;
1408   }   1411   }
1409     1412  
1410   // if acti on is 'sho w' then se lect event s from the  database   1413   // if acti on is 'sho w' then se lect event s from the  database
1411   if ( strle n($show_qu ery) )   1414   if ( strle n($show_qu ery) )
1412   {   1415   {
1413       $show_ result = d b_res( $sh ow_query ) ;   1416       $show_ result = d b_res( $sh ow_query ) ;
1414       $show_ num = mysq l_num_rows ( $show_re sult );   1417       $show_ num = mysq l_num_rows ( $show_re sult );
1415       $total _num_arr =  db_arr( $ total_quer y );   1418       $total _num_arr =  db_arr( $ total_quer y );
1416       $total _num = (in t)$total_n um_arr[0];   1419       $total _num = (in t)$total_n um_arr[0];
1417   }   1420   }
1418     1421  
1419   TopCodeAdm in();   1422   TopCodeAdm in();
1420   ContentBlo ckHead("Ma nage event s");   1423   ContentBlo ckHead("Ma nage event s");
1421     1424  
1422   if ( strle n($show['e rror_text' ]) )   1425   if ( strle n($show['e rror_text' ]) )
1423       echo "   1426       echo "
1424   <center>   1427   <center>
1425       <div c lass=\"err \">{$show[ 'error_tex t']}</div>   1428       <div c lass=\"err \">{$show[ 'error_tex t']}</div>
1426   </center>" ;   1429   </center>" ;
1427   ?>   1430   ?>
1428     1431  
1429   <center>   1432   <center>
1430     1433  
1431   <script la nguage="Ja vaScript"  type="text /javascrip t">   1434   <script la nguage="Ja vaScript"  type="text /javascrip t">
1432   <!--   1435   <!--
1433       functi on updateS howControl s()   1436       functi on updateS howControl s()
1434       {   1437       {
1435           do cument.for ms['showEv entsForm'] .elements[ 'show_even ts_between 1'].disabl ed = !(doc ument.getE lementById ('show_eve nts_date_i d').checke d);   1438           do cument.for ms['showEv entsForm'] .elements[ 'show_even ts_between 1'].disabl ed = !(doc ument.getE lementById ('show_eve nts_date_i d').checke d);
1436           do cument.get ElementByI d('show_ev ents_betwe en1_choose _id').disa bled = !(d ocument.ge tElementBy Id('show_e vents_date _id').chec ked);   1439           do cument.get ElementByI d('show_ev ents_betwe en1_choose _id').disa bled = !(d ocument.ge tElementBy Id('show_e vents_date _id').chec ked);
1437           do cument.get ElementByI d('show_ev ents_betwe en1_clear_ id').disab led = !(do cument.get ElementByI d('show_ev ents_date_ id').check ed);   1440           do cument.get ElementByI d('show_ev ents_betwe en1_clear_ id').disab led = !(do cument.get ElementByI d('show_ev ents_date_ id').check ed);
1438           do cument.for ms['showEv entsForm'] .elements[ 'show_even ts_between 2'].disabl ed = !(doc ument.getE lementById ('show_eve nts_date_i d').checke d);   1441           do cument.for ms['showEv entsForm'] .elements[ 'show_even ts_between 2'].disabl ed = !(doc ument.getE lementById ('show_eve nts_date_i d').checke d);
1439           do cument.get ElementByI d('show_ev ents_betwe en2_choose _id').disa bled = !(d ocument.ge tElementBy Id('show_e vents_date _id').chec ked);   1442           do cument.get ElementByI d('show_ev ents_betwe en2_choose _id').disa bled = !(d ocument.ge tElementBy Id('show_e vents_date _id').chec ked);
1440           do cument.get ElementByI d('show_ev ents_betwe en2_clear_ id').disab led = !(do cument.get ElementByI d('show_ev ents_date_ id').check ed);   1443           do cument.get ElementByI d('show_ev ents_betwe en2_clear_ id').disab led = !(do cument.get ElementByI d('show_ev ents_date_ id').check ed);
1441           do cument.get ElementByI d('show_ev ents_selec t_id').dis abled = !( document.g etElementB yId('show_ events_cou ntry_id'). checked);   1444           do cument.get ElementByI d('show_ev ents_selec t_id').dis abled = !( document.g etElementB yId('show_ events_cou ntry_id'). checked);
1442       }   1445       }
1443   -->   1446   -->
1444   </script>   1447   </script>
1445     1448  
1446   <div style ="text-ali gn: right;  padding-r ight: 45px ; padding- bottom: 2p x;">   1449   <div style ="text-ali gn: right;  padding-r ight: 45px ; padding- bottom: 2p x;">
1447       <a hre f="<?= "{$ _SERVER['P HP_SELF']} ?action=sh ow_edit_fo rm" ?>">Ad d new even t</a>   1450       <a hre f="<?= "{$ _SERVER['P HP_SELF']} ?action=sh ow_edit_fo rm" ?>">Ad d new even t</a>
1448   </div>   1451   </div>
1449     1452  
1450   <form id=" showEvents Form" acti on="<?= $_ SERVER['PH P_SELF'] ? >" method= "get" styl e="margin:  0px;">   1453   <form id=" showEvents Form" acti on="<?= $_ SERVER['PH P_SELF'] ? >" method= "get" styl e="margin:  0px;">
1451   <table cla ss="text"  cellspacin g="2" cell padding="4 " width="5 00" border ="0">   1454   <table cla ss="text"  cellspacin g="2" cell padding="4 " width="5 00" border ="0">
1452       <tr>   1455       <tr>
1453           <t d class="s ection_hea der" nowra p>Select e vents to s how</td>   1456           <t d class="s ection_hea der" nowra p>Select e vents to s how</td>
1454       </tr>   1457       </tr>
1455       <tr>   1458       <tr>
1456           <t d class="s ection_row ">   1459           <t d class="s ection_row ">
1457                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="480" ali gn="center ">   1460                <table c ellpadding ="4" cells pacing="0"  border="0 " class="t ext" width ="480" ali gn="center ">
1458                    <tr>   1461                    <tr>
1459                         <td align= "left" wid th="160" c olspan="2" >   1462                         <td align= "left" wid th="160" c olspan="2" >
1460                             <input  type="rad io" name=" show_event s" id="sho w_events_a ll_id" cla ss="no" va lue="all"  style="ver tical-alig n: middle; " onClick= "javascrip t: updateS howControl s();" <?=  $_REQUEST[ 'show_even ts'] == 'a ll' ? 'che cked="chec ked"' : ''  ?> />   1463                             <input  type="rad io" name=" show_event s" id="sho w_events_a ll_id" cla ss="no" va lue="all"  style="ver tical-alig n: middle; " onClick= "javascrip t: updateS howControl s();" <?=  $_REQUEST[ 'show_even ts'] == 'a ll' ? 'che cked="chec ked"' : ''  ?> />
1461                             &nbsp; <label for ="show_eve nts_all_id ">Show all  events</l abel>   1464                             &nbsp; <label for ="show_eve nts_all_id ">Show all  events</l abel>
1462                         </td>   1465                         </td>
1463                    </tr >   1466                    </tr >
1464                    <tr>   1467                    <tr>
1465                         <td align= "left" wid th="160">   1468                         <td align= "left" wid th="160">
1466                             <input  type="rad io" name=" show_event s" id="sho w_events_d ate_id" cl ass="no" v alue="date " style="v ertical-al ign: middl e;" onClic k="javascr ipt: updat eShowContr ols();" <? = $_REQUES T['show_ev ents'] ==  'date' ? ' checked="c hecked"' :  '' ?> />   1469                             <input  type="rad io" name=" show_event s" id="sho w_events_d ate_id" cl ass="no" v alue="date " style="v ertical-al ign: middl e;" onClic k="javascr ipt: updat eShowContr ols();" <? = $_REQUES T['show_ev ents'] ==  'date' ? ' checked="c hecked"' :  '' ?> />
1467                             &nbsp; <label for ="show_eve nts_date_i d">Show ev ents betwe en</label>   1470                             &nbsp; <label for ="show_eve nts_date_i d">Show ev ents betwe en</label>
1468                         </td>   1471                         </td>
1469                         <td align= "left">   1472                         <td align= "left">
1470                             <input  type="tex t" class=" no" name=" show_event s_between1 " id="show _events_be tween1_id"  size="20"  value="<? = isset($s how['betwe en_date1'] ) ? htmlsp ecialchars ($show['be tween_date 1']) : ''  ?>" <?= $b etween_dis abled ?> / >   1473                             <input  type="tex t" class=" no" name=" show_event s_between1 " id="show _events_be tween1_id"  size="20"  value="<? = isset($s how['betwe en_date1'] ) ? htmlsp ecialchars ($show['be tween_date 1']) : ''  ?>" <?= $b etween_dis abled ?> / >
1471                             &nbsp; <input typ e="button"  id="show_ events_bet ween1_choo se_id" val ue="Choose " <?= $bet ween_disab led ?> />   1474                             &nbsp; <input typ e="button"  id="show_ events_bet ween1_choo se_id" val ue="Choose " <?= $bet ween_disab led ?> />
1472                             &nbsp; <input typ e="button"  id="show_ events_bet ween1_clea r_id" onCl ick="javas cript: doc ument.getE lementById ('show_eve nts_betwee n1_id').va lue = '';  " value="C lear" <?=  $between_d isabled ?>  />   1475                             &nbsp; <input typ e="button"  id="show_ events_bet ween1_clea r_id" onCl ick="javas cript: doc ument.getE lementById ('show_eve nts_betwee n1_id').va lue = '';  " value="C lear" <?=  $between_d isabled ?>  />
1473                         </td>   1476                         </td>
1474                    </tr >   1477                    </tr >
1475                    <tr>   1478                    <tr>
1476                         <td align= "right" wi dth="160"> and</td>   1479                         <td align= "right" wi dth="160"> and</td>
1477                         <td align= "left">   1480                         <td align= "left">
1478                             <input  type="tex t" class=" no" name=" show_event s_between2 " id="show _events_be tween2_id"  size="20"  value="<? = isset($s how['betwe en_date2'] ) ? htmlsp ecialchars ($show['be tween_date 2']) : ''  ?>" <?= $b etween_dis abled ?> / >   1481                             <input  type="tex t" class=" no" name=" show_event s_between2 " id="show _events_be tween2_id"  size="20"  value="<? = isset($s how['betwe en_date2'] ) ? htmlsp ecialchars ($show['be tween_date 2']) : ''  ?>" <?= $b etween_dis abled ?> / >
1479                             &nbsp; <input typ e="button"  id="show_ events_bet ween2_choo se_id" val ue="Choose " <?= $bet ween_disab led ?> />   1482                             &nbsp; <input typ e="button"  id="show_ events_bet ween2_choo se_id" val ue="Choose " <?= $bet ween_disab led ?> />
1480                             &nbsp; <input typ e="button"  id="show_ events_bet ween2_clea r_id" onCl ick="javas cript: doc ument.getE lementById ('show_eve nts_betwee n2_id').va lue = '';  " value="C lear" <?=  $between_d isabled ?>  />   1483                             &nbsp; <input typ e="button"  id="show_ events_bet ween2_clea r_id" onCl ick="javas cript: doc ument.getE lementById ('show_eve nts_betwee n2_id').va lue = '';  " value="C lear" <?=  $between_d isabled ?>  />
1481                         </td>   1484                         </td>
1482                    </tr >   1485                    </tr >
1483                    <tr>   1486                    <tr>
1484                         <td align= "left" wid th="160">   1487                         <td align= "left" wid th="160">
1485                             <input  type="rad io" name=" show_event s" id="sho w_events_c ountry_id"  class="no " value="c ountry" st yle="verti cal-align:  middle;"  onClick="j avascript:  updateSho wControls( );"  <?= $ _REQUEST[' show_event s'] == 'co untry' ? ' checked="c hecked"' :  '' ?> />   1488                             <input  type="rad io" name=" show_event s" id="sho w_events_c ountry_id"  class="no " value="c ountry" st yle="verti cal-align:  middle;"  onClick="j avascript:  updateSho wControls( );"  <?= $ _REQUEST[' show_event s'] == 'co untry' ? ' checked="c hecked"' :  '' ?> />
1486                             &nbsp; <label for ="show_eve nts_countr y_id">Show  events by  country</ label>   1489                             &nbsp; <label for ="show_eve nts_countr y_id">Show  events by  country</ label>
1487                         </td>   1490                         </td>
1488                         <td align= "left">   1491                         <td align= "left">
1489                             <selec t class="n o" name="s how_events _country"  id="show_e vents_sele ct_id" <?=  $country_ disabled ? > >   1492                             <selec t class="n o" name="s how_events _country"  id="show_e vents_sele ct_id" <?=  $country_ disabled ? > >
1490   <?   1493   <?
1491       $sel_c ountry = i sset($show ['country' ]) ? $show ['country' ] : getPar am( 'defau lt_country ' );   1494       $sel_c ountry = i sset($show ['country' ]) ? $show ['country' ] : getPar am( 'defau lt_country ' );
1492       foreac h ( $aPreV alues['Cou ntry'] as  $key => $v alue )   1495       foreac h ( $aPreV alues['Cou ntry'] as  $key => $v alue )
1493       {   1496       {
1494           ec ho "   1497           ec ho "
1495                                 <o ption valu e=\"{$key} \" ". ( $s el_country  == $key ?  'selected ="selected "' : '') . " >". _t($ value['LKe y']) ."</o ption>";   1498                                 <o ption valu e=\"{$key} \" ". ( $s el_country  == $key ?  'selected ="selected "' : '') . " >". _t($ value['LKe y']) ."</o ption>";
1496       }   1499       }
1497   ?>   1500   ?>
1498                             </sele ct>   1501                             </sele ct>
1499                         </td>   1502                         </td>
1500                    </tr >   1503                    </tr >
1501                </table>   1504                </table>
1502           </ td>   1505           </ td>
1503       </tr>   1506       </tr>
1504   </table>   1507   </table>
1505   <br />   1508   <br />
1506   <input typ e="submit"  class="no " value="S how" />   1509   <input typ e="submit"  class="no " value="S how" />
1507   <input typ e="hidden"  name="act ion" value ="show" />   1510   <input typ e="hidden"  name="act ion" value ="show" />
1508   <input typ e="hidden"  name="fro m" value=" 0" />   1511   <input typ e="hidden"  name="fro m" value=" 0" />
1509   </form>   1512   </form>
1510     1513  
1511   </center>   1514   </center>
1512   <?   1515   <?
1513   ContentBlo ckFoot();   1516   ContentBlo ckFoot();
1514   /**   1517   /**
1515    * Shows d iv with re sults of e vent searc h form   1518    * Shows d iv with re sults of e vent searc h form
1516    */   1519    */
1517   if ( strle n($show_qu ery) )   1520   if ( strle n($show_qu ery) )
1518   {   1521   {
1519     1522  
1520   ContentBlo ckHead("Ev ents");   1523   ContentBlo ckHead("Ev ents");
1521   ?>   1524   ?>
1522     1525  
1523   <center>   1526   <center>
1524     1527  
1525   <script la nguage="Ja vaScript"  type="text /javascrip t">   1528   <script la nguage="Ja vaScript"  type="text /javascrip t">
1526   <!--   1529   <!--
1527       functi on navigat ionSubmit(  fromParam  )   1530       functi on navigat ionSubmit(  fromParam  )
1528       {   1531       {
1529           do cument.for ms['showEv entsForm'] .elements[ 'from'].va lue = from Param;   1532           do cument.for ms['showEv entsForm'] .elements[ 'from'].va lue = from Param;
1530           do cument.for ms['showEv entsForm'] .submit();   1533           do cument.for ms['showEv entsForm'] .submit();
1531       }   1534       }
1532   -->   1535   -->
1533   </script>   1536   </script>
1534   <?   1537   <?
1535       if ( $ show_num = = 0 )   1538       if ( $ show_num = = 0 )
1536       {   1539       {
1537           ec ho "No eve nts availa ble";   1540           ec ho "No eve nts availa ble";
1538       }   1541       }
1539       else   1542       else
1540       {   1543       {
1541           ec ho SDPrint Navigation ( (int)$_R EQUEST['fr om'], $tot al_num, tr ue );   1544           ec ho SDPrint Navigation ( (int)$_R EQUEST['fr om'], $tot al_num, tr ue );
1542           wh ile ( $sho w_arr = my sql_fetch_ assoc($sho w_result)  )   1545           wh ile ( $sho w_arr = my sql_fetch_ assoc($sho w_result)  )
1543           {   1546           {
1544                SDPrintE ventRow( $ show_arr ) ;   1547                SDPrintE ventRow( $ show_arr ) ;
1545           }   1548           }
1546           ec ho SDPrint Navigation ( (int)$_R EQUEST['fr om'], $tot al_num, fa lse );   1549           ec ho SDPrint Navigation ( (int)$_R EQUEST['fr om'], $tot al_num, fa lse );
1547       }   1550       }
1548   ?>   1551   ?>
1549     1552  
1550   </center>   1553   </center>
1551   <?   1554   <?
1552     1555  
1553   ContentBlo ckFoot();   1556   ContentBlo ckFoot();
1554   }   1557   }
1555     1558  
1556   /**   1559   /**
1557    * Shows d iv with ev ent partic ipants inf ormation,  pages navi gation, co ntrols for   1560    * Shows d iv with ev ent partic ipants inf ormation,  pages navi gation, co ntrols for
1558    * removin g members  from event   1561    * removin g members  from event
1559    */   1562    */
1560   if ( $_REQ UEST['acti on'] == 's how_part'  && $event_ id )   1563   if ( $_REQ UEST['acti on'] == 's how_part'  && $event_ id )
1561   {   1564   {
1562   ?>   1565   ?>
1563           <d iv class=" block_head ">Event pa rticipants </div>   1566           <d iv class=" block_head ">Event pa rticipants </div>
1564           <d iv class=" block_oute r">   1567           <d iv class=" block_oute r">
1565                <div cla ss="block_ inner">   1568                <div cla ss="block_ inner">
1566     1569  
1567   <?   1570   <?
1568   if ( strle n($show_pa rt['error_ text']) )   1571   if ( strle n($show_pa rt['error_ text']) )
1569       echo "   1572       echo "
1570   <center>   1573   <center>
1571       <div c lass=\"err \">{$show_ part['erro r_text']}< /div>   1574       <div c lass=\"err \">{$show_ part['erro r_text']}< /div>
1572   </center>   1575   </center>
1573   <br />";   1576   <br />";
1574   ?>   1577   ?>
1575     1578  
1576   <center>   1579   <center>
1577     1580  
1578   <form id=" searchProf ilesForm"  action="<? = $_SERVER ['PHP_SELF '] ?>" met hod="get"  style="mar gin: 0px;" >   1581   <form id=" searchProf ilesForm"  action="<? = $_SERVER ['PHP_SELF '] ?>" met hod="get"  style="mar gin: 0px;" >
1579   <table cel lpadding=" 2" cellspa cing="2" c lass="pane l" border= "0" width= "540">   1582   <table cel lpadding=" 2" cellspa cing="2" c lass="pane l" border= "0" width= "540">
1580       <tr>   1583       <tr>
1581           <t d colspan= "3" align= "center">   1584           <t d colspan= "3" align= "center">
1582                <input t ype="text"  class="no " name="se arch_filte r" size="6 0" />   1585                <input t ype="text"  class="no " name="se arch_filte r" size="6 0" />
1583           </ td>   1586           </ td>
1584       </tr>   1587       </tr>
1585       <tr>   1588       <tr>
1586           <t d align="r ight">   1589           <t d align="r ight">
1587                <input t ype="submi t" class=" no" name=" search_ema il" value= "Search by  Email" st yle="width : 150px;"  />   1590                <input t ype="submi t" class=" no" name=" search_ema il" value= "Search by  Email" st yle="width : 150px;"  />
1588           </ td>   1591           </ td>
1589           <t d align="c enter">   1592           <t d align="c enter">
1590                <input t ype="submi t" class=" no" name=" search_nic k" value=" Search by  Nickname"  style="wid th: 150px; " />   1593                <input t ype="submi t" class=" no" name=" search_nic k" value=" Search by  Nickname"  style="wid th: 150px; " />
1591           </ td>   1594           </ td>
1592           <t d align="l eft">   1595           <t d align="l eft">
1593                <input t ype="submi t" class=" no" name=" search_id"  value="Se arch by ID " style="w idth: 150p x;" />   1596                <input t ype="submi t" class=" no" name=" search_id"  value="Se arch by ID " style="w idth: 150p x;" />
1594           </ td>   1597           </ td>
1595       </tr>   1598       </tr>
1596   </table>   1599   </table>
1597   <input typ e="hidden"  name="act ion" value ="show_par t" />   1600   <input typ e="hidden"  name="act ion" value ="show_par t" />
1598   <input typ e="hidden"  name="eve nt_id" val ue="<?= $e vent_id ?> " />   1601   <input typ e="hidden"  name="eve nt_id" val ue="<?= $e vent_id ?> " />
1599   </form>   1602   </form>
1600     1603  
1601   <br />   1604   <br />
1602     1605  
1603   <div style ="align: c enter;">   1606   <div style ="align: c enter;">
1604       <form  id="upperN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">   1607       <form  id="upperN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">
1605           <i nput type= "hidden" n ame="actio n" value=" show_part"  />   1608           <i nput type= "hidden" n ame="actio n" value=" show_part"  />
1606           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />   1609           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />
1607           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $part_p_p er_page, $ part_profi les_total)  ?></b>&nb sp;|&nbsp; Total:&nbs p;<b><?= $ part_profi les_total  ?></b>&nbs p;|&nbsp;R esults per  page:&nbs p;   1610           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $part_p_p er_page, $ part_profi les_total)  ?></b>&nb sp;|&nbsp; Total:&nbs p;<b><?= $ part_profi les_total  ?></b>&nbs p;|&nbsp;R esults per  page:&nbs p;
1608           <s elect name ="part_p_p er_page" c lass="no"  onchange=" javascript : document .forms['up perNavigat ionForm']. submit();"  style="ve rtical-ali gn: middle ;">   1611           <s elect name ="part_p_p er_page" c lass="no"  onchange=" javascript : document .forms['up perNavigat ionForm']. submit();"  style="ve rtical-ali gn: middle ;">
1609   <?   1612   <?
1610       foreac h ( $part_ per_page_a rray as $p er_page_el em )   1613       foreac h ( $part_ per_page_a rray as $p er_page_el em )
1611       {   1614       {
1612           ec ho "   1615           ec ho "
1613                <option  value=\"{$ per_page_e lem}\" ".  ($part_p_p er_page ==  $per_page _elem ? 's elected="s elected"'  : '') .">{ $per_page_ elem}</opt ion>";   1616                <option  value=\"{$ per_page_e lem}\" ".  ($part_p_p er_page ==  $per_page _elem ? 's elected="s elected"'  : '') .">{ $per_page_ elem}</opt ion>";
1614       }   1617       }
1615   ?>   1618   ?>
1616           </ select>   1619           </ select>
1617           <b r />   1620           <b r />
1618           Pa ges:&nbsp;   1621           Pa ges:&nbsp;
1619   <?   1622   <?
1620       for (  $i = 1; $i  <= $pages _num; $i++  )   1623       for (  $i = 1; $i  <= $pages _num; $i++  )
1621       {   1624       {
1622           if  ( $i == $ part_page  )   1625           if  ( $i == $ part_page  )
1623                echo "[{ $i}]&nbsp; ";   1626                echo "[{ $i}]&nbsp; ";
1624           el se   1627           el se
1625                echo "<a  href=\"{$ part_get_u rl}&amp;pa rt_page={$ i}\">{$i}< /a>&nbsp;" ;   1628                echo "<a  href=\"{$ part_get_u rl}&amp;pa rt_page={$ i}\">{$i}< /a>&nbsp;" ;
1626       }   1629       }
1627   ?>   1630   ?>
1628       </form >   1631       </form >
1629   </div>   1632   </div>
1630     1633  
1631   <br />   1634   <br />
1632     1635  
1633   <form id=" profilesFo rm" action ="<?= $_SE RVER['PHP_ SELF'] ?>? action=sho w_part&amp ;event_id= <?= $event _id ?>" me thod="post " style="m argin: 0px ;">   1636   <form id=" profilesFo rm" action ="<?= $_SE RVER['PHP_ SELF'] ?>? action=sho w_part&amp ;event_id= <?= $event _id ?>" me thod="post " style="m argin: 0px ;">
1634   <table cel lpadding=" 2" cellspa cing="1" b order="0"  width="540 " bgcolor= "#EEEEEE"  class="sma ll">   1637   <table cel lpadding=" 2" cellspa cing="1" b order="0"  width="540 " bgcolor= "#EEEEEE"  class="sma ll">
1635   <?   1638   <?
1636       if ( $ part_profi les_total  == 0 )   1639       if ( $ part_profi les_total  == 0 )
1637       {   1640       {
1638   ?>   1641   ?>
1639       <tr>   1642       <tr>
1640           <t d align="c enter" cla ss="panel" >No partic ipants for  this even t</td>   1643           <t d align="c enter" cla ss="panel" >No partic ipants for  this even t</td>
1641       </tr>   1644       </tr>
1642   <?   1645   <?
1643       }   1646       }
1644       else   1647       else
1645       {   1648       {
1646   ?>   1649   ?>
1647       <tr cl ass="panel ">   1650       <tr cl ass="panel ">
1648           <t d align="c enter">&nb sp;</td>   1651           <t d align="c enter">&nb sp;</td>
1649           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=Prof iles.ID<?=  $part_sor tby == 'Pr ofiles.ID'  ? ($part_ sortorder  == 'ASC' ?  '&amp;sor torder=DES C' : '&amp ;sortorder =ASC') : ' ' ?>">ID</ a></td>   1652           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=Prof iles.ID<?=  $part_sor tby == 'Pr ofiles.ID'  ? ($part_ sortorder  == 'ASC' ?  '&amp;sor torder=DES C' : '&amp ;sortorder =ASC') : ' ' ?>">ID</ a></td>
1650           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=Nick Name<?= $p art_sortby  == 'NickN ame' ? ($p art_sortor der == 'AS C' ? '&amp ;sortorder =DESC' : ' &amp;sorto rder=ASC')  : '' ?>"> Nickname</ a></td>   1653           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=Nick Name<?= $p art_sortby  == 'NickN ame' ? ($p art_sortor der == 'AS C' ? '&amp ;sortorder =DESC' : ' &amp;sorto rder=ASC')  : '' ?>"> Nickname</ a></td>
1651           <t d align="c enter"><a  href="<?=  $part_get_ url ?>&amp ;sortby=Se x<?= $part _sortby ==  'Sex' ? ( $part_sort order == ' ASC' ? '&a mp;sortord er=DESC' :  '&amp;sor torder=ASC ') : '' ?> ">Sex</a>< /td>   1654           <t d align="c enter"><a  href="<?=  $part_get_ url ?>&amp ;sortby=Se x<?= $part _sortby ==  'Sex' ? ( $part_sort order == ' ASC' ? '&a mp;sortord er=DESC' :  '&amp;sor torder=ASC ') : '' ?> ">Sex</a>< /td>
1652           <t d align="l eft">E-Mai l</td>   1655           <t d align="l eft">E-Mai l</td>
1653           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=SDat ingPartici pants.Part icipantUID <?= $part_ sortby ==  'SDatingPa rticipants .Participa ntUID' ? ( $part_sort order == ' ASC' ? '&a mp;sortord er=DESC' :  '&amp;sor torder=ASC ') : '' ?> ">UID</a>< /td>   1656           <t d align="l eft"><a hr ef="<?= $p art_get_ur l ?>&amp;s ortby=SDat ingPartici pants.Part icipantUID <?= $part_ sortby ==  'SDatingPa rticipants .Participa ntUID' ? ( $part_sort order == ' ASC' ? '&a mp;sortord er=DESC' :  '&amp;sor torder=ASC ') : '' ?> ">UID</a>< /td>
1654       </tr>   1657       </tr>
1655   <?   1658   <?
1656           wh ile ( $par t_profiles _arr = mys ql_fetch_a ssoc($part _profiles_ res) )   1659           wh ile ( $par t_profiles _arr = mys ql_fetch_a ssoc($part _profiles_ res) )
1657           {   1660           {
1658                switch (  $part_pro files_arr[ 'Status']  )   1661                switch (  $part_pro files_arr[ 'Status']  )
1659                {   1662                {
1660                    case  'Unconfir med':   1663                    case  'Unconfir med':
1661                    case  'Approval ':   1664                    case  'Approval ':
1662                    case  'Rejected ':   1665                    case  'Rejected ':
1663                    case  'Suspende d':   1666                    case  'Suspende d':
1664                         $row_class  = "prof_s tat_{$part _profiles_ arr['Statu s']}";   1667                         $row_class  = "prof_s tat_{$part _profiles_ arr['Statu s']}";
1665                         break;   1668                         break;
1666                    case  'Active':   1669                    case  'Active':
1667                    defa ult:   1670                    defa ult:
1668                         $row_class  = 'table' ;   1671                         $row_class  = 'table' ;
1669                }   1672                }
1670   ?>   1673   ?>
1671       <tr cl ass="<?= $ row_class  ?>" bgcolo r="#FFFFFF ">   1674       <tr cl ass="<?= $ row_class  ?>" bgcolo r="#FFFFFF ">
1672           <t d align="c enter" wid th="20"><i nput type= "checkbox"  name="<?=  $part_pro files_arr[ 'PartID']  ?>" onclic k="UpdateS ubmit('pro filesForm' );" /></td >   1675           <t d align="c enter" wid th="20"><i nput type= "checkbox"  name="<?=  $part_pro files_arr[ 'PartID']  ?>" onclic k="UpdateS ubmit('pro filesForm' );" /></td >
1673           <t d align="l eft" width ="30"><a h ref="<?= $ site['url' ] ?>profil e.php?ID=< ?= $part_p rofiles_ar r['ID'] ?> "><?= $par t_profiles _arr['ID']  ?></a></t d>   1676           <t d align="l eft" width ="30"><a h ref="<?= $ site['url' ] ?>profil e.php?ID=< ?= $part_p rofiles_ar r['ID'] ?> "><?= $par t_profiles _arr['ID']  ?></a></t d>
1674           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['N ickName'])  ?></td>   1677           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['N ickName'])  ?></td>
1675           <t d align="c enter" wid th="20"><? = _t('_a_' .$part_pro files_arr[ 'Sex']) ?> </td>   1678           <t d align="c enter" wid th="20"><? = _t('_a_' .$part_pro files_arr[ 'Sex']) ?> </td>
1676           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['E mail']) ?> </td>   1679           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['E mail']) ?> </td>
1677           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['U ID']) ?></ td>   1680           <t d align="l eft"><?= p rocess_lin e_output($ part_profi les_arr['U ID']) ?></ td>
1678       </tr>   1681       </tr>
1679   <?   1682   <?
1680           }   1683           }
1681       }   1684       }
1682   ?>   1685   ?>
1683   </table>   1686   </table>
1684     1687  
1685   <table cel lpadding=" 4" cellspa cing="0" c lass="text " border=" 0">   1688   <table cel lpadding=" 4" cellspa cing="0" c lass="text " border=" 0">
1686       <tr>   1689       <tr>
1687           <t d>   1690           <t d>
1688                <a href= "javascrip t:void(nul l);" oncli ck="javasc ript: setC heckboxes(  'profiles Form', tru e ); retur n false;"> Check all< /a>&nbsp;/ &nbsp;<a h ref="javas cript:void (null);" o nclick="ja vascript:  setCheckbo xes( 'prof ilesForm',  false );  return fal se;">Unche ck all</a>   1691                <a href= "javascrip t:void(nul l);" oncli ck="javasc ript: setC heckboxes(  'profiles Form', tru e ); retur n false;"> Check all< /a>&nbsp;/ &nbsp;<a h ref="javas cript:void (null);" o nclick="ja vascript:  setCheckbo xes( 'prof ilesForm',  false );  return fal se;">Unche ck all</a>
1689           </ td>   1692           </ td>
1690           <t d>With sel ected:</td >   1693           <t d>With sel ected:</td >
1691           <t d>   1694           <t d>
1692                <input t ype="submi t" class=" no" name=" participan t_cancel"  value="Rem ove from e vent" styl e="width:  150px;" />   1695                <input t ype="submi t" class=" no" name=" participan t_cancel"  value="Rem ove from e vent" styl e="width:  150px;" />
1693           </ td>   1696           </ td>
1694       </tr>   1697       </tr>
1695       <tr>   1698       <tr>
1696           <t d align="c enter" col span="3">< textarea n ame="messa ge" class= "no" rows= "7" cols=" 50"></text area></td>   1699           <t d align="c enter" col span="3">< textarea n ame="messa ge" class= "no" rows= "7" cols=" 50"></text area></td>
1697       </tr>   1700       </tr>
1698       <tr>   1701       <tr>
1699           <t d align="c enter" col span="3">   1702           <t d align="c enter" col span="3">
1700                <input t ype="submi t" class=" no" name=" send_messa ge" value= "Send mess age" />   1703                <input t ype="submi t" class=" no" name=" send_messa ge" value= "Send mess age" />
1701           </ td>   1704           </ td>
1702       </tr>   1705       </tr>
1703   </table>   1706   </table>
1704   <?   1707   <?
1705       if ( i sset($_REQ UEST['part _page']) )   1708       if ( i sset($_REQ UEST['part _page']) )
1706           ec ho "   1709           ec ho "
1707   <input typ e=\"hidden \" name=\" part_page\ " value=\" {$_REQUEST ['part_pag e']}\" />" ;   1710   <input typ e=\"hidden \" name=\" part_page\ " value=\" {$_REQUEST ['part_pag e']}\" />" ;
1708       if ( i sset($_REQ UEST['part _p_per_pag e']) )   1711       if ( i sset($_REQ UEST['part _p_per_pag e']) )
1709           ec ho "   1712           ec ho "
1710   <input typ e=\"hidden \" name=\" part_p_per _page\" va lue=\"{$_R EQUEST['pa rt_p_per_p age']}\" / >";   1713   <input typ e=\"hidden \" name=\" part_p_per _page\" va lue=\"{$_R EQUEST['pa rt_p_per_p age']}\" / >";
1711   ?>   1714   ?>
1712   </form>   1715   </form>
1713     1716  
1714   <div style ="align: c enter;">   1717   <div style ="align: c enter;">
1715       <form  id="lowerN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">   1718       <form  id="lowerN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">
1716           <i nput type= "hidden" n ame="actio n" value=" show_part"  />   1719           <i nput type= "hidden" n ame="actio n" value=" show_part"  />
1717           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />   1720           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />
1718           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $part_p_p er_page, $ part_profi les_total)  ?></b>&nb sp;|&nbsp; Total:&nbs p;<b><?= $ part_profi les_total  ?></b>&nbs p;|&nbsp;R esults per  page:&nbs p;   1721           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $part_p_p er_page, $ part_profi les_total)  ?></b>&nb sp;|&nbsp; Total:&nbs p;<b><?= $ part_profi les_total  ?></b>&nbs p;|&nbsp;R esults per  page:&nbs p;
1719           <s elect name ="part_p_p er_page" c lass="no"  onchange=" javascript : document .forms['lo werNavigat ionForm']. submit();"  style="ve rtical-ali gn: middle ;">   1722           <s elect name ="part_p_p er_page" c lass="no"  onchange=" javascript : document .forms['lo werNavigat ionForm']. submit();"  style="ve rtical-ali gn: middle ;">
1720   <?   1723   <?
1721       foreac h ( $part_ per_page_a rray as $p er_page_el em )   1724       foreac h ( $part_ per_page_a rray as $p er_page_el em )
1722       {   1725       {
1723           ec ho "   1726           ec ho "
1724                <option  value=\"{$ per_page_e lem}\" ".  ($part_p_p er_page ==  $per_page _elem ? 's elected="s elected"'  : '') .">{ $per_page_ elem}</opt ion>";   1727                <option  value=\"{$ per_page_e lem}\" ".  ($part_p_p er_page ==  $per_page _elem ? 's elected="s elected"'  : '') .">{ $per_page_ elem}</opt ion>";
1725       }   1728       }
1726   ?>   1729   ?>
1727           </ select>   1730           </ select>
1728           <b r />   1731           <b r />
1729           Pa ges:&nbsp;   1732           Pa ges:&nbsp;
1730   <?   1733   <?
1731       for (  $i = 1; $i  <= $pages _num; $i++  )   1734       for (  $i = 1; $i  <= $pages _num; $i++  )
1732       {   1735       {
1733           if  ( $i == $ part_page  )   1736           if  ( $i == $ part_page  )
1734                echo "[{ $i}]&nbsp; ";   1737                echo "[{ $i}]&nbsp; ";
1735           el se   1738           el se
1736                echo "<a  href=\"{$ part_get_u rl}&amp;pa rt_page={$ i}\">{$i}< /a>&nbsp;" ;   1739                echo "<a  href=\"{$ part_get_u rl}&amp;pa rt_page={$ i}\">{$i}< /a>&nbsp;" ;
1737       }   1740       }
1738   ?>   1741   ?>
1739       </form >   1742       </form >
1740   </div>   1743   </div>
1741     1744  
1742   </center>   1745   </center>
1743     1746  
1744                </div>   1747                </div>
1745           </ div>   1748           </ div>
1746           <d iv class=" block_foot "></div>   1749           <d iv class=" block_foot "></div>
1747   <?   1750   <?
1748   }   1751   }
1749     1752  
1750   /**   1753   /**
1751    * Shows d iv with ev ent match  informatio n, pages n avigation,  controls  for matchm aking emai l   1754    * Shows d iv with ev ent match  informatio n, pages n avigation,  controls  for matchm aking emai l
1752    * sending   1755    * sending
1753    */   1756    */
1754   if ( $_REQ UEST['acti on'] == 's how_match'  && $event _id )   1757   if ( $_REQ UEST['acti on'] == 's how_match'  && $event _id )
1755   {   1758   {
1756   ?>   1759   ?>
1757           <d iv class=" block_head ">Event ma tches</div >   1760           <d iv class=" block_head ">Event ma tches</div >
1758           <d iv class=" block_oute r">   1761           <d iv class=" block_oute r">
1759                <div cla ss="block_ inner">   1762                <div cla ss="block_ inner">
1760     1763  
1761   <?   1764   <?
1762   if ( strle n($show_ma tch['error _text']) )   1765   if ( strle n($show_ma tch['error _text']) )
1763       echo "   1766       echo "
1764   <center>   1767   <center>
1765       <div c lass=\"err \">{$show_ match['err or_text']} </div>   1768       <div c lass=\"err \">{$show_ match['err or_text']} </div>
1766   </center>   1769   </center>
1767   <br />";   1770   <br />";
1768   ?>   1771   ?>
1769     1772  
1770   <center>   1773   <center>
1771     1774  
1772   <div class ="SDInfoBo x">   1775   <div class ="SDInfoBo x">
1773       Total  matches: < ?= $match_ count_tota l ?>   1776       Total  matches: < ?= $match_ count_tota l ?>
1774   </div>   1777   </div>
1775   <br />   1778   <br />
1776   <form id=" sendMatchE mailsForm"  action="< ?= $_SERVE R['PHP_SEL F'] ?>?act ion=show_m atch&amp;e vent_id=<? = $event_i d ?>" meth od="post"  style="mar gin: 0px;" >   1779   <form id=" sendMatchE mailsForm"  action="< ?= $_SERVE R['PHP_SEL F'] ?>?act ion=show_m atch&amp;e vent_id=<? = $event_i d ?>" meth od="post"  style="mar gin: 0px;" >
1777       <input  type="hid den" name= "send_matc h_emails"  value="on"  />   1780       <input  type="hid den" name= "send_matc h_emails"  value="on"  />
1778   <?   1781   <?
1779       if ( i sset($_REQ UEST['matc h_page'])  )   1782       if ( i sset($_REQ UEST['matc h_page'])  )
1780           ec ho "   1783           ec ho "
1781       <input  type=\"hi dden\" nam e=\"match_ page\" val ue=\"{$_RE QUEST['mat ch_page']} \" />";   1784       <input  type=\"hi dden\" nam e=\"match_ page\" val ue=\"{$_RE QUEST['mat ch_page']} \" />";
1782       if ( i sset($_REQ UEST['matc h_p_per_pa ge']) )   1785       if ( i sset($_REQ UEST['matc h_p_per_pa ge']) )
1783           ec ho "   1786           ec ho "
1784       <input  type=\"hi dden\" nam e=\"match_ p_per_page \" value=\ "{$_REQUES T['match_p _per_page' ]}\" />";   1787       <input  type=\"hi dden\" nam e=\"match_ p_per_page \" value=\ "{$_REQUES T['match_p _per_page' ]}\" />";
1785   ?>   1788   ?>
1786       <input  type="sub mit" class ="no" valu e="Send ma tchmaking  emails" st yle="width : 200px" / >   1789       <input  type="sub mit" class ="no" valu e="Send ma tchmaking  emails" st yle="width : 200px" / >
1787   </form>   1790   </form>
1788     1791  
1789   <br />   1792   <br />
1790     1793  
1791   <div style ="align: c enter;">   1794   <div style ="align: c enter;">
1792       <form  id="upperN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">   1795       <form  id="upperN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">
1793           <i nput type= "hidden" n ame="actio n" value=" show_match " />   1796           <i nput type= "hidden" n ame="actio n" value=" show_match " />
1794           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />   1797           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />
1795           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $match_p_ per_page,  $match_pro files_tota l) ?></b>& nbsp;|&nbs p;Total:&n bsp;<b><?=  $match_pr ofiles_tot al ?></b>& nbsp;|&nbs p;Results  per page:& nbsp;   1798           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $match_p_ per_page,  $match_pro files_tota l) ?></b>& nbsp;|&nbs p;Total:&n bsp;<b><?=  $match_pr ofiles_tot al ?></b>& nbsp;|&nbs p;Results  per page:& nbsp;
1796           <s elect name ="match_p_ per_page"  class="no"  onchange= "javascrip t: documen t.forms['u pperNaviga tionForm'] .submit(); " style="v ertical-al ign: middl e;">   1799           <s elect name ="match_p_ per_page"  class="no"  onchange= "javascrip t: documen t.forms['u pperNaviga tionForm'] .submit(); " style="v ertical-al ign: middl e;">
1797   <?   1800   <?
1798       foreac h ( $match _per_page_ array as $ per_page_e lem )   1801       foreac h ( $match _per_page_ array as $ per_page_e lem )
1799       {   1802       {
1800           ec ho "   1803           ec ho "
1801                <option  value=\"{$ per_page_e lem}\" ".  ($match_p_ per_page = = $per_pag e_elem ? ' selected=" selected"'  : '') ."> {$per_page _elem}</op tion>";   1804                <option  value=\"{$ per_page_e lem}\" ".  ($match_p_ per_page = = $per_pag e_elem ? ' selected=" selected"'  : '') ."> {$per_page _elem}</op tion>";
1802       }   1805       }
1803   ?>   1806   ?>
1804           </ select>   1807           </ select>
1805           <b r />   1808           <b r />
1806           Pa ges:&nbsp;   1809           Pa ges:&nbsp;
1807   <?   1810   <?
1808       for (  $i = 1; $i  <= $pages _num; $i++  )   1811       for (  $i = 1; $i  <= $pages _num; $i++  )
1809       {   1812       {
1810           if  ( $i == $ match_page  )   1813           if  ( $i == $ match_page  )
1811                echo "[{ $i}]&nbsp; ";   1814                echo "[{ $i}]&nbsp; ";
1812           el se   1815           el se
1813                echo "<a  href=\"{$ match_get_ url}&match _page={$i} \">{$i}</a >&nbsp;";   1816                echo "<a  href=\"{$ match_get_ url}&match _page={$i} \">{$i}</a >&nbsp;";
1814       }   1817       }
1815   ?>   1818   ?>
1816       </form >   1819       </form >
1817   </div>   1820   </div>
1818     1821  
1819   <br />   1822   <br />
1820     1823  
1821   <script ty pe="text/j avascript"  language= "JavaScrip t">   1824   <script ty pe="text/j avascript"  language= "JavaScrip t">
1822   <!--   1825   <!--
1823       functi on makeSho wHideSwitc h( showFla g, showLab el, hideLa bel, switc hDiv )   1826       functi on makeSho wHideSwitc h( showFla g, showLab el, hideLa bel, switc hDiv )
1824       {   1827       {
1825           if  ( showFla g )   1828           if  ( showFla g )
1826           {   1829           {
1827                if ( sho wLabel )   1830                if ( sho wLabel )
1828                    show Label.styl e.display  = 'none';   1831                    show Label.styl e.display  = 'none';
1829                if ( hid eLabel )   1832                if ( hid eLabel )
1830                    hide Label.styl e.display  = 'inline' ;   1833                    hide Label.styl e.display  = 'inline' ;
1831                if ( swi tchDiv )   1834                if ( swi tchDiv )
1832                    swit chDiv.styl e.display  = 'block';   1835                    swit chDiv.styl e.display  = 'block';
1833           }   1836           }
1834           el se   1837           el se
1835           {   1838           {
1836                if ( sho wLabel )   1839                if ( sho wLabel )
1837                    show Label.styl e.display  = 'inline' ;   1840                    show Label.styl e.display  = 'inline' ;
1838                if ( hid eLabel )   1841                if ( hid eLabel )
1839                    hide Label.styl e.display  = 'none';   1842                    hide Label.styl e.display  = 'none';
1840                if ( swi tchDiv )   1843                if ( swi tchDiv )
1841                    swit chDiv.styl e.display  = 'none';   1844                    swit chDiv.styl e.display  = 'none';
1842           }   1845           }
1843       }   1846       }
1844   -->   1847   -->
1845   </script>   1848   </script>
1846     1849  
1847   <table cel lpadding=" 2" cellspa cing="1" b order="0"  width="540 " class="t ext">   1850   <table cel lpadding=" 2" cellspa cing="1" b order="0"  width="540 " class="t ext">
1848   <?   1851   <?
1849       while  ( $match_p rofiles_ar r = mysql_ fetch_asso c($match_p rofiles_re s) )   1852       while  ( $match_p rofiles_ar r = mysql_ fetch_asso c($match_p rofiles_re s) )
1850       {   1853       {
1851           $c hosen_res  = db_res(  "SELECT `P rofiles`.` NickName`,  `SDatingP articipant s`.`Partic ipantUID`  AS `UID`,  `SDatingPa rticipants `.`ID` AS  `PartID`,   (`MatchTa ble2`.`IDC hooser` IS  NOT NULL)  AS `Choos eMatches`  FROM `SDat ingMatches ` AS `Matc hTable1`   1854           $c hosen_res  = db_res(  "SELECT `P rofiles`.` NickName`,  `SDatingP articipant s`.`Partic ipantUID`  AS `UID`,  `SDatingPa rticipants `.`ID` AS  `PartID`,   (`MatchTa ble2`.`IDC hooser` IS  NOT NULL)  AS `Choos eMatches`  FROM `SDat ingMatches ` AS `Matc hTable1`
1852                                      LEFT JOI N `SDating Matches` A S `MatchTa ble2` ON ` MatchTable 2`.`IDChoo ser` = `Ma tchTable1` .`IDChosen ` AND `Mat chTable2`. `IDChosen`  = `MatchT able1`.`ID Chooser`   1855                                      LEFT JOI N `SDating Matches` A S `MatchTa ble2` ON ` MatchTable 2`.`IDChoo ser` = `Ma tchTable1` .`IDChosen ` AND `Mat chTable2`. `IDChosen`  = `MatchT able1`.`ID Chooser`
1853                                      LEFT JOI N `SDating Participan ts` ON `SD atingParti cipants`.` ID` = `Mat chTable1`. `IDChosen`   1856                                      LEFT JOI N `SDating Participan ts` ON `SD atingParti cipants`.` ID` = `Mat chTable1`. `IDChosen`
1854                                      LEFT JOI N `Profile s` ON `Pro files`.`ID ` = `SDati ngParticip ants`.`IDM ember`   1857                                      LEFT JOI N `Profile s` ON `Pro files`.`ID ` = `SDati ngParticip ants`.`IDM ember`
1855                                      WHERE `M atchTable1 `.`IDChoos er` = {$ma tch_profil es_arr['Pa rtID']}" ) ;   1858                                      WHERE `M atchTable1 `.`IDChoos er` = {$ma tch_profil es_arr['Pa rtID']}" ) ;
1856           $c hosen_num  = mysql_nu m_rows($ch osen_res);   1859           $c hosen_num  = mysql_nu m_rows($ch osen_res);
1857   ?>   1860   ?>
1858       <tr>   1861       <tr>
1859           <t d class="t able" alig n="left" b gcolor="#F FFFFF">   1862           <t d class="t able" alig n="left" b gcolor="#F FFFFF">
1860                <table c ellspacing ="0" cellp adding="4"  border="0 " width="1 00%" class ="text">   1863                <table c ellspacing ="0" cellp adding="4"  border="0 " width="1 00%" class ="text">
1861                    <tr  class="SDM atchMember HeadRow">   1864                    <tr  class="SDM atchMember HeadRow">
1862                         <td align= "left" val ign="middl e"><b><?=  $match_pro files_arr[ 'UID'] ?>  (Nickname:  <?= $matc h_profiles _arr['Nick Name'] ?>) </b></td>   1865                         <td align= "left" val ign="middl e"><b><?=  $match_pro files_arr[ 'UID'] ?>  (Nickname:  <?= $matc h_profiles _arr['Nick Name'] ?>) </b></td>
1863                         <td align= "right" wi dth="150"  valign="mi ddle">   1866                         <td align= "right" wi dth="150"  valign="mi ddle">
1864   <?   1867   <?
1865           if  ( $chosen _num > 0 )   1868           if  ( $chosen _num > 0 )
1866           {   1869           {
1867   ?>   1870   ?>
1868                             <a hre f="javascr ipt:void(n ull);" id= "show<?= $ match_prof iles_arr[' PartID'] ? >_label_id " onClick= "javascrip t: makeSho wHideSwitc h( true, t his, docum ent.getEle mentById(' hide<?= $m atch_profi les_arr['P artID'] ?> _label_id' ), documen t.getEleme ntById('ma tch<?= $ma tch_profil es_arr['Pa rtID'] ?>_ box_id') ) ;" style=" display: i nline;">Sh ow chosen  members</a >   1871                             <a hre f="javascr ipt:void(n ull);" id= "show<?= $ match_prof iles_arr[' PartID'] ? >_label_id " onClick= "javascrip t: makeSho wHideSwitc h( true, t his, docum ent.getEle mentById(' hide<?= $m atch_profi les_arr['P artID'] ?> _label_id' ), documen t.getEleme ntById('ma tch<?= $ma tch_profil es_arr['Pa rtID'] ?>_ box_id') ) ;" style=" display: i nline;">Sh ow chosen  members</a >
1869                             <a hre f="javascr ipt:void(n ull);" id= "hide<?= $ match_prof iles_arr[' PartID'] ? >_label_id " onClick= "javascrip t: makeSho wHideSwitc h( false,  document.g etElementB yId('show< ?= $match_ profiles_a rr['PartID '] ?>_labe l_id'), th is, docume nt.getElem entById('m atch<?= $m atch_profi les_arr['P artID'] ?> _box_id')  );" style= "display:  none;">Hid e chosen m embers</a>   1872                             <a hre f="javascr ipt:void(n ull);" id= "hide<?= $ match_prof iles_arr[' PartID'] ? >_label_id " onClick= "javascrip t: makeSho wHideSwitc h( false,  document.g etElementB yId('show< ?= $match_ profiles_a rr['PartID '] ?>_labe l_id'), th is, docume nt.getElem entById('m atch<?= $m atch_profi les_arr['P artID'] ?> _box_id')  );" style= "display:  none;">Hid e chosen m embers</a>
1870   <?   1873   <?
1871           }   1874           }
1872   ?>   1875   ?>
1873                         </td>   1876                         </td>
1874                    </tr >   1877                    </tr >
1875                </table>   1878                </table>
1876                <div id= "match<?=  $match_pro files_arr[ 'PartID']  ?>_box_id"  class="SD MatchBox"  style="dis play: none ;">   1879                <div id= "match<?=  $match_pro files_arr[ 'PartID']  ?>_box_id"  class="SD MatchBox"  style="dis play: none ;">
1877                    <for m id="matc h<?= $matc h_profiles _arr['Part ID'] ?>For m" action= "<?= $_SER VER['PHP_S ELF'] ?>?a ction=show _match&amp ;event_id= <?= $event _id ?>" me thod="post " style="m argin: 0px ;">   1880                    <for m id="matc h<?= $matc h_profiles _arr['Part ID'] ?>For m" action= "<?= $_SER VER['PHP_S ELF'] ?>?a ction=show _match&amp ;event_id= <?= $event _id ?>" me thod="post " style="m argin: 0px ;">
1878                    <tab le cellpad ding="0" c ellspacing ="0" borde r="0" widt h="100%">   1881                    <tab le cellpad ding="0" c ellspacing ="0" borde r="0" widt h="100%">
1879   <?   1882   <?
1880           if  ( $chosen _num > 0 )   1883           if  ( $chosen _num > 0 )
1881           {   1884           {
1882                while (  $chosen_ar r = mysql_ fetch_asso c($chosen_ res) )   1885                while (  $chosen_ar r = mysql_ fetch_asso c($chosen_ res) )
1883                {   1886                {
1884   ?>   1887   ?>
1885                         <tr class= "<?= $chos en_arr['Ch ooseMatche s'] ? 'SDM atchMember MatchRow'  : 'SDMatch MemberNotM atchRow' ? >">   1888                         <tr class= "<?= $chos en_arr['Ch ooseMatche s'] ? 'SDM atchMember MatchRow'  : 'SDMatch MemberNotM atchRow' ? >">
1886                             <td al ign="cente r" width=" 20" valign ="middle"> <input typ e="checkbo x" name="< ?= $chosen _arr['Part ID'] ?>" i d="choose_ <?= $match _profiles_ arr['PartI D'] ?>_<?=  $chosen_a rr['PartID '] ?>_id"  /></td>   1889                             <td al ign="cente r" width=" 20" valign ="middle"> <input typ e="checkbo x" name="< ?= $chosen _arr['Part ID'] ?>" i d="choose_ <?= $match _profiles_ arr['PartI D'] ?>_<?=  $chosen_a rr['PartID '] ?>_id"  /></td>
1887                             <td al ign="left"  valign="m iddle"><la bel for="c hoose_<?=  $match_pro files_arr[ 'PartID']  ?>_<?= $ch osen_arr[' PartID'] ? >_id"><?=  $chosen_ar r['UID'] ? > (Nicknam e: <?= $ch osen_arr[' NickName']  ?>)</labe l></td>   1890                             <td al ign="left"  valign="m iddle"><la bel for="c hoose_<?=  $match_pro files_arr[ 'PartID']  ?>_<?= $ch osen_arr[' PartID'] ? >_id"><?=  $chosen_ar r['UID'] ? > (Nicknam e: <?= $ch osen_arr[' NickName']  ?>)</labe l></td>
1888                         </tr>   1891                         </tr>
1889   <?   1892   <?
1890                }   1893                }
1891           }   1894           }
1892           el se   1895           el se
1893           {   1896           {
1894   ?>   1897   ?>
1895                    <tr>   1898                    <tr>
1896                         <td>&nbsp; </td>   1899                         <td>&nbsp; </td>
1897                    </tr >   1900                    </tr >
1898   <?   1901   <?
1899           }   1902           }
1900   ?>   1903   ?>
1901                    </ta ble>   1904                    </ta ble>
1902                    <cen ter>   1905                    <cen ter>
1903                    <tab le cellpad ding="0" c ellspacing ="0" borde r="0" clas s="text" s tyle="padd ing: 0px 4 px;">   1906                    <tab le cellpad ding="0" c ellspacing ="0" borde r="0" clas s="text" s tyle="padd ing: 0px 4 px;">
1904                         <tr>   1907                         <tr>
1905                             <td>   1908                             <td>
1906                                 <a  href="jav ascript:vo id(null);"  onclick=" javascript : setCheck boxes( 'ma tch<?= $ma tch_profil es_arr['Pa rtID'] ?>F orm', true  ); return  false;">C heck all</ a>&nbsp;/& nbsp;<a hr ef="javasc ript:void( null);" on click="jav ascript: s etCheckbox es( 'match <?= $match _profiles_ arr['PartI D'] ?>Form ', false ) ; return f alse;">Unc heck all</ a>   1909                                 <a  href="jav ascript:vo id(null);"  onclick=" javascript : setCheck boxes( 'ma tch<?= $ma tch_profil es_arr['Pa rtID'] ?>F orm', true  ); return  false;">C heck all</ a>&nbsp;/& nbsp;<a hr ef="javasc ript:void( null);" on click="jav ascript: s etCheckbox es( 'match <?= $match _profiles_ arr['PartI D'] ?>Form ', false ) ; return f alse;">Unc heck all</ a>
1907                             </td>   1910                             </td>
1908                             <td>Wi th selecte d:</td>   1911                             <td>Wi th selecte d:</td>
1909                             <td>   1912                             <td>
1910                                 <i nput type= "submit" c lass="no"  name="choo se_cancel"  value="Re move from  choose lis t" style=" width: 180 px;" />   1913                                 <i nput type= "submit" c lass="no"  name="choo se_cancel"  value="Re move from  choose lis t" style=" width: 180 px;" />
1911                             </td>   1914                             </td>
1912                         </tr>   1915                         </tr>
1913                    </ta ble>   1916                    </ta ble>
1914                    </ce nter>   1917                    </ce nter>
1915                    <inp ut type="h idden" nam e="part_id " value="< ?= $match_ profiles_a rr['PartID '] ?>" />   1918                    <inp ut type="h idden" nam e="part_id " value="< ?= $match_ profiles_a rr['PartID '] ?>" />
1916                    </fo rm>   1919                    </fo rm>
1917                </div>   1920                </div>
1918           </ td>   1921           </ td>
1919       </tr>   1922       </tr>
1920   <?   1923   <?
1921       }   1924       }
1922   ?>   1925   ?>
1923   </table>   1926   </table>
1924     1927  
1925   <br />   1928   <br />
1926     1929  
1927   <div style ="align: c enter;">   1930   <div style ="align: c enter;">
1928       <form  id="lowerN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">   1931       <form  id="lowerN avigationF orm" actio n="<?= $_S ERVER['PHP _SELF'] ?> " method=" get" style ="margin:  0px;">
1929           <i nput type= "hidden" n ame="actio n" value=" show_match " />   1932           <i nput type= "hidden" n ame="actio n" value=" show_match " />
1930           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />   1933           <i nput type= "hidden" n ame="event _id" value ="<?= $eve nt_id ?>"  />
1931           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $match_p_ per_page,  $match_pro files_tota l) ?></b>& nbsp;|&nbs p;Total:&n bsp;<b><?=  $match_pr ofiles_tot al ?></b>& nbsp;|&nbs p;Results  per page:& nbsp;   1934           Re sults:&nbs p;<b><?= ( $limit_fir st + 1) ?> </b>-<b><? = min($lim it_first +  $match_p_ per_page,  $match_pro files_tota l) ?></b>& nbsp;|&nbs p;Total:&n bsp;<b><?=  $match_pr ofiles_tot al ?></b>& nbsp;|&nbs p;Results  per page:& nbsp;
1932           <s elect name ="match_p_ per_page"  class="no"  onchange= "javascrip t: documen t.forms['l owerNaviga tionForm'] .submit(); " style="v ertical-al ign: middl e;">   1935           <s elect name ="match_p_ per_page"  class="no"  onchange= "javascrip t: documen t.forms['l owerNaviga tionForm'] .submit(); " style="v ertical-al ign: middl e;">
1933   <?   1936   <?
1934       foreac h ( $match _per_page_ array as $ per_page_e lem )   1937       foreac h ( $match _per_page_ array as $ per_page_e lem )
1935       {   1938       {
1936           ec ho "   1939           ec ho "
1937                <option  value=\"{$ per_page_e lem}\" ".  ($match_p_ per_page = = $per_pag e_elem ? ' selected=" selected"'  : '') ."> {$per_page _elem}</op tion>";   1940                <option  value=\"{$ per_page_e lem}\" ".  ($match_p_ per_page = = $per_pag e_elem ? ' selected=" selected"'  : '') ."> {$per_page _elem}</op tion>";
1938       }   1941       }
1939   ?>   1942   ?>
1940           </ select>   1943           </ select>
1941           <b r />   1944           <b r />
1942           Pa ges:&nbsp;   1945           Pa ges:&nbsp;
1943   <?   1946   <?
1944       for (  $i = 1; $i  <= $pages _num; $i++  )   1947       for (  $i = 1; $i  <= $pages _num; $i++  )
1945       {   1948       {
1946           if  ( $i == $ match_page  )   1949           if  ( $i == $ match_page  )
1947                echo "[{ $i}]&nbsp; ";   1950                echo "[{ $i}]&nbsp; ";
1948           el se   1951           el se
1949                echo "<a  href=\"{$ match_get_ url}&match _page={$i} \">{$i}</a >&nbsp;";   1952                echo "<a  href=\"{$ match_get_ url}&match _page={$i} \">{$i}</a >&nbsp;";
1950       }   1953       }
1951   ?>   1954   ?>
1952       </form >   1955       </form >
1953   </div>   1956   </div>
1954     1957  
1955   </center>   1958   </center>
1956     1959  
1957                </div>   1960                </div>
1958           </ div>   1961           </ div>
1959           <d iv class=" block_foot "></div>   1962           <d iv class=" block_foot "></div>
1960   <?   1963   <?
1961   }   1964   }
1962     1965  
1963   /**   1966   /**
1964    * Shows d iv with ev ent edit f orm   1967    * Shows d iv with ev ent edit f orm
1965    */   1968    */
1966   if ( $_REQ UEST['acti on'] == 's how_edit_f orm' )   1969   if ( $_REQ UEST['acti on'] == 's how_edit_f orm' )
1967   {   1970   {
1968   ?>   1971   ?>
1969           <d iv class=" block_head ">Edit Eve nt</div>   1972           <d iv class=" block_head ">Edit Eve nt</div>
1970           <d iv class=" block_oute r">   1973           <d iv class=" block_oute r">
1971                <div cla ss="block_ inner">   1974                <div cla ss="block_ inner">
1972     1975  
1973   <center>   1976   <center>
1974     1977  
1975   <?   1978   <?
1976       if ( i sset( $_RE QUEST['eve nt_id'] )  )   1979       if ( i sset( $_RE QUEST['eve nt_id'] )  )
1977       {   1980       {
1978           $e vent_id =  (int)$_REQ UEST['even t_id'];   1981           $e vent_id =  (int)$_REQ UEST['even t_id'];
1979           $e vent_res =  db_res( " SELECT `ID `, `Title` , `Descrip tion`, `St atus`, `St atusMessag e`, `Count ry`, `City `, `Place` , `PhotoFi lename`, ` EventStart `, `EventE nd`, `Tick etSaleStar t`, `Ticke tSaleEnd`,  `Responsi bleName`,  `Responsib leEmail`,  `Responsib lePhone`,  `EventSexF ilter`, `E ventAgeLow erFilter`,  `EventAge UpperFilte r`, `Event Membership Filter`, ` TicketCoun tFemale`,  `TicketCou ntMale`, ` TicketPric eFemale`,  `TicketPri ceMale`, ` ChoosePeri od`, `Allo wViewParti cipants` F ROM `SDati ngEvents`  WHERE `ID`  = $event_ id" );   1982           $e vent_res =  db_res( " SELECT `ID `, `Title` , `Descrip tion`, `St atus`, `St atusMessag e`, `Count ry`, `City `, `Place` , `PhotoFi lename`, ` EventStart `, `EventE nd`, `Tick etSaleStar t`, `Ticke tSaleEnd`,  `Responsi bleName`,  `Responsib leEmail`,  `Responsib lePhone`,  `EventSexF ilter`, `E ventAgeLow erFilter`,  `EventAge UpperFilte r`, `Event Membership Filter`, ` TicketCoun tFemale`,  `TicketCou ntMale`, ` TicketPric eFemale`,  `TicketPri ceMale`, ` ChoosePeri od`, `Allo wViewParti cipants` F ROM `SDati ngEvents`  WHERE `ID`  = $event_ id" );
1980           $e vent_arr =  mysql_fet ch_assoc(  $event_res  );   1983           $e vent_arr =  mysql_fet ch_assoc(  $event_res  );
1981           SD ShowEditFo rm( false,  $event_ar r );   1984           SD ShowEditFo rm( false,  $event_ar r );
1982       }   1985       }
1983       else   1986       else
1984       {   1987       {
1985           SD ShowEditFo rm( true ) ;   1988           SD ShowEditFo rm( true ) ;
1986       }   1989       }
1987   ?>   1990   ?>
1988     1991  
1989   </center>   1992   </center>
1990     1993  
1991                </div>   1994                </div>
1992           </ div>   1995           </ div>
1993           <d iv class=" block_foot "></div>   1996           <d iv class=" block_foot "></div>
1994   <?   1997   <?
1995   }   1998   }
1996     1999  
1997   ?>   2000   ?>
1998   <!-- Loadi ng Calenda r JavaScri pt files - ->   2001   <!-- Loadi ng Calenda r JavaScri pt files - ->
1999       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/utils .js"></scr ipt>   2002       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/utils .js"></scr ipt>
2000       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar.js"></ script>   2003       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar.js"></ script>
2001       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar-setup. js"></scri pt>   2004       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _src/calen dar-setup. js"></scri pt>
2002     2005  
2003   <!-- Loadi ng languag e definiti on file -- >   2006   <!-- Loadi ng languag e definiti on file -- >
2004       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _lang/cale ndar-en.js "></script >   2007       <scrip t type="te xt/javascr ipt" src=" <?= $site[ 'plugins']  ?>calenda r/calendar _lang/cale ndar-en.js "></script >
2005     2008  
2006   <script ty pe="text/j avascript" >   2009   <script ty pe="text/j avascript" >
2007   //<![CDATA [   2010   //<![CDATA [
2008         Zapa tec.Calend ar.setup({   2011         Zapa tec.Calend ar.setup({
2009           fi rstDay           : 1,   2012           fi rstDay           : 1,
2010           we ekNumbers        : tr ue,   2013           we ekNumbers        : tr ue,
2011           sh owOthers         : tr ue,   2014           sh owOthers         : tr ue,
2012           sh owsTime          : tr ue,   2015           sh owsTime          : tr ue,
2013           ti meFormat         : "2 4",   2016           ti meFormat         : "2 4",
2014           st ep               : 2,   2017           st ep               : 2,
2015           ra nge              : [1 900.01, 20 99.12],   2018           ra nge              : [1 900.01, 20 99.12],
2016           el ectric           : fa lse,   2019           el ectric           : fa lse,
2017           si ngleClick        : tr ue,   2020           si ngleClick        : tr ue,
2018           in putField         : "s how_events _between1_ id",   2021           in putField         : "s how_events _between1_ id",
2019           bu tton             : "s how_events _between1_ choose_id" ,   2022           bu tton             : "s how_events _between1_ choose_id" ,
2020           if Format           : "% Y-%m-%d %H :%M:%S",   2023           if Format           : "% Y-%m-%d %H :%M:%S",
2021           da Format           : "% Y/%m/%d",   2024           da Format           : "% Y/%m/%d",
2022           al ign              : "B r"   2025           al ign              : "B r"
2023         });   2026         });
2024         Zapa tec.Calend ar.setup({   2027         Zapa tec.Calend ar.setup({
2025           fi rstDay           : 1,   2028           fi rstDay           : 1,
2026           we ekNumbers        : tr ue,   2029           we ekNumbers        : tr ue,
2027           sh owOthers         : tr ue,   2030           sh owOthers         : tr ue,
2028           sh owsTime          : tr ue,   2031           sh owsTime          : tr ue,
2029           ti meFormat         : "2 4",   2032           ti meFormat         : "2 4",
2030           st ep               : 2,   2033           st ep               : 2,
2031           ra nge              : [1 900.01, 20 99.12],   2034           ra nge              : [1 900.01, 20 99.12],
2032           el ectric           : fa lse,   2035           el ectric           : fa lse,
2033           si ngleClick        : tr ue,   2036           si ngleClick        : tr ue,
2034           in putField         : "s how_events _between2_ id",   2037           in putField         : "s how_events _between2_ id",
2035           bu tton             : "s how_events _between2_ choose_id" ,   2038           bu tton             : "s how_events _between2_ choose_id" ,
2036           if Format           : "% Y-%m-%d %H :%M:%S",   2039           if Format           : "% Y-%m-%d %H :%M:%S",
2037           da Format           : "% Y/%m/%d",   2040           da Format           : "% Y/%m/%d",
2038           al ign              : "B r"   2041           al ign              : "B r"
2039         });   2042         });
2040   <?   2043   <?
2041     2044  
2042   if ( $_REQ UEST['acti on'] == 's how_edit_f orm' )   2045   if ( $_REQ UEST['acti on'] == 's how_edit_f orm' )
2043   {   2046   {
2044   ?>   2047   ?>
2045         Zapa tec.Calend ar.setup({   2048         Zapa tec.Calend ar.setup({
2046           fi rstDay           : 1,   2049           fi rstDay           : 1,
2047           we ekNumbers        : tr ue,   2050           we ekNumbers        : tr ue,
2048           sh owOthers         : tr ue,   2051           sh owOthers         : tr ue,
2049           sh owsTime          : tr ue,   2052           sh owsTime          : tr ue,
2050           ti meFormat         : "2 4",   2053           ti meFormat         : "2 4",
2051           st ep               : 2,   2054           st ep               : 2,
2052           ra nge              : [1 900.01, 20 99.12],   2055           ra nge              : [1 900.01, 20 99.12],
2053           el ectric           : fa lse,   2056           el ectric           : fa lse,
2054           si ngleClick        : tr ue,   2057           si ngleClick        : tr ue,
2055           in putField         : "e vent_start _id",   2058           in putField         : "e vent_start _id",
2056           bu tton             : "s tart_choos e_id",   2059           bu tton             : "s tart_choos e_id",
2057           if Format           : "% Y-%m-%d %H :%M:%S",   2060           if Format           : "% Y-%m-%d %H :%M:%S",
2058           da Format           : "% Y/%m/%d",   2061           da Format           : "% Y/%m/%d",
2059           al ign              : "B r"   2062           al ign              : "B r"
2060         });   2063         });
2061         Zapa tec.Calend ar.setup({   2064         Zapa tec.Calend ar.setup({
2062           fi rstDay           : 1,   2065           fi rstDay           : 1,
2063           we ekNumbers        : tr ue,   2066           we ekNumbers        : tr ue,
2064           sh owOthers         : tr ue,   2067           sh owOthers         : tr ue,
2065           sh owsTime          : tr ue,   2068           sh owsTime          : tr ue,
2066           ti meFormat         : "2 4",   2069           ti meFormat         : "2 4",
2067           st ep               : 2,   2070           st ep               : 2,
2068           ra nge              : [1 900.01, 20 99.12],   2071           ra nge              : [1 900.01, 20 99.12],
2069           el ectric           : fa lse,   2072           el ectric           : fa lse,
2070           si ngleClick        : tr ue,   2073           si ngleClick        : tr ue,
2071           in putField         : "e vent_end_i d",   2074           in putField         : "e vent_end_i d",
2072           bu tton             : "e nd_choose_ id",   2075           bu tton             : "e nd_choose_ id",
2073           if Format           : "% Y-%m-%d %H :%M:%S",   2076           if Format           : "% Y-%m-%d %H :%M:%S",
2074           da Format           : "% Y/%m/%d",   2077           da Format           : "% Y/%m/%d",
2075           al ign              : "B r"   2078           al ign              : "B r"
2076         });   2079         });
2077         Zapa tec.Calend ar.setup({   2080         Zapa tec.Calend ar.setup({
2078           fi rstDay           : 1,   2081           fi rstDay           : 1,
2079           we ekNumbers        : tr ue,   2082           we ekNumbers        : tr ue,
2080           sh owOthers         : tr ue,   2083           sh owOthers         : tr ue,
2081           sh owsTime          : tr ue,   2084           sh owsTime          : tr ue,
2082           ti meFormat         : "2 4",   2085           ti meFormat         : "2 4",
2083           st ep               : 2,   2086           st ep               : 2,
2084           ra nge              : [1 900.01, 20 99.12],   2087           ra nge              : [1 900.01, 20 99.12],
2085           el ectric           : fa lse,   2088           el ectric           : fa lse,
2086           si ngleClick        : tr ue,   2089           si ngleClick        : tr ue,
2087           in putField         : "e vent_sale_ start_id",   2090           in putField         : "e vent_sale_ start_id",
2088           bu tton             : "s ale_start_ choose_id" ,   2091           bu tton             : "s ale_start_ choose_id" ,
2089           if Format           : "% Y-%m-%d %H :%M:%S",   2092           if Format           : "% Y-%m-%d %H :%M:%S",
2090           da Format           : "% Y/%m/%d",   2093           da Format           : "% Y/%m/%d",
2091           al ign              : "B r"   2094           al ign              : "B r"
2092         });   2095         });
2093         Zapa tec.Calend ar.setup({   2096         Zapa tec.Calend ar.setup({
2094           fi rstDay           : 1,   2097           fi rstDay           : 1,
2095           we ekNumbers        : tr ue,   2098           we ekNumbers        : tr ue,
2096           sh owOthers         : tr ue,   2099           sh owOthers         : tr ue,
2097           sh owsTime          : tr ue,   2100           sh owsTime          : tr ue,
2098           ti meFormat         : "2 4",   2101           ti meFormat         : "2 4",
2099           st ep               : 2,   2102           st ep               : 2,
2100           ra nge              : [1 900.01, 20 99.12],   2103           ra nge              : [1 900.01, 20 99.12],
2101           el ectric           : fa lse,   2104           el ectric           : fa lse,
2102           si ngleClick        : tr ue,   2105           si ngleClick        : tr ue,
2103           in putField         : "e vent_sale_ end_id",   2106           in putField         : "e vent_sale_ end_id",
2104           bu tton             : "s ale_end_ch oose_id",   2107           bu tton             : "s ale_end_ch oose_id",
2105           if Format           : "% Y-%m-%d %H :%M:%S",   2108           if Format           : "% Y-%m-%d %H :%M:%S",
2106           da Format           : "% Y/%m/%d",   2109           da Format           : "% Y/%m/%d",
2107           al ign              : "B r"   2110           al ign              : "B r"
2108         });   2111         });
2109   <?   2112   <?
2110   }   2113   }
2111   ?>   2114   ?>
2112   //]]>   2115   //]]>
2113   </script>   2116   </script>
2114   <?   2117   <?
2115   BottomCode ();   2118   BottomCode ();
2116   ?>   2119   ?>