59. File Comparison Report

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

59.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin notifies.php Thu Sep 20 08:58:42 2007 UTC
2 Dolphin-v.6.1.0\admin notifies.php Sat Apr 19 12:05:02 2008 UTC

59.2 Comparison summary

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

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

59.4 Active regular expressions

No regular expressions were active.

59.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     26  
27   function P rintStatus ()   27   function P rintStatus ()
28   {   28   {
29       global  $site;   29       global  $site;
30     30  
31       $queue _not_empty  = false;   31       $queue _not_empty  = false;
32     32  
33       echo "   33       echo "
34           <c enter>   34           <c enter>
35           <t able cells pacing=2 c ellpadding =2 class=t ext border =0>   35           <t able cells pacing=2 c ellpadding =2 class=t ext border =0>
36                <tr clas s=header a lign=\"cen ter\">   36                <tr clas s=header a lign=\"cen ter\">
37                    <td  colspan=3> Queue stat us:</td>   37                    <td  colspan=3> Queue stat us:</td>
38                </tr>";   38                </tr>";
39     39  
40       // Sel ect count  of emails  in queue p er one mes sage   40       // Sel ect count  of emails  in queue p er one mes sage
41       $query  = "SELECT  NotifyMsg s.ID, Noti fyMsgs.Sub j, COUNT(N otifyQueue .Email) AS  `count_pe r_msg` FRO M NotifyMs gs INNER J OIN Notify Queue ON ( NotifyQueu e.Msg = No tifyMsgs.I D) GROUP B Y NotifyMs gs.ID";   41       $query  = "SELECT  NotifyMsg s.ID, Noti fyMsgs.Sub j, COUNT(N otifyQueue .Email) AS  `count_pe r_msg` FRO M NotifyMs gs INNER J OIN Notify Queue ON ( NotifyQueu e.Msg = No tifyMsgs.I D) GROUP B Y NotifyMs gs.ID";
42       $res =  db_res($q uery);   42       $res =  db_res($q uery);
43       if ( ! mysql_num_ rows($res)  )   43       if ( ! mysql_num_ rows($res)  )
44       {   44       {
45           ec ho "   45           ec ho "
46                <tr>   46                <tr>
47                    <td  colspan=3  align=cent er><b><fon t color=re d>There ar e no email s in queue </font></b ></td>   47                    <td  colspan=3  align=cent er><b><fon t color=re d>There ar e no email s in queue </font></b ></td>
48                </tr>";   48                </tr>";
49       }   49       }
50       else   50       else
51       {   51       {
52           wh ile ($arr  = mysql_fe tch_array( $res))   52           wh ile ($arr  = mysql_fe tch_array( $res))
53           {   53           {
54                echo "   54                echo "
55                <tr clas s=table al ign=\"cent er\">   55                <tr clas s=table al ign=\"cent er\">
56                    <td> ID: <b>{$a rr['ID']}< /b> </td>   56                    <td> ID: <b>{$a rr['ID']}< /b> </td>
57                    <td  align=left >Subj: <b> {$arr['Sub j']}</b> < /td>   57                    <td  align=left >Subj: <b> {$arr['Sub j']}</b> < /td>
58                    <td>   <b>{$arr ['count_pe r_msg']} e mails</b>  </td>   58                    <td>   <b>{$arr ['count_pe r_msg']} e mails</b>  </td>
59                </tr>";   59                </tr>";
60                $queue_n ot_empty =  true;   60                $queue_n ot_empty =  true;
61           }   61           }
62       }   62       }
63       echo "   63       echo "
64           </ table>   64           </ table>
65           <h r>   65           <h r>
66           <t able cells pacing=2 c ellpadding =2 class=t ext>   66           <t able cells pacing=2 c ellpadding =2 class=t ext>
67                <tr clas s=header>   67                <tr clas s=header>
68                    <td  colspan=3  align=\"ce nter\">Cup id mails s tatus:</td >   68                    <td  colspan=3  align=\"ce nter\">Cup id mails s tatus:</td >
69                </tr>";   69                </tr>";
70     70  
71       // Sel ect count  of message s in queue  for cupid  mails   71       // Sel ect count  of message s in queue  for cupid  mails
72       $arr_c ount = db_ arr("SELEC T COUNT(*)  `count` F ROM `Notif yQueue` WH ERE `From`  = 'Profil esMsgText' ");   72       $arr_c ount = db_ arr("SELEC T COUNT(*)  `count` F ROM `Notif yQueue` WH ERE `From`  = 'Profil esMsgText' ");
73       $numro ws = $arr_ count['cou nt'];   73       $numro ws = $arr_ count['cou nt'];
74       if ( ! $numrows )   74       if ( ! $numrows )
75       {   75       {
76           ec ho "   76           ec ho "
77                <tr>   77                <tr>
78                    <td  colspan=3  align=cent er><b><fon t color=re d>There ar e no email s in queue </font></b ></td>   78                    <td  colspan=3  align=cent er><b><fon t color=re d>There ar e no email s in queue </font></b ></td>
79                </tr>";   79                </tr>";
80       }   80       }
81       else   81       else
82       {   82       {
83           ec ho "   83           ec ho "
84                <tr clas s=table>   84                <tr clas s=table>
85                    <td> </td>   85                    <td> </td>
86                    <td  align=\"ce nter\"><b> {$numrows}  emails</b ></td>   86                    <td  align=\"ce nter\"><b> {$numrows}  emails</b ></td>
87                    <td> </td>   87                    <td> </td>
88                </tr>";   88                </tr>";
89           $q ueue_not_e mpty = tru e;   89           $q ueue_not_e mpty = tru e;
90       }   90       }
91       echo "   91       echo "
92           </ table>   92           </ table>
93           <h r>";   93           <h r>";
94     94  
95       // If  queue is n ot empty t hen show l ink to cle ar it   95       // If  queue is n ot empty t hen show l ink to cle ar it
96       if ( $ queue_not_ empty )   96       if ( $ queue_not_ empty )
97       {   97       {
98           ec ho "   98           ec ho "
99           <t able class =\"text\"  width=\"50 %\" style= \"height:  30px;\">   99           <t able class =\"text\"  width=\"50 %\" style= \"height:  30px;\">
100                <tr clas s=\"table\ ">   100                <tr clas s=\"table\ ">
101                    <td  align=\"ce nter\" col span=\"3\" >   101                    <td  align=\"ce nter\" col span=\"3\" >
102                         <a href=\" {$site['ur l_admin']} notifies.p hp?action= empty\">Em pty Queue< /a>   102                         <a href=\" {$site['ur l_admin']} notifies.p hp?action= empty\">Em pty Queue< /a>
103                    </td >   103                    </td >
104                </tr>   104                </tr>
105           </ table>   105           </ table>
106           <h r>";   106           <h r>";
107       }   107       }
108     108  
109       echo "   109       echo "
110           </ center>";   110           </ center>";
111   }   111   }
112     112  
113   function Q ueueMessag e()   113   function Q ueueMessag e()
114   {   114   {
115       $msg_i d = (int)$ _POST['msg s_id'];   115       $msg_i d = (int)$ _POST['msg s_id'];
116       $ret =  "";   116       $ret =  "";
117     117  
118       $query  = "SELECT  `ID` FROM  `NotifyMs gs` WHERE  `ID` = $ms g_id";   118       $query  = "SELECT  `ID` FROM  `NotifyMs gs` WHERE  `ID` = $ms g_id";
119       $arr_a rr = db_ar r( $query  );   119       $arr_a rr = db_ar r( $query  );
120       if ( ! $arr_arr )   120       if ( ! $arr_arr )
121       {   121       {
122           re turn "Fail ed to queu e emails ( ID: {$msg_ id}).";   122           re turn "Fail ed to queu e emails ( ID: {$msg_ id}).";
123       }   123       }
124     124  
125       // Ini tially no  emails que ued   125       // Ini tially no  emails que ued
126       $email s = 0;   126       $email s = 0;
127     127  
128       // Sen d to all e mails in N otifyEmail s table   128       // Sen d to all e mails in N otifyEmail s table
129       if ( $ _POST['sen d_to_subsc ribers'] = = 'on' )   129       if ( $ _POST['sen d_to_subsc ribers'] = = 'on' )
130       {   130       {
131           $r es_eml = d b_res( "SE LECT `ID`  FROM `Noti fyEmails`"  );   131           $r es_eml = d b_res( "SE LECT `ID`  FROM `Noti fyEmails`"  );
132           wh ile ($arr_ eml = mysq l_fetch_ar ray($res_e ml))   132           wh ile ($arr_ eml = mysq l_fetch_ar ray($res_e ml))
133           {   133           {
134                $res = d b_res("SEL ECT `Notif yEmails`.` Email` FRO M `NotifyQ ueue` INNE R JOIN `No tifyEmails ` ON (`Not ifyQueue`. `Email` =  `NotifyEma ils`.`ID`)  WHERE `No tifyQueue` .`Email` =  {$arr_eml ['ID']} AN D `NotifyQ ueue`.`Msg ` = $msg_i d AND `Fro m` = 'Noti fyEmails'" );   134                $res = d b_res("SEL ECT `Notif yEmails`.` Email` FRO M `NotifyQ ueue` INNE R JOIN `No tifyEmails ` ON (`Not ifyQueue`. `Email` =  `NotifyEma ils`.`ID`)  WHERE `No tifyQueue` .`Email` =  {$arr_eml ['ID']} AN D `NotifyQ ueue`.`Msg ` = $msg_i d AND `Fro m` = 'Noti fyEmails'" );
135                if ( $re s && ($arr  = mysql_f etch_array ($res)) )   135                if ( $re s && ($arr  = mysql_f etch_array ($res)) )
136                {   136                {
137                    $ret  .= "Email (notify) < b><u>{$arr ['Email']} </u></b> a lready exi sts in que ue.<br>";   137                    $ret  .= "Email (notify) < b><u>{$arr ['Email']} </u></b> a lready exi sts in que ue.<br>";
138                    cont inue;   138                    cont inue;
139                }   139                }
140     140  
141                $res = d b_res("INS ERT INTO ` NotifyQueu e` SET `Em ail` = {$a rr_eml['ID ']}, `Msg`  = $msg_id , `From` =  'NotifyEm ails', `Cr eation` =  NOW()");   141                $res = d b_res("INS ERT INTO ` NotifyQueu e` SET `Em ail` = {$a rr_eml['ID ']}, `Msg`  = $msg_id , `From` =  'NotifyEm ails', `Cr eation` =  NOW()");
142                if ( !$r es )   142                if ( !$r es )
143                {   143                {
144                    $ret  .= "Email  <b><u>{$a rr['Email' ]}</u></b>  was not a dded to qu eue.<br>";   144                    $ret  .= "Email  <b><u>{$a rr['Email' ]}</u></b>  was not a dded to qu eue.<br>";
145                    cont inue;   145                    cont inue;
146                }   146                }
147     147  
148                $emails+ +;   148                $emails+ +;
149           }   149           }
150       }   150       }
151     151  
152       // Sen d to all p rofiles   152       // Sen d to all p rofiles
153       if ( $ _POST['sen d_to_membe rs'] == 'o n' )   153       if ( $ _POST['sen d_to_membe rs'] == 'o n' )
154       {   154       {
155           //  Sex filte r   155           //  Sex filte r
156           $a pply_filte r = false;   156           $a pply_filte r = false;
157           $a rrpd = db_ arr( "SELE CT `extra`  FROM `Pro filesDesc`  WHERE `na me` = 'Sex '" );   157  
        
158           $v als = preg _split ("/ [,\']+/",  $arrpd['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );   158           $v als = getF ieldValues ( 'Sex' );
159           fo reach ( $v als as $v  )   159  
        
160            {   160           fo reach ( $v als as $v  ) {
161                if ( !is set($_POST ["sex_{$v} "]) || $_P OST["sex_{ $v}"] != ' on' )   161                if ( !is set($_POST ["sex_{$v} "]) || $_P OST["sex_{ $v}"] != ' on' ) {
162                 {    
163                    $app ly_filter  = true;   162                    $app ly_filter  = true;
164                    brea k;   163                    brea k;
165                }   164                }
166           }   165           }
167           if  ( $apply_ filter )   166  
        
168            {   167           if  ( $apply_ filter ) {
169                $sex_str ing_buffer  = "'-1'";   168                $sex_str ing_buffer  = "'-1'";
170                 foreach   (   $vals   as   $v  
)
  169                 foreach   (   $vals   as   $v   =>   $lang_val   )   {
171                {    
172                    if (  isset($_P OST["sex_{ $v}"]) &&  $_POST["se x_{$v}"] = = 'on' )   170                    if (  isset($_P OST["sex_{ $v}"]) &&  $_POST["se x_{$v}"] = = 'on' )
173                         $sex_strin g_buffer . = ",'{$v}' ";   171                         $sex_strin g_buffer . = ",'{$v}' ";
174                }   172                }
175           }   173           }
176           el se   174           el se
177           {   175           {
178                $sex_fil ter_sql =  '';   176                $sex_fil ter_sql =  '';
179           }   177           }
180     178  
181           //  Age filte r   179           //  Age filte r
182           $a ge_start =  (int)$_PO ST['age_st art'];   180           $a ge_start =  (int)$_PO ST['age_st art'];
183           $a ge_end = ( int)$_POST ['age_end' ];   181           $a ge_end = ( int)$_POST ['age_end' ];
184           if  ( $age_st art && $ag e_end )   182           if  ( $age_st art && $ag e_end )
185           {   183           {
186                $date_st art = (int )( date( " Y" ) - $ag e_start );   184                $date_st art = (int )( date( " Y" ) - $ag e_start );
187                $date_en d = (int)(  date( "Y"  ) - $age_ end - 1 );   185                $date_en d = (int)(  date( "Y"  ) - $age_ end - 1 );
188                $date_st art = $dat e_start .  date( "-m- d" );   186                $date_st art = $dat e_start .  date( "-m- d" );
189                $date_en d = $date_ end . date ( "-m-d" ) ;   187                $date_en d = $date_ end . date ( "-m-d" ) ;
190                $age_fil ter_sql =  "AND (TO_D AYS(`DateO fBirth`) B ETWEEN TO_ DAYS('{$da te_end}')  AND (TO_DA YS('{$date _start}')+ 1))";   188                $age_fil ter_sql =  "AND (TO_D AYS(`DateO fBirth`) B ETWEEN TO_ DAYS('{$da te_end}')  AND (TO_DA YS('{$date _start}')+ 1))";
191           }   189           }
192           el se   190           el se
193           {   191           {
194                $age_fil ter_sql =  '';   192                $age_fil ter_sql =  '';
195           }   193           }
196     194  
197           //  Country f ilter   195           //  Country f ilter
198           if  ( $_POST[ 'country']  != 'all'  )   196           if  ( $_POST[ 'country']  != 'all'  )
199           {   197           {
200                $country  = process _db_input( $_POST['co untry']);   198                $country  = process _db_input( $_POST['co untry']);
201                $country _filter_sq l = "AND ` Country` =  '{$countr y}'";   199                $country _filter_sq l = "AND ` Country` =  '{$countr y}'";
202           }   200           }
203           el se   201           el se
204           {   202           {
205                $country _filter_sq l = '';   203                $country _filter_sq l = '';
206           }   204           }
207     205  
208           //  Membershi p filter   206           //  Membershi p filter
209           if  ( $_POST[ 'membershi p'] != 'al l' )   207           if  ( $_POST[ 'membershi p'] != 'al l' )
210           {   208           {
211                $members hipID = (i nt)$_POST[ 'membershi p'];   209                $members hipID = (i nt)$_POST[ 'membershi p'];
212           }   210           }
213           el se   211           el se
214           {   212           {
215                $members hipID = -1 ;   213                $members hipID = -1 ;
216           }   214           }
217     215  
218           $r es_eml = d b_res("SEL ECT `ID` F ROM `Profi les` WHERE  `Status`  <> 'Unconf irmed' AND  `EmailNot ify` = 'No tifyMe' $s ex_filter_ sql $age_f ilter_sql  $country_f ilter_sql" );   216           $r es_eml = d b_res("SEL ECT `ID` F ROM `Profi les` WHERE  `Status`  <> 'Unconf irmed' AND  `EmailNot ify` = 'No tifyMe' $s ex_filter_ sql $age_f ilter_sql  $country_f ilter_sql" );
219           wh ile ($arr_ eml = mysq l_fetch_ar ray($res_e ml))   217           wh ile ($arr_ eml = mysq l_fetch_ar ray($res_e ml))
220           {   218           {
221                // Dynam ic members hip filter   219                // Dynam ic members hip filter
222                $members hip_info =  getMember Membership Info($arr_ eml['ID']) ;   220                $members hip_info =  getMember Membership Info($arr_ eml['ID']) ;
223                if ( $me mbershipID  != -1 &&  $membershi p_info['ID '] != $mem bershipID  )   221                if ( $me mbershipID  != -1 &&  $membershi p_info['ID '] != $mem bershipID  )
224                    cont inue;   222                    cont inue;
225     223  
226                $res = d b_res("SEL ECT `Profi les`.`Emai l` FROM `N otifyQueue ` INNER JO IN `Profil es` ON (`N otifyQueue `.`Email`  = `Profile s`.`ID`) W HERE `Noti fyQueue`.` Email` = { $arr_eml[' ID']} AND  `NotifyQue ue`.`Msg`  = $msg_id   AND `From ` = 'Profi les' ");   224                $res = d b_res("SEL ECT `Profi les`.`Emai l` FROM `N otifyQueue ` INNER JO IN `Profil es` ON (`N otifyQueue `.`Email`  = `Profile s`.`ID`) W HERE `Noti fyQueue`.` Email` = { $arr_eml[' ID']} AND  `NotifyQue ue`.`Msg`  = $msg_id   AND `From ` = 'Profi les' ");
227                if ( $re s && ($arr  = mysql_f etch_array ($res)) )   225                if ( $re s && ($arr  = mysql_f etch_array ($res)) )
228                {   226                {
229                    $ret  .= "Email (profiles)  <b><u>{$a rr['Email' ]}</u></b>  already e xists in q ueue.<br>" ;   227                    $ret  .= "Email (profiles)  <b><u>{$a rr['Email' ]}</u></b>  already e xists in q ueue.<br>" ;
230                    cont inue;   228                    cont inue;
231                }   229                }
232     230  
233                $res = d b_res("INS ERT INTO ` NotifyQueu e` SET `Em ail` = {$a rr_eml['ID ']}, `Msg`  = $msg_id , `From` =  'Profiles ', `Creati on` = NOW( )");   231                $res = d b_res("INS ERT INTO ` NotifyQueu e` SET `Em ail` = {$a rr_eml['ID ']}, `Msg`  = $msg_id , `From` =  'Profiles ', `Creati on` = NOW( )");
234                if ( !$r es )   232                if ( !$r es )
235                {   233                {
236                    $ret  .= "Email  <b><u>{$a rr['Email' ]}</u></b>  was not a dded to qu eue.<br>";   234                    $ret  .= "Email  <b><u>{$a rr['Email' ]}</u></b>  was not a dded to qu eue.<br>";
237                    cont inue;   235                    cont inue;
238                }   236                }
239     237  
240                $emails+ +;   238                $emails+ +;
241           }   239           }
242       }   240       }
243     241  
244       $ret . = (int)$em ails." ema ils was su ccessfully  added to  queue.";   242       $ret . = (int)$em ails." ema ils was su ccessfully  added to  queue.";
245       return  $ret;   243       return  $ret;
246   }   244   }
247     245  
248     246  
249   function A ddMessage( )   247   function A ddMessage( )
250   {   248   {
251       $query  = "INSERT  INTO `Not ifyMsgs` S ET `Subj`  = '". proc ess_db_inp ut($_POST[ 'subj']) . "', `Text`  = '". pro cess_db_in put(html2t xt($_POST[ 'body_html '])) ."',` HTML` = '" . process_ db_input($ _POST['bod y_html'])  ."'";   249       $query  = "INSERT  INTO `Not ifyMsgs` S ET `Subj`  = '". proc ess_db_inp ut($_POST[ 'subj']) . "', `Text`  = '". pro cess_db_in put(html2t xt($_POST[ 'body_html '])) ."',` HTML` = '" . process_ db_input($ _POST['bod y_html'])  ."'";
252     250  
253       $res =  db_res( $ query );   251       $res =  db_res( $ query );
254       if ( $ res )   252       if ( $ res )
255           $_ POST['msgs _id'] = my sql_insert _id();   253           $_ POST['msgs _id'] = my sql_insert _id();
256     254  
257       return  $res;   255       return  $res;
258   }   256   }
259     257  
260   function U pdateMessa ge()   258   function U pdateMessa ge()
261   {   259   {
262       $query  = "UPDATE  `NotifyMs gs` SET `S ubj` = '".  process_d b_input($_ POST['subj ']) ."', ` Text` = '" . process_ db_input(h tml2txt($_ POST['body _html']))  ."', `HTML ` = '". pr ocess_db_i nput($_POS T['body_ht ml']) ."'  WHERE ID =  '". (int) $_POST['ms gs_id'] ." '";   260       $query  = "UPDATE  `NotifyMs gs` SET `S ubj` = '".  process_d b_input($_ POST['subj ']) ."', ` Text` = '" . process_ db_input(h tml2txt($_ POST['body _html']))  ."', `HTML ` = '". pr ocess_db_i nput($_POS T['body_ht ml']) ."'  WHERE ID =  '". (int) $_POST['ms gs_id'] ." '";
263     261  
264       $res =  db_res( $ query );   262       $res =  db_res( $ query );
265     263  
266       return  $res;   264       return  $res;
267   }   265   }
268     266  
269   function P reviewMess age()   267   function P reviewMess age()
270   {   268   {
271       global  $site;   269       global  $site;
272     270  
273       $body_ html = pro cess_pass_ data( $_PO ST['body_h tml'] );   271       $body_ html = pro cess_pass_ data( $_PO ST['body_h tml'] );
274     272  
275       Conten tBlockHead ("Preview" );   273       Conten tBlockHead ("Preview" );
276   ?>   274   ?>
277           <c enter>   275           <c enter>
278                <iframe  id="IFrame Preview" n ame="IFram ePreview"  frameborde r="1" scro lling="yes " height=" 200" width ="500" src ="<?= $sit e['url_adm in'] ?>not ify_previe w.php">   276                <iframe  id="IFrame Preview" n ame="IFram ePreview"  frameborde r="1" scro lling="yes " height=" 200" width ="500" src ="<?= $sit e['url_adm in'] ?>not ify_previe w.php">
279                </iframe >   277                </iframe >
280           </ center>   278           </ center>
281     279  
282           <f orm name=" form_previ ew" action ="<?= $sit e['url_adm in'] ?>not ify_previe w.php" met hod="POST"  target="I FramePrevi ew">   280           <f orm name=" form_previ ew" action ="<?= $sit e['url_adm in'] ?>not ify_previe w.php" met hod="POST"  target="I FramePrevi ew">
283                <input t ype="hidde n" name="p ost_data"  value="<?=  htmlspeci alchars($b ody_html)  ?>">   281                <input t ype="hidde n" name="p ost_data"  value="<?=  htmlspeci alchars($b ody_html)  ?>">
284           </ form>   282           </ form>
285     283  
286           <s cript lang uage="Java Script">   284           <s cript lang uage="Java Script">
287                <!--   285                <!--
288                document .forms['fo rm_preview '].submit( );   286                document .forms['fo rm_preview '].submit( );
289                -->   287                -->
290           </ script>   288           </ script>
291   <?   289   <?
292       Conten tBlockFoot ();   290       Conten tBlockFoot ();
293   }   291   }
294     292  
295   function D eleteMessa ge()   293   function D eleteMessa ge()
296   {   294   {
297       $query  = "DELETE  FROM `Not ifyMsgs` W HERE `ID`  = ". (int) $_POST['ms gs_id'];   295       $query  = "DELETE  FROM `Not ifyMsgs` W HERE `ID`  = ". (int) $_POST['ms gs_id'];
298       if ( ! ($res = db _res( $que ry )) )   296       if ( ! ($res = db _res( $que ry )) )
299           re turn $res;   297           re turn $res;
300     298  
301       $_POST ['msgs_id' ] = 0;   299       $_POST ['msgs_id' ] = 0;
302     300  
303       $query  = "DELETE  FROM `Not ifyQueue`  WHERE `Msg ` = ". (in t)$_POST[' msgs_id'];   301       $query  = "DELETE  FROM `Not ifyQueue`  WHERE `Msg ` = ". (in t)$_POST[' msgs_id'];
304       $res =  db_res( $ query );   302       $res =  db_res( $ query );
305     303  
306       return  $res;   304       return  $res;
307   }   305   }
308     306  
309   function E mptyQueue( )   307   function E mptyQueue( )
310   {   308   {
311       return  db_res("T RUNCATE TA BLE `Notif yQueue`");   309       return  db_res("T RUNCATE TA BLE `Notif yQueue`");
312   }   310   }
313     311  
314   $logged['a dmin']   =   member_aut h(   1  
);
  312   $logged['a dmin']   =   member_aut h(   1 ,   true,   true   );
315     313  
316   $_page['he ader'] = " Notify Let ter";   314   $_page['he ader'] = " Notify Let ter";
317   $_page['he ader_text' ] = "Send  Notify let ters";   315   $_page['he ader_text' ] = "Send  Notify let ters";
318     316  
319   TopCodeAdm in();   317   TopCodeAdm in();
320     318  
321   ContentBlo ckHead("Ma ss Mailer  Status");   319   ContentBlo ckHead("Ma ss Mailer  Status");
322     320  
323   if ( $_POS T['queue_m essage'] )   321   if ( $_POS T['queue_m essage'] )
324       $actio n = 'queue ';   322       $actio n = 'queue ';
325   if ( $_POS T['add_mes sage'] )   323   if ( $_POS T['add_mes sage'] )
326       $actio n = 'add';   324       $actio n = 'add';
327   if ( $_POS T['update_ message']  )   325   if ( $_POS T['update_ message']  )
328       $actio n = 'updat e';   326       $actio n = 'updat e';
329   if ( $_POS T['delete_ message']  )   327   if ( $_POS T['delete_ message']  )
330       $actio n = 'delet e';   328       $actio n = 'delet e';
331   if ( $_POS T['preview _message']  )   329   if ( $_POS T['preview _message']  )
332       $actio n = 'previ ew';   330       $actio n = 'previ ew';
333   if ( $_REQ UEST['acti on'] == 'e mpty' )   331   if ( $_REQ UEST['acti on'] == 'e mpty' )
334       $actio n = 'empty ';   332       $actio n = 'empty ';
335     333  
336   // demo mo de check o mmited her e on purpo se   334   // demo mo de check o mmited her e on purpo se
337   if ( $acti on == 'add ' && strle n($_POST[' body_html' ]) )   335   if ( $acti on == 'add ' && strle n($_POST[' body_html' ]) )
338   {   336   {
339       if ( A ddMessage( ) )   337       if ( A ddMessage( ) )
340           $a ction_resu lt .= "Mes sage was a dded.<br>" ;   338           $a ction_resu lt .= "Mes sage was a dded.<br>" ;
341       else   339       else
342           $a ction_resu lt .= "Mes sage was n ot added.< br>";   340           $a ction_resu lt .= "Mes sage was n ot added.< br>";
343   }   341   }
344     342  
345   if ( !$dem o_mode &&  $action ==  'update'  && $_POST[ 'msgs_id']  && strlen ($_POST['b ody_html'] ) )   343   if ( !$dem o_mode &&  $action ==  'update'  && $_POST[ 'msgs_id']  && strlen ($_POST['b ody_html'] ) )
346   {   344   {
347       if ( U pdateMessa ge() )   345       if ( U pdateMessa ge() )
348           $a ction_resu lt .= "Mes sage was u pdated.<br >";   346           $a ction_resu lt .= "Mes sage was u pdated.<br >";
349       else   347       else
350           $a ction_resu lt .= "Mes sage was n ot updated .<br>";   348           $a ction_resu lt .= "Mes sage was n ot updated .<br>";
351   }   349   }
352     350  
353   if ( !$dem o_mode &&  $action ==  'delete'  && $_POST[ 'msgs_id']  )   351   if ( !$dem o_mode &&  $action ==  'delete'  && $_POST[ 'msgs_id']  )
354   {   352   {
355       if ( D eleteMessa ge() )   353       if ( D eleteMessa ge() )
356           $a ction_resu lt .= "Mes sage was d eleted.<br >";   354           $a ction_resu lt .= "Mes sage was d eleted.<br >";
357       else   355       else
358           $a ction_resu lt .= "Mes sage was n ot deleted .<br>";   356           $a ction_resu lt .= "Mes sage was n ot deleted .<br>";
359   }   357   }
360     358  
361   if ( !$dem o_mode &&  $action ==  'empty' )   359   if ( !$dem o_mode &&  $action ==  'empty' )
362   {   360   {
363       if ( E mptyQueue( ) )   361       if ( E mptyQueue( ) )
364           $a ction_resu lt .= "Que ue empty.< br>";   362           $a ction_resu lt .= "Que ue empty.< br>";
365       else   363       else
366           $a ction_resu lt .= "Que ue emptyin g failed.< br>";   364           $a ction_resu lt .= "Que ue emptyin g failed.< br>";
367   }   365   }
368     366  
369   if ( !$dem o_mode &&  $action ==  'queue' & & $_POST[' msgs_id']  )   367   if ( !$dem o_mode &&  $action ==  'queue' & & $_POST[' msgs_id']  )
370   {   368   {
371       $actio n_result . = QueueMes sage();   369       $actio n_result . = QueueMes sage();
372   }   370   }
373     371  
374   if ( strle n($action_ result) )   372   if ( strle n($action_ result) )
375       echo " <br><cente r><div cla ss=\"err\" >$action_r esult</div ></center> <br>\n";   373       echo " <br><cente r><div cla ss=\"err\" >$action_r esult</div ></center> <br>\n";
376     374  
377   PrintStatu s();   375   PrintStatu s();
378     376  
379   // Print c ombobox wi th all mes sages   377   // Print c ombobox wi th all mes sages
380   ?>   378   ?>
381       <form  name="form _messages"  method="P OST" actio n="<?= $_S ERVER['PHP _SELF'] ?> ">   379       <form  name="form _messages"  method="P OST" actio n="<?= $_S ERVER['PHP _SELF'] ?> ">
382           <i nput type= "hidden" n ame="actio n" value=" view">   380           <i nput type= "hidden" n ame="actio n" value=" view">
383           <c enter clas s="text">M essages:&n bsp;   381           <c enter clas s="text">M essages:&n bsp;
384                <select  name=msgs_ id onChang e="javascr ipt: docum ent.forms[ 'form_mess ages'].sub mit();">   382                <select  name=msgs_ id onChang e="javascr ipt: docum ent.forms[ 'form_mess ages'].sub mit();">
385                    <opt ion value= 0>NONE</op tion>   383                    <opt ion value= 0>NONE</op tion>
386   <?   384   <?
387     385  
388   $res_msgs  = db_res(" SELECT `ID `, `Subj`,  `Text`, ` HTML`, (`I D` = ". (i nt)$_POST[ 'msgs_id']  ." OR `Su bj` = '".  process_db _input($_P OST['subj' ]) ."' ) A S `Selecte d` FROM `N otifyMsgs` ");   386   $res_msgs  = db_res(" SELECT `ID `, `Subj`,  `Text`, ` HTML`, (`I D` = ". (i nt)$_POST[ 'msgs_id']  ." OR `Su bj` = '".  process_db _input($_P OST['subj' ]) ."' ) A S `Selecte d` FROM `N otifyMsgs` ");
389   while ( $a rr_msgs =  mysql_fetc h_array($r es_msgs) )   387   while ( $a rr_msgs =  mysql_fetc h_array($r es_msgs) )
390   {   388   {
391       $sel =  ($arr_msg s['Selecte d'] ? "sel ected" : " ");   389       $sel =  ($arr_msg s['Selecte d'] ? "sel ected" : " ");
392       echo "   390       echo "
393                    <opt ion value= \"{$arr_ms gs['ID']}\ " $sel>{$a rr_msgs['S ubj']}</op tion>";   391                    <opt ion value= \"{$arr_ms gs['ID']}\ " $sel>{$a rr_msgs['S ubj']}</op tion>";
394   }   392   }
395     393  
396   ?>   394   ?>
397                </select >   395                </select >
398           </ center>   396           </ center>
399       </form >   397       </form >
400     398  
401   <?   399   <?
402   ContentBlo ckFoot();   400   ContentBlo ckFoot();
403   ContentBlo ckHead( "E -mail mess age" );   401   ContentBlo ckHead( "E -mail mess age" );
404     402  
405   $body_html  = "";   403   $body_html  = "";
406   $body_text  = "";   404   $body_text  = "";
407   $subject =  "";   405   $subject =  "";
408     406  
409   if ( $_POS T['body_ht ml'] && $_ POST['acti on'] != 'd elete' )   407   if ( $_POS T['body_ht ml'] && $_ POST['acti on'] != 'd elete' )
410   {   408   {
411       $body_ html = pro cess_pass_ data( $_PO ST['body_h tml'] );   409       $body_ html = pro cess_pass_ data( $_PO ST['body_h tml'] );
412       $body_ text = htm l2txt($bod y_html);   410       $body_ text = htm l2txt($bod y_html);
413       $subje ct = proce ss_pass_da ta( $_POST ['subj'] ) ;   411       $subje ct = proce ss_pass_da ta( $_POST ['subj'] ) ;
414   }   412   }
415   elseif ( $ _POST['msg s_id'] )   413   elseif ( $ _POST['msg s_id'] )
416   {   414   {
417       $arr =  db_arr( " SELECT * F ROM `Notif yMsgs` WHE RE `ID` =  ". (int)$_ POST['msgs _id'] );   415       $arr =  db_arr( " SELECT * F ROM `Notif yMsgs` WHE RE `ID` =  ". (int)$_ POST['msgs _id'] );
418       $body_ html = $ar r['HTML'];   416       $body_ html = $ar r['HTML'];
419       $body_ text = $ar r['Text'];   417       $body_ text = $ar r['Text'];
420       $subje ct = $arr[ 'Subj'];   418       $subje ct = $arr[ 'Subj'];
421   }   419   }
422     420  
423   ?>   421   ?>
424   <form acti on="<?= $_ SERVER['PH P_SELF'];  ?>" method ="POST">   422   <form acti on="<?= $_ SERVER['PH P_SELF'];  ?>" method ="POST">
425   <center>   423   <center>
426   <table cel lspacing=2  cellpaddi ng=2 class =text bord er="0">   424   <table cel lspacing=2  cellpaddi ng=2 class =text bord er="0">
427       <tr cl ass=table>   425       <tr cl ass=table>
428           <t d align="l eft">&nbsp ;E-mail su bject&nbsp ;</td>   426           <t d align="l eft">&nbsp ;E-mail su bject&nbsp ;</td>
429           <t d align="l eft"><inpu t class=no  type=text  size=60 n ame="subj"  value="<? = htmlspec ialchars($ subject) ? >"></td>   427           <t d align="l eft"><inpu t class=no  type=text  size=60 n ame="subj"  value="<? = htmlspec ialchars($ subject) ? >"></td>
430       </tr>   428       </tr>
431     429  
432       <tr cl ass=table>   430       <tr cl ass=table>
433           <t d valign=t op align=" left">&nbs p;HTML e-m ail body&n bsp;</td>   431           <t d valign=t op align=" left">&nbs p;HTML e-m ail body&n bsp;</td>
434           <t d align="l eft"><text area cols= "55" rows= "10" name= "body_html " style="t ext-align:  justify;" ><?= htmls pecialchar s($body_ht ml) ?></te xtarea></t d>   432           <t d align="l eft"><text area cols= "55" rows= "10" name= "body_html " style="t ext-align:  justify;" ><?= htmls pecialchar s($body_ht ml) ?></te xtarea></t d>
435       </tr>   433       </tr>
436   <?   434   <?
437     435  
438   if ( strle n($body_ht ml) )   436   if ( strle n($body_ht ml) )
439   {   437   {
440   ?>   438   ?>
441       <tr cl ass="table ">   439       <tr cl ass="table ">
442           <t d valign=" top" align ="left" wi dth="120"> &nbsp;Text  e-mail bo dy&nbsp;</ td>   440           <t d valign=" top" align ="left" wi dth="120"> &nbsp;Text  e-mail bo dy&nbsp;</ td>
443           <t d width="3 90" align= "justify"  style="bor der: 1px s olid #6666 66"><?= pr ocess_text _output($b ody_text)  ?></td>   441           <t d width="3 90" align= "justify"  style="bor der: 1px s olid #6666 66"><?= pr ocess_text _output($b ody_text)  ?></td>
444       </tr>   442       </tr>
445   <?   443   <?
446   }   444   }
447     445  
448   ?>   446   ?>
449       <tr>   447       <tr>
450           <t d colspan= "2">&nbsp; </td>   448           <t d colspan= "2">&nbsp; </td>
451       </tr>   449       </tr>
452       <tr>   450       <tr>
453           <t d colspan= 2 align=ce nter>   451           <t d colspan= 2 align=ce nter>
454   <?   452   <?
455     453  
456   if ( $_POS T['msgs_id '] )   454   if ( $_POS T['msgs_id '] )
457   {   455   {
458   ?>   456   ?>
459                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="add_mes sage" valu e="Add mes sage">   457                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="add_mes sage" valu e="Add mes sage">
460                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="update_ message" v alue="Upda te message ">   458                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="update_ message" v alue="Upda te message ">
461                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="delete_ message" v alue="Dele te message ">   459                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="delete_ message" v alue="Dele te message ">
462                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="preview _message"  value="Pre view messa ge">   460                <input c lass="text " type="su bmit" styl e="width:  120px" nam e="preview _message"  value="Pre view messa ge">
463   <?   461   <?
464   }   462   }
465   else   463   else
466   {   464   {
467   ?>   465   ?>
468                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="add_mes sage" valu e="Add mes sage">   466                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="add_mes sage" valu e="Add mes sage">
469                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="preview _message"  value="Pre view messa ge">   467                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="preview _message"  value="Pre view messa ge">
470   <?   468   <?
471   }   469   }
472   ?>   470   ?>
473                <input c lass="text " type="hi dden" name ="msgs_id"  value="<? = $_POST[' msgs_id']  ?>">   471                <input c lass="text " type="hi dden" name ="msgs_id"  value="<? = $_POST[' msgs_id']  ?>">
474           </ td>   472           </ td>
475       </tr>   473       </tr>
476   </table>   474   </table>
477   </center>   475   </center>
478   </form>   476   </form>
479     477  
480   <?   478   <?
481   ContentBlo ckFoot();   479   ContentBlo ckFoot();
482     480  
483     481  
484   if ( $_POS T['msgs_id '] )   482   if ( $_POS T['msgs_id '] )
485   {   483   {
486     484  
487     485  
488   ContentBlo ckHead("Qu eue messag e");   486   ContentBlo ckHead("Qu eue messag e");
489   ?>   487   ?>
490     488  
491   <script ty pe="text/j avascript"  language= "JavaScrip t">   489   <script ty pe="text/j avascript"  language= "JavaScrip t">
492       <!--   490       <!--
493     491  
494       functi on setCont rolsState(  enabled )   492       functi on setCont rolsState(  enabled )
495       {   493       {
496           va r state_di sabled = (  enabled ?  false : t rue );   494           va r state_di sabled = (  enabled ?  false : t rue );
497   <?   495   <?
498       $arrpd  = db_arr(  "SELECT ` extra` FRO M `Profile sDesc` WHE RE `name`  = 'Sex'" ) ;   496       $sex_v als = getF ieldValues ( 'Sex' );
499       $sex_v als = preg _split ("/ [,\']+/",  $arrpd['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );   497       
500        foreach   (   $sex_vals   as   $v  
)
  498        foreach   (   $sex_vals   as   $v   =>   $lang_v   )
501       {   499       {
502           ec ho "   500           ec ho "
503           do cument.for ms['form_q ueue'].ele ments['sex _{$v}'].di sabled = s tate_disab led;";   501           do cument.for ms['form_q ueue'].ele ments['sex _{$v}'].di sabled = s tate_disab led;";
504       }   502       }
505   ?>   503   ?>
506           do cument.for ms['form_q ueue'].ele ments['age _start'].d isabled =  state_disa bled;   504           do cument.for ms['form_q ueue'].ele ments['age _start'].d isabled =  state_disa bled;
507           do cument.for ms['form_q ueue'].ele ments['age _end'].dis abled = st ate_disabl ed;   505           do cument.for ms['form_q ueue'].ele ments['age _end'].dis abled = st ate_disabl ed;
508           do cument.for ms['form_q ueue'].ele ments['cou ntry'].dis abled = st ate_disabl ed;   506           do cument.for ms['form_q ueue'].ele ments['cou ntry'].dis abled = st ate_disabl ed;
509           do cument.for ms['form_q ueue'].ele ments['mem bership']. disabled =  state_dis abled;   507           do cument.for ms['form_q ueue'].ele ments['mem bership']. disabled =  state_dis abled;
510       }   508       }
511     509  
512       -->   510       -->
513   </script>   511   </script>
514     512  
515   <form id=" form_queue " action=" <?= $_SERV ER['PHP_SE LF']; ?>"  method="po st">   513   <form id=" form_queue " action=" <?= $_SERV ER['PHP_SE LF']; ?>"  method="po st">
516   <center>   514   <center>
517   <table cel lpadding=" 0" cellspa cing="0" c lass="text " border=" 0" width=" 450">   515   <table cel lpadding=" 0" cellspa cing="0" c lass="text " border=" 0" width=" 450">
518       <tr cl ass="panel ">   516       <tr cl ass="panel ">
519           <t d align="l eft" valig n="middle"  style="pa dding: 2px ;">   517           <t d align="l eft" valig n="middle"  style="pa dding: 2px ;">
520                <input c lass="text " type="ch eckbox" na me="send_t o_subscrib ers" id="i d_subscrib ers" check ed style=" vertical-a lign: midd le;" />   518                <input c lass="text " type="ch eckbox" na me="send_t o_subscrib ers" id="i d_subscrib ers" check ed style=" vertical-a lign: midd le;" />
521                &nbsp;<l abel for=" id_subscri bers"><b>S end to sub scribers</ b></label>   519                &nbsp;<l abel for=" id_subscri bers"><b>S end to sub scribers</ b></label>
522           </ td>   520           </ td>
523       </tr>   521       </tr>
524       <tr cl ass="panel ">   522       <tr cl ass="panel ">
525           <t d align="l eft" valig n="middle"  style="pa dding: 2px ;">   523           <t d align="l eft" valig n="middle"  style="pa dding: 2px ;">
526                <input c lass="text " type="ch eckbox" na me="send_t o_members"  id="id_me mbers" che cked style ="vertical -align: mi ddle;" onc lick="java script: se tControlsS tate( this .checked ?  true : fa lse );">   524                <input c lass="text " type="ch eckbox" na me="send_t o_members"  id="id_me mbers" che cked style ="vertical -align: mi ddle;" onc lick="java script: se tControlsS tate( this .checked ?  true : fa lse );">
527                &nbsp;<l abel for=" id_members "><b>Send  to members </b></labe l>   525                &nbsp;<l abel for=" id_members "><b>Send  to members </b></labe l>
528           </ td>   526           </ td>
529       </tr>   527       </tr>
530       <tr cl ass="table ">   528       <tr cl ass="table ">
531           <t d align="l eft">   529           <t d align="l eft">
532                <table c ellpadding ="2" cells pacing="0"  class="te xt" id="me mbers_tabl e" style=" border: 1p x solid si lver;" wid th="100%">   530                <table c ellpadding ="2" cells pacing="0"  class="te xt" id="me mbers_tabl e" style=" border: 1p x solid si lver;" wid th="100%">
533                    <tr  class="tab le">   531                    <tr  class="tab le">
534                         <td align= "right" va lign="midd le">Sex:</ td>   532                         <td align= "right" va lign="midd le">Sex:</ td>
535                         <td width= "12"></td>   533                         <td width= "12"></td>
536                         <td align= "left" val ign="middl e">   534                         <td align= "left" val ign="middl e">
537   <?   535   <?
538        foreach   (   $sex_vals   as   $v  
)
  536        foreach   (   $sex_vals   as   $v   =>   $lang_v   )
539       {   537       {
540           ec ho "   538           ec ho "
541                              <input   class=\"te xt\"   type=\"che ckbox\"   name=\"sex _{$v}\"   id=\"id_se x_{$v}\"   checked=\" checked\"   style=\"ve rtical-ali gn:   middle;\"> &nbsp;<lab el   for=\"id_s ex_{$v}\"> { $
v } </label>";
  539                              <input   class=\"te xt\"   type=\"che ckbox\"   name=\"sex _{$v}\"   id=\"id_se x_{$v}\"   checked=\" checked\"   style=\"ve rtical-ali gn:   middle;\"> &nbsp;<lab el   for=\"id_s ex_{$v}\"> "   .   _t(   $ lang_ v   )   .   " </label>";
542       }   540       }
543   ?>   541   ?>
544                         </td>   542                         </td>
545                    </tr >   543                    </tr >
546                    <tr  class="tab le">   544                    <tr  class="tab le">
547                         <td align= "right" va lign="midd le">Age:</ td>   545                         <td align= "right" va lign="midd le">Age:</ td>
548                         <td width= "12"></td>   546                         <td width= "12"></td>
549                         <td align= "left" val ign="middl e">   547                         <td align= "left" val ign="middl e">
550                             from&n bsp;<selec t class="t ext" name= "age_start ">   548                             from&n bsp;<selec t class="t ext" name= "age_start ">
551   <?   549   <?
552       $gl_se arch_start _age = (in t)getParam ( 'search_ start_age'  );   550       $gl_se arch_start _age = (in t)getParam ( 'search_ start_age'  );
553       $gl_se arch_end_a ge = (int) getParam(  'search_en d_age' );   551       $gl_se arch_end_a ge = (int) getParam(  'search_en d_age' );
554       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )   552       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )
555       {   553       {
556           $s el = ($i = = $gl_sear ch_start_a ge ? 'sele cted' : '' );   554           $s el = ($i = = $gl_sear ch_start_a ge ? 'sele cted' : '' );
557           ec ho "   555           ec ho "
558                                          <opt ion value= \"$i\" $se l>$i</opti on>";   556                                          <opt ion value= \"$i\" $se l>$i</opti on>";
559       }   557       }
560   ?>   558   ?>
561                                          </se lect>   559                                          </se lect>
562                             to&nbs p;<select  class="tex t" name="a ge_end">   560                             to&nbs p;<select  class="tex t" name="a ge_end">
563   <?   561   <?
564       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )   562       for (  $i = $gl_s earch_star t_age ; $i  <= $gl_se arch_end_a ge ; $i++  )
565       {   563       {
566           $s el = ($i = = $gl_sear ch_end_age  ? 'select ed' : '');   564           $s el = ($i = = $gl_sear ch_end_age  ? 'select ed' : '');
567           ec ho "   565           ec ho "
568                                          <opt ion value= \"$i\" $se l>$i</opti on>";   566                                          <opt ion value= \"$i\" $se l>$i</opti on>";
569       }   567       }
570   ?>   568   ?>
571                             </sele ct>   569                             </sele ct>
572                         </td>   570                         </td>
573                    </tr >   571                    </tr >
574                    <tr  class="tab le">   572                    <tr  class="tab le">
575                         <td align= "right" va lign="midd le">Countr y:</td>   573                         <td align= "right" va lign="midd le">Countr y:</td>
576                         <td width= "12"></td>   574                         <td width= "12"></td>
577                         <td align= "left" val ign="middl e">   575                         <td align= "left" val ign="middl e">
578                             <selec t class="t ext" name= "country">   576                             <selec t class="t ext" name= "country">
579                                 <o ption valu e="all" se lected>All </option>   577                                 <o ption valu e="all" se lected>All </option>
580   <?   578   <?
581        foreach   (   $ p r of [' c ountr ies ']   as   $key   =>   $value   )   579        foreach   (   $ aP r eValues [' C ountr y ']   as   $key   =>   $value   )
582       {   580       {
583           ec ho "   581           ec ho "
584                                  <option   value=\"{$ key}\">".   _t( '__'. $value
)   ."</option >";
  582                                  <option   value=\"{$ key}\">".   _t(
$value ['LKey'] )   ."</option >";
585       }   583       }
586   ?>   584   ?>
587                             </sele ct>   585                             </sele ct>
588                         </td>   586                         </td>
589                    </tr >   587                    </tr >
590                    <tr  class="tab le">   588                    <tr  class="tab le">
591                         <td align= "right" va lign="midd le">Member ship level :</td>   589                         <td align= "right" va lign="midd le">Member ship level :</td>
592                         <td width= "12"></td>   590                         <td width= "12"></td>
593                         <td align= "left" val ign="middl e">   591                         <td align= "left" val ign="middl e">
594                             <selec t class="t ext" name= "membershi p">   592                             <selec t class="t ext" name= "membershi p">
595                                 <o ption valu e="all" se lected>All </option>   593                                 <o ption valu e="all" se lected>All </option>
596   <?   594   <?
597       $membe rships_arr  = getMemb erships();   595       $membe rships_arr  = getMemb erships();
598       foreac h ( $membe rships_arr  as $membe rshipID =>  $membersh ipName )   596       foreac h ( $membe rships_arr  as $membe rshipID =>  $membersh ipName )
599       {   597       {
600           if  ( $member shipID ==  MEMBERSHIP _ID_NON_ME MBER )   598           if  ( $member shipID ==  MEMBERSHIP _ID_NON_ME MBER )
601                continue ;   599                continue ;
602           ec ho "   600           ec ho "
603                                 <o ption valu e=\"{$memb ershipID}\ ">{$member shipName}< /option>";   601                                 <o ption valu e=\"{$memb ershipID}\ ">{$member shipName}< /option>";
604       }   602       }
605   ?>   603   ?>
606                             </sele ct>   604                             </sele ct>
607                         </td>   605                         </td>
608                    </tr >   606                    </tr >
609                </table>   607                </table>
610           </ td>   608           </ td>
611       </tr>   609       </tr>
612       <tr cl ass="table ">   610       <tr cl ass="table ">
613           <t d align="c enter" sty le="paddin g: 5px;">   611           <t d align="c enter" sty le="paddin g: 5px;">
614                <input c lass="text " type="hi dden" name ="msgs_id"  value="<? = $_POST[' msgs_id']  ?>">   612                <input c lass="text " type="hi dden" name ="msgs_id"  value="<? = $_POST[' msgs_id']  ?>">
615                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="queue_m essage" va lue="Queue  message">   613                <input c lass="text " type="su bmit" styl e="width:  140px" nam e="queue_m essage" va lue="Queue  message">
616           </ td>   614           </ td>
617       </tr>   615       </tr>
618   </table>   616   </table>
619   </center>   617   </center>
620   </form>   618   </form>
621     619  
622   <?   620   <?
623   ContentBlo ckFoot();   621   ContentBlo ckFoot();
624   }   622   }
625     623  
626   if ( !$dem o_mode &&  $action ==  'preview'  && strlen ($_POST['b ody_html'] ) )   624   if ( !$dem o_mode &&  $action ==  'preview'  && strlen ($_POST['b ody_html'] ) )
627   {   625   {
628       Previe wMessage() ;   626       Previe wMessage() ;
629   }   627   }
630     628  
631   BottomCode ();   629   BottomCode ();
632   ?>   630   ?>