Ir para conteúdo
  • Cadastre-se

[ajuda pf] configura a vip no site.


Posts Recomendados

  1. alguem pode ajuda a configura a vip no site , pq eu ja tentei de quase todo jeito e não da certo , eu vo posta aki abaixo o link para configura o site , os scripts estão la em baixo na Configurando o Gesior.

 

  • <p>New password: <b>'.$org_pass.'</b></p>
    </body>
    </html>';
    require("phpmailer/class.phpmailer.php");
    $mail = new PHPMailer();
    if ($config['site']['smtp_enabled'] == "yes")
    {
    $mail->IsSMTP();
    $mail->Host = $config['site']['smtp_host'];
    $mail->Port = (int)$config['site']['smtp_port'];
    $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
    $mail->Username = $config['site']['smtp_user'];
    $mail->Password = $config['site']['smtp_pass'];
    }
    else
    $mail->IsMail();
    $mail->IsHTML(true);
    $mail->From = $config['site']['mail_address'];
    $mail->AddAddress($account_logged->getEMail());
    $mail->Subject = $config['server']['serverName']." - Changed password";
    $mail->Body = $mailBody;
    if($mail->Send())
    $main_content .= '<br /><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
    else
    $main_content .= '<br /><small>An error occorred while sending email with password!</small>';
    }
    $main_content .= '</td></tr>  </table></div>  </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" 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>';
    $_SESSION['password'] = $new_password;
    }
    }
    }
     
    //############# CHANGE E-MAIL ###################
    if($action == "changeemail") {
    $account_email_new_time = $account_logged->getCustomField("email_new_time");
    if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); }
    if($account_email_new_time < 10){
    if($_POST['changeemailsave'] == 1) {
    $account_email_new = trim($_POST['new_email']);
    $post_password = trim($_POST['password']);
    if(empty($account_email_new)) {
    $change_email_errors[] = "Please enter your new email address.";
    }
    else
    {
    if(!check_mail($account_email_new)) {
    $change_email_errors[] = "E-mail address is not correct.";
    }
    }
    if(empty($post_password)) {
    $change_email_errors[] = "Please enter password to your account.";
    }
    else
    {
    $post_password = password_ency($post_password);
    if($post_password != $account_logged->getPassword()) {
    $change_email_errors[] = "Wrong password to account.";
    }
    }
    if(empty($change_email_errors)) {
    $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;
    $account_logged->setCustomField("email_new", $account_email_new);
    $account_logged->setCustomField("email_new_time", $account_email_new_time);
    $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, H: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>';
    }
    else
    {
    //show errors
    $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 />';
    foreach($change_email_errors as $change_email_error) {
    $main_content .= '<li>'.$change_email_error;
    }
    $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 />';
    //show form
    $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=index.php?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&amp;action=manage" 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>';
    }
    }
    else
    {
    $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=index.php?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&amp;action=manage" 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>';
    }
    }
    else
    {
    if($account_email_new_time < time()) {
    if($_POST['changeemailsave'] == 1) {
    $account_logged->setCustomField("email_new", "");
    $account_logged->setCustomField("email_new_time", 0);
    $account_logged->setEmail($account_email_new);
    $account_logged->save();
    $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="index.php?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>';
    }
    else
    {
    $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="index.php?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="index.php?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&amp;action=manage" 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>';
    }
    }
    else
    {
    $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="index.php?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&amp;action=manage" 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>';
    }
    }
    if($_POST['emailchangecancel'] == 1) {
    $account_logged->setCustomField("email_new", "");
    $account_logged->setCustomField("email_new_time", 0);
    $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&amp;action=manage" 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>';
    }
    }
           
    //########### CHANGE PUBLIC INFORMATION (about account owner) ######################
    if($action == "changeinfo") {
    $new_rlname = htmlspecialchars(stripslashes(trim($_POST['info_rlname'])));
    $new_location = htmlspecialchars(stripslashes(trim($_POST['info_location'])));
    if($_POST['changeinfosave'] == 1) {
    //save data from form
    $account_logged->setRLName($new_rlname);
    $account_logged->setLocation($new_location);
    $account_logged->save();
    $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&amp;action=manage" 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>';
    }
    else
    {
    //show form
    $account_rlname = $account_logged->getRLName();
    $account_location = $account_logged->getLocation();
    $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="index.php?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&amp;action=manage" 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>';
    }
    }
     
    //############## GENERATE RECOVERY KEY ###########
    if($action == "registeraccount")
    {
    $reg_password = password_ency(trim($_POST['reg_password']));
    $old_key = $account_logged->getRecoveryKey("key");
    if($_POST['registeraccountsave'] == "1")
    {
    if($reg_password == $account_logged->getPassword())
    {
    if(empty($old_key))
    {
    $dontshowtableagain = 1;
    $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890';
    $max = strlen($acceptedChars)-1;
    $new_rec_key = NULL;
    // 10 = number of chars in generated key
    for($i=0; $i < 22; $i++) {
    $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
    $new_rec_key .= $cnum[$i];
    }
    $account_logged->setRecoveryKey($new_rec_key);
    $account_logged->save();
    $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>';
    if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])
    {
    $mailBody = '<html>
    <body>
    <h3>New recovery key!</h3>
    <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>
    <p>Recovery key: <b>'.$new_rec_key.'</b></p>
    </body>
    </html>';
    require("phpmailer/class.phpmailer.php");
    $mail = new PHPMailer();
    if ($config['site']['smtp_enabled'] == "yes")
    {
    $mail->IsSMTP();
    $mail->Host = $config['site']['smtp_host'];
    $mail->Port = (int)$config['site']['smtp_port'];
    $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
    $mail->Username = $config['site']['smtp_user'];
    $mail->Password = $config['site']['smtp_pass'];
    }
    else
    $mail->IsMail();
    $mail->IsHTML(true);
    $mail->From = $config['site']['mail_address'];
    $mail->AddAddress($account_logged->getEMail());
    $mail->Subject = $config['server']['serverName']." - recovery key";
    $mail->Body = $mailBody;
    if($mail->Send())
    $main_content .= '<br /><small>Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
    else
    $main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';
    }
    $main_content .= '</ul>  </table></div>  </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" 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>';
    }
    else
    $reg_errors[] = 'Your account is already registred.';
    }
    else
    $reg_errors[] = 'Wrong password to account.';
    }
    if($dontshowtableagain != 1)
    {
    //show errors if not empty
    if(!empty($reg_errors))
    {
    $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 />';
    foreach($reg_errors as $reg_error)
    $main_content .= '<li>'.$reg_error;
    $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 />';
    }
    //show form
    $main_content .= 'To generate recovery key for your account please enter your password.<br /><br />
    <form action="index.php?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&amp;action=manage" 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>';
    }
    }
    //############## GENERATE NEW RECOVERY KEY ###########
    if($action == "newreckey"){
    $reg_password = password_ency(trim($_POST['reg_password']));
    $reckey = $account_logged->getRecoveryKey();
    if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))
    $main_content .= '
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
    <td class="white"><b>Error</b></td>
    </tr>
    <tr bgcolor='.$config['site']['darkborder'].'>
    <td>
    <table border="0" cellspacing="1" cellpadding="1">
    <tr>
    <td>You are not allowed to generate a new recovery key.</td>
    </tr>
    </table>
    </td>
    </tr>
    </table> ';
    else
    {
    $points = $account_logged->getPremiumPoints();
    if($_POST['registeraccountsave'] == "1")
    {
    if($reg_password == $account_logged->getPassword())
    {
    if($points >= $config['site']['generate_new_reckey_price'])
    {
    $dontshowtableagain = 1;
    $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890';
    $max = strlen($acceptedChars)-1;
    $new_rec_key = NULL;
    // 10 = number of chars in generated key
    for($i=0; $i < 22; $i++) {
    $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
    $new_rec_key .= $cnum[$i];
    }
    $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>';
    $mailBody = '
    <html>
    <body>
    <h3>New recovery key!</h3>
    <p>You or someone else generated recovery key to your account on server <b>'.$config['server']['serverName'].'</b>.</p>
    <p>Recovery key: <b>'.$new_rec_key.'</b></p>
    </body>
    </html>';
    require("phpmailer/class.phpmailer.php");
    $mail = new PHPMailer();
    if ($config['site']['smtp_enabled'] == "yes")
    {
    $mail->IsSMTP();
    $mail->Host = $config['site']['smtp_host'];
    $mail->Port = (int)$config['site']['smtp_port'];
    $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
    $mail->Username = $config['site']['smtp_user'];
    $mail->Password = $config['site']['smtp_pass'];
    }
    else
    $mail->IsMail();
    $mail->IsHTML(true);
    $mail->From = $config['site']['mail_address'];
    $mail->AddAddress($account_logged->getEMail());
    $mail->Subject = $config['server']['serverName']." - new recovery key";
    $mail->Body = $mailBody;
    if($mail->Send())
    {
    $account_logged->setRecoveryKey(new_rec_key);
    $account_logged->setPremiumPoints($account_logged->getPremiumPoints()-$config['site']['generate_new_reckey_price']);
    $account_logged->save();
    $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.';
    }
    else
    $main_content .= 'An error occorred while sending email (<b>'.$account_logged->getEMail().'</b>) with recovery key! Recovery key not changed. Try again later.';
    $main_content .= '</ul></table></div>  </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" 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>';
    }
    else
    $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';
    }
    else
    $reg_errors[] = 'Wrong password to account.';
    }
    if($dontshowtableagain != 1)
    {
    //show errors if not empty
    if(!empty($reg_errors))
    {
    $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 />';
    foreach($reg_errors as $reg_error)
    $main_content .= '<li>'.$reg_error;
    $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 />';
    }
    //show form
    $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><br />You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><br /><br /><form action="index.php?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>';
    if ($account_logged->getCustomField("premium_points") < $config['site']['generate_new_reckey_price']){
    $main_content .='<input type="text" name="" size="35" value="You no have premium points to buy" disabled="disabled" >';
    }
    else
    {
    $main_content .='<input type="password" name="reg_password" size="30" maxlength="29" >';
    }
    $main_content .='</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&amp;action=manage" 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>';
    }
    }
    }
    //###### CHANGE CHARACTER COMMENT ######
    if($action == "changecomment") {
    $player_name = stripslashes($_REQUEST['name']);
    $new_comment = htmlspecialchars(stripslashes(substr(trim($_POST['comment']),0,2000)));
    $new_hideacc = (int) $_POST['accountvisible'];
    $new_showskills = (int) $_POST['showskills'];
    $show_outfit = (int) $_POST['show_outfit'];
    $show_eq = (int) $_POST['show_eq'];
     
    if(check_name($player_name)) {
    $player = $ots->createObject('Player');
    $player->find($player_name);
    if($player->isLoaded()) {
    $player_account = $player->getAccount();
    if($account_logged->getId() == $player_account->getId()) {
    if($_POST['changecommentsave'] == 1) {
    $player->setCustomField("hide_char", $new_hideacc);
    $player->setCustomField("show_eq", $show_eq);
    $player->setCustomField("comment", $new_comment);
    $player->setCustomField("show_outfit", $show_outfit);
    $main_content .= '
    <form action="index.php?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" >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" >
    <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>';
    }
    else
    {
    $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 />
    <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" >Character Data</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" style="vertical-align:middle;">Name:</td>
    <td style="width:80%;" >'.$player_name.'</td>
    </tr>
    <tr>
    <td class="LabelV" style="vertical-align:middle;" >World:</td>
    <td style="width:80%;" >'.$config['site']['worlds'][$player->getWorld()].'</td>
    </tr>';
    if ($player->getCustomField("sex") > 0){
    $main_content .='
    <tr>
    <td class="LabelV" style="vertical-align:middle;">Sex:</td>
    ';
    $sex_types = array (1 => 'male', 0 => 'female');
    $main_content .='
    <td>'.$sex_types[$player->getCustomField("sex")].'</td>
    </tr>';
    }
    $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>
    </td>
    </tr>
    </table>
    </div>
    </table>
    </div>
    </td>
    </tr>
    <br />
    <form action="index.php?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" >Hide Account:</td><td>';
    if($player->getCustomField("hide_char") == 1)
    {
    $main_content .= '<input type="checkbox" name="accountvisible"  value="1" checked="checked">';
    }
    else
    {
    $main_content .= '<input type="checkbox" name="accountvisible"  value="1" >';
    }
     
    $main_content .= ' check to hide your account information</td>
    </tr>
    <tr><td><b>Comment:</b></td>
    <td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual">'.$player->getCustomField("comment").'</textarea><br />[max. length: 2000 chars, 50 lines (ENTERs)]<br />
    <Small><b>BBCode:</b> OFF</small></td>
    </tr>';
     
     
    $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>
    </div>
    </div>
    </td>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </td>
    </tr>
    </table>
    </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="index.php?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>';  
    } }
    else
    {
    $main_content .= '<div class="notice">Player <b>'.$player_name.'</b> is not on your account !</div><br />
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <a href="javascript:void();" onclick=location.href="index.php?subtopic=accountmanagement">
    <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); visibility: hidden;"></div>
    <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
    </table>';
    }
    }
    else
    {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
    <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
    <td CLASS="white"><b>Error</b></td>
    </tr>
    <tr BGCOLOR='.$config['site']['darkborder'].'>
    <td>Error. Character with this name doesn\'t exist.</td>
    </tr>
    </TABLE>
    <br />
    <center>
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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>
    <form action="?subtopic=accountmanagement" method="post">
    <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
    </form>
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </center>';
    }
    }
    else
    {
    $main_content .= "Error. Name contain illegal characters.";
    }
    }
     
    //### NEW NICK - set new nick proposition ###
    if($action == "newnick")
    $name = $_GET['name'];
    $name_new = stripslashes(ucwords(strtolower(trim($_GET['name_new']))));
    if(!empty($name) && !empty($name_new))
    {
    if(check_name_new_char($name_new))
    {
    $player = $ots->createObject('Player');
    $player->find($name);
    if($player->isLoaded() && $player->isNameLocked())
    {
    $player_account = $player->getAccount();
    if($account_logged->getId() == $player_account->getId())
    {
    if(!$player->getOldName())
    if(!$player->isOnline())
    {
    $player->setCustomField('old_name', $name_new);
    $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>';
    }
    else
    $main_content .= 'This character is online.';
    else
    $main_content .= 'You already set new name for this character ( <b>'.$player->getOldName().'</b> ). You must wait until GM accept/reject your proposition.';
    }
    else
    $main_content .= 'Character <b>'.$player_name.'</b> is not on your account.';
    }
    else
    $main_content .= 'Character with this name doesn\'t exist or isn\'t name locked.';
    }
    else
    $main_content .= 'Name contain illegal characters. Invalid format or lenght.';
    }
    else
    $main_content .= 'Please enter new char name.';
    $main_content .= '<br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?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>';
    }
     
    //### DELETE character from account ###
    if($action == "deletecharacter") {
    $player_name = stripslashes(trim($_GET['name']));
    $password_verify = trim($_POST['delete_password']);
    $password_verify = password_ency($password_verify);
    if($_POST['deletecharactersave'] == 1) {
    if(!empty($player_name) && !empty($password_verify)) {
    if(check_name($player_name)) {
    $player = $ots->createObject('Player');
    $player->find($player_name);
    if($player->isLoaded()) {
    $player_account = $player->getAccount();
    if($account_logged->getId() == $player_account->getId()) {
    if($password_verify == $account_logged->getPassword()) {
    if(!$player->isOnline())
    {
    // show table "delete character" again
    $dontshowtableagain = 1;
    //delete player
    $player->setCustomField('deleted', 1);
    $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="index.php?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>';
    }
    else
    $delete_errors[] = 'This character is online.';
    }
    else
    {
    $delete_errors[] = 'Wrong password to account.';
    }
    }
    else
    {
    $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
    }
    }
    else
    {
    $delete_errors[] = 'Character with this name doesn\'t exist.';
    }
    }
    else
    {
    $delete_errors[] = 'Name contain illegal characters.';
    }
    }
    else
    {
    $delete_errors[] = 'Character name or/and password is empty. Please fill in form.';
    }
    }
    if($dontshowtableagain != 1) {
    if(!empty($delete_errors)) {
    $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 />';
    foreach($delete_errors as $delete_error) {
    $main_content .= '<li>'.$delete_error;
    }
    $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 />';
    }
    $main_content .= 'To delete this character enter your password and click on "Submit".
    You can undelete the character within the first 2 months (60 days) after the deletion.
    After this time the character is deleted for good and cannot be restored anymore!<br /><br />
    <form action="index.php?subtopic=accountmanagement&action=deletecharacter&name='.$player_name.'" 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%;" >'.$player_name.'</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="index.php?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>';
    }
    }
     
           
    //### UNDELETE character from account ###
    if($action == "undelete")
    {
    $player_name = stripslashes(trim($_GET['name']));
    if(!empty($player_name))
    {
    if(check_name($player_name))
    {
    $player = $ots->createObject('Player');
    $player->find($player_name);
    if($player->isLoaded())
    {
    $player_account = $player->getAccount();
    if($account_logged->getId() == $player_account->getId())
    {
    if(!$player->isOnline())
    {
    $player->setCustomField('deleted', 0);
    $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="index.php?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>';
    }
    else
    $delete_errors[] = 'This character is online.';
    }
    else
    $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
    }
    else
    $delete_errors[] = 'Character with this name doesn\'t exist.';
    }
    else
    $delete_errors[] = 'Name contain illegal characters.';
    }
    }
    //## CREATE CHARACTER on account ###
    if($action == "createcharacter"){
    if(count($config['site']['worlds']) > 1){
    if(isset($_REQUEST['world']))
    $world_id = (int) $_REQUEST['world'];
    }
    else
    $world_id = 0;
    if(!isset($world_id)){
    $main_content .= 'Before you can create character you must select world: ';
    foreach($config['site']['worlds'] as $id => $world_n)
    $main_content .= '<br /><a href="index.php?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.$world_n.'</a>';
    $main_content .= '<br /><h3><a href="index.php?subtopic=accountmanagement">BACK</a></h3>';
    }else{
    $main_content .= '
    <script type="text/javascript">
    var nameHttp;
     
    function checkName()
    {
    if(document.getElementById("newcharname").value=="")
    {
    document.getElementById("name_check").innerHTML = \'<font color="red">Please enter new character name.</font>\';
    return;
    }
    nameHttp=GetXmlHttpObject();
    if (nameHttp==null)
    {
    return;
    }
    var newcharname = document.getElementById("newcharname").value;
    var url="ajax/check_name.php?name=" + newcharname + "&uid="+Math.random();
    nameHttp.onreadystatechange=NameStateChanged;
    nameHttp.open("GET",url,true);
    nameHttp.send(null);
    }
     
    function NameStateChanged()
    {
    if (nameHttp.readyState==4)
    {
    document.getElementById("name_check").innerHTML=nameHttp.responseText;
    }
    }
    </script>';
    $newchar_name = stripslashes(ucwords(strtolower(trim($_POST['newcharname']))));
    $newchar_sex = $_POST['newcharsex'];
    $newchar_vocation = $_POST['newcharvocation'];
    $newchar_town = $_POST['newchartown'];
    if($_POST['savecharacter'] != 1)
    {
    $main_content .= 'Please choose a name';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= ', vocation';
    $main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="index.php?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br />';
    if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
    $main_content .= '<br /><TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS=white><b>Erro</b></td>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'><TD><b><font color="red">You have maximum number of characters per account on your account. Delete one before you make new.</font></b></TD>
    </TR></TABLE>';
    $main_content .= '<br /><form action="index.php?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>';
    $main_content .= '<input type="radio" name="newcharsex" value="1" ';
    if($newchar_sex == 1)
    $main_content .= 'checked="checked" ';
    $main_content .= '>male<br />';
    $main_content .= '<input type="radio" name="newcharsex" value="0" ';
    if($newchar_sex == "0")
    $main_content .= 'checked="checked" ';
    $main_content .= '>female<br /></td></tr></table></div></div></table></div>';
    if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= '<div class="InnerTableContainer" >  <table style="width:100%;" ><tr>';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    {
    $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%" >';
    foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
    {
    $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
    if($newchar_vocation == $char_vocation_key)
    $main_content .= 'checked="checked" ';
    $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }
    if(count($config['site']['newchar_towns'][$world_id]) > 1)
    {
    $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%" >';
    foreach($config['site']['newchar_towns'][$world_id] as $town_id)
    {
    $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
    if($newchar_town == $town_id)
    $main_content .= 'checked="checked" ';
    $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }
    if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= '</tr></table></div>';
    $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="index.php?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>';
    }
    else
    {      
    if(empty($newchar_name))
    $newchar_errors[] = 'Please enter a name for your character!';
    if(empty($newchar_sex) && $newchar_sex != "0")
    $newchar_errors[] = 'Please select the sex for your character!';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    {
    if(empty($newchar_vocation))
    $newchar_errors[] = 'Please select a vocation for your character.';
    }
    else
    $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];
    if(count($config['site']['newchar_towns'][$world_id]) > 1)
    {
    if(empty($newchar_town))
    $newchar_errors[] = 'Please select a town for your character.';
    }
    else
    $newchar_town = $config['site']['newchar_towns'][$world_id][0];
    if(empty($newchar_errors))
    {
    if(!check_name_new_char($newchar_name))
    $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
    if($newchar_sex != 1 && $newchar_sex != "0")
    $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
    if(!in_array($newchar_town, $config['site']['newchar_towns'][$world_id]))
    $newchar_errors[] = 'Please select valid town.';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    {
    $newchar_vocation_check = FALSE;
    foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
    if($newchar_vocation == $char_vocation_key)
    $newchar_vocation_check = TRUE;
    if(!$newchar_vocation_check)
    $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
    }
    else
    $newchar_vocation = 0;
    }
    if(empty($newchar_errors))
    {
    $check_name_in_database = $ots->createObject('Player');
    $check_name_in_database->find($newchar_name);
    if($check_name_in_database->isLoaded())
    $newchar_errors[] .= 'This name is already used. Please choose another name!';
    $number_of_players_on_account = $account_logged->getPlayersList()->count();
    if($number_of_players_on_account >= $config['site']['max_players_per_account'])
    $newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';
    }
    if(empty($newchar_errors))
    {
    $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];
    $char_to_copy = new OTS_Player();
    $char_to_copy->find($char_to_copy_name);
    if(!$char_to_copy->isLoaded())
    $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.';
    }
    if(empty($newchar_errors))
    {
    if($newchar_sex == "0")
    $char_to_copy->setLookType(136);
    $player = $ots->createObject('Player');
    $player->setName($newchar_name);
    $player->setAccount($account_logged);
    $player->setGroup($char_to_copy->getGroup());
    $player->setSex($newchar_sex);
    $player->setVocation($char_to_copy->getVocation());
    $player->setConditions($char_to_copy->getConditions());
    $player->setRank($char_to_copy->getRank());
    $player->setLookAddons($char_to_copy->getLookAddons());
    $player->setTownId($newchar_town);
    $player->setExperience($char_to_copy->getExperience());
    $player->setLevel($char_to_copy->getLevel());
    $player->setMagLevel($char_to_copy->getMagLevel());
    $player->setHealth($char_to_copy->getHealth());
    $player->setHealthMax($char_to_copy->getHealthMax());
    $player->setMana($char_to_copy->getMana());
    $player->setManaMax($char_to_copy->getManaMax());
    $player->setManaSpent($char_to_copy->getManaSpent());
    $player->setSoul($char_to_copy->getSoul());
    $player->setDirection($char_to_copy->getDirection());
    $player->setLookBody($char_to_copy->getLookBody());
    $player->setLookFeet($char_to_copy->getLookFeet());
    $player->setLookHead($char_to_copy->getLookHead());
    $player->setLookLegs($char_to_copy->getLookLegs());
    $player->setLookType($char_to_copy->getLookType());
    $player->setCap($char_to_copy->getCap());
    $player->setPosX(160);
    $player->setPosY(54);
    $player->setPosZ(7);
    $player->setLossExperience($char_to_copy->getLossExperience());
    $player->setLossMana($char_to_copy->getLossMana());
    $player->setLossSkills($char_to_copy->getLossSkills());
    $player->setLossItems($char_to_copy->getLossItems());
    $player->save();
    unset($player);
    $player = $ots->createObject('Player');
    $player->find($newchar_name);
    if($player->isLoaded())
    {
    $player->setCustomField('world_id', (int) $world_id);
    $player->setSkill(0,$char_to_copy->getSkill(0));
    $player->setSkill(1,$char_to_copy->getSkill(1));
    $player->setSkill(2,$char_to_copy->getSkill(2));
    $player->setSkill(3,$char_to_copy->getSkill(3));
    $player->setSkill(4,$char_to_copy->getSkill(4));
    $player->setSkill(5,$char_to_copy->getSkill(5));
    $player->setSkill(6,$char_to_copy->getSkill(6));
    $player->save();
    $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
    foreach($loaded_items_to_copy as $save_item)
    $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']."');");
    $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="index.php?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>';
    }
    else
    {
    echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
    exit;
    }
    }
    else
    {
    $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 />';
    foreach($newchar_errors as $newchar_error)
    $main_content .= '<li>'.$newchar_error;
    $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 />';
    $main_content .= 'Please choose a name';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= ', vocation';
    $main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="index.php?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br /><br /><form action="index.php?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>';
    $main_content .= '<input type="radio" name="newcharsex" value="1" ';
    if($newchar_sex == 1)
    $main_content .= 'checked="checked" ';
    $main_content .= '>male<br />';
    $main_content .= '<input type="radio" name="newcharsex" value="0" ';
    if($newchar_sex == "0")
    $main_content .= 'checked="checked" ';
    $main_content .= '>female<br /></td></tr></table></div></div></table></div>';
    if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= '<div class="InnerTableContainer" >  <table style="width:100%;" ><tr>';
    if(count($config['site']['newchar_vocations'][$world_id]) > 1)
    {
    $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%" >';
    foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
    {
    $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
    if($newchar_vocation == $char_vocation_key)
    $main_content .= 'checked="checked" ';
    $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }
    if(count($config['site']['newchar_towns'][$world_id]) > 1)
    {
    $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%" >';
    foreach($config['site']['newchar_towns'][$world_id] as $town_id)
    {
    $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
    if($newchar_town == $town_id)
    $main_content .= 'checked="checked" ';
    $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }
    if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
    $main_content .= '</tr></table></div>';
    $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="index.php?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>';
    }
    }
    }
    }
    }

     

    ?>

     

    • pot/OTS_Account.php

    <?php

     
    /**#@+
     * @version 0.0.1
     */
     
    /**
     * @package POT
     * @version 0.1.5
     * @author Wrzasq <[email protected]>
     * @copyright 2007 - 2008 © by Wrzasq
     */
     
    /**
     * OTServ account abstraction.
     * 
     * @package POT
     * @version 0.1.5
     * @property string $name Account name.
     * @property string $password Password.
     * @property string $eMail Email address.
     * @property int $premiumEnd Timestamp of PACC end.
     * @property bool $blocked Blocked flag state.
     * @property bool $deleted Deleted flag state.
     * @property bool $warned Warned flag state.
     * @property bool $banned Ban state.
     * @property-read int $id Account number.
     * @property-read bool $loaded Loaded state.
     * @property-read OTS_Players_List $playersList Characters of this account.
     * @property-read int $access Access level.
     * @tutorial POT/Accounts.pkg
     */
    class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
    {
    /**
     * Account data.
     * 
     * @var array
     * @version 0.1.5
     */
        private $data = array('email' => '', 'key' => '', 'premium_points' => 0, 'blocked' => false, 'warned' => false, 'rlname' => '', 'location' => '', 'page_access' => 0, 'lastday' => 0, 'premdays' => 0, 'created' => 0);
     
    /**
     * Creates new account.
     * 
     * <p>
     * This method creates new account with given name. Account number is generated automaticly and saved into {@link OTS_Account::getId() ID field}.
     * </p>
     * 
     * <p>
     * If you won't specify account name then random one will be generated.
     * </p>
     * 
     * <p>
     * If you use own account name then it will be returned after success, and exception will be generated if it will be alredy used as name will be simply used in query with account create attempt.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @param string $name Account name.
     * @return string Account name.
     * @throws PDOException On PDO operation error.
     * @example examples/create.php create.php
     * @tutorial POT/Accounts.pkg#create
     */
        public function createNamed($name = null)
        {
            // if name is not passed then it will be generated randomly
            if( !isset($name) )
            {
                $exist = array();
     
                // reads already existing names
                foreach( $this->db->query('SELECT ' . $this->db->fieldName('name') . ' FROM ' . $this->db->tableName('accounts') )->fetchAll() as $account)
                {
                    $exist[] = $account['name'];
                }
     
                // initial name
                $name = uniqid();
     
                // repeats until name is unique
                while( in_array($name, $exist) )
                {
                    $name .= '_';
                }
            }
     
            // saves blank account info
            $this->db->query('INSERT INTO ' . $this->db->tableName('accounts') . ' (' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ) VALUES (' . $this->db->quote($name) . ', \'\', \'\')');
     
            // reads created account's ID
            $this->data['id'] = $this->db->lastInsertId();
     
            // return name of newly created account
            return $name;
        }
     
    /**
     * Creates new account.
     * 
     * <p>
     * Create new account in given range (1 - 9999999 by default).
     * </p>
     * 
     * <p>
     * Note: If account name won't be speciffied random will be created.
     * </p>
     * 
     * <p>
     * Note: Since 0.0.3 version this method doesn't require buffered queries.
     * </p>
     * 
     * <p>
     * Note: Since 0.1.5 version you should use {@link OTS_Account::createNamed() createNamed() method} since OTServ now uses account names.
     * </p>
     * 
     * <p>
     * Note: Since 0.1.1 version this method throws {@link E_OTS_Generic E_OTS_Generic} exceptions instead of general Exception class objects. Since all exception classes are child classes of Exception class so your old code will still handle all exceptions.
     * </p>
     * 
     * <p>
     * Note: Since 0.1.5 version this method no longer creates account as blocked.
     * </p>
     * 
     * @version 0.1.5
     * @param int $min Minimum number.
     * @param int $max Maximum number.
     * @param string $name Account name.
     * @return int Created account number.
     * @throws E_OTS_Generic When there are no free account numbers.
     * @throws PDOException On PDO operation error.
     * @deprecated 0.1.5 Use createNamed().
     */
        public function create($min = 1, $max = 9999999, $name = null)
        {
            // generates random account number
            $random = rand($min, $max);
            $number = $random;
            $exist = array();
     
            // if name is not passed then it will be generated randomly
            if( !isset($name) )
            {
                // reads already existing names
                foreach( $this->db->query('SELECT ' . $this->db->fieldName('name') . ' FROM ' . $this->db->tableName('accounts') )->fetchAll() as $account)
                {
                    $exist[] = $account['name'];
                }
     
                // initial name
                $name = uniqid();
     
                // repeats until name is unique
                while( in_array($name, $exist) )
                {
                    $name .= '_';
                }
     
                // resets array for account numbers loop
                $exist = array();
            }
     
            // reads already existing accounts
            foreach( $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('accounts') )->fetchAll() as $account)
            {
                $exist[] = $account['id'];
            }
     
            // finds unused number
            while(true)
            {
                // unused - found
                if( !in_array($number, $exist) )
                {
                    break;
                }
     
                // used - next one
                $number++;
     
                // we need to re-set
                if($number > $max)
                {
                    $number = $min;
                }
     
                // we checked all possibilities
                if($number == $random)
                {
                    throw new E_OTS_Generic(E_OTS_Generic::CREATE_ACCOUNT_IMPOSSIBLE);
                }
            }
     
            // saves blank account info
            $this->data['id'] = $number;
     
            $this->db->query('INSERT INTO ' . $this->db->tableName('accounts') . ' (' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ') VALUES (' . $number . ', ' . $this->db->quote($name) . ', \'\', \'\')');
     
            return $number;
        }
     
    /**
     * @version 0.0.6
     * @since 0.0.4
     * @param OTS_Group $group Group to be assigned to account.
     * @param int $min Minimum number.
     * @param int $max Maximum number.
     * @return int Created account number.
     * @deprecated 0.0.6 There is no more group_id field in database, use create().
     */
        public function createEx(OTS_Group $group, $min = 1, $max = 9999999)
        {
            return $this->create($min, $max);
        }
     
    /**
     * Loads account with given number.
     * 
     * @version 0.0.6
     * @param int $id Account number.
     * @throws PDOException On PDO operation error.
     */
        public function load($id)
        {
            // SELECT query on database
           $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('key') . ', ' . $this->db->fieldName('premium_points') . ', ' . $this->db->fieldName('page_access') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('lastday') . ',  ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
        }
     
    /**
     * Loads account by it's name.
     * 
     * <p>
     * Note: Since 0.1.5 version this method loads account by it's name not by e-mail address. To find account by it's e-mail address use {@link OTS_Account::findByEMail() findByEMail() method}.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.0.2
     * @param string $name Account's name.
     * @throws PDOException On PDO operation error.
     */
        public function find($name)
        {
            // finds player's ID
            $id = $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($name) )->fetch();
     
            // if anything was found
            if( isset($id['id']) )
            {
                $this->load($id['id']);
            }
        }
     
    /**
     * Loads account by it's e-mail address.
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @param string $email Account's e-mail address.
     * @throws PDOException On PDO operation error.
     */
        public function findByEMail($email)
        {
            // finds player's ID
            $id = $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($email) )->fetch();
     
            // if anything was found
            if( isset($id['id']) )
            {
                $this->load($id['id']);
            }
        }
     
    /**
     * Checks if object is loaded.
     * 
     * @return bool Load state.
     */
        public function isLoaded()
        {
            return isset($this->data['id']);
        }
     
    /**
     * Updates account in database.
     * 
     * <p>
     * Unlike other DAO objects account can't be saved without ID being set. It means that you can't just save unexisting account to automaticly create it. First you have to create record by using {@link OTS_Account::createName() createNamed() method}
     * </p>
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded exception} instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.1.5
     * @throws E_OTS_NotLoaded If account doesn't have ID assigned.
     * @throws PDOException On PDO operation error.
     */
        public function save()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // UPDATE query on database
            $this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('premium_points') . ' = ' . $this->db->quote($this->data['premium_points']) . ', ' . $this->db->fieldName('key') . ' = ' . $this->db->quote($this->data['key']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
        }
     
    /**
     * Account number.
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.0.3
     * @return int Account number.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function getId()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['id'];
        }
     
    /**
     * Other Account Information.
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.0.3
     * @return int Account Information.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
     
    public function getRLName()
        {
            if( !isset($this->data['rlname']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['rlname'];
        }
     
        public function getLocation()
        {
            if( !isset($this->data['location']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['location'];
        }
     
        public function getPageAccess()
        {
            if( !isset($this->data['page_access']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['page_access'];
        }
     
        public function getPremDays()
        {
            if( !isset($this->data['premdays']) || !isset($this->data['lastday']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));
        }
     
        public function getLastLogin()
        {
            if( !isset($this->data['lastday']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['lastday'];
        }
     
        public function isPremium()
        {
            return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0);
        }
     
        public function getCreated()
        {
            if( !isset($this->data['created']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['created'];
        }
     
    public function getRecoveryKey()
        {
            if( !isset($this->data['key']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['key'];
        }
    public function getPremiumPoints()
        {
            if( !isset($this->data['premium_points']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['premium_points'];
        }
     
        public function setRLName($rlname)
        {
            $this->data['rlname'] = (string) $rlname;
        }
     
        public function setLocation($loc)
        {
            $this->data['location'] = (string) $loc;
        }
     
        public function setRecoveryKey($rec_key)
        {
            $this->data['key'] = (string) $rec_key;
        }
     
        public function setPremiumPoints($premium_points)
        {
            $this->data['premium_points'] = (string) $premium_points;
        }
     
    /**
     * @version 0.1.0
     * @since 0.0.4
     * @return OTS_Group Group of which current account is member (currently random group).
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @deprecated 0.0.6 There is no more group_id field in database.
     */
        public function getGroup()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // loads default group
            $groups = new OTS_Groups_List();
            $groups->rewind();
            return $groups->current();
        }
     
    /**
     * Name.
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @return string Name.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function getName()
        {
            if( !isset($this->data['name']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['name'];
        }
     
    /**
     * Sets account's name.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @param string $name Account name.
     */
        public function setName($name)
        {
            $this->data['name'] = (string) $name;
        }
     
    /**
     * Account's password.
     * 
     * <p>
     * Doesn't matter what password hashing mechanism is used by OTServ - this method will just return RAW database content. It is not possible to "decrypt" hashed strings, so it even wouldn't be possible to return real password string.
     * </p>
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.0.3
     * @return string Password.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function getPassword()
        {
            if( !isset($this->data['password']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['password'];
        }
     
    /**
     * Sets account's password.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * <p>
     * Remember that this method just sets database field's content. It doesn't apply any hashing/encryption so if OTServ uses hashing for passwords you have to apply it by yourself before passing string to this method.
     * </p>
     * 
     * @param string $password Password.
     */
        public function setPassword($password)
        {
            $this->data['password'] = (string) $password;
        }
     
    /**
     * E-mail address.
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.0.3
     * @return string E-mail.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function getEMail()
        {
            if( !isset($this->data['email']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['email'];
        }
     
    /**
     * Sets account's email.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @param string $email E-mail address.
     */
        public function setEMail($email)
        {
            $this->data['email'] = (string) $email;
        }
     
     
    /**
     * Checks if account is blocked.
     * 
     * <p>
     * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING.
     * </p>
     * 
     * @version 0.0.3
     * @return bool Blocked state.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function isBlocked()
        {
            if( !isset($this->data['blocked']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['blocked'];
        }
     
    /**
     * Unblocks account.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     */
        public function unblock()
        {
            $this->data['blocked'] = false;
        }
     
    /**
     * Blocks account.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     */
        public function block()
        {
            $this->data['blocked'] = true;
        }
     
    /**
     * Checks if account is deleted (by flag setting).
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @return bool Flag state.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function isDeleted()
        {
            if( !isset($this->data['deleted']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['blocked'];
        }
     
    /**
     * Unsets account's deleted flag.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     */
        public function unsetDeleted()
        {
            $this->data['deleted'] = false;
        }
     
    /**
     * Deletes account (only by setting flag state, not physicly).
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     */
        public function setDeleted()
        {
            $this->data['deleted'] = true;
        }
     
    /**
     * Checks if account is warned.
     * 
     * @version 0.1.5
     * @since 0.1.5
     * @return bool Flag state.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function isWarned()
        {
            if( !isset($this->data['warned']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return $this->data['warned'];
        }
     
    /**
     * Unwarns account.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     */
        public function unwarn()
        {
            $this->data['warned'] = false;
        }
     
    /**
     * Warns account.
     * 
     * <p>
     * This method only updates object state. To save changes in database you need to use {@link OTS_Account::save() save() method} to flush changed to database.
     * </p>
     * 
     * @version 0.1.5
     * @since 0.1.5
     */
        public function warn()
        {
            $this->data['warned'] = true;
        }
     
    /**
     * @version 0.0.4
     * @return int PACC days.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @deprecated 0.0.3 There is no more premdays field in accounts table.
     */
        public function getPACCDays()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            return 0;
        }
     
    /**
     * @version 0.0.4
     * @param int $pacc PACC days.
     * @deprecated 0.0.3 There is no more premdays field in accounts table.
     */
        public function setPACCDays($premdays)
        {
        }
     
    /**
     * Reads custom field.
     * 
     * <p>
     * Reads field by it's name. Can read any field of given record that exists in database.
     * </p>
     * 
     * <p>
     * Note: You should use this method only for fields that are not provided in standard setters/getters (SVN fields). This method runs SQL query each time you call it so it highly overloads used resources.
     * </p>
     * 
     * @version 0.0.5
     * @since 0.0.3
     * @param string $field Field name.
     * @return string Field value.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws PDOException On PDO operation error.
     */
        public function getCustomField($field)
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            $value = $this->db->query('SELECT ' . $this->db->fieldName($field) . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id'])->fetch();
            return $value[$field];
        }
     
    /**
     * Writes custom field.
     * 
     * <p>
     * Write field by it's name. Can write any field of given record that exists in database.
     * </p>
     * 
     * <p>
     * Note: You should use this method only for fields that are not provided in standard setters/getters (SVN fields). This method runs SQL query each time you call it so it highly overloads used resources.
     * </p>
     * 
     * <p>
     * Note: Make sure that you pass $value argument of correct type. This method determinates whether to quote field name. It is safe - it makes you sure that no unproper queries that could lead to SQL injection will be executed, but it can make your code working wrong way. For example: $object->setCustomField('foo', '1'); will quote 1 as as string ('1') instead of passing it as a integer.
     * </p>
     * 
     * @version 0.0.5
     * @since 0.0.3
     * @param string $field Field name.
     * @param mixed $value Field value.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws PDOException On PDO operation error.
     */
        public function setCustomField($field, $value)
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // quotes value for SQL query
            if(!( is_int($value) || is_float($value) ))
            {
                $value = $this->db->quote($value);
            }
     
            $this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName($field) . ' = ' . $value . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
        }
     
    /**
     * @version 0.1.0
     * @return array Array of OTS_Player objects from given account.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @deprecated 0.0.5 Use getPlayersList().
     */
        public function getPlayers()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            $players = array();
     
            foreach( $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('players') . ' WHERE ' . $this->db->fieldName('account_id') . ' = ' . $this->data['id'])->fetchAll() as $player)
            {
                // creates new object
                $object = new OTS_Player();
                $object->load($player['id']);
                $players[] = $object;
            }
     
            return $players;
        }
     
    /**
     * List of characters on account.
     * 
     * <p>
     * In difference to {@link OTS_Account::getPlayers() getPlayers() method} this method returns filtered {@link OTS_Players_List OTS_Players_List} object instead of array of {@link OTS_Player OTS_Player} objects. It is more effective since OTS_Player_List doesn't perform all rows loading at once.
     * </p>
     * 
     * <p>
     * Note: Returned object is only prepared, but not initialised. When using as parameter in foreach loop it doesn't matter since it will return it's iterator, but if you will wan't to execute direct operation on that object you will need to call {@link OTS_Base_List::rewind() rewind() method} first.
     * </p>
     * 
     * @version 0.1.4
     * @since 0.0.5
     * @return OTS_Players_List List of players from current account.
     * @throws E_OTS_NotLoaded If account is not loaded.
     */
        public function getPlayersList()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // creates filter
            $filter = new OTS_SQLFilter();
            $filter->compareField('account_id', (int) $this->data['id']);
     
            // creates list object
            $list = new OTS_Players_List();
            $list->setFilter($filter);
     
            return $list;
        }
     
    /**
     * @version 0.1.5
     * @since 0.0.5
     * @param int $time Time for time until expires (0 - forever).
     * @throws PDOException On PDO operation error.
     * @deprecated 0.1.5 Use OTS_AccountBan class.
     */
        public function ban($time = 0)
        {
            // can't ban nothing
            if( !$this->isLoaded() )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // creates ban entry
            $ban = new OTS_AccountBan();
            $ban->setValue($this->data['id']);
            $ban->setExpires($time);
            $ban->setAdded( time() );
            $ban->activate();
            $ban->save();
        }
     
    /**
     * @version 0.1.5
     * @since 0.0.5
     * @throws PDOException On PDO operation error.
     * @deprecated 0.1.5 Use OTS_AccountBan class.
     */
        public function unban()
        {
            // can't unban nothing
            if( !$this->isLoaded() )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // deletes ban entry
            $ban = new OTS_AccountBan();
            $ban->find($this->data['id']);
            $ban->delete();
        }
     
    /**
     * @version 0.1.5
     * @since 0.0.5
     * @return bool True if account is banned, false otherwise.
     * @throws PDOException On PDO operation error.
     * @deprecated 0.1.5 Use OTS_AccountBan class.
     */
        public function isBanned()
        {
            // nothing can't be banned
            if( !$this->isLoaded() )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // finds ban entry
            $ban = new OTS_AccountBan();
            $ban->find($this->data['id']);
            return $ban->isLoaded() && $ban->isActive() && ( $ban->getExpires() == 0 || $ban->getExpires() > time() );
        }
     
    /**
     * Deletes account.
     * 
     * <p>
     * This method physicly deletes account from database! To set <i>deleted</i> flag use {@link OTS_Account::setDeleted() setDeleted() method}.
     * </p>
     * 
     * @version 0.0.5
     * @since 0.0.5
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws PDOException On PDO operation error.
     */
        public function delete()
        {
            if( !isset($this->data['id']) )
            {
                throw new E_OTS_NotLoaded();
            }
     
            // deletes row from database
            $this->db->query('DELETE FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
     
            // resets object handle
            unset($this->data['id']);
        }
     
    /**
     * Checks highest access level of account.
     * 
     * @return int Access level (highest access level of all characters).
     * @throws PDOException On PDO operation error.
     */
        public function getAccess()
        {
            // by default
            $access = 0;
     
            // finds groups of all characters
            foreach( $this->getPlayersList() as $player)
            {
                $group = $player->getGroup();
     
                // checks if group's access level is higher then previouls found highest
                if( $group->getAccess() > $access)
                {
                    $access = $group->getAccess();
                }
            }
     
            return $access;
        }
     
    /**
     * Checks highest access level of account in given guild.
     * 
     * @param OTS_Guild $guild Guild in which access should be checked.
     * @return int Access level (highest access level of all characters).
     * @throws PDOException On PDO operation error.
     */
        public function getGuildAccess(OTS_Guild $guild)
        {
            // by default
            $access = 0;
     
            // finds ranks of all characters
            foreach( $this->getPlayersList() as $player)
            {
                $rank = $player->getRank();
     
                // checks if rank's access level is higher then previouls found highest
                if( isset($rank) && $rank->getGuild()->getId() == $guild->getId() && $rank->getLevel() > $access)
                {
                    $access = $rank->getLevel();
                }
            }
     
            return $access;
        }
     
    /**
     * Returns players iterator.
     * 
     * <p>
     * There is no need to implement entire Iterator interface since we have {@link OTS_Players_List players list class} for it.
     * </p>
     * 
     * @version 0.0.5
     * @since 0.0.5
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws PDOException On PDO operation error.
     * @return Iterator List of players.
     */
        public function getIterator()
        {
            return $this->getPlayersList();
        }
     
    /**
     * Returns number of player within.
     * 
     * @version 0.0.5
     * @since 0.0.5
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws PDOException On PDO operation error.
     * @return int Count of players.
     */
        public function count()
        {
            return $this->getPlayersList()->count();
        }
     
    /**
     * Magic PHP5 method.
     * 
     * @version 0.1.5
     * @since 0.1.0
     * @param string $name Property name.
     * @return mixed Property value.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws OutOfBoundsException For non-supported properties.
     * @throws PDOException On PDO operation error.
     */
        public function __get($name)
        {
            switch($name)
            {
                case 'id':
                    return $this->getId();
     
                case 'name':
                    return $this->getName();
     
                case 'password':
                    return $this->getPassword();
     
                case 'eMail':
                    return $this->getEMail();
     
                case 'premiumEnd':
                    return $this->getPremiumEnd();
     
                case 'loaded':
                    return $this->isLoaded();
     
                case 'playersList':
                    return $this->getPlayersList();
     
                case 'blocked':
                    return $this->isBlocked();
     
                case 'deleted':
                    return $this->isDeleted();
     
                case 'warned':
                    return $this->isWarned();
     
                case 'banned':
                    return $this->isBanned();
     
                case 'access':
                    return $this->getAccess();
     
                default:
                    throw new OutOfBoundsException();
            }
        }
     
    /**
     * Magic PHP5 method.
     * 
     * @version 0.1.5
     * @since 0.1.0
     * @param string $name Property name.
     * @param mixed $value Property value.
     * @throws E_OTS_NotLoaded If account is not loaded.
     * @throws OutOfBoundsException For non-supported properties.
     * @throws PDOException On PDO operation error.
     */
        public function __set($name, $value)
        {
            switch($name)
            {
                case 'name':
                    $this->setName($name);
                    break;
     
                case 'password':
                    $this->setPassword($value);
                    break;
     
                case 'eMail':
                    $this->setEMail($value);
                    break;
     
                case 'premiumEnd':
                    $this->setPremiumEnd($value);
                    break;
     
                case 'blocked':
                    if($value)
                    {
                        $this->block();
                    }
                    else
                    {
                        $this->unblock();
                    }
                    break;
     
                case 'deleted':
                    if($value)
                    {
                        $this->setDeleted();
                    }
                    else
                    {
                        $this->unsetDeleted();
                    }
                    break;
     
                case 'warned':
                    if($value)
                    {
                        $this->warn();
                    }
                    else
                    {
                        $this->unwarn();
                    }
                    break;
     
                case 'banned':
                    if($value)
                    {
                        $this->ban();
                    }
                    else
                    {
                        $this->unban();
                    }
                    break;
     
                default:
                    throw new OutOfBoundsException();
            }
        }
     
    /**
     * Returns string representation of object.
     * 
     * <p>
     * If any display driver is currently loaded then it uses it's method. Otherwise just returns account number.
     * </p>
     * 
     * @version 0.1.3
     * @since 0.1.0
     * @return string String representation of object.
     */
        public function __toString()
        {
            $ots = POT::getInstance();
     
            // checks if display driver is loaded
            if( $ots->isDisplayDriverLoaded() )
            {
                return $ots->getDisplayDriver()->displayAccount($this);
            }
     
            return $this->getId();
        }
    }
     
    /**#@-*/
     
    ?>
     

    • characters.php 

    <?PHP

    //$guild = $SQL->query('SELECT ``, `date`, `level` FROM `player_deaths` WHERE `player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,10;');
    $name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));
     
    if(empty($name)) {
    $main_content .= 'Here you can get detailed information about a certain player on '.$config['server']['serverName'].'.<BR>  <FORM ACTION=?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site]['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR='.$config['site]['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
    }
    else
    {
    if(check_name($name)) {
    $player = $ots->createObject('Player');
    $player->find($name);
    if($player->isLoaded()) {
    $account = $player->getAccount();
    $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD>';
    $main_content .= '<b><font color="#cd6a1a">'.$player->getName().'</font></b>
    ';
     
    if($player->isOnline())
    $main_content .= '|<font color="green"><strong>ON</strong></font>|';
    else
    $main_content .= '|<font color="red"><strong>OFF</strong></font>|';
    if($player->isDeleted())
    $main_content .= '<font color="red"> [DELETED]</font>';
    if($player->isNameLocked())
    $main_content .= '<font color="red"> [NAMELOCK]</font>';
    $main_content .= '</TD></TR>';
    if($player->getOldName())
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    if($player->isNameLocked())
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Proposition:</TD><TD>'.$player->getOldName().'</TD></TR>';
    else
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Old name:</TD><TD>'.$player->getOldName().'</TD></TR>';
    }
               // BEGIN Position Showing *** Fixed by jerryb1988 from otfans.net
                $group = $player->getGroup();
                if ($group == 2){$group_name = 'Tutor';}
                if ($group == 3){$group_name = 'Senior Tutor';}
                if ($group == 4){$group_name = 'Gamemaster';}
                if ($group == 5){$group_name = 'Community Manager';}
                if ($group == 6){$group_name = 'GOD';}
     
                if($group != 1)
                {
     
                    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group_name.'</TD></TR>';
                }
                // END Position Showing
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>';
    $main_content .= ($player->getSex() == 0) ? 'female' : 'male';
    $main_content .= '</TD></TR>';
    if($config['site']['show_marriage_info'])
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Marital status:</TD><TD>';
    $marriage = new OTS_Player();
    $marriage->load($player->getMarriage());
    if($marriage->isLoaded())
    $main_content .= 'married to <a href="?subtopic=characters&name='.urlencode($marriage->getName()).'"><b>'.$marriage->getName().'</b></a></TD></TR>';
    else
    $main_content .= 'single</TD></TR>';
    }
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>World:</TD><TD>'.$config['site']['worlds'][$player->getWorld()].'</TD></TR>';
    if(!empty($towns_list[$player->getWorld()][$player->getTownId()]))
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                  $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Balance:</TD><TD>'.$player->getBalance().' Gold Coins.</TD></TR>';
     
     
                      }
     
    $rank_of_player = $player->getRank();
    if(!empty($rank_of_player))
    {
    {
    $guild_id = $rank_of_player->getGuild()->getId();
    $guild_name = $rank_of_player->getGuild()->getName();
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild Name:</TD><TD>'.$rank_of_player->getName().' of the <a href="?subtopic=guilds&action=show&guild='.$guild_id.'">'.$guild_name.'</a></TD></TR>';
    }
    }
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $lastlogin = $player->getLastLogin();
    if(empty($lastlogin))
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>Never logged in.</TD></TR>';
    else
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>'.date("j F Y, g:i a", $lastlogin).'</TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    if($config['site']['show_creationdate'] && $player->getCreated())
    {
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>';
    }
    if($config['site']['show_vip_status'])
    {
                $id = $player->getCustomField("id");
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
     
    $comment = $player->getComment();
    $newlines   = array("\r\n", "\n", "\r");
    $comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
    if($count < 50)
    $comment = $comment_with_lines;
    if(!empty($comment))
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
    }
    }
     
    //Outfit shower by Pening edited by loleslav
    if($config['site']['show_outfit']) {
                $id = $player->getCustomField("id");
                $main_content .= '<TD BGCOLOR="'.$config['site']['darkborder'].'">Outfit:';
    $listaddon = array('128','129','130','131','132','133','134','135','136','137','138','139','140','141','142','143','144','145','146','147','148','149','150','151','152','153','154','155','158','159','251','252','268','269','270','273','278','279','288','289','302','324','325');
    $lookadd = array('0','1','2','3');
    foreach ($listaddon as $pid => $name)
    foreach ($lookadd as $addo => $name) {
    $addon1 = $SQL->query('SELECT * FROM players WHERE id = '.$id.' AND looktype = '.$listaddon[$pid].' AND lookaddons = '.$lookadd[$addo].';')->fetch();
    if($addon1[looktype] == true ) {
    $finaddon = $addon1[looktype] + $addon1[lookaddons] * 300;
    $main_content .= '<TD with=50% style="background-color: '.$config['site']['darkborder'].'"><center><img src="images/addons/'.$finaddon.'.gif"/></center></TD></TD>';
    }
    }
    }
    $main_content .= '</td>';
    //end   Outfit shower by Pening edited by loleslav
     
    //modified status scripts by ballack13
    $main_content .= '<table width=100%><tr>';
     
    if($config['site']['show_skills_info']) {
    //Skills Pics v2. Table borders optimized by Absolute Mango
    $main_content .= '<br/><table cellspacing="0" cellpadding="0" border="0" width="200" align="center"><caption><strong>Skills</strong></caption><tbody><tr>
                <td align="center"><a href="?subtopic=highscores&list=experience"><img src="images/skills/level.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=magic"><img src="images/skills/ml.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=fist"><img src="images/skills/fist.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=club"><img src="images/skills/club.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=sword"><img src="images/skills/sword.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=axe"><img src="images/skills/axe.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=distance"><img src="images/skills/dist.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=shield"><img src="images/skills/def.png" style="border: none;"/></a></td>
                <td align="center"><a href="?subtopic=highscores&list=fishing"><img src="images/skills/fish.png" style="border: none;"/></a></td>
    </tr></tbody></table>
    <table cellspacing="0" cellpadding="0" border="1" width="360" align="center"><tbody><tr><tr bgcolor="'.$config['site']['darkborder'].'">
                <td align="center" width="38"><strong>Level</strong></td>
                <td align="center" width="38"><strong>ML</strong></td>
                <td align="center" width="42"><strong>Fist</strong></td>
                <td align="center" width="40"><strong>Club</strong></td>
                <td align="center" width="38"><strong>Swrd</strong></td>
                <td align="center" width="38"><strong>Axe</strong></td>
                <td align="center" width="38"><strong>Dist</strong></td>
                <td align="center" width="38"><strong>Shield</strong></td>
                <td align="center" width="38"><strong>Fish</strong></td></font>
            </tr>
            <tr bgcolor="'.$config['site']['lightborder'].'">
                <td align="center" width="38">'.$player->getLevel().'</td>
                <td align="center" width="38">'.$player->getMagLevel().'</td>
                <td align="center" width="38">'.$player->getSkill(0).'</td>
                <td align="center" width="38">'.$player->getSkill(1).'</td>
                <td align="center" width="38">'.$player->getSkill(2).'</td>
                <td align="center" width="38">'.$player->getSkill(3).'</td>
                <td align="center" width="38">'.$player->getSkill(4).'</td>
                <td align="center" width="38">'.$player->getSkill(5).'</td>
                <td align="center" width="38">'.$player->getSkill(6).'</td>
            </tr></tbody></table><div table align="center">&nbsp;<br />&nbsp;</div>';
    //skill script end
    }
               
    //quest status by ballack13
    $id = $player->getCustomField("id");
    $number_of_quests = 0;
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>';
                            $quests = $config['site']['quests'];
                            foreach ($quests as $storage => $name) {
    if(is_int($number_of_quests / 2))
    $bgcolor = $config['site']['darkborder'];
    else
    $bgcolor = $config['site']['lightborder'];
    $number_of_quests++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=95%>'.$storage.'</TD>';
                            $quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch();
                               if($quest == false) {
    $main_content .= '<TD><img src="images/false.png"/></TD></TR>';
                            }
    else
    {
    $main_content .= '<TD><img src="images/true.png"/></TD></TR>';
    }
    }
     
    $main_content .= '</TABLE></td></tr></table><br />';
    $deads = 0;
     
    //deaths list
    $player_deaths = $SQL->query('SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,10;');
    foreach($player_deaths as $death)
    {
    if(is_int($number_of_rows / 2))
    $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
     
    $number_of_rows++; $deads++;
    $dead_add_content .= "<tr bgcolor=\"".$bgcolor."\">
    <td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death['date'])."</td>
    <td>";
    $killers = $SQL->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id
    LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id
    WHERE killers.death_id = ".$SQL->quote($death['id'])." ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll();
     
    $i = 0;
    $count = count($killers);
    foreach($killers as $killer)
    {
    $i++;
    if(in_array($i, array(1, $count)))
    $killer['monster_name'] = str_replace(array("an ", "a "), array("", ""), $killer['monster_name']);
     
    if($killer['player_name'] != "")
    {
    if($i == 1)
    $dead_add_content .= "Killed at level <b>".$death['level']."</b> by ";
    else if($i == $count)
    $dead_add_content .= " and by ";
    else
    $dead_add_content .= ", ";
     
    if($killer['monster_name'] != "")
    $dead_add_content .= $killer['monster_name']." summoned by ";
     
    if($killer['player_exists'] == 0)
    $dead_add_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">";
     
    $dead_add_content .= $killer['player_name'];
    if($killer['player_exists'] == 0)
    $dead_add_content .= "</a>";
    }
    else
    {
    if($i == 1)
    $dead_add_content .= "Died at level <b>".$death['level']."</b> by ";
    else if($i == $count)
    $dead_add_content .= " and by ";
    else
    $dead_add_content .= ", ";
     
    $dead_add_content .= $killer['monster_name'];
    }
     
    if($i == $count)
    $dead_add_content .= ".";
    }
     
    $dead_add_content .= ".</td></tr>";
    }
     
    if($deads > 0)
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>' . $dead_add_content . '</TABLE><br />';
     
    //end
    if(!$player->getHideChar()) {
    $main_content .= '<TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>';
    if($account->getRLName())
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getRLName().'</TD></TR>';
    }
    if($account->getLocation())
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getLocation().'</TD></TR>';
    }
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    if($account->getLastLogin())
    $main_content .= '';
    else
    $main_content .= '';
    if($account->getCreated())
    {
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Created:</TD><TD>'.date("j F Y, g:i a", $account->getCreated()).'</TD></TR>';
    }
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account&#160;Status:</TD><TD>';
    $main_content .= ($account->isPremium()) ? '<b>Premium Account</b>' : '<b>Premium Account</b>';
    $main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
    }
    $main_content .= '<BR><BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR='.$config['site]['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
    $main_content .= '</TABLE>';
    }
    else
    $search_errors[] = 'Character <b>'.$name.'</b> does not exist.';
    }
    else
    $search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';
    if(!empty($search_errors))
    {
    $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/>';
    foreach($search_errors as $search_error)
    $main_content .= '<li>'.$search_error;
    $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/>';
    $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR='.$config['site]['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
    }
    }
    ?>
     

    • shopsystem.php

    <?PHP

    if($config['site']['shop_system'] == 1) {
    if($logged)
    $user_premium_points = $account_logged->getCustomField('premium_points');
    else
    $user_premium_points = 'Login first';
     
    function getItemByID($id)
    {
    $id = (int) $id;
    $SQL = $GLOBALS['SQL'];
    $data = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' WHERE '.$SQL->fieldName('id').' = '.$SQL->quote($id).';')->fetch();
    if ($data['offer_type'] == 'pacc')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['days'] = $data['count1'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'item')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['item_id'] = $data['itemid1'];
    $offer['item_count'] = $data['count1'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'vipdays')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['days'] = $data['count1'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'itemvip')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['item_id'] = $data['itemid1'];
    $offer['item_count'] = $data['count1'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'container')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['container_id'] = $data['itemid2'];
    $offer['container_count'] = $data['count2'];
    $offer['item_id'] = $data['itemid1'];
    $offer['item_count'] = $data['count1'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'unban')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
     
    elseif ($data['offer_type'] == 'redskull')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    elseif ($data['offer_type'] == 'itemlogout')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['pid'] = $data['pid'];
    $offer['count1'] = $data['count1'];
    $offer['item_id'] = $data['itemid1'];
    $offer['free_cap'] = $data['free_cap'];
    }
    elseif ($data['offer_type'] == 'changename')
    {
    $offer['id'] = $data['id'];
    $offer['type'] = $data['offer_type'];
    $offer['points'] = $data['points'];
    $offer['description'] = $data['offer_description'];
    $offer['name'] = $data['offer_name'];
    }
    return $offer;
    }
     
    function getOfferArray()
    {
    $offer_list = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_shop_offer').';');
    $i_pacc = 0;
    $i_item = 0;
    $i_vipdays = 0;
    $i_itemvip = 0;
    $i_container = 0;
    $i_unban = 0;
    $i_redskull = 0;
    $i_itemlogout = 0;
    $i_changename = 0;
    while($data = $offer_list->fetch()) {
    if ($data['offer_type'] == 'pacc')
    {
    $offer_array['pacc'][$i_pacc]['id'] = $data['id'];
    $offer_array['pacc'][$i_pacc]['days'] = $data['count1'];
    $offer_array['pacc'][$i_pacc]['points'] = $data['points'];
    $offer_array['pacc'][$i_pacc]['description'] = $data['offer_description'];
    $offer_array['pacc'][$i_pacc]['name'] = $data['offer_name'];
    $i_pacc++;
    }
    elseif ($data['offer_type'] == 'item')
    {
    $offer_array['item'][$i_item]['id'] = $data['id'];
    $offer_array['item'][$i_item]['item_id'] = $data['itemid1'];
    $offer_array['item'][$i_item]['item_count'] = $data['count1'];
    $offer_array['item'][$i_item]['points'] = $data['points'];
    $offer_array['item'][$i_item]['description'] = $data['offer_description'];
    $offer_array['item'][$i_item]['name'] = $data['offer_name'];
    $i_item++;
    }
    elseif ($data['offer_type'] == 'vipdays')
    {
    $offer_array['vipdays'][$i_vipdays]['id'] = $data['id'];
    $offer_array['vipdays'][$i_vipdays]['days'] = $data['count1'];
    $offer_array['vipdays'][$i_vipdays]['points'] = $data['points'];
    $offer_array['vipdays'][$i_vipdays]['description'] = $data['offer_description'];
    $offer_array['vipdays'][$i_vipdays]['name'] = $data['offer_name'];
    $i_vipdays++;
    }
    elseif ($data['offer_type'] == 'itemvip')
    {
    $offer_array['itemvip'][$i_itemvip]['id'] = $data['id'];
    $offer_array['itemvip'][$i_itemvip]['item_id'] = $data['itemid1'];
    $offer_array['itemvip'][$i_itemvip]['item_count'] = $data['count1'];
    $offer_array['itemvip'][$i_itemvip]['points'] = $data['points'];
    $offer_array['itemvip'][$i_itemvip]['description'] = $data['offer_description'];
    $offer_array['itemvip'][$i_itemvip]['name'] = $data['offer_name'];
    $i_itemvip++;
    }
    elseif ($data['offer_type'] == 'container')
    {
    $offer_array['container'][$i_container]['id'] = $data['id'];
    $offer_array['container'][$i_container]['container_id'] = $data['itemid2'];
    $offer_array['container'][$i_container]['container_count'] = $data['count2'];
    $offer_array['container'][$i_container]['item_id'] = $data['itemid1'];
    $offer_array['container'][$i_container]['item_count'] = $data['count1'];
    $offer_array['container'][$i_container]['points'] = $data['points'];
    $offer_array['container'][$i_container]['description'] = $data['offer_description'];
    $offer_array['container'][$i_container]['name'] = $data['offer_name'];
    $i_container++;
    }
    elseif ($data['offer_type'] == 'unban')
    {
    $offer_array['unban'][$i_unban]['id'] = $data['id'];
    $offer_array['unban'][$i_unban]['points'] = $data['points'];
    $offer_array['unban'][$i_unban]['description'] = $data['offer_description'];
    $offer_array['unban'][$i_unban]['name'] = $data['offer_name'];
    $i_unban++;
    }
    elseif ($data['offer_type'] == 'redskull')
    {
    $offer_array['redskull'][$i_redskull]['id'] = $data['id'];
    $offer_array['redskull'][$i_redskull]['points'] = $data['points'];
    $offer_array['redskull'][$i_redskull]['description'] = $data['offer_description'];
    $offer_array['redskull'][$i_redskull]['name'] = $data['offer_name'];
    $i_redskull++;
    }
    elseif ($data['offer_type'] == 'itemlogout')
    {
    $offer_array['itemlogout'][$i_itemlogout]['id'] = $data['id'];
    $offer_array['itemlogout'][$i_itemlogout]['points'] = $data['points'];
    $offer_array['itemlogout'][$i_itemlogout]['description'] = $data['offer_description'];
    $offer_array['itemlogout'][$i_itemlogout]['name'] = $data['offer_name'];
    $offer_array['itemlogout'][$i_itemlogout]['count1'] = $data['count1'];
    $offer_array['itemlogout'][$i_itemlogout]['pid'] = $data['pid'];
    $offer_array['itemlogout'][$i_itemlogout]['item_id'] = $data['itemid1'];
    $offer_array['itemlogout'][$i_itemlogout]['free_cap'] = $data['free_cap'];
    $i_itemlogout++;
    }
    elseif ($data['offer_type'] == 'changename')
    {
    $offer_array['changename'][$i_changename]['id'] = $data['id'];
    $offer_array['changename'][$i_changename]['points'] = $data['points'];
    $offer_array['changename'][$i_changename]['description'] = $data['offer_description'];
    $offer_array['changename'][$i_changename]['name'] = $data['offer_name'];
    $i_changename++;
    }
    }
    return $offer_array;
    }
     
    if($action == '') {
    unset($_SESSION['viewed_confirmation_page']);
    $main_content .= '<h2><center>Welcome to '.$config['server']['serverName'].' Shop</center></h2>';
    $offer_list = getOfferArray();
    //show list of vipdays offers
    if(count($offer_list['vipdays']) > 0) {
    $main_content .= '
    <div class="TableContainer">
    <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">Upgrade Account</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
    </tr>';
    foreach($offer_list['vipdays'] as $vipdays) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/shop/vip.gif" /></td>
    <td><font style="font-size:16px; font-weight:bold;">'.$vipdays['name'].'</font>&nbsp;<small>('.$vipdays['points'].' points)</small><br />'.$vipdays['description'].'</td>
    <td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
    <input type="hidden" name="buy_id" value="'.$vipdays['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';
    }
    $main_content .= '</tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div><br />';}
    //show list of itemsvip offers
    if(count($offer_list['itemvip']) > 0) {
    $main_content .= '
    <div class="TableContainer">
    <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">Items VIP</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
    </tr>';
    foreach($offer_list['itemvip'] as $itemvip) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign=middle" align="center">'; if(file_exists('images/items/'.$itemvip['item_id].'.gif')) { $main_content .= '<br /><img src="images/items/'.$itemvip['item_id'].'.gif" height=32" width="32"><br /><small><b>'.$itemvip['name].'</b></small><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32"><br /><small><b>'.$itemvip['name'].'</b></small>'; }
    $main_content .='</td><td><b>'.$itemvip['name'].'</b> ('.$itemvip['points'].' points)<br />'.$itemvip['description'].'</td><td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
    <input type="hidden" name="buy_id" value="'.$itemvip['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';
    }
    $main_content .= '</tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div><br />';}
    //show list of items offers
    if(count($offer_list['item']) > 0 or count($offer_list['itemlogout']) > 0)
    $main_content .= '
    <div class="TableContainer">
    <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">Items</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
     
    </tr>';
    if(count($offer_list['item']) > 0) {
    foreach($offer_list['item'] as $item) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '
    <tr bgcolor="'.$config['site']['lightborder'].'">
    <td valign="middle" align="center">'; if(file_exists('images/items/'.$item['item_id'].'.gif')) { $main_content .= '<br /><img src=images/items/'.$item['item_id].'.gif" height="32" width="32"><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32">'; } 
    $main_content .='
    </td>
    <td><font style="font-size:16px; font-weight:bold;">'.$item['name'].'</font>&nbsp;';
    $main_content .='<small>('.$item['points'].' points)</small>';
    $main_content .='<br />
    '.$item['description'].'
    </td>
    <td valign="middle" align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$item['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>'; 
    }
    $main_content .= '</tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div><br />';
    }
    //show list of containers offers
     
    if(count($offer_list['itemlogout']) > 0) {
    $main_content .= '
    <div class="TableContainer">
    <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">Items Logout</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
    </tr>';
    foreach($offer_list['itemlogout'] as $itemlogout) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign=middle" align="center"><img src="images/items/'.$itemlogout['id].'.gif"></td><td><b>'.$itemlogout['name'].'</b> ('.$itemlogout['points'].' points)<br />'.$itemlogout['description'].'</td><td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
    <input type="hidden" name="buy_id" value="'.$itemlogout['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';
    }
    $main_content .= '</tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div><br />';}
    if(count($offer_list['container']) > 0) {
    $main_content .= '
    <div class="TableContainer">
    <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">Containers Of Items</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
     
    </tr>';
    foreach($offer_list['container'] as $container) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign=middle" align="center">'; if(file_exists('images/items/'.$container['item_id].'.gif')) { $main_content .= '<img src="images/items/'.$container['item_id'].'.gif" height="32" width="32">'; } else { $main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">'; } $main_content .='</td>
    <td><b>'.$container['name'].'</b> ('.$container['points'].' points)<br />'.$container['description'].'</td><td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$container['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';
    }
    $main_content .= '</tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div><br />';}
    if(count($offer_list['changename']) > 0 or count($offer_list['pacc']) > 0 or count($offer_list['redskull']) > 0 or count($offer_list['unban']) > 0){
    $main_content .= '
    <div class="TableContainer">
    <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">Items &amp; Additional</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>
    <table class="Table5" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>
    <div class="InnerTableContainer">
    <table style="width:100%;">
    <tbody>
    <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" style="border:1px solid #faf0d7;" width="100%">
    <tbody>
    <tr bgcolor="#D4C0A1">
    <td valign="middle" width="10%" align="center"><b>Product</b></td>
    <td valign="middle" width="60%"><b>Description</b></td>
    <td valign="middle">&nbsp;</td>
    </tr>';
    if(count($offer_list['pacc']) > 0)
    foreach($offer_list['pacc'] as $pacc) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
    <td valign="middle" align="center"><img src="images/shop/premium.gif" /><br /><font style="font-weight:bold;">'.$pacc['days'].' Days</font></td>
    <td><b>'.$pacc['name'].'</b> <small>('.$pacc['points'].' points)</small><br />'.$pacc['description'].'</td>
    <td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$pacc['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image" />
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';}
    //Change Name
    if(count($offer_list['changename']) > 0)
    foreach($offer_list['changename'] as $changename) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
    <td valign="middle" align="center"><img src="images/shop/name.gif" /></td>
    <td><font style="font-size:16px; font-weight:bold;">'.$changename['name'].'</font>&nbsp;';
    $main_content .='<small>('.$changename['points'].' points)</small>';
    $main_content .='<br />
    '.$changename['description'].'</td>
    <td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$changename['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';}
    //Remove Red Skull
    if(count($offer_list['redskull']) > 0)
    foreach($offer_list['redskull'] as $redskull) {
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
    <td valign="middle" align="center"><img src="images/shop/skull.gif" /></td>
    <td><font style="font-size:16px; font-weight:bold;">'.$redskull['name'].'</font>&nbsp;';
    $main_content .='<small>('.$redskull['points'].' points)</small>';
    $main_content .='<br />'.$redskull['description'].'</td>
    <td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$redskull['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';}
    //Unban
    if(count($offer_list['unban']) > 0)
    foreach($offer_list['unban'] as $unban){
    if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
    $main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'">
    <td valign="middle" align="center"><br /><img src="images/shop/ban.gif" /></td>
    <td><font style="font-size:16px; font-weight:bold;">'.$unban['name'].'</font>&nbsp;';
    $main_content .='<small>('.$unban['points'].' points)</small>';
    $main_content .='<br />'.$unban['description'].'</td>
    <td align="center">';
    if(!$logged) $main_content .= '<b><a href="index.php?subtopic=accountmanagement">Login First</a></b>'; else 
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=select_player" method="POST">
    <input type="hidden" name="buy_id" value="'.$unban['id'].'">
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <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" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">
    </div>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </form>';
    $main_content .= '</td></tr>';}
    $main_content .= '
    </tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div>';}}
    elseif($action == 'select_player') {
    unset($_SESSION['viewed_confirmation_page']);
    if(!$logged) {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS=white><B>Shoping Error</B></TD>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'>
    <td>
    <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
    <TR>
    <TD>Please login first.</TD>
    </TR>
    </TABLE>
    </td>
    </tr>
    </TABLE>';} 
    else {
    $buy_id = (int) $_REQUEST['buy_id'];
    if(empty($buy_id)) {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS=white><B>Shoping Error</B></TD>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'>
    <td>
    <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
    <TR>
    <TD>Please <a href="index.php?subtopic=shopsystem">select item</a> first.</TD>
    </TR>
    </TABLE>
    </td>
    </tr>
    </TABLE>';} 
    else {
    $buy_offer = getItemByID($buy_id);
    if(isset($buy_offer['id'])) { //item exist in database
    if($buy_offer['type'] != 'changename') {
    if($user_premium_points >= $buy_offer['points']) {
     
    $main_content .= '
    <div class="TableContainer">
    <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">Delivery Informations</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>
    <table class="Table5" cellpadding="0" cellspacing="0"> 
    <tbody><tr>
    <td>
    <div class="InnerTableContainer"> 
    <table style="width: 100%;"><tbody><tr><td>
    <div class="InnerTableContainer">
    <table>
    <tbody>
    <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" style="border: 1px solid #faf0d7;">
    <tbody>
    <tr style="background-color: #505050;">
    </tr>
    <tr class="Table" style="background-color: #d4c0a1;">
    <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
    <table border="0" cellpadding="4" cellspacing="1" width="100%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
    <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Item Informations</b></font></td>
    </tr>
    <tr bgcolor="#D4C0A1">
    <td width="100"><b>Image:</b></td>
    <td width="550">';
    if(file_exists('images/items/'.$buy_offer['item_id'].'.gif')) {
    $main_content .= '<img src="images/items/'.$buy_offer['item_id'].'.gif" height="32" width="32">';
    } else {
    $main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">';
    }
    $main_content .='</td>
    </tr>
    <tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
    <tr bgcolor="#D4C0A1"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>';
    $main_content .='<tr bgcolor="#F1E0C6"><td width="100"><b>Cost:</b></td><td width="550"><small><b>'.$buy_offer['points'].'</b> premium points</small></td></tr>';
    $main_content .='
    </table>
    </td>
    </tr>
    </tbody>
    </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>
    </tbody>
    </table>
    </div>
    <div class="InnerTableContainer">
    <table>
    <tbody>
    <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" style="border: 1px solid #faf0d7;">
    <tbody>
    <tr style="background-color: #505050;">
    </tr>
    <tr class="Table" style="background-color: #d4c0a1;">
    <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
    <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST>
    <input type="hidden" name="buy_id" value="'.$buy_id.'">
    <table border="0" cellpadding="4" cellspacing="1" width="100%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
    <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Select one Player</b></font></td>
    </tr>
    <tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b>&nbsp;&nbsp;<select name="buy_name" style="padding: 5px;">';
    $players_from_logged_acc = $account_logged->getPlayersList();
    if(count($players_from_logged_acc) > 0) {
    $players_from_logged_acc->orderBy('name');
    foreach($players_from_logged_acc as $player)
    $main_content .= '<option>'.$player->getName().'</option>';
    } else {
    $main_content .= 'You don\'t have any character on your account.';
    }
    $main_content .= '</select>&nbsp;<input type="submit" value="Purschase"><br /><small>Character <b> your account </b> you will receive.</small></td></tr></table>
    </form>
    </td>
    </tr>
    </tbody>
    </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>
    </tbody>
    </table>
    </div>
    <div class="InnerTableContainer">
    <table>
    <tbody>
    <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" style="border: 1px solid #faf0d7;">
    <tbody>
    <tr style="background-color: #505050;">
    </tr>
    <tr class="Table" style="background-color: #d4c0a1;">
    <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
    <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_id" value="'.$buy_id.'">
    <table border="0" cellpadding="4" cellspacing="1" width="100%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
    <td colspan="2"><font style="font-size:16px; font-weight:bold; color: #FFFFFF;"><b>Send Gift</b></font></td>
    </tr>
    <tr bgcolor="#D4C0A1"><td width="110"><b>To player:</b>&nbsp;&nbsp;<input type="text" name="buy_name" autocomplete="off" placeholder="Character&nbsp;to&nbsp;recive&nbsp;'.$buy_offer['name'].'" size="25">&nbsp;<input type="submit" value="Purschase to friend"><br /><small>Put in the field above the name of the character that will receive the item.</small></td></tr>
    </table>
    </form>
    </td>
    </tr>
    </tbody>
    </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>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    </div>';
    } else {
    $main_content .= '
    <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS="white"><b>Erro</b></td>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'><TD>Para comprar <b>'.$buy_offer['name'].'</b> voce precisa de <b>'.$buy_offer['points'].' premium points</b> disponíveis.<br />Atualmente você possui <b>'.$user_premium_points.'</b> premium points.</TD>
    </TR>
    </TABLE>
    <br />
    <table width="100%">
    <tbody>
    <tr align="center">
    <td>
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody><tr><td style="border: 0px none;">
    <a href="javascript:void();" onclick=location.href="index.php?subtopic=donate">
    <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>
    <div class="ButtonText" style="background-image:url('.$layout_name.'/images/buttons/_sbutton_buypoints.png);"></div>
    </div>
    </div>
    </a>
    </td>
    </tr>
    <tr>
    </tr>
    </tbody>
    </table>
    </td>
    <td>
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td style="border: 0px none;">
    <a href="javascript:void();" onclick=location.href="index.php?subtopic=shopsystem"><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); visibility: hidden;"></div>
    <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
    </table>
    </td>
    </tr>
    </tbody>
    </table>
    <p>&nbsp;</p>';}
    } else {
    $main_content .= '<script type="text/javascript">
     
    var accountHttp;
     
    //sprawdza czy dane konto istnieje czy nie
    function checkAccount()
    {
    if(document.getElementById("account_name").value=="")
    {
    document.getElementById("acc_name_check").innerHTML = \'<img src="images/nok.gif" />\';
    return;
    }
    accountHttp=GetXmlHttpObject();
    if (accountHttp==null)
    {
    return;
    }
    var account = document.getElementById("account_name").value;
    var url="ajax/check_account.php?account=" + account + "&uid="+Math.random();
    accountHttp.onreadystatechange=AccountStateChanged;
    accountHttp.open("GET",url,true);
    accountHttp.send(null);
     
    function AccountStateChanged() 
    if (accountHttp.readyState==4)
    document.getElementById("acc_name_check").innerHTML=accountHttp.responseText;
    }
    }
     
    var emailHttp;
     
    //sprawdza czy dane konto istnieje czy nie
    function checkEmail()
    {
    if(document.getElementById("email").value=="")
    {
    document.getElementById("email_check").innerHTML = \'<img src="images/nok.gif" />\';
    return;
    }
    emailHttp=GetXmlHttpObject();
    if (emailHttp==null)
    {
    return;
    }
    var email = document.getElementById("email").value;
    var url="ajax/check_email.php?email=" + email + "&uid="+Math.random();
    emailHttp.onreadystatechange=EmailStateChanged;
    emailHttp.open("GET",url,true);
    emailHttp.send(null);
     
    function EmailStateChanged() 
    if (emailHttp.readyState==4)
    document.getElementById("email_check").innerHTML=emailHttp.responseText;
    }
    }
     
    function validate_required(field,alerttxt)
    {
    with (field)
    {
    if (value==null||value==""||value==" ")
     {alert(alerttxt);return false;}
    else {return true}
    }
    }
     
    function validate_email(field,alerttxt)
    {
    with (field)
    {
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2) 
     {alert(alerttxt);return false;}
    else {return true;}
    }
    }
     
    function validate_form(thisform)
    {
    with (thisform)
    {
    if (validate_required(buy_from,"Please enter a new name of your character!")==false)
     {buy_from.focus();return false;}
    if (validate_required(email,"Please enter your e-mail!")==false)
     {email.focus();return false;}
    if (validate_email(email,"Invalid e-mail format!")==false)
     {email.focus();return false;}
    if (verifpass==1) {
    if (validate_required(passor,"Please enter password!")==false)
     {passor.focus();return false;}
    if (validate_required(passor2,"Please repeat password!")==false)
     {passor2.focus();return false;}
    if (passor2.value!=passor.value)
     {alert(\'Repeated password is not equal to password!\');return false;}
    }
    if(rules.checked==false)
     {alert(\'To create account you must accept server rules!\');return false;}
    }
    }
    </script>';
    $main_content .= '
    <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="post" onsubmit="return validate_form(this)"><input type="hidden" name="buy_id" value="'.$buy_id.'">
    <table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="#505050"><td colspan="2"><b class="white">Change Name</b></td></tr>
    <tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b></td><td width="550">
    <select style="padding: 5px;" name="buy_name">';
    $players_from_logged_acc = $account_logged->getPlayersList();
    if(count($players_from_logged_acc) > 0) {
    $players_from_logged_acc->orderBy('name');
    foreach($players_from_logged_acc as $player) {
    $main_content .= '<option>'.$player->getName().'</option>';}
    } else {
    $main_content .= 'You don\'t have any character on your account.';}
    $main_content .= '</select>
    </td>
    </tr>
    <tr bgcolor="#F1E0C6">
    <td width="110"><b>New name:</b></td>
    <td width="550"><input type="text" name="buy_from" id="buy_from" />&nbsp;';
    if ($account_logged->getCustomField("premium_points") <= $buy_offer['points']){$main_content .='<input type="submit" value="Change Name" disabled />';} else {$main_content .='<input type="submit" value="Change Name" />';}
    $main_content .='</td>
    </tr>
    </table>
    <br />
    </form>';}
    } else {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
    <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
    <td CLASS="white"><b>Error</b></td>
    </tr>
    <tr BGCOLOR='.$config['site']['darkborder'].'>
    <td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>
    </tr>
    </TABLE>';}
    }}}
    elseif($action == 'confirm_transaction') {
    if(!$logged) {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS=white><B>Shoping Error</B></TD>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'>
    <td>
    <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
    <TR>
    <TD>Please login first.</TD>
    </TR>
    </TABLE>
    </td>
    </tr>
    </TABLE>';} 
    else {
    $buy_id = (int) $_POST['buy_id'];
    $buy_name = stripslashes(urldecode($_POST['buy_name']));
    $buy_from = stripslashes(urldecode($_POST['buy_from']));
    if(empty($buy_id)) {
    $main_content .= 'Please <a href="index.php?subtopic=shopsystem">select item</a> first.';
    } else {
    if($buy_offer['type'] == 'changename'){
    if(!check_name_new_char($buy_from)) {
    $main_content .= 'Invalid name format of new name.';
    }}
    else {
    $buy_offer = getItemByID($buy_id);
    $check_name_in_database = $ots->createObject('Player');
    $check_name_in_database->find($buy_from);
    if($buy_offer['type'] == 'changename'){
    if(!$check_name_in_database->isLoaded()) {
    }}
    if(isset($buy_offer['id'])) { //item exist in database
    if($user_premium_points >= $buy_offer['points']) {
    if(check_name($buy_name)) {
    $buy_player = new OTS_Player();
    $buy_player->find($buy_name);
    if($buy_player->isLoaded()) {
    $buy_player_account = $buy_player->getAccount();
    if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {
    if($buy_offer['type'] == 'pacc')
    {
    $player_viptime = $buy_player_account->getCustomField('viptime');
    $player_lastlogin = $buy_player_account->getCustomField('lastday');
    $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
    $SQL->query($save_transaction);
     
    if($player_viptime > 0)
    $buy_player_account->setCustomField('viptime', $player_viptime + ($buy_offer['days'] * 24 * 60 * 60));
    else
    $buy_player_account->setCustomField('viptime', time() + ($buy_offer['days'] * 24 * 60 * 60));
     
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    if($player_viptime == 0)
    {
    $buy_player_account->setCustomField('lastday', time());
    }
    $main_content .= '<h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of Vip Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>';
    }
    elseif($buy_offer['type'] == 'unban'){
    $my_acc_id = $account_logged->getCustomField('id');
    $datadata = $SQL->query('SELECT * FROM '.$SQL->tableName('bans').' WHERE value = '.$my_acc_id.';')->fetch();
    if($datadata['value'] == $my_acc_id) {
    if($SQL->query('DELETE FROM bans WHERE value= '.$my_acc_id.' LIMIT 1;')) {
    } else {
    $SQL->query('DELETE FROM bans WHERE account= '.$my_acc_id.' LIMIT 1;');
    }
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<center><h2>Ban Deleted!</h2><b>Your account has been unbanned for '.$buy_offer['points'].' premium points</b> from your account.
    <br>Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br>';
    } else {
    $main_content .= '<center><b>You don\'t have any bans in your account!</b><br><br><a href="index.php?subtopic=shopsystem">Go back</a><br>';
    }
    }
    ////////////////////////////////
    elseif($buy_offer['type'] == 'itemlogout') {
    $my_acc_id = $buy_player->getCustomField('id');
    $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE id = '.$my_acc_id.';')->fetch();
    $playerslot = $SQL->query('SELECT * FROM '.$SQL->tableName('player_items').' WHERE player_id = '.$my_acc_id.';')->fetch();
    if ($playerinfo['online'] == '0') {
    if ($playerslot['pid'] != '10') {
    if ($datadata['cap'] >= $SQL->quote($buy_offer['free_cap'])) {
    $SQL->query('INSERT INTO player_items (player_id, pid, itemtype, count) VALUES ('.$my_acc_id.', '.$SQL->quote($buy_offer['pid']).', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['count1']).');');
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<h2>Item received to player: '.$buy_player->getName().'!</h2><br />Now you have <b>'.$user_premium_points.' premium points</b>.
    <br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a>';
    } else {
    $main_content .= '<b>You need '.$SQL->quote($buy_offer['free_cap']).' or more of cap!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
    }} else {
    $main_content .= '<b>Please leave the arrow slot in blank to receive item!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
    }} else {
    $main_content .= '<b>You need to be offline!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';
    }
    }
    ////////////////////////////////
    elseif($buy_offer['type'] == 'changename') {
    $my_acc_id = $buy_player->getCustomField('id');
    $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
    $checkname = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('name').' = '. $SQL->quote($buy_from) .';')->fetch();
    if($playerinfo['online'] == '0') {
    if($checkname == false) {
    $SQL->query('UPDATE `players` SET `name` = '. $SQL->quote($buy_from) .' WHERE `id` = '. $my_acc_id.' ;');
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<center><h2>Your name has been changed to '.$buy_from.'.</h2><br /><b>You have '.$user_premium_points.' premium points left</b>.
    <br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';
    } else {
    $main_content .= '<center><h2>Sorry, the name "<i>'.$buy_from.'</i>" does already exist.<br />Please select another name.</h2><br />';
    }} else {
    $main_content .= '<center><h2>'.$buy_name.' has to be offline to complete transaction.</h2><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';
    }}
    ////////////////////////////////
    elseif($buy_offer['type'] == 'redskull') {
    $my_acc_id = $buy_player->getCustomField('id');
    $playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
    if($playerinfo['skull'] == '4' AND $playerinfo['online'] >= '0' AND $playerinfo['skulltime'] > '0') {
    $SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
    $SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<center><h2>RedSkull Removed!</h2><br /><b>Your redskull has been removed from the player '.$buy_player->getName().'.</b>
    <br />Now you have<b> '.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';
    } else {
    $main_content .= '<center><b>'.$buy_player->getName().' has to be offline or have redskull to complete transaction!.</b><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';
    }}
    //////////////////////////
    elseif($buy_offer['type'] == 'item') {
    $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', \'\', \'\', \'item\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
    $SQL->query($sql);
    $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
    $SQL->query($save_transaction);
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS="white"><b>Item added successfully !</b></td>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'>
    <TD>
    <b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />
    Now you have <b>'.$user_premium_points.' premium points</b>.
    </TD>
    </TR>
    </TABLE>
    <br /><a href="index.php?subtopic=shopsystem">MAIN SHOP SITE</a><br /><br />';}
    if($buy_offer['type'] == 'vipdays') {
    $player_vip_time = $buy_player_account->getCustomField('vip_time');
    $player_lastlogin = $buy_player_account->getCustomField('lastday');
    $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
    $SQL->query($save_transaction);
    if($player_vip_time > 0)
    $buy_player_account->setCustomField('vip_time', $player_vip_time + $buy_offer['days'] * 86400);
    else
    $buy_player_account->setCustomField('vip_time', time() + $buy_offer['days'] * 86400);
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    if ($player_vip_days >= 1) {
    }
    $main_content .= '<center><h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of VIP days added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';} 
    elseif($buy_offer['type'] == 'itemvip') {
    $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['megaitems_count']).', \'\', \'\', \'megaitems\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
    $SQL->query($sql);
    $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
    $SQL->query($save_transaction);
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<center><h2>Mega Item added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br>Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br>';
    }
    elseif($buy_offer['type'] == 'container') {
    $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote($buy_offer['container_id']).', '.$SQL->quote($buy_offer['container_count']).', \'container\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
    $SQL->query($sql);
    $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
    $SQL->query($save_transaction);
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '<center><h2>Container of items added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br />';
    }} 
    else {
    if($buy_offer['type'] != 'changename') {
    $set_session = TRUE;
    $_SESSION['viewed_confirmation_page'] = 'yes';
    $main_content .= '
    <table border="0" cellpadding="4" cellspacing="1" width="100%">
    <tr bgcolor="#505050"><td colspan="3"><font color="white"><b>Confirm transaction</b></font></td></tr>
    <tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Image:</b></td><td width=550" colspan="2"><img src="images/items/'.$buy_offer['item_id].'.gif" align="absmiddle"/><br /><small><b>'.$buy_offer['name'].'</b></small></td></tr>
    <tr bgcolor="'.$config['site']['lightborder'].'"><td><b>Description:</b></td><td width=550" colspan="2">'.$buy_offer['description].'</td></tr>';
    $main_content .='
    <tr bgcolor="'.$config['site']['darkborder'].'">
    <td><b>Cost:</b></td>
    <td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b> from your account</td>
    </tr>';
    $main_content .='
    <tr bgcolor="'.$config['site']['lightborder'].'"><td><b>For Player:</b></td><td width="550" colspan="2">'.$buy_player->getName().' <small>[<a href="index.php?subtopic=characters&name='.$buy_player->getName().'" target="_blank">View Character</a>]</small></td></tr>
    <tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Confirm Transaction ?</b></td>
    <td><form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST">
    <input type="hidden" name="buy_confirmed" value="yes">
    <input type="hidden" name="buy_id" value="'.$buy_id.'">
    <input type="hidden" name="buy_from" value="'.urlencode($new_name).'">
    <input type="hidden" name="buy_name" value="'.urlencode($buy_name).'">
    <input type="submit" value="Accept">
    </form>
    </td>
    <td>
    <form action="index.php?subtopic=shopsystem" method="POST">
    <input type="submit" value="Cancel">
    </form>
    </td>
    </tr>
    </table><br />';
    } else {
    $set_session = TRUE;
    $_SESSION['viewed_confirmation_page'] = 'yes';
    $main_content .= '<center><h2>Confirm Name Changing</h2>
    <table border="0" cellpadding="4" cellspacing="1" width="100%">
    <tr bgcolor="#505050"><td colspan="3"><font color="white" size="4"><b>Confirm transaction</b></font></td></tr>
    <tr bgcolor="#D4C0A1"><td width="130"><b>Name:</b></td><td width="550" colspan="2">'.$buy_offer['name'].'</td></tr>
    <tr bgcolor="#F1E0C6"><td width="130"><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>
    <tr bgcolor="#D4C0A1"><td width="130"><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b></td></tr>
    <tr bgcolor="#F1E0C6"><td width="130"><b>Current Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_player->getName().'</font></td></tr>
    <tr bgcolor="#D4C0A1"><td width="130"><b>New Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_from.'</font></td></tr>
    <tr bgcolor="#F1E0C6"><td width="130"><b>Change Name?</b></td><td width="275" align="left">
    <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST">
    <input type="hidden" name="buy_confirmed" value="yes">
    <input type="hidden" name="buy_id" value="'.$buy_id.'">
    <input type="hidden" name="buy_from" value="'.urlencode($buy_from).'">
    <input type="hidden" name="buy_name" value="'.urlencode($buy_name).'">
    <input type="submit" value="Accept">
    </form>
    </td>
    <td align="right"><form action="index.php?subtopic=shopsystem" method="POST">
    <input type="submit" value="Cancel">
    </form>
    </td>
    </tr>
    </table>';}}} 
    else {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
    <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
    <td CLASS="white"><b>Error</b></td>
    </tr>
    <tr BGCOLOR='.$config['site']['darkborder'].'>
    <td>Player with name <b>'.$buy_name.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</td>
    </tr>
    </TABLE>';
    }
    } else {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
    <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    <TD CLASS=white><B>Shoping Error</B></TD>
    </TR>
    <TR BGCOLOR='.$config['site']['darkborder'].'>
    <td>
    <TABLE BORDER="0" CELLSPACING="1" cellpadding="4">
    <TR>
    <TD>Invalid name format. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</TD>
    </TR>
    </TABLE>
    </td>
    </tr>
    </TABLE><br />';}
    } else {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
    <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
    <td CLASS="white"><b>Error</b></td>
    </tr>
    <tr BGCOLOR='.$config['site']['darkborder'].'>
    <td>For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_premium_points.'</b> premium points. Please <a href="index.php?subtopic=shopsystem">select other item</a> or buy premium points.</td>
    </tr>
    </TABLE>';
    }}
    else {
    $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
    <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
    <td CLASS="white"><b>Error</b></td>
    </tr>
    <tr BGCOLOR='.$config['site']['darkborder'].'>
    <td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>
    </tr>
    </TABLE>';
    }}}}
    if(!$set_session) {
    unset($_SESSION['viewed_confirmation_page']);
    }}
    if(!$logged)
    $main_content .= '<br /><center><div class="notice"><b>Please login to see how much points you have</b></div></center>';
    else
    if($account_logged->getCustomField("premium_points") <= 0)
    $main_content .='<br /><center><div class="error">You do not have premium points available.<br /><a href="index.php?subtopic=donate">Buy now Premium Points here!</a></div></center>'; 
    else
    if($account_logged->getCustomField("premium_points") >= 1)
    $main_content .='<br /><center><div class="success" style="width: 300px;">You have&nbsp;<b>'.$account_logged->getCustomField("premium_points").'</b>&nbsp;premium points available</div></center>';
    }
    else
    $main_content .= '
    <div class="error_type">
    Shop for disabled the internal maintenance, back in a moment with our standard systems.<br /><br /><b><small>Graciously, Staff</small></b>
    </div>
    ';
    ?> 

    10 rep + pra quem ajuda.

Link para o post
Compartilhar em outros sites

Você especifico ó conteúdo do sistema mais não disse o que quer que seja feito apenas mostro os codigo .PHP sem citar o que deseja em mente pesso que seja mais claro brevemente.

Link para o post
Compartilhar em outros sites

esta aki o link 

onde as configurações  estão  la  embaixo da do link q eu mandei ai em cima , la tem a modificações 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo