81. File Comparison Report

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

81.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1 pedit.php Sun May 11 13:17:04 2008 UTC
2 Dolphin-v.6.1.2 pedit.php Mon Jun 2 06:48:02 2008 UTC

81.2 Comparison summary

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

81.3 Comparison options

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

81.4 Active regular expressions

No regular expressions were active.

81.5 Comparison detail

1   <?php   1   <?php
2     2  
3   require_on ce( './inc /header.in c.php' );   3   require_on ce( './inc /header.in c.php' );
4   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'admin.i nc.php' );   4   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'admin.i nc.php' );
5   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'db.inc. php' );   5   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'db.inc. php' );
6   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'match.i nc.php' );   6   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'match.i nc.php' );
7   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofileField s.php' );   7   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofileField s.php' );
8   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofilesCont roller.php ' );   8   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofilesCont roller.php ' );
9   require_on ce( BX_DIR ECTORY_PAT H_ROOT     . "templat es/tmpl_{$ tmpl}/scri pts/BxTemp lFormView. php" );   9   require_on ce( BX_DIR ECTORY_PAT H_ROOT     . "templat es/tmpl_{$ tmpl}/scri pts/BxTemp lFormView. php" );
10     10  
11   $_page['na me_index']  = 25;   11   $_page['na me_index']  = 25;
12   $_page['cs s_name']    = 'pedit. css';   12   $_page['cs s_name']    = 'pedit. css';
13   //$_page[' extra_js']    = '<scr ipt type=" text/javas cript" lan guage="Jav aScript" s rc="' . $s ite['plugi ns'] . 'jq uery/jquer y.js"></sc ript>';   13   //$_page[' extra_js']    = '<scr ipt type=" text/javas cript" lan guage="Jav aScript" s rc="' . $s ite['plugi ns'] . 'jq uery/jquer y.js"></sc ript>';
14   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/ui.date picker.js" ></script> ';   14   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/ui.date picker.js" ></script> ';
15   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/jquery. form.js">< /script>';   15   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/jquery. form.js">< /script>';
16   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="inc/js/p edit.js">< /script>';   16   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="inc/js/p edit.js">< /script>';
17     17  
18   //init dat epicker   18   //init dat epicker
19   $iMinAge   = (int)get Param( 'se arch_start _age' );   19   $iMinAge   = (int)get Param( 'se arch_start _age' );
20   $iMaxAge   = (int)get Param( 'se arch_end_a ge'   );   20   $iMaxAge   = (int)get Param( 'se arch_end_a ge'   );
21   $iCurYear  = (int)dat e('Y');   21   $iCurYear  = (int)dat e('Y');
22   $iMinYear  = $iCurYea r - $iMaxA ge - 1;   22   $iMinYear  = $iCurYea r - $iMaxA ge - 1;
23   $iMaxYear  = $iCurYea r - $iMinA ge;   23   $iMaxYear  = $iCurYea r - $iMinA ge;
24   $iSelected Rel = ceil ( $iMinAge  * 365.25  ); //get r elative da ys number  for defaul t date   24   $iSelected Rel = ceil ( $iMinAge  * 365.25  ); //get r elative da ys number  for defaul t date
25     25  
26   $sDatepick erInit = $ oTemplConf ig -> cust omize['joi n']['datep ickerInit' ];   26   $sDatepick erInit = $ oTemplConf ig -> cust omize['joi n']['datep ickerInit' ];
27     27  
28   $sDatepick erInit = s tr_replace ( '{min_ye ar}', $iMi nYear, $sD atepickerI nit );   28   $sDatepick erInit = s tr_replace ( '{min_ye ar}', $iMi nYear, $sD atepickerI nit );
29   $sDatepick erInit = s tr_replace ( '{max_ye ar}', $iMa xYear, $sD atepickerI nit );   29   $sDatepick erInit = s tr_replace ( '{max_ye ar}', $iMa xYear, $sD atepickerI nit );
30   $sDatepick erInit = s tr_replace ( '{dfl_da ys}', $iSe lectedRel,  $sDatepic kerInit );   30   $sDatepick erInit = s tr_replace ( '{dfl_da ys}', $iSe lectedRel,  $sDatepic kerInit );
31     31  
32   $_page['ex tra_js']   .= '   32   $_page['ex tra_js']   .= '
33       <scrip t type="te xt/javascr ipt" langu age="JavaS cript">   33       <scrip t type="te xt/javascr ipt" langu age="JavaS cript">
34           $(  document  ).ready( f unction(){   34           $(  document  ).ready( f unction(){
35                ' . $sDa tepickerIn it . '   35                ' . $sDa tepickerIn it . '
36           }  );   36           }  );
37       </scri pt>';   37       </scri pt>';
38     38  
39   check_logg ed();   39   check_logg ed();
40     40  
41   $_page['he ader']       = _t( '_ Edit Profi le' );   41   $_page['he ader']       = _t( '_ Edit Profi le' );
42   $_page['he ader_text' ] = _t( '_ Edit Profi le' );   42   $_page['he ader_text' ] = _t( '_ Edit Profi le' );
43     43  
44     44  
45     45  
46   $oEditProc  = new BxD olPEditPro cessor();   46   $oEditProc  = new BxD olPEditPro cessor();
47     47  
48   $_ni = $_p age['name_ index'];   48   $_ni = $_p age['name_ index'];
49   $_page_con t[$_ni]['p age_main_c ode'] = $o EditProc - > process( );   49   $_page_con t[$_ni]['p age_main_c ode'] = $o EditProc - > process( );
50     50  
51     51  
52   PageCode() ;   52   PageCode() ;
53     53  
54     54  
55     55  
56   class BxDo lPEditProc essor {   56   class BxDo lPEditProc essor {
57       var $i ProfileID;  // id of  profile wh ich will b e edited   57       var $i ProfileID;  // id of  profile wh ich will b e edited
58       var $i Area = 0;   // 2=owne r, 3=admin , 4=modera tor   58       var $i Area = 0;   // 2=owne r, 3=admin , 4=modera tor
59       var $b Couple = f alse; // i f we editi tng couple  profile   59       var $b Couple = f alse; // i f we editi tng couple  profile
60       var $a CoupleMutu alFields;  // couple  mutual fie lds   60       var $a CoupleMutu alFields;  // couple  mutual fie lds
61          61       
62       var $o PC;         // object  of profil es control ler   62       var $o PC;         // object  of profil es control ler
63       var $o PF;         // object  of profil e fields   63       var $o PF;         // object  of profil e fields
64          64       
65       var $a Blocks;     // blocks  of page ( with items )   65       var $a Blocks;     // blocks  of page ( with items )
66       var $a Items;      // all it ems within  blocks   66       var $a Items;      // all it ems within  blocks
67          67       
68       var $a Profiles;   // array  with profi les (coupl e) data   68       var $a Profiles;   // array  with profi les (coupl e) data
69       var $a Values;     // values   69       var $a Values;     // values
70       var $a OldValues;  // values  before sa ve   70       var $a OldValues;  // values  before sa ve
71       var $a Errors;     // genera ted errors   71       var $a Errors;     // genera ted errors
72          72       
73       var $b AjaxMode;   // if the  script wa s called v ia ajax   73       var $b AjaxMode;   // if the  script wa s called v ia ajax
74          74       
75       functi on BxDolPE ditProcess or() {   75       functi on BxDolPE ditProcess or() {
76           gl obal $logg ed;   76           gl obal $logg ed;
77              77           
78           $t his -> aPr ofiles = a rray( 0 =>  array(),  1 => array () ); // d ouble arra ys (for co uples)   78           $t his -> aPr ofiles = a rray( 0 =>  array(),  1 => array () ); // d ouble arra ys (for co uples)
79           $t his -> aVa lues   = a rray( 0 =>  array(),  1 => array () );   79           $t his -> aVa lues   = a rray( 0 =>  array(),  1 => array () );
80           $t his -> aEr rors   = a rray( 0 =>  array(),  1 => array () );   80           $t his -> aEr rors   = a rray( 0 =>  array(),  1 => array () );
81              81           
82           $t his -> iPr ofileID =  (int)$_REQ UEST['ID'] ;   82           $t his -> iPr ofileID =  (int)$_REQ UEST['ID'] ;
83              83           
84           //  basic che cks   84           //  basic che cks
85           if ( $logged[ 'member']  ) {   85           if ( $logged[ 'member']  ) {
86                $iMember ID = (int) $_COOKIE[' memberID'] ;   86                $iMember ID = (int) $_COOKIE[' memberID'] ;
87                if( !$th is -> iPro fileID ) {   87                if( !$th is -> iPro fileID ) {
88                    //if  profile i d is not s et by requ est, edit  own profil e   88                    //if  profile i d is not s et by requ est, edit  own profil e
89                    $thi s -> iProf ileID = $i MemberID;   89                    $thi s -> iProf ileID = $i MemberID;
90                    $thi s -> iArea  = 2;   90                    $thi s -> iArea  = 2;
91                } else {   91                } else {
92                    // c heck if th is member  is owner   92                    // c heck if th is member  is owner
93                    if(  $this -> i ProfileID  == $iMembe rID )   93                    if(  $this -> i ProfileID  == $iMembe rID )
94                         $this -> i Area = 2;   94                         $this -> i Area = 2;
95                }   95                }
96           }  elseif( $l ogged['adm in'] )   96           }  elseif( $l ogged['adm in'] )
97                $this ->  iArea = 3 ;   97                $this ->  iArea = 3 ;
98           el seif( $log ged['moder ator'] )   98           el seif( $log ged['moder ator'] )
99                $this ->  iArea = 4 ;   99                $this ->  iArea = 4 ;
100              100           
101              101           
102           $t his -> bAj axMode = (  isset( $_ SERVER['HT TP_X_REQUE STED_WITH' ] ) and $_ SERVER['HT TP_X_REQUE STED_WITH' ] == 'XMLH ttpRequest ' );   102           $t his -> bAj axMode = (  isset( $_ SERVER['HT TP_X_REQUE STED_WITH' ] ) and $_ SERVER['HT TP_X_REQUE STED_WITH' ] == 'XMLH ttpRequest ' );
103       }   103       }
104          104       
105       functi on process () {   105       functi on process () {
106           if ( !$this - > iProfile ID )   106           if ( !$this - > iProfile ID )
107                return _ t( '_Profi le not spe cified' );   107                return _ t( '_Profi le not spe cified' );
108              108           
109           if ( !$this - > iArea )   109           if ( !$this - > iArea )
110                return _ t( '_You c annot edit  this prof ile' );   110                return _ t( '_You c annot edit  this prof ile' );
111              111           
112           /*  @var $thi s->oPC BxD olProfiles Controller  */   112           /*  @var $thi s->oPC BxD olProfiles Controller  */
113           $t his -> oPC  = new BxD olProfiles Controller ();   113           $t his -> oPC  = new BxD olProfiles Controller ();
114              114           
115           // get profil e info arr ay   115           // get profil e info arr ay
116           $t his -> aPr ofiles[0]  = $this ->  oPC -> ge tProfileIn fo( $this  -> iProfil eID );   116           $t his -> aPr ofiles[0]  = $this ->  oPC -> ge tProfileIn fo( $this  -> iProfil eID );
117           if ( !$this - > aProfile s[0] )   117           if ( !$this - > aProfile s[0] )
118                return _ t( '_Profi le not fou nd' );   118                return _ t( '_Profi le not fou nd' );
119              119           
120           if ( $this ->  aProfiles [0]['Coupl e'] ) { //  load coup le profile   120           if ( $this ->  aProfiles [0]['Coupl e'] ) { //  load coup le profile
121                $this ->  aProfiles [1] = $thi s -> oPC - > getProfi leInfo( $t his -> aPr ofiles[0][ 'Couple']  );   121                $this ->  aProfiles [1] = $thi s -> oPC - > getProfi leInfo( $t his -> aPr ofiles[0][ 'Couple']  );
122                   122                
123                if( !$th is -> aPro files[1] )   123                if( !$th is -> aPro files[1] )
124                    retu rn _t( '_C ouple prof ile not fo und' );   124                    retu rn _t( '_C ouple prof ile not fo und' );
125                   125                
126                $this ->  bCouple =  true; //c ouple enab led   126                $this ->  bCouple =  true; //c ouple enab led
127           }   127           }
128              128           
129           /*  @var $thi s->oPF BxD olProfileF ields */   129           /*  @var $thi s->oPF BxD olProfileF ields */
130           $t his -> oPF  = new BxD olProfileF ields( $th is -> iAre a );   130           $t his -> oPF  = new BxD olProfileF ields( $th is -> iAre a );
131           if ( !$this - > oPF -> a Area )   131           if ( !$this - > oPF -> a Area )
132                return ' Profile Fi elds cache  not loade d. Cannot  continue.' ;   132                return ' Profile Fi elds cache  not loade d. Cannot  continue.' ;
133              133           
134           $t his -> aCo upleMutual Fields = $ this -> oP F -> getCo upleMutual Fields();   134           $t his -> aCo upleMutual Fields = $ this -> oP F -> getCo upleMutual Fields();
135              135           
136           // collect bl ocks   136           // collect bl ocks
137           $t his -> aBl ocks = $th is -> oPF  -> aArea;   137           $t his -> aBl ocks = $th is -> oPF  -> aArea;
138              138           
139           // collect it ems   139           // collect it ems
140           $t his -> aIt ems = arra y();   140           $t his -> aIt ems = arra y();
141           fo reach ($th is -> aBlo cks as $aB lock) {   141           fo reach ($th is -> aBlo cks as $aB lock) {
142                foreach(  $aBlock[' Items'] as  $iItemID  => $aItem  )   142                foreach(  $aBlock[' Items'] as  $iItemID  => $aItem  )
143                    $thi s -> aItem s[$iItemID ] = $aItem ;   143                    $thi s -> aItem s[$iItemID ] = $aItem ;
144           }   144           }
145              145           
146           $t his -> aVa lues[0] =  $this -> o PF -> getV aluesFromP rofile( $t his -> aPr ofiles[0]  ); // set  default va lues   146           $t his -> aVa lues[0] =  $this -> o PF -> getV aluesFromP rofile( $t his -> aPr ofiles[0]  ); // set  default va lues
147           if ( $this ->  bCouple )   147           if ( $this ->  bCouple )
148                $this ->  aValues[1 ] = $this  -> oPF ->  getValuesF romProfile ( $this ->  aProfiles [1] ); //  set defaul t values   148                $this ->  aValues[1 ] = $this  -> oPF ->  getValuesF romProfile ( $this ->  aProfiles [1] ); //  set defaul t values
149              149           
150           $t his -> aOl dValues =  $this -> a Values;   150           $t his -> aOl dValues =  $this -> a Values;
151              151           
152           $s StatusText  = '';   152           $s StatusText  = '';
153           if ( isset($_ POST['do_s ubmit']) )  {   153           if ( isset($_ POST['do_s ubmit']) )  {
154                $this ->  oPF -> pr ocessPostV alues( $th is -> bCou ple, $this  -> aValue s, $this - > aErrors,  0, $this  -> iProfil eID );   154                $this ->  oPF -> pr ocessPostV alues( $th is -> bCou ple, $this  -> aValue s, $this - > aErrors,  0, $this  -> iProfil eID );
155                   155                
156                if( empt y( $this - > aErrors[ 0] ) and e mpty( $thi s -> aErro rs[1] ) an d !$this - > bAjaxMod e ) { // d o not save  in ajax m ode   156                if( empt y( $this - > aErrors[ 0] ) and e mpty( $thi s -> aErro rs[1] ) an d !$this - > bAjaxMod e ) { // d o not save  in ajax m ode
157                    $thi s -> saveP rofile();   157                    $thi s -> saveP rofile();
158                    $sSt atusText =  '_Save pr ofile succ essful';   158                    $sSt atusText =  '_Save pr ofile succ essful';
159     159  
160                    repa rseObjTags ( 'profile ', $this-> iProfileID  );   160                    repa rseObjTags ( 'profile ', $this-> iProfileID  );
161                }   161                }
162           }   162           }
163              163           
164           if ( $this ->  bAjaxMode  ) {   164           if ( $this ->  bAjaxMode  ) {
165                //print_ r( $_POST  );   165                //print_ r( $_POST  );
166                $this ->  showError sJson();   166                $this ->  showError sJson();
167                exit;   167                exit;
168           }  else {   168           }  else {
169                ob_start ();   169                ob_start ();
170                $this ->  showEditF orm( $sSta tusText );   170                $this ->  showEditF orm( $sSta tusText );
171                return o b_get_clea n();   171                return o b_get_clea n();
172           }   172           }
173       }   173       }
174          174       
175       functi on showErr orsJson()  {   175       functi on showErr orsJson()  {
176           he ader('Cont ent-Type:t ext/javasc ript');   176           he ader('Cont ent-Type:t ext/javasc ript');
177              177           
178           ec ho $this - > oPF -> g enJsonErro rs( $this  -> aErrors , $this ->  bCouple ) ;   178           ec ho $this - > oPF -> g enJsonErro rs( $this  -> aErrors , $this ->  bCouple ) ;
179       }   179       }
180          180       
181       functi on showEdi tForm( $sS tatusText  ) {   181       functi on showEdi tForm( $sS tatusText  ) {
182           // echoDbg( $ this -> aV alues );ex it;   182           // echoDbg( $ this -> aV alues );ex it;
183              183           
184           $a FormAttrs  = array(   184           $a FormAttrs  = array(
185                'id' =>  'edit_form ',   185                'id' =>  'edit_form ',
186                'onsubmi t' => 'ret urn valida teEditForm (this);',   186                'onsubmi t' => 'ret urn valida teEditForm (this);',
187                'action'  => ( $_SE RVER['PHP_ SELF'] . ' ?ID=' . $t his -> iPr ofileID )   187                'action'  => ( $_SE RVER['PHP_ SELF'] . ' ?ID=' . $t his -> iPr ofileID )
188           );   188           );
189              189           
190           $a TableAttrs  = array(   190           $a TableAttrs  = array(
191                'id' =>  'edit_form _table'   191                'id' =>  'edit_form _table'
192           );   192           );
193              193           
194           $a FormParams  = array(   194           $a FormParams  = array(
195                'hidden'  => array(  'ID' => $ this -> iP rofileID,  'do_submit ' => '1' )   195                'hidden'  => array(  'ID' => $ this -> iP rofileID,  'do_submit ' => '1' )
196           );   196           );
197              197           
198           $a TableParam s = array(   198           $a TableParam s = array(
199                'double'          = > $this ->  bCouple,   199                'double'          = > $this ->  bCouple,
200                'second_ enabled' = > $this ->  bCouple   200                'second_ enabled' = > $this ->  bCouple
201           );   201           );
202              202           
203           $a TableParam s['headers ']     = a rray( '',  _t( '_Firs t Person'  ), _t( '_S econd Pers on' ) );   203           $a TableParam s['headers ']     = a rray( '',  _t( '_Firs t Person'  ), _t( '_S econd Pers on' ) );
204           $a TableParam s['headers _add'] = ' class="hea der form_s econd_col" ' . ( $thi s -> bCoup le ? '' :  ' style="d isplay: no ne;"' );   204           $a TableParam s['headers _add'] = ' class="hea der form_s econd_col" ' . ( $thi s -> bCoup le ? '' :  ' style="d isplay: no ne;"' );
205              205           
206           $a Buttons =  array(   206           $a Buttons =  array(
207                array(   207                array(
208                    'typ e' => 'sub mit',   208                    'typ e' => 'sub mit',
209                    'val ue' => _t(  '_Save' ) ,   209                    'val ue' => _t(  '_Save' ) ,
210                    'cla ss' => 'in put_submit '   210                    'cla ss' => 'in put_submit '
211                )   211                )
212           );   212           );
213              213           
214           /*  @var $oFo rm BxTempl FormView * /   214           /*  @var $oFo rm BxTempl FormView * /
215           $o Form = new  BxTemplFo rmView( 'e dit_form'  );   215           $o Form = new  BxTemplFo rmView( 'e dit_form'  );
216           $o Form -> be gin( $aFor mAttrs, $a TableAttrs , $aFormPa rams, $aTa bleParams  );   216           $o Form -> be gin( $aFor mAttrs, $a TableAttrs , $aFormPa rams, $aTa bleParams  );
217     217  
218           fo reach( $th is -> aBlo cks as $aB lock ) {   218           fo reach( $th is -> aBlo cks as $aB lock ) {
219                $oForm - > beginBlo ck( _t( $a Block['Cap tion'] ) ) ;   219                $oForm - > beginBlo ck( _t( $a Block['Cap tion'] ) ) ;
220     220  
221                foreach(  $aBlock[' Items'] as  $aItem )  {   221                foreach(  $aBlock[' Items'] as  $aItem )  {
222     222  
223                    $aCo l0 = array ();   223                    $aCo l0 = array ();
224     224  
225                    $aCo l0['Type']       = $a Item['Type '];   225                    $aCo l0['Type']       = $a Item['Type '];
226                    $aCo l0['Name']       = (  $aItem['Ty pe'] == 's ystem' ) ?  $aItem['N ame'] : (  $aItem['Na me'] . '[0 ]' );   226                    $aCo l0['Name']       = (  $aItem['Ty pe'] == 's ystem' ) ?  $aItem['N ame'] : (  $aItem['Na me'] . '[0 ]' );
227                    $aCo l0['Mandat ory'] = $a Item['Type '] == 'pas s' ? false  : $aItem[ 'Mandatory '];   227                    $aCo l0['Mandat ory'] = $a Item['Type '] == 'pas s' ? false  : $aItem[ 'Mandatory '];
228                    $aCo l0['Contro l']   = $a Item['Cont rol'];   228                    $aCo l0['Contro l']   = $a Item['Cont rol'];
229                    $aCo l0['Values ']    = $a Item['Valu es'];   229                    $aCo l0['Values ']    = $a Item['Valu es'];
230                    $aCo l0['UseLKe y']   = $a Item['UseL Key'];   230                    $aCo l0['UseLKe y']   = $a Item['UseL Key'];
231                       231                    
232                    $aCo l0['Captio n']   = _t ( $aItem[' Caption']  );   232                    $aCo l0['Captio n']   = _t ( $aItem[' Caption']  );
233                    $aCo l0['Desc']       = _t ( $aItem[' Desc'] );   233                    $aCo l0['Desc']       = _t ( $aItem[' Desc'] );
234                    if(  $aCol0['De sc'] == $a Item['Desc '] )   234                    if(  $aCol0['De sc'] == $a Item['Desc '] )
235                         $aCol0['De sc'] = '';   235                         $aCol0['De sc'] = '';
236                       236                    
237                    // s et value   237                    // s et value
238                    if(  isset( $th is -> aVal ues[0][ $a Item['Name '] ] ) )   238                    if(  isset( $th is -> aVal ues[0][ $a Item['Name '] ] ) )
239                         $aCol0['Va lue']   =  $this -> a Values[0][  $aItem['N ame'] ];   239                         $aCol0['Va lue']   =  $this -> a Values[0][  $aItem['N ame'] ];
240                    else if( $aItem ['Name'] = = 'Couple'  )   240                    else if( $aItem ['Name'] = = 'Couple'  )
241                         $aCol0['Va lue'] = $t his -> bCo uple;   241                         $aCol0['Va lue'] = $t his -> bCo uple;
242                    else if( $aItem ['Name'] = = 'Members hip' )   242                    else if( $aItem ['Name'] = = 'Members hip' )
243                         $aCol0['Va lue'] = ge tMemberMem bershipInf o($this ->  iProfileI D);   243                         $aCol0['Va lue'] = ge tMemberMem bershipInf o($this ->  iProfileI D);
244                       244                    
245                    // s et error   245                    // s et error
246                    if(  isset( $th is -> aErr ors[0][ $a Item['Name '] ] ) )   246                    if(  isset( $th is -> aErr ors[0][ $a Item['Name '] ] ) )
247                         $aCol0['Er ror']   =  $this -> a Errors[0][  $aItem['N ame'] ];   247                         $aCol0['Er ror']   =  $this -> a Errors[0][  $aItem['N ame'] ];
248                       248                    
249                    // c heck secon d person's  field   249                    // c heck secon d person's  field
250                    if(  $this -> b Couple and  !in_array ( $aItem[' Name'], $t his -> aCo upleMutual Fields ) )  {   250                    if(  $this -> b Couple and  !in_array ( $aItem[' Name'], $t his -> aCo upleMutual Fields ) )  {
251                         $aCol1 = a rray();   251                         $aCol1 = a rray();
252                           252                        
253                         $aCol1['Ty pe']    =  $aItem['Ty pe'];   253                         $aCol1['Ty pe']    =  $aItem['Ty pe'];
254                         $aCol1['Na me']    =  $aItem['Na me'] . '[1 ]';   254                         $aCol1['Na me']    =  $aItem['Na me'] . '[1 ]';
255                         $aCol1['Co ntrol'] =  $aItem['Co ntrol'];   255                         $aCol1['Co ntrol'] =  $aItem['Co ntrol'];
256                         $aCol1['Va lues']  =  $aItem['Va lues'];   256                         $aCol1['Va lues']  =  $aItem['Va lues'];
257                         $aCol1['Us eLKey'] =  $aItem['Us eLKey'];   257                         $aCol1['Us eLKey'] =  $aItem['Us eLKey'];
258                           258                        
259                         // set val ue   259                         // set val ue
260                         if( isset(  $this ->  aValues[1] [ $aItem[' Name'] ] )  )   260                         if( isset(  $this ->  aValues[1] [ $aItem[' Name'] ] )  )
261                             $aCol1 ['Value']    = $this  -> aValues [1][ $aIte m['Name']  ];   261                             $aCol1 ['Value']    = $this  -> aValues [1][ $aIte m['Name']  ];
262                           262                        
263                         // set err or   263                         // set err or
264                         if( isset(  $this ->  aErrors[1] [ $aItem[' Name'] ] )  )   264                         if( isset(  $this ->  aErrors[1] [ $aItem[' Name'] ] )  )
265                             $aCol1 ['Error']    = $this  -> aValues [1][ $aIte m['Name']  ];   265                             $aCol1 ['Error']    = $this  -> aValues [1][ $aIte m['Name']  ];
266                           266                        
267                         //echoDbg(  $aCol0 );   267                         //echoDbg(  $aCol0 );
268                         $oForm ->  addRow( $a Col0, $aCo l1 );   268                         $oForm ->  addRow( $a Col0, $aCo l1 );
269                    } el se   269                    } el se
270                         $oForm ->  addRow( $a Col0 );   270                         $oForm ->  addRow( $a Col0 );
271                }    271                } 
272                   272                
273                $oForm - > endBlock ();   273                $oForm - > endBlock ();
274           }   274           }
275              275           
276           $o Form -> en d( $aButto ns );   276           $o Form -> en d( $aButto ns );
277              277           
278           if ( $sStatus Text )   278           if ( $sStatus Text )
279                echo '<d iv class=" notice_tex t">' . _t( $sStatusTe xt) . "</d iv>";   279                echo '<d iv class=" notice_tex t">' . _t( $sStatusTe xt) . "</d iv>";
280              280           
281           ec ho $oForm  -> getCode ();   281           ec ho $oForm  -> getCode ();
282       }   282       }
283          283       
284       functi on savePro file() {   284       functi on savePro file() {
285           $a Diff = $th is -> getD iffValues( 0);   285           $a Diff = $th is -> getD iffValues( 0);
286           $a Upd = $thi s -> oPF - > getProfi leFromValu es( $aDiff  );   286           $a Upd = $thi s -> oPF - > getProfi leFromValu es( $aDiff  );
287              287           
288           $a Upd['DateL astEdit']  = date( 'Y -m-d H:i:s ' );   288           $a Upd['DateL astEdit']  = date( 'Y -m-d H:i:s ' );
289           if ( !getPara m('autoApp roval_ifPr ofile') &&  $this ->  iArea == 2  )   289           if ( !getPara m('autoApp roval_ifPr ofile') &&  $this ->  iArea == 2  )
290                $aUpd['S tatus'] =  'Approval' ;   290                $aUpd['S tatus'] =  'Approval' ;
291              291           
292            if(   (   $this   ->   iArea   ==   3   or   $this   ->   iArea   ==   4   )   and   isset(   $_POST['do SetMembers hip']   )   and   $_POST['do SetMembers hip']   =  
'yes'   )
  292            if(   (   $this   ->   iArea   ==   3   or   $this   ->   iArea   ==   4   )   and   isset(   $_POST['do SetMembers hip']   )   and   $_POST['do SetMembers hip']   = =   'yes'   )
293                $this ->  setMember ship();   293                $this ->  setMember ship();
294              294           
295           $t his -> oPC  -> update Profile( $ this -> iP rofileID,  $aUpd );   295           $t his -> oPC  -> update Profile( $ this -> iP rofileID,  $aUpd );
296              296           
297           cl earProfile MatchCache ( $this ->  iProfileI D );   297           cl earProfile MatchCache ( $this ->  iProfileI D );
298              298           
299           if ( $this ->  bCouple )  {   299           if ( $this ->  bCouple )  {
300                $aDiff =  $this ->  getDiffVal ues(1);   300                $aDiff =  $this ->  getDiffVal ues(1);
301                $aUpd =  $this -> o PF -> getP rofileFrom Values( $a Diff );   301                $aUpd =  $this -> o PF -> getP rofileFrom Values( $a Diff );
302     302  
303                $aUpd['D ateLastEdi t'] = date ( 'Y-m-d H :i:s' );   303                $aUpd['D ateLastEdi t'] = date ( 'Y-m-d H :i:s' );
304                if( !get Param('aut oApproval_ ifProfile' ) && $this  -> iArea  == 2 )   304                if( !get Param('aut oApproval_ ifProfile' ) && $this  -> iArea  == 2 )
305                    $aUp d['Status' ] = 'Appro val';   305                    $aUp d['Status' ] = 'Appro val';
306     306  
307                $this ->  oPC -> up dateProfil e( $this - > aProfile s[0]['Coup le'], $aUp d );   307                $this ->  oPC -> up dateProfil e( $this - > aProfile s[0]['Coup le'], $aUp d );
308                   308                
309                clearPro fileMatchC ache( $thi s -> aProf iles[0]['C ouple'] );   309                clearPro fileMatchC ache( $thi s -> aProf iles[0]['C ouple'] );
310           }   310           }
311              311           
312       }   312       }
313          313       
314       functi on setMemb ership() {   314       functi on setMemb ership() {
315              315           
316           $i MshipID    = (int)$_P OST['Membe rshipID'];   316           $i MshipID    = (int)$_P OST['Membe rshipID'];
317           $i MshipDays  = (int)$_P OST['Membe rshipDays' ]; // 0 =  unlim   317           $i MshipDays  = (int)$_P OST['Membe rshipDays' ]; // 0 =  unlim
318           $b StartsNow  = ($_POST[ 'Membershi pImmediate ly'] == 'o n');   318           $b StartsNow  = ($_POST[ 'Membershi pImmediate ly'] == 'o n');
319              319           
320           $b Result = s etMembersh ip( $this  -> iProfil eID, $iMsh ipID, $iMs hipDays, $ bStartsNow  );   320           $b Result = s etMembersh ip( $this  -> iProfil eID, $iMsh ipID, $iMs hipDays, $ bStartsNow  );
321              321           
322           if ( $bResult  ) {   322           if ( $bResult  ) {
323                $check_r es = check Action($th is -> iPro fileID, AC TION_ID_US E_CHAT);   323                $check_r es = check Action($th is -> iPro fileID, AC TION_ID_US E_CHAT);
324                if ($che ck_res[CHE CK_ACTION_ RESULT] ==  CHECK_ACT ION_RESULT _ALLOWED)   324                if ($che ck_res[CHE CK_ACTION_ RESULT] ==  CHECK_ACT ION_RESULT _ALLOWED)
325                    modu les_unbloc k($this ->  iProfileI D, 'chat') ;   325                    modu les_unbloc k($this ->  iProfileI D, 'chat') ;
326                else   326                else
327                    modu les_block( $this -> i ProfileID,  'chat');   327                    modu les_block( $this -> i ProfileID,  'chat');
328     328  
329                $check_r es = check Action($th is -> iPro fileID, AC TION_ID_US E_FORUM);   329                $check_r es = check Action($th is -> iPro fileID, AC TION_ID_US E_FORUM);
330                if ($che ck_res[CHE CK_ACTION_ RESULT] ==  CHECK_ACT ION_RESULT _ALLOWED)   330                if ($che ck_res[CHE CK_ACTION_ RESULT] ==  CHECK_ACT ION_RESULT _ALLOWED)
331                    modu les_unbloc k($this ->  iProfileI D, 'forum' );   331                    modu les_unbloc k($this ->  iProfileI D, 'forum' );
332                else   332                else
333                    modu les_block( $this -> i ProfileID,  'forum');   333                    modu les_block( $this -> i ProfileID,  'forum');
334           }   334           }
335              335           
336           re turn $bRes ult;   336           re turn $bRes ult;
337       }   337       }
338          338       
339       functi on getDiff Values($iI nd) {   339       functi on getDiff Values($iI nd) {
340           $a Old = $thi s -> aOldV alues[$iIn d];   340           $a Old = $thi s -> aOldV alues[$iIn d];
341           $a New = $thi s -> aValu es[$iInd];   341           $a New = $thi s -> aValu es[$iInd];
342              342           
343           $a Diff = arr ay();   343           $a Diff = arr ay();
344           fo reach( $aN ew as $sNa me => $mNe w ){   344           fo reach( $aN ew as $sNa me => $mNe w ){
345                $mOld =  $aOld[$sNa me];   345                $mOld =  $aOld[$sNa me];
346                   346                
347                if( is_a rray($mNew ) ) {   347                if( is_a rray($mNew ) ) {
348                    if(  count($mNe w) == coun t($mOld) )  {   348                    if(  count($mNe w) == coun t($mOld) )  {
349                         //compare  each value   349                         //compare  each value
350                         $mOldS = $ mOld;   350                         $mOldS = $ mOld;
351                         $mNewS = $ mNew;   351                         $mNewS = $ mNew;
352                         sort( $mOl dS ); //so rt them fo r correct  comparison   352                         sort( $mOl dS ); //so rt them fo r correct  comparison
353                         sort( $mNe wS );   353                         sort( $mNe wS );
354                           354                        
355                         foreach( $ mNewS as $ iKey => $s Val )   355                         foreach( $ mNewS as $ iKey => $s Val )
356                             if( $m NewS[$iKey ] != $mOld [$iKey] )  {   356                             if( $m NewS[$iKey ] != $mOld [$iKey] )  {
357                                 $a Diff[$sNam e] = $mNew ; //found  difference   357                                 $a Diff[$sNam e] = $mNew ; //found  difference
358                                 br eak;   358                                 br eak;
359                             }   359                             }
360                    } el se   360                    } el se
361                         $aDiff[$sN ame] = $mN ew;   361                         $aDiff[$sN ame] = $mN ew;
362                } else {   362                } else {
363                    if(  $mNew != $ mOld )   363                    if(  $mNew != $ mOld )
364                         $aDiff[$sN ame] = $mN ew;   364                         $aDiff[$sN ame] = $mN ew;
365                }   365                }
366           }   366           }
367              367           
368           re turn $aDif f;   368           re turn $aDif f;
369       }   369       }
370          370       
371   }   371   }