Guest User

accountmanagement.php

a guest
Jun 14th, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 146.70 KB | None | 0 0
  1. <?PHP
  2. if(!$logged)
  3.     if($action == "logout")
  4.         $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Logout Successful</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr>          </table>        </div>  </table></div></td></tr>';
  5.     else
  6.         $main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Login</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';
  7. else
  8. {
  9.     //########### ACCOUNT MANAGER ##########
  10.     if($action == "")
  11.     {
  12.        
  13.  
  14. $difference = date('d/m/Y', $account_logged->getPlayerVip_Time());
  15.  
  16.  
  17.  
  18.        
  19.         $account_reckey = $account_logged->getRecoveryKey();
  20.         if(!$account_logged->isPremium())
  21.             $account_status = '<b><font color="red">Free Account</font></b>';
  22.         else
  23.             $account_status = '<b><font color="#00CD00">Premium Account, '.$account_logged->getPremDays().' days left</font></b>';
  24.         if(empty($account_reckey))
  25.             $account_registred = '<b><font color="red">No</font></b>';
  26.         else
  27.             if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])
  28.                 $account_registred = '<b><font color="#0000CD">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Rec key </a> )</font></b>';
  29.             else
  30.                 $account_registred = '<b><font color="#0000CD">Yes</font></b>';
  31.         $account_created = $account_logged->getCreated();
  32.         $account_email = $account_logged->getEMail();
  33.         $account_email_new_time = $account_logged->getCustomField("email_new_time");
  34.         if($account_email_new_time > 1)
  35.             $account_email_new = $account_logged->getCustomField("email_new");
  36.         /*Vip Status*/
  37.         $account_vip = $account_logged->getPlayerVip_Time() ? '<b><font color="#00CD00"> Vip Account, '.$difference.' Days left </font></b>' : '<b><font color="red">Not Vip Account</font></b>';
  38.         $account_rlname = $account_logged->getRLName();
  39.         $account_location = $account_logged->getLocation();
  40.         if($account_logged->isBanned())
  41.             if($account_logged->getBanTime() > 0)
  42.                 $welcome_msg = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>';
  43.             else
  44.                 $welcome_msg = '<font color="red">Your account is banished FOREVER!</font>';
  45.         else
  46.             $welcome_msg = 'Welcome to your account!';
  47.         $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" ><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><td width="100%" align=center>';
  48.         $main_content .= '[<a href="#General+Information" >General Information</a>] [<a href="#Registration" >Registration</a>] [<a href="#Public+Information" >Public Information</a>] [<a href="#Characters" >Characters</a>] ';
  49.         $main_content .= '</td><td width=50%><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=logout" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif" ></div></div></td></tr></form></table></td></tr></table>    </div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/><center><table><tr><td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /></td><td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >'.$welcome_msg.'<br/></td><td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></td></tr></table><br/></center>';
  50.         //if account dont have recovery key show hint
  51.         if(empty($account_reckey))
  52.             $main_content .= '<div class="SmallBox" ><div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" >You can register your account for increased protection. Click on "Register Account" and get your free recovery key today!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  53.        
  54.        
  55.  
  56.  
  57.  
  58.             $main_content .= '
  59. <div class="SmallBox" >
  60.     <div class="MessageContainer" >    
  61.         <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  62.         <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  63.         <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  64.         <div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  65.         <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  66.         <table>
  67.             <tr>
  68.                 <td class="LabelV" ><font color="#0000CD">Hint:</font></td>
  69.                 <td style="width:100%;" ><font color="#0000CD"><b>Sistema de confirma&ccedil;&atilde;o de deposito!</b></font></td>
  70.             </tr>
  71.         </table>
  72.         <div align="center" >
  73.             <table border="0" cellspacing="0" cellpadding="0" >
  74.                 <tr>
  75.                     <td style="border:0px;" >
  76. <form action="?subtopic=accountmanagement&action=confirmarDeposito" method="post" >
  77.                         <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  78.                             <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  79.                                 <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  80.                                 <input class="ButtonText" type="image" name="Confirmar" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_confirmar.gif" >
  81.                             </div>
  82.             </form>
  83.                         </div>
  84.                     </td>
  85.                    
  86.                     <td style="border:0px;" >
  87. <form action="?subtopic=accountmanagement&action=statusDeposito" method="post" >
  88.                         <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  89.                             <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  90.                                 <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  91.                                 <input class="ButtonText" type="image" name="Confirmar" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_status.gif" >
  92.                             </div>
  93.             </form>
  94.                         </div>
  95.                     </td>
  96.                    
  97.                 </tr>
  98.  
  99.             </table>
  100.         </div>
  101.     </div>    
  102.     <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  103.     <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  104.     <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  
  105. </div>
  106. </div><br/>';      
  107.        
  108.        
  109.        
  110.        
  111.        
  112.        
  113.         if($account_email_new_time > 1)
  114.             if($account_email_new_time < time())
  115.                 $account_email_change = '<br>(You can accept <b>'.$account_email_new.'</b> as a new email.)';
  116.             else
  117.             {
  118.                 $account_email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b>";
  119.                 $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="Message" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Note:</td><td style="width:100%;" >A request has been submitted to change the email address of this account to <b>'.$account_email_new.'</b>. After <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b> you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></div>    </div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/><br/>';
  120.             }
  121.         $main_content .= '<a name="General+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" >  <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" ><table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Email Address:</td><td style="width:90%;" >'.$account_email.''.$account_email_change.'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Created:</td><td>'.date("j F Y, G:i:s", $account_created).'</td></td><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Vip Status:</td><td>'.$account_vip.'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Registered:</td><td>'.$account_registred.'</td></tr></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name=newemail value="" ><input type="hidden" name=newemaildate value=0 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form>      </table></td><td width="100%"></td>';
  122.         //show button "register account"
  123.         if(empty($account_reckey))
  124.             $main_content .= '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>';
  125.         $main_content .= '</tr></table></td></tr></table></div></table></div></td></tr><br/><a name="Public+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" >  <table class="Table5" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td><table style="width:100%;"><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" >'.$account_rlname.'</td></tr><tr><td class="LabelV" >Location:</td><td style="width:90%;" >'.$account_location.'</td></tr></table></td><td align=right><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeinfo" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';
  126.         $main_content .= '<a name="Characters" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Characters</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>   <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:65%" >Name</td><td style="width:15%" >Level</td><td style="width:7%">Status</td><td style="width:5%">&#160;</td></tr>';
  127.         $account_players = $account_logged->getPlayersList();
  128.         $account_players->orderBy('name');
  129.         //show list of players on account
  130.         foreach($account_players as $account_player)
  131.         {
  132.             $player_number_counter++;
  133.             $main_content .= '<tr style="background-color:';
  134.             if(is_int($player_number_counter / 2))
  135.                 $main_content .= $config['site']['darkborder'];
  136.             else
  137.                 $main_content .= $config['site']['lightborder'];
  138.             $main_content .= ';" ><td><NOBR>'.$player_number_counter.'.&#160;'.$account_player->getName();
  139.             if($account_player->isDeleted())
  140.                 $main_content .= '<font color="red"><b> [ DELETED ] </b> <a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">>> UNDELETE <<</a></font>';
  141.             if($account_player->isNameLocked())
  142.                 if($account_player->getOldName())
  143.                     $main_content .= '<font color="red"><b> [ NAMELOCK:</b> Wait for GM, new name: <b>'.$account_player->getOldName().' ]</b></font>';
  144.                 else
  145.                     $main_content .= '<font color="red"><b> [ NAMELOCK: <form action="" method="GET"><input name="subtopic" type="hidden" value="accountmanagement" /><input name="action" type="hidden" value="newnick" /><input name="name" type="hidden" value="'.$account_player->getName().'" /><input name="name_new" type="text" value="Enter here new nick" size="16" /><input type="submit" value="Set new nick" /></form> ]</b></font>';
  146.             $main_content .= '</NOBR></td><td><NOBR>'.$account_player->getLevel().' '.$vocation_name[$account_player->getWorld()][$account_player->getPromotion()][$account_player->getVocation()].'</NOBR></td>';
  147.             if(!$account_player->isOnline())
  148.                 $main_content .= '<td><font color="red"><b>Offline</b></font></td>';
  149.             else
  150.                 $main_content .= '<td><font color="green"><b>Online</b></font></td>';
  151.             $main_content .= '<td>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</td></tr>';
  152.         }
  153.         $main_content .= '</table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif" ></div></div></td></tr></form></table></td><td style="width:100%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="'.$layout_name.'/images/buttons/_sbutton_deletecharacter.gif" ></div></div></td></tr></form></table></td></tr></table></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';
  154.     }
  155.     //########### CHANGE PASSWORD ##########
  156.     if($action == "changepassword")
  157.     {
  158.         $new_password = trim(anti_injection($_POST['newpassword']));
  159.         $new_password2 = trim(anti_injection($_POST['newpassword2']));
  160.         $old_password = trim(anti_injection($_POST['oldpassword']));
  161.         if(empty($new_password) && empty($new_password2) && empty($old_password))
  162.             $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  163.         else
  164.         {
  165.             if(empty($new_password) || empty($new_password2) || empty($old_password))
  166.                 $show_msgs[] = "Please fill in form.";
  167.             if($new_password != $new_password2)
  168.                 $show_msgs[] = "The new passwords do not match!";
  169.             if(empty($show_msgs))
  170.             {
  171.                 if(!check_password($new_password))
  172.                     $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
  173.                 $old_password = password_ency($old_password);
  174.                 if($old_password != $account_logged->getPassword())
  175.                     $show_msgs[] = "Current password is incorrect!";
  176.             }
  177.             if(!empty($show_msgs))
  178.             {
  179.                 //show errors
  180.                 $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  181.                 foreach($show_msgs as $show_msg)
  182.                     $main_content .= '<li>'.$show_msg;
  183.                 $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  184.                 //show form
  185.                 $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  186.             }
  187.             else
  188.             {
  189.                 $org_pass = $new_password;
  190.                 $new_password = password_ency($new_password);
  191.                 $account_logged->setPassword($new_password);
  192.                 $account_logged->save();
  193.                 $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Password Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your password has been changed.';
  194.                 if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])
  195.                 {
  196.                     $mailBody = '<html>
  197.                         <body>
  198.                             <h3>Password to account changed!</h3>
  199.                             <p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a>.</p>
  200.                             <p>New password: <b>'.$org_pass.'</b></p>
  201.                         </body>
  202.                     </html>';
  203.                     require("phpmailer/class.phpmailer.php");
  204.                     $mail = new PHPMailer();
  205.                     if ($config['site']['smtp_enabled'] == "yes")
  206.                     {
  207.                         $mail->IsSMTP();
  208.                         $mail->Host = $config['site']['smtp_host'];
  209.                         $mail->Port = (int)$config['site']['smtp_port'];
  210.                         $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  211.                         $mail->Username = $config['site']['smtp_user'];
  212.                         $mail->Password = $config['site']['smtp_pass'];
  213.                     }
  214.                     else
  215.                         $mail->IsMail();
  216.                     $mail->IsHTML(true);
  217.                     $mail->From = $config['site']['mail_address'];
  218.                     $mail->AddAddress($account_logged->getEMail());
  219.                     $mail->Subject = $config['server']['serverName']." - Changed password";
  220.                     $mail->Body = $mailBody;
  221.                     if($mail->Send())
  222.                         $main_content .= '<br /><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
  223.                     else
  224.                         $main_content .= '<br /><small>An error occorred while sending email with password!</small>';
  225.                 }
  226.                 $main_content .= '</td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  227.                 $_SESSION['password'] = $new_password;
  228.             }
  229.         }
  230.     }
  231.     //############# CHANGE E-MAIL ###################
  232.     if($action == "changeemail")
  233.     {
  234.         $account_email_new_time = $account_logged->getCustomField("email_new_time");
  235.         if($account_email_new_time > 10)
  236.             $account_email_new = $account_logged->getCustomField("email_new");
  237.         if($account_email_new_time < 10)
  238.         {
  239.             if($_POST['changeemailsave'] == 1)
  240.             {
  241.                 $account_email_new = trim(anti_injection($_POST['new_email']));
  242.                 $post_password = trim(anti_injection($_POST['password']));
  243.                 if(empty($account_email_new))
  244.                     $change_email_errors[] = "Please enter your new email address.";
  245.                 else
  246.                     if(!check_mail($account_email_new))
  247.                         $change_email_errors[] = "E-mail address is not correct.";
  248.                 if(empty($post_password))
  249.                     $change_email_errors[] = "Please enter password to your account.";
  250.                 else
  251.                 {
  252.                     $post_password = password_ency($post_password);
  253.                     if($post_password != $account_logged->getPassword())
  254.                         $change_email_errors[] = "Wrong password to account.";
  255.                 }
  256.                 if(empty($change_email_errors))
  257.                 {
  258.                     $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;
  259.                     $account_logged->setCustomField("email_new", $account_email_new);
  260.                     $account_logged->setCustomField("email_new_time", $account_email_new_time);
  261.                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >New Email Address Requested</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have requested to change your email address to <b>'.$account_email_new.'</b>. The actual change will take place after <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>, during which you can cancel the request at any time.</td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  262.                 }
  263.                 else
  264.                 {
  265.                     //show errors
  266.                     $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  267.                     foreach($change_email_errors as $change_email_error)
  268.                         $main_content .= '<li>'.$change_email_error;
  269.                     $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  270.                     //show form
  271.                     $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br/><br/><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Change Email Address</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td>  <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td>  <td><input type="password" name="password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  272.                 }
  273.             }
  274.             else
  275.                 $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br/><br/><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Change Email Address</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td>  <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td>  <td><input type="password" name="password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  276.         }
  277.         else
  278.         {
  279.             if($account_email_new_time < time())
  280.             {
  281.                 if($_POST['changeemailsave'] == 1)
  282.                 {
  283.                     $account_logged->setCustomField("email_new", "");
  284.                     $account_logged->setCustomField("email_new_time", 0);
  285.                     $account_logged->setEmail($account_email_new);
  286.                     $account_logged->save();
  287.                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Accepted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have accepted <b>'.$account_logged->getEmail().'</b> as your new email adress.</td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  288.                 }
  289.                 else
  290.                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Accepted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Do you accept <b>'.$account_email_new.'</b> as your new email adress?</td></tr>          </table>        </div>  </table></div></td></tr><br /><table width="100%"><tr><td width="30">&nbsp;</td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$layout_name.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$layout_name.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement" method="post" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30">&nbsp;</td></tr></table>';
  291.             }
  292.             else
  293.                 $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Change of Email Address</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>A request has been submitted to change the email address of this account to <b>'.$account_email_new.'</b>.<br/>The actual change will take place on <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>.<br>If you do not want to change your email address, please click on "Cancel".</td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name="emailchangecancel" value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  294.         }
  295.         if($_POST['emailchangecancel'] == 1)
  296.         {
  297.             $account_logged->setCustomField("email_new", "");
  298.             $account_logged->setCustomField("email_new_time", 0);
  299.             $main_content = '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Cancelled</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your request to change the email address of your account has been cancelled. The email address will not be changed.</td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  300.         }
  301.     }
  302.     //########### CHANGE PUBLIC INFORMATION (about account owner) ######################
  303.     if($action == "changeinfo")
  304.     {
  305.         $new_rlname = htmlspecialchars(stripslashes(trim(anti_injection($_POST['info_rlname']))));
  306.         $new_location = htmlspecialchars(stripslashes(trim(anti_injection($_POST['info_location']))));
  307.         if($_POST['changeinfosave'] == 1)
  308.         {
  309.             //save data from form
  310.             $account_logged->setRLName($new_rlname);
  311.             $account_logged->setLocation($new_location);
  312.             $account_logged->save();
  313.             $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Public Information Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your public information has been changed.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  314.         }
  315.         else
  316.         {
  317.             //show form
  318.             $account_rlname = $account_logged->getRLName();
  319.             $account_location = $account_logged->getLocation();
  320.             $main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changeinfo" method=post><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Change Public Information</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" ><input name="info_rlname" value="'.$account_rlname.'" size="30" maxlength="50" ></td></tr><tr><td class="LabelV" >Location:</td><td><input name="info_location" value="'.$account_location.'" size="30" maxlength="50" ></td></tr></table>        </div>  </table></div></td></tr><br/><table width="100%"><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="changeinfosave" value="1" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  321.         }
  322.     }
  323.     //############## GENERATE RECOVERY KEY ###########
  324.     if($action == "registeraccount")
  325.     {
  326.         $reg_password = password_ency(trim($_POST['reg_password']));
  327.         $old_key = $account_logged->getRecoveryKey("key");
  328.         if($_POST['registeraccountsave'] == "1")
  329.         {
  330.             if($reg_password == $account_logged->getPassword())
  331.             {
  332.                 if(empty($old_key))
  333.                 {
  334.                     $dontshowtableagain = 1;
  335.                     $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  336.                     $max = strlen($acceptedChars)-1;
  337.                     $new_rec_key = NULL;
  338.                     // 10 = number of chars in generated key
  339.                     for($i=0; $i < 10; $i++)
  340.                     {
  341.                         $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  342.                         $new_rec_key .= $cnum[$i];
  343.                     }
  344.                     $account_logged->setRecoveryKey($new_rec_key);
  345.                     $account_logged->save();
  346.                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Registered</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" >Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following<br/><br/><font size="5">&nbsp;&nbsp;&nbsp;<b>Recovery Key: '.$new_rec_key.'</b></font><br/><br/><br/><b>Important:</b><ul><li>Write down this recovery key carefully.</li><li>Store it at a safe place!</li>';
  347.                     if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])
  348.                     {
  349.                         $mailBody = '<html>
  350.                             <body>
  351.                                 <h3>New recovery key!</h3>
  352.                                 <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a>.</p>
  353.                                 <p>Recovery key: <b>'.$new_rec_key.'</b></p>
  354.                             </body>
  355.                         </html>';
  356.                         require("phpmailer/class.phpmailer.php");
  357.                         $mail = new PHPMailer();
  358.                         if ($config['site']['smtp_enabled'] == "yes")
  359.                         {
  360.                             $mail->IsSMTP();
  361.                             $mail->Host = $config['site']['smtp_host'];
  362.                             $mail->Port = (int)$config['site']['smtp_port'];
  363.                             $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  364.                             $mail->Username = $config['site']['smtp_user'];
  365.                             $mail->Password = $config['site']['smtp_pass'];
  366.                         }
  367.                         else
  368.                             $mail->IsMail();
  369.                         $mail->IsHTML(true);
  370.                         $mail->From = $config['site']['mail_address'];
  371.                         $mail->AddAddress($account_logged->getEMail());
  372.                         $mail->Subject = $config['server']['serverName']." - recovery key";
  373.                         $mail->Body = $mailBody;
  374.                         if($mail->Send())
  375.                             $main_content .= '<br /><small>Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
  376.                         else
  377.                             $main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';
  378.                     }
  379.                     $main_content .= '</ul>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  380.                 }
  381.                 else
  382.                     $reg_errors[] = 'Your account is already registred.';
  383.             }
  384.             else
  385.                 $reg_errors[] = 'Wrong password to account.';
  386.         }
  387.         if($dontshowtableagain != 1)
  388.         {
  389.             //show errors if not empty
  390.             if(!empty($reg_errors))
  391.             {
  392.                 $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  393.                 foreach($reg_errors as $reg_error)
  394.                     $main_content .= '<li>'.$reg_error;
  395.                 $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  396.             }
  397.             //show form
  398.             $main_content .= 'To generate recovery key for your account please enter your password.<br/><br/><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Generate recovery key</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  399.         }
  400.     }
  401.     //############## GENERATE NEW RECOVERY KEY ###########
  402.     if($action == "newreckey")
  403.     {
  404.         $reg_password = password_ency(trim($_POST['reg_password']));
  405.         $reckey = $account_logged->getRecoveryKey();
  406.         if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))
  407.             $main_content .= 'You cant get new rec key';
  408.         else
  409.         {
  410.             $points = $account_logged->getPremiumPoints();
  411.             if($_POST['registeraccountsave'] == "1")
  412.             {
  413.                 if($reg_password == $account_logged->getPassword())
  414.                 {
  415.                     if($points >= $config['site']['generate_new_reckey_price'])
  416.                     {
  417.                         $dontshowtableagain = 1;
  418.                         $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  419.                         $max = strlen($acceptedChars)-1;
  420.                         $new_rec_key = NULL;
  421.                         // 10 = number of chars in generated key
  422.                         for($i=0; $i < 10; $i++)
  423.                         {
  424.                             $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  425.                             $new_rec_key .= $cnum[$i];
  426.                         }
  427.                        
  428.                        
  429.                        
  430.                        
  431.                        
  432.                         $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Registered</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><ul>';
  433.                         $mailBody = '<html>
  434.                             <body>
  435.                                 <h3>New recovery key!</h3>
  436.                                 <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a>.</p>
  437.                                 <p>Recovery key: <b>'.$new_rec_key.'</b></p>
  438.                             </body>
  439.                         </html>';
  440.                         require("phpmailer/class.phpmailer.php");
  441.                         $mail = new PHPMailer();
  442.                         if ($config['site']['smtp_enabled'] == "yes")
  443.                         {
  444.                             $mail->IsSMTP();
  445.                             $mail->Host = $config['site']['smtp_host'];
  446.                             $mail->Port = (int)$config['site']['smtp_port'];
  447.                             $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  448.                             $mail->Username = $config['site']['smtp_user'];
  449.                             $mail->Password = $config['site']['smtp_pass'];
  450.                         }
  451.                         else
  452.                             $mail->IsMail();
  453.                         $mail->IsHTML(true);
  454.                         $mail->From = $config['site']['mail_address'];
  455.                         $mail->AddAddress($account_logged->getEMail());
  456.                         $mail->Subject = $config['server']['serverName']." - new recovery key";
  457.                         $mail->Body = $mailBody;
  458.                         if($mail->Send())
  459.                         {
  460.                             $account_logged->setRecoveryKey($new_rec_key);
  461.                             $account_logged->setPremiumPoints($account_logged->getPremiumPoints()-$config['site']['generate_new_reckey_price']);
  462.                             $account_logged->save();
  463.                             $main_content .= '<br />Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b> for '.$config['site']['generate_new_reckey_price'].' premium points.';
  464.                         }
  465.                         else
  466.                             $main_content .= '<br />An error occorred while sending email ( <b>'.$account_logged->getEMail().'</b> ) with recovery key! Recovery key not changed. Try again.';
  467.                         $main_content .= '</ul>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  468.                     }
  469.                     else
  470.                         $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';
  471.                 }
  472.                 else
  473.                     $reg_errors[] = 'Wrong password to account.';
  474.             }
  475.             if($dontshowtableagain != 1)
  476.             {
  477.                 //show errors if not empty
  478.                 if(!empty($reg_errors))
  479.                 {
  480.                     $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  481.                     foreach($reg_errors as $reg_error)
  482.                     $main_content .= '<li>'.$reg_error;
  483.                     $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  484.                 }
  485.                 //show form
  486.                 $main_content .= 'To generate NEW recovery key for your account please enter your password.<br/><font color="red"><b>New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points.</font> You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><br/><form action="?subtopic=accountmanagement&action=newreckey" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Generate recovery key</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  487.             }
  488.         }
  489.     }
  490.     //###### CHANGE CHARACTER COMMENT ######
  491.     if($action == "changecomment")
  492.     {
  493.         $player_name = stripslashes(anti_injection($_REQUEST['name']));
  494.         $new_comment = htmlspecialchars(stripslashes(substr(trim(anti_injection($_POST['comment'])),0,2000)));
  495.         $new_hideacc = (int) $_POST['accountvisible'];
  496.         if(check_name($player_name))
  497.         {
  498.             $player = $ots->createObject('Player');
  499.             $player->find($player_name);
  500.             if($player->isLoaded())
  501.             {
  502.                 $player_account = $player->getAccount();
  503.                 if($account_logged->getId() == $player_account->getId())
  504.                 {
  505.                     if($_POST['changecommentsave'] == 1)
  506.                     {
  507.                         $player->setCustomField("hide_char", $new_hideacc);
  508.                         $player->setCustomField("comment", $new_comment);
  509.                         $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Information Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character information has been changed.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  510.                     }
  511.                     else
  512.                     {
  513.                         $main_content .= 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" >  <table class="Table5" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Edit Character Information</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';
  514.                         if($player->getHideChar() == 1)
  515.                             $main_content .= '<input type="checkbox" name="accountvisible"  value="1" checked="checked">';
  516.                         else
  517.                             $main_content .= '<input type="checkbox" name="accountvisible"  value="1" >';
  518.                         $main_content .= ' check to hide your account information</td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td class="LabelV" ><span >Comment:</span></td><td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getComment().'</textarea><br>[max. length: 2000 chars, 50 lines]</td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="name" value="'.$player->getName().'"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  519.                     }
  520.                 }
  521.                 else
  522.                     $main_content .= "Error. Character <b>".$player_name."</b> is not on your account.";
  523.             }
  524.             else
  525.                 $main_content .= "Error. Character with this name doesn't exist.";
  526.         }
  527.         else
  528.             $main_content .= "Error. Name contain illegal characters.";
  529.     }
  530.     //### NEW NICK - set new nick proposition ###
  531.     if($action == "newnick")
  532.     {
  533.         $name = $_GET['name'];
  534.         $name_new = stripslashes(ucwords(strtolower(trim($_GET['name_new']))));
  535.         if(!empty($name) && !empty($name_new))
  536.         {
  537.             if(check_name_new_char($name_new))
  538.             {
  539.                 $player = $ots->createObject('Player');
  540.                 $player->find($name);
  541.                 if($player->isLoaded() && $player->isNameLocked())
  542.                 {
  543.                     $player_account = $player->getAccount();
  544.                     if($account_logged->getId() == $player_account->getId())
  545.                     {
  546.                         if(!$player->getOldName())
  547.                             if(!$player->isOnline())
  548.                             {
  549.                                 $player->setCustomField('old_name', $name_new);
  550.                                 $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >New nick proposition</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character <b>'.$name.'</b> new nick proposition <b>'.$name_new.'</b> has been set. Now you must wait for acceptation from GM.</td></tr>          </table>        </div>  </table></div></td></tr>';
  551.                             }
  552.                             else
  553.                                 $main_content .= 'This character is online.';
  554.                         else
  555.                             $main_content .= 'You already set new name for this character ( <b>'.$player->getOldName().'</b> ). You must wait until GM accept/reject your proposition.';
  556.                     }
  557.                     else
  558.                         $main_content .= 'Character <b>'.$player_name.'</b> is not on your account.';
  559.                 }
  560.                 else
  561.                     $main_content .= 'Character with this name doesn\'t exist or isn\'t name locked.';
  562.             }
  563.             else
  564.                 $main_content .= 'Name contain illegal characters. Invalid format or lenght.';
  565.         }
  566.         else
  567.             $main_content .= 'Please enter new char name.';
  568.         $main_content .= '<br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  569.     }
  570.     //### DELETE character from account ###
  571.     if($action == "deletecharacter")
  572.     {
  573.         $player_name = stripslashes(trim($_POST['delete_name']));
  574.         $password_verify = trim($_POST['delete_password']);
  575.         $password_verify = password_ency($password_verify);
  576.         if($_POST['deletecharactersave'] == 1)
  577.         {
  578.             if(!empty($player_name) && !empty($password_verify))
  579.             {
  580.                 if(check_name($player_name))
  581.                 {
  582.                     $player = $ots->createObject('Player');
  583.                     $player->find($player_name);
  584.                     if($player->isLoaded())
  585.                     {
  586.                         $player_account = $player->getAccount();
  587.                         if($account_logged->getId() == $player_account->getId())
  588.                         {
  589.                             if($password_verify == $account_logged->getPassword())
  590.                             {
  591.                                 if(!$player->isOnline())
  592.                                 {
  593.                                     //dont show table "delete character" again
  594.                                     $dontshowtableagain = 1;
  595.                                     //delete player
  596.                                     $player->setCustomField('deleted', 1);
  597.                                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Deleted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character <b>'.$player_name.'</b> has been deleted.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  598.                                 }
  599.                                 else
  600.                                     $delete_errors[] = 'This character is online.';
  601.                             }
  602.                             else
  603.                                 $delete_errors[] = 'Wrong password to account.';
  604.                         }
  605.                         else
  606.                             $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
  607.                     }
  608.                     else
  609.                         $delete_errors[] = 'Character with this name doesn\'t exist.';
  610.                 }
  611.                 else
  612.                     $delete_errors[] = 'Name contain illegal characters.';
  613.             }
  614.             else
  615.                 $delete_errors[] = 'Character name or/and password is empty. Please fill in form.';
  616.         }
  617.         if($dontshowtableagain != 1)
  618.         {
  619.             if(!empty($delete_errors))
  620.             {
  621.                 $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  622.                 foreach($delete_errors as $delete_error) {
  623.                     $main_content .= '<li>'.$delete_error;
  624.                 }
  625.                 $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  626.             }
  627.             $main_content .= 'To delete a character enter the name of the character and your password.<br/><br/><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><input type="hidden" name="deletecharactersave" value="1"><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Delete Character</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Character Name:</td><td style="width:90%;" ><input name="delete_name" value="" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="delete_password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  628.         }
  629.     }
  630.     //### UNDELETE character from account ###
  631.     if($action == "undelete")
  632.     {
  633.         $player_name = stripslashes(trim($_GET['name']));
  634.         if(!empty($player_name))
  635.         {
  636.             if(check_name($player_name))
  637.             {
  638.                 $player = $ots->createObject('Player');
  639.                 $player->find($player_name);
  640.                 if($player->isLoaded())
  641.                 {
  642.                     $player_account = $player->getAccount();
  643.                     if($account_logged->getId() == $player_account->getId())
  644.                     {
  645.                         if(!$player->isOnline())
  646.                         {
  647.                             $player->setCustomField('deleted', 0);
  648.                             $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Undeleted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character <b>'.$player_name.'</b> has been undeleted.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  649.                         }
  650.                         else
  651.                             $delete_errors[] = 'This character is online.';
  652.                     }
  653.                     else
  654.                         $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
  655.                 }
  656.                 else
  657.                     $delete_errors[] = 'Character with this name doesn\'t exist.';
  658.             }
  659.             else
  660.                 $delete_errors[] = 'Name contain illegal characters.';
  661.         }
  662.     }
  663.     //## CREATE CHARACTER on account ###
  664.     if($action == "createcharacter")
  665.     {
  666.         if(count($config['site']['worlds']) > 1)
  667.         {
  668.             if(isset($_REQUEST['world']))
  669.                 $world_id = (int) $_REQUEST['world'];
  670.         }
  671.         else
  672.             $world_id = 0;
  673.         if(!isset($world_id))
  674.         {
  675.             $main_content .= 'Before you can create character you must select world: ';
  676.             foreach($config['site']['worlds'] as $id => $world_n)
  677.                 $main_content .= '<br /><a href="?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.$world_n.'</a>';
  678.             $main_content .= '<br /><h3><a href="?subtopic=accountmanagement">BACK</a></h3>';
  679.         }
  680.         else
  681.         {
  682.             $main_content .= '<script type="text/javascript">
  683.                 var nameHttp;
  684.                 function checkName()
  685.                 {
  686.                     if(document.getElementById("newcharname").value=="")
  687.                     {
  688.                         document.getElementById("name_check").innerHTML = \'<b><font color="red">Please enter new character name.</font></b>\';
  689.                         return;
  690.                     }
  691.                     nameHttp=GetXmlHttpObject();
  692.                     if (nameHttp==null)
  693.                     {
  694.                         return;
  695.                     }
  696.                     var newcharname = document.getElementById("newcharname").value;
  697.                     var url="ajax/check_name.php?name=" + newcharname + "&uid="+Math.random();
  698.                     nameHttp.onreadystatechange=NameStateChanged;
  699.                     nameHttp.open("GET",url,true);
  700.                     nameHttp.send(null);
  701.                 }
  702.                 function NameStateChanged()
  703.                 {
  704.                     if (nameHttp.readyState==4)
  705.                     {
  706.                         document.getElementById("name_check").innerHTML=nameHttp.responseText;
  707.                     }
  708.                 }
  709.             </script>';
  710.             $newchar_name = stripslashes(ucwords(strtolower(trim(anti_injection($_POST['newcharname'])))));
  711.             $newchar_sex = $_POST['newcharsex'];
  712.             $newchar_vocation = $_POST['newcharvocation'];
  713.             $newchar_town = $_POST['newchartown'];
  714.             if($_POST['savecharacter'] != 1)
  715.             {
  716.                 $main_content .= 'Please choose a name';
  717.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  718.                     $main_content .= ', vocation';
  719.                 $main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.';
  720.                 if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
  721.                     $main_content .= '<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>';
  722.                 $main_content .= '<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';
  723.                 $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  724.                 if($newchar_sex == 1)
  725.                     $main_content .= 'checked="checked" ';
  726.                 $main_content .= '>male<br/>';
  727.                 $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  728.                 if($newchar_sex == "0")
  729.                     $main_content .= 'checked="checked" ';
  730.                 $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  731.                 if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  732.                     $main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';
  733.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  734.                 {
  735.                     $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  736.                     foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  737.                     {
  738.                         $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  739.                         if($newchar_vocation == $char_vocation_key)
  740.                             $main_content .= 'checked="checked" ';
  741.                         $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
  742.                     }
  743.                     $main_content .= '</table></table></td>';
  744.                 }
  745.                 if(count($config['site']['newchar_towns'][$world_id]) > 1)
  746.                 {
  747.                     $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  748.                     foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  749.                     {
  750.                         $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  751.                         if($newchar_town == $town_id)
  752.                             $main_content .= 'checked="checked" ';
  753.                         $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
  754.                     }
  755.                     $main_content .= '</table></table></td>';
  756.                 }
  757.                 if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  758.                     $main_content .= '</tr></table></div>';
  759.                 $main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  760.             }
  761.             else
  762.             {      
  763.                 if(strlen($newchar_name > 20))
  764.                     $newchar_errors[] = 'Character name can not be logner then 20 characters.';
  765.                 if(empty($newchar_name))
  766.                     $newchar_errors[] = 'Please enter a name for your character!';
  767.                 if(empty($newchar_sex) && $newchar_sex != "0")
  768.                     $newchar_errors[] = 'Please select the sex for your character!';
  769.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  770.                 {
  771.                     if(empty($newchar_vocation))
  772.                         $newchar_errors[] = 'Please select a vocation for your character.';
  773.                 }
  774.                 else
  775.                     $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];
  776.                 if(count($config['site']['newchar_towns'][$world_id]) > 1)
  777.                 {
  778.                     if(empty($newchar_town))
  779.                         $newchar_errors[] = 'Please select a town for your character.';
  780.                 }
  781.                 else
  782.                     $newchar_town = $config['site']['newchar_towns'][$world_id][0];
  783.                 if(empty($newchar_errors))
  784.                 {
  785.                     if(!check_name_new_char($newchar_name))
  786.                         $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
  787.                     if($newchar_sex != 1 && $newchar_sex != "0")
  788.                         $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
  789.                     if(!in_array($newchar_town, $config['site']['newchar_towns'][$world_id]))
  790.                         $newchar_errors[] = 'Please select valid town.';
  791.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  792.                     {
  793.                         $newchar_vocation_check = FALSE;
  794.                         foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  795.                             if($newchar_vocation == $char_vocation_key)
  796.                                 $newchar_vocation_check = TRUE;
  797.                         if(!$newchar_vocation_check)
  798.                             $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
  799.                     }
  800.                     else
  801.                         $newchar_vocation = 0;
  802.                 }
  803.                 if(empty($newchar_errors))
  804.                 {
  805.                     $check_name_in_database = $ots->createObject('Player');
  806.                     $check_name_in_database->find($newchar_name);
  807.                     if($check_name_in_database->isLoaded())
  808.                         $newchar_errors[] .= 'This name is already used. Please choose another name!';
  809.                     $number_of_players_on_account = $account_logged->getPlayersList()->count();
  810.                     if($number_of_players_on_account >= $config['site']['max_players_per_account'])
  811.                         $newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';
  812.                 }
  813.                 if(empty($newchar_errors))
  814.                 {
  815.                     $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];
  816.                     $char_to_copy = new OTS_Player();
  817.                     $char_to_copy->find($char_to_copy_name);
  818.                     if(!$char_to_copy->isLoaded())
  819.                         $newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy'.$char_to_copy_name.'</b> doesn\'t exist.';
  820.                 }
  821.                 if(empty($newchar_errors))
  822.                 {
  823.                     if($newchar_sex == "0")
  824.                         $char_to_copy->setLookType(136);
  825.                     $player = $ots->createObject('Player');
  826.                     $player->setName($newchar_name);
  827.                     $player->setAccount($account_logged);
  828.                     $player->setGroup($char_to_copy->getGroup());
  829.                     $player->setSex($newchar_sex);
  830.                     $player->setVocation($char_to_copy->getVocation());
  831.                     $player->setConditions($char_to_copy->getConditions());
  832.                     $player->setRank($char_to_copy->getRank());
  833.                     $player->setLookAddons($char_to_copy->getLookAddons());
  834.                     $player->setTownId($newchar_town);
  835.                     $player->setExperience($char_to_copy->getExperience());
  836.                     $player->setLevel($char_to_copy->getLevel());
  837.                     $player->setMagLevel($char_to_copy->getMagLevel());
  838.                     $player->setHealth($char_to_copy->getHealth());
  839.                     $player->setHealthMax($char_to_copy->getHealthMax());
  840.                     $player->setMana($char_to_copy->getMana());
  841.                     $player->setManaMax($char_to_copy->getManaMax());
  842.                     $player->setManaSpent($char_to_copy->getManaSpent());
  843.                     $player->setSoul($char_to_copy->getSoul());
  844.                     $player->setDirection($char_to_copy->getDirection());
  845.                     $player->setLookBody($char_to_copy->getLookBody());
  846.                     $player->setLookFeet($char_to_copy->getLookFeet());
  847.                     $player->setLookHead($char_to_copy->getLookHead());
  848.                     $player->setLookLegs($char_to_copy->getLookLegs());
  849.                     $player->setLookType($char_to_copy->getLookType());
  850.                     $player->setCap($char_to_copy->getCap());
  851.                     $player->setPosX(0);
  852.                     $player->setPosY(0);
  853.                     $player->setPosZ(0);
  854.                     $player->setLossExperience($char_to_copy->getLossExperience());
  855.                     $player->setLossMana($char_to_copy->getLossMana());
  856.                     $player->setLossSkills($char_to_copy->getLossSkills());
  857.                     $player->setLossItems($char_to_copy->getLossItems());
  858.                     $player->save();
  859.                     unset($player);
  860.                     $player = $ots->createObject('Player');
  861.                     $player->find($newchar_name);
  862.                     if($player->isLoaded())
  863.                     {
  864.                         $player->setCustomField('world_id', (int) $world_id);
  865.                         $player->setSkill(0,$char_to_copy->getSkill(0));
  866.                         $player->setSkill(1,$char_to_copy->getSkill(1));
  867.                         $player->setSkill(2,$char_to_copy->getSkill(2));
  868.                         $player->setSkill(3,$char_to_copy->getSkill(3));
  869.                         $player->setSkill(4,$char_to_copy->getSkill(4));
  870.                         $player->setSkill(5,$char_to_copy->getSkill(5));
  871.                         $player->setSkill(6,$char_to_copy->getSkill(6));
  872.                         $player->save();
  873.                         $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
  874.                         foreach($loaded_items_to_copy as $save_item)
  875.                             $SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
  876.                         $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Created</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character <b>'.$newchar_name.'</b> has been created.<br/>Please select the outfit when you log in for the first time.<br/><br/><b>See you on '.$config['server']['serverName'].'!</b></td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  877.                     }
  878.                     else
  879.                     {
  880.                         echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
  881.                         exit;
  882.                     }
  883.                 }
  884.                 else
  885.                 {
  886.                     $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  887.                     foreach($newchar_errors as $newchar_error)
  888.                         $main_content .= '<li>'.$newchar_error;
  889.                     $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
  890.                     $main_content .= 'Please choose a name';
  891.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  892.                         $main_content .= ', vocation';
  893.                     $main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';
  894.                     $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  895.                     if($newchar_sex == 1)
  896.                         $main_content .= 'checked="checked" ';
  897.                     $main_content .= '>male<br/>';
  898.                     $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  899.                     if($newchar_sex == "0")
  900.                         $main_content .= 'checked="checked" ';
  901.                     $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  902.                     if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  903.                         $main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';
  904.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  905.                     {
  906.                         $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  907.                         foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  908.                         {
  909.                             $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  910.                             if($newchar_vocation == $char_vocation_key)
  911.                                 $main_content .= 'checked="checked" ';
  912.                             $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
  913.                         }
  914.                         $main_content .= '</table></table></td>';
  915.                     }
  916.                     if(count($config['site']['newchar_towns'][$world_id]) > 1)
  917.                     {
  918.                         $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  919.                         foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  920.                         {
  921.                             $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  922.                             if($newchar_town == $town_id)
  923.                                 $main_content .= 'checked="checked" ';
  924.                                 $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
  925.                         }
  926.                             $main_content .= '</table></table></td>';
  927.                     }
  928.                     if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  929.                         $main_content .= '</tr></table></div>';
  930.                     $main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  931.                 }
  932.             }
  933.         }
  934.     }
  935. if($action == "statusDeposito"){       
  936. $main_content .= 'Historico de doa&ccedil;&otilde;es.';
  937. $main_content .= '<table width="100%" style="border-style:dashed; border-color:#000;" border="1" cellspacing="0" cellpadding="0">
  938.  <tr>
  939.    <td>#</td>
  940.    <td>Data</td>
  941.    <td>Tipo</td>
  942.    <td>Valor</td>
  943.    <td>Status</td>
  944.  </tr>';
  945.  
  946. $buscaDepositos = $SQL->query('SELECT * FROM depositos WHERE acc = '.$account_logged.'');
  947. foreach($buscaDepositos as $buscaDep){
  948.     $countDep++;
  949.     $main_content .= '  
  950. <tr>
  951.   <td>'.$countDep.'</td>
  952.   <td>'.$buscaDep['data'].'</td>
  953.   <td>'.$buscaDep['tipo'].'</td>
  954.   <td>'.$buscaDep['valor'].'</td>
  955.   <td>'.$buscaDep['status'].'</td>
  956. </tr>';
  957.    
  958.  
  959. }
  960.  
  961.  
  962. $main_content .= '</table>';
  963.  
  964. }
  965. if($action == "depositoOK"){       
  966. $main_content .= 'Deposito confirmado com sucesso!!!<br />Basta aguardar liberação.';
  967. }
  968. if($action == "salvadeposito"){
  969.  
  970. $SQL->query('INSERT INTO depositos (id, nome, email, valor, data, hora, n_envelope, outros, data_cad, acc, tipo) VALUES (NULL, "'.$_POST['name'].'", "'.$_POST['email'].'", "'.$_POST['valor'].'", "'.$_POST['data'].'", "'.$_POST['hora'].'", "'.$_POST['envelope'].'", "'.$_POST['outros'].'", now(), "'.$account_logged.'", "'.$_POST['tipo'].'")');
  971.    
  972. header('location: index.php?subtopic=accountmanagement&action=depositoOK');
  973.        
  974.        
  975. }
  976.     if($action == "confirmarDeposito"){
  977. echo'
  978. <script language="javascript">
  979. function MascaraMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){
  980.    var sep = 0;
  981.    var key = \'\';
  982.    var i = j = 0;
  983.    var len = len2 = 0;
  984.    var strCheck = \'0123456789\';
  985.    var aux = aux2 = \'\';
  986.    var whichCode = (window.Event) ? e.which : e.keyCode;
  987.    if (whichCode == 13) return true;
  988.    key = String.fromCharCode(whichCode); // Valor para o código da Chave
  989.    if (strCheck.indexOf(key) == -1) return false; // Chave inválida
  990.    len = objTextBox.value.length;
  991.    for(i = 0; i < len; i++)
  992.        if ((objTextBox.value.charAt(i) != \'0\') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break;
  993.    aux = \'\';
  994.    for(; i < len; i++)
  995.        if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i);
  996.    aux += key;
  997.    len = aux.length;
  998.    if (len == 0) objTextBox.value = \'\';
  999.    if (len == 1) objTextBox.value = \'0\'+ SeparadorDecimal + \'0\' + aux;
  1000.    if (len == 2) objTextBox.value = \'0\'+ SeparadorDecimal + aux;
  1001.    if (len > 2) {
  1002.        aux2 = \'\';
  1003.        for (j = 0, i = len - 3; i >= 0; i--) {
  1004.            if (j == 3) {
  1005.                aux2 += SeparadorMilesimo;
  1006.                j = 0;
  1007.            }
  1008.            aux2 += aux.charAt(i);
  1009.            j++;
  1010.        }
  1011.        objTextBox.value = \'\';
  1012.        len2 = aux2.length;
  1013.        for (i = len2 - 1; i >= 0; i--)
  1014.        objTextBox.value += aux2.charAt(i);
  1015.        objTextBox.value += SeparadorDecimal + aux.substr(len - 2, len);
  1016.    }
  1017.    return false;
  1018. }
  1019.  
  1020.  
  1021. function mascaraData(campoData){
  1022.              var data = campoData.value;
  1023.              if (data.length == 2){
  1024.                  data = data + \'/\';
  1025.                  document.forms[0].data.value = data;
  1026.      return true;              
  1027.              }
  1028.              if (data.length == 5){
  1029.                  data = data + \'/\';
  1030.                  document.forms[0].data.value = data;
  1031.                  return true;
  1032.              }
  1033.         }
  1034. </script>
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042. <script language="javascript" type="text/javascript" src="include/validate.js"></script>
  1043. <link type="text/css" rel="stylesheet" media="screen" href="include/validate.css">';
  1044.         $formPag = $_REQUEST['formPag'];
  1045.        
  1046.         if(empty($formPag)){
  1047.         $main_content .= '
  1048.         <center>
  1049.         <br /><img src="imglogo/titulo.gif"/><br /><br />
  1050.         <a href="?subtopic=accountmanagement&action=confirmarDeposito&formPag=pagseguro"><img src="imglogo/pagseguro.png" width="300px" border="0" /><br /><br /></a>
  1051.         <a href="?subtopic=accountmanagement&action=confirmarDeposito&formPag=bb"><img src="imglogo/logo-bb.png" width="300px" border="0" /><br /><br /></a>
  1052.         <a href="?subtopic=accountmanagement&action=confirmarDeposito&formPag=caixa"><img src="imglogo/caixa.png" width="300px" border="0" /><br /><br /></a>
  1053.         </center>';
  1054.         }
  1055.         if(!empty($formPag)){
  1056.     $main_content .= '
  1057.    
  1058.    
  1059. <h3>Cadastro de deposito</h3>
  1060.  
  1061. <form name="validate" action="index.php?subtopic=accountmanagement&action=salvadeposito" method="post" onsubmit="return _init.check_form();">
  1062. <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5>
  1063. <TR>
  1064.     <TD><label for="name">Seu Nome</label></TD>
  1065.     <TD><div id="_name" class="input_wrap"><input type=text name="name" value="" class="input_box"></div></TD>
  1066. </TR>
  1067. <TR>
  1068.     <TD> <label for="email">Seu e-mail</label></TD>
  1069.     <TD><div id="_email" class="input_wrap"><input type=text name="email" value="" class="input_box"></div></TD>
  1070. </TR>
  1071. <TR>
  1072.     <TD><label for="valor">Valor</label></TD>
  1073.     <TD><div id="_valor" class="input_wrap"><input type="text" name="valor" value="" class="input_box" onKeyPress="return(MascaraMoeda(this,\'.\',\',\',event))"></div></TD>
  1074. </TR>
  1075.  
  1076. <TR>
  1077.     <TD><label for="data">Data</label></TD>
  1078.     <TD><div id="_data" class="input_wrap"><input type="text" name="data" value="" class="input_box"  OnKeyUp="mascaraData(this);"></div></TD>
  1079. </TR>
  1080. <TR>
  1081.     <TD><label for="hora">Hora</label></TD>
  1082.     <TD><div id="_hora" class="input_wrap"><input type="text" name="hora" value="" class="input_box" ></div></TD>
  1083. </TR>
  1084. <TR>
  1085.         <TD><label for="envelope">N Envelope</label></TD>
  1086.     <TD><div id="_envelope" class="input_wrap"><input type="text" name="envelope" value="" class="input_box"></div></TD>
  1087. </TR>
  1088.  
  1089. <TR>
  1090.     <TD><label for="outros">Outros dados</label></TD>
  1091.     <TD><div id="_outros" class="input_wrap"><input type=text name="outros" value="" class="input_box"></div></TD>
  1092. </TR>
  1093. <TR>
  1094.     <TD COLSPAN=2>&nbsp;</TD>
  1095. </TR>
  1096.  
  1097. <input type="hidden" name="tipo" value="'.$formPag.'" />
  1098.  
  1099.  
  1100. <TR>
  1101.     <TD><input type="button" value="Reset Form" onClick="this.form.reset()" /></TD>
  1102.     <TD ALIGN=RIGHT><input type=submit name="submit" value="Submit"></TD>
  1103. </TR>
  1104. </TABLE>
  1105. </form>
  1106.  
  1107. <script>
  1108. /* ---------------------------------------------------------
  1109.   initialize the form to validate
  1110. ----------------------------------------------------------*/
  1111. var _init = new validate
  1112. ({
  1113.     form_name       : \'validate\',
  1114.     debug           : 1,
  1115.     msg_type        : \'inline\',
  1116.    inline : {
  1117.         yalign : "top",
  1118.         xoffset: -1,
  1119.         yoffset: 0,
  1120.         spdin : 0,
  1121.         htmlpre : "<div class=\"error\">",
  1122.         htmlpost : "</div>"
  1123.    },
  1124.    tooltip : {
  1125.         yalign : "top",
  1126.         xoffset: -1,
  1127.         yoffset: 0,
  1128.         spdin : 0,
  1129.         spdout : 0,
  1130.         fadeout: 0,
  1131.         htmlpre : "<div class=\"msg\">",
  1132.         htmlpost : "</div>"
  1133.    }
  1134. });
  1135.  
  1136. /* ---------------------------------------------------------
  1137.   Setup the fields that are required
  1138.   checks to make sure value is filled in, selected or checked
  1139. ----------------------------------------------------------*/
  1140. _init.required({ field: "name", msg: "Seu nome", inline : { position_id : "_name" } });
  1141. _init.required({ field: "valor", msg: "Valor doado", inline : { position_id : "_valor" } });
  1142. _init.required({ field: "email", msg: "Use um e-mail valido", inline : { position_id : "_email" } });
  1143. _init.required({ field: "data", msg: "Data doação", inline : { position_id : "_data" } });
  1144. _init.required({ field: "hora", msg: "Horario doação", inline : { position_id : "_hora" } });
  1145.  
  1146. _init.special({ type: "email", field: "email", msg: "Ops, e-mail invalido", inline : { position_id : "_email" } });
  1147. _init.special({ type: "date", field: "data", format: ["%D/%M/%Y"], msg: "Ops, Ex.00/00/0000", inline : { position_id : "_data" } });
  1148.  
  1149.  
  1150. _init.tooltip({ field: "name", msg: "Seu nome", tooltip : { position_id : "_name" } });
  1151. _init.tooltip({ field: "email", msg: "E-mail valido.", tooltip : { position_id : "_email" } });
  1152. _init.tooltip({ field: "valor", msg: "Valor doado", tooltip : { position_id : "_senha" } });
  1153. _init.tooltip({ field: "data", msg: "Data doação", tooltip : { position_id : "_data" } });
  1154. _init.tooltip({ field: "hora", msg: "Horario doação", tooltip : { position_id : "_hora" } });
  1155. _init.tooltip({ field: "outros", msg: "Outros dados", tooltip : { position_id : "_outros" } });
  1156. _init.tooltip({ field: "envelope", msg: "Numero do envelope", tooltip : { position_id : "_envelope" } });
  1157.  
  1158. </script>
  1159. ';
  1160.    
  1161.    
  1162.         }
  1163.  
  1164.     }  
  1165.    
  1166.    
  1167. }
  1168. ?>
Add Comment
Please, Sign In to add comment