78. File Comparison Report

Produced on Mon May 12 13:04:42 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.

78.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin sdating_admin.php Wed Oct 17 08:48:24 2007 UTC
2 Dolphin-v.6.1.0\admin sdating_admin.php Sat Apr 19 12:05:02 2008 UTC

78.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 10 4214
Changed 9 18
Inserted 0 0
Removed 0 0

78.3 Comparison options

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

78.4 Active regular expressions

No regular expressions were active.

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