PHP Code:
<?php
/**
* @author Nguyen Huy
* @copyright 2009
*/
if (eregi("uythac.cl.php", $_SERVER['SCRIPT_NAME'])) { die(); }
require("error.php");
require("anti.php");
if(isset($_SESSION['t_k']) && isset($_SESSION['m_k'])){
include('cauhinh/uythac.ch.php');
$login = stripslashes($_SESSION['t_k']);
$charid = stripslashes($_POST['charid']);
$time = $_SERVER["REQUEST_TIME"];
include('mssql.php');
include('mysql.php');
if($_POST['mod']=='uy_thac'){
$thoigian = (int)($_POST['thoigian']);
$loai = stripslashes($_POST['loai']);
if (empty($charid) || empty($thoigian) || empty($loai))
{ die(notin); }
else if (strlen($login) < 4 or strlen($login) > 10 || eregi("[^a-zA-Z0-9]", $login))
{ die(loiacc); }
else if (strlen($charid) < 4 or strlen($charid) > 10 || eregi("[^a-zA-Z0-9]", $charid))
{ die(char_fail); }
else{
include('fuc.php');
$a =$db->Execute("Select Name from uy_thac WHERE AccountID ='".secure($login)."' and Name ='".secure($charid)."'");
if($a->numrows()==1)
{die("<div class=do><b>$charid</b> ".uythacno."</div>");}
else{
$y = $db->Execute("Select Name,CtlCode from Character WHERE AccountID ='".secure($login)."' and Name ='".secure($charid)."'");
if($y->numrows()==1){
$cot_y =$y->fetchrow();
if($cot_y[1]==1)
{die(charblock); }
else if($cot_y[1]!=0)
{die("<b class=do>$charid</b>".relockitem); }
else
{
$y1 = $db->Execute("Select GameIDC from AccountCharacter WHERE Id ='".secure($login)."' and GameIDC ='".secure($charid)."'");
if($y1->numrows()==0){
if($loai=='yzen')
{$colum ='zen';$colum2 ='nganhang_zen';$eror =bankzen;$upjava ="bankzen";}
else{$colum ='cash';$colum2 ='nganhang_cash';$eror =bankcash;$upjava ="bankcash";}
$b = $db->Execute("Select $colum2 from MEMB_INFO WHERE memb___id ='".secure($login)."'");
$cot_b =$b->fetchrow();
$c =mysql_query("Select $colum from cauhinh_uythac WHERE thoigian ='".$thoigian."'");
$cotc =mysql_fetch_row($c);
if($cot_b[0]>=$cotc[0]){
$moneyend =($cot_b[0]-$cotc[0]);
if($db->Execute("INSERT INTO uy_thac (AccountID,Name,thoigian,vaoluc) VALUES ('".secure($login)."','".secure($charid)."','".$thoigian."','".time()."')"))
{
$db->Execute("update MEMB_INFO set $colum2='$moneyend' WHERE memb___id ='".secure($login)."'");
$db->Execute("update Character set CtlCode='5' WHERE Name ='".secure($charid)."'");
echo("<script type=\"text/javascript\">
$('#$upjava').html('".number_format($moneyend)."');
$('#list_uythac').load('op.php?ok=uythac.cl&list_uythac');
</script><div class=xanh><b>$charid</b> ".uythacok."</div>"); }
else{die(bugquery); }
}
else{die($eror); }
}
else{die(gamechange); }
}
}
else{die(chardie); }
}
}
}
else if(isset($_GET['list_uythac'])){
include('mssql.php');
include('fuc.php');
$mychar =$db->Execute("Select Name,thoigian,vaoluc from uy_thac where AccountID='".secure($login)."' order by Name asc");
$num =$mychar->numrows();
if($num >=1){
for($i=0;$i<$num;++$i)
{
$row =$mychar->fetchrow();
$lefttime = ($row[2]+($row[1]*3600));
$setimg =($time-$row[2]);
if($setimg>=60){ $butimg ="<img src='img/uythac.jpg' border=\"0\">";}
else{$butimg =""; }
if($time >= $lefttime){$unset ="uythacok"; }
else{$unset ="unsetuythac"; }
$charlist .="<tr id=\"char-$row[0]\">
<td align=center>$row[0]</td>
<td align=center>$row[1] ".hous."</td>
<td align=center>".uythac3." <b>".date_formats($row[2],$time,'long')."</b></td>
<td align=center><a href=\"javascript:void(0)\" onclick=\"$unset('$row[0]'); return false;\">$butimg</a></td>
</tr>";
}
}
else{
$charlist .="<tr>
<td align=center colspan=4><div class='loi'>".utnochar."</td>
</tr>";
}
Echo("<div id=\"msgunset\" class=\"loi\"></div>
$row[2]
<table align=\"center\" width=\"480\" cellpadding=\"0\" cellspacing=\"0\" class=\"listchar\"><thead>
<tr>
<td align=center>".charter."</td>
<td align=center>".uttime."</td>
<td align=center>".utduoc."</td>
<td align=center>".utend."</td>
</tr>
</thead>
".$charlist."
</table>");
}
else if($_GET['mod']=='end_uythac'){
if (empty($charid))
{ die(notin); }
else if (strlen($login) < 4 or strlen($login) > 10 || eregi("[^a-zA-Z0-9]", $login))
{ die(loiacc); }
else if (strlen($charid) < 4 or strlen($charid) > 10 || eregi("[^a-zA-Z0-9]", $charid))
{ die(char_fail); }
else{
include('mssql.php');
include('mysql.php');
include('fuc.php');
$a =$db->Execute("Select Name,thoigian,vaoluc from uy_thac WHERE AccountID ='".secure($login)."' and Name ='".secure($charid)."'");
if($a->numrows()>0){
$cota =$a->fetchrow();
$b = $db->Execute("Select Name,cLevel from Character WHERE AccountID ='".secure($login)."' and Name ='".secure($charid)."'");
if($b->numrows()>0){
$c =mysql_query("Select thoigian from cauhinh_uythac WHERE thoigian ='".$cota[1]."'");
if(mysql_num_rows($c)==0)
{die(ch_uythac); }
else
{
$cot_b =$b->fetchrow();
$cotc =$c->fetchrow();
$d = $db->Execute("Select vip from MEMB_INFO WHERE memb___id ='".secure($login)."'");
$cot_d =$d->fetchrow();
if($cot_d[0]>=1){$lvlvip =rand($uythac['vip_randa'],$uythac['vip_randb']);}
else{$lvlvip =rand($uythac['randa'],$uythac['randb']);}
$timeend =($cota[1]*60*60)+$cota[2];
if($time >= $timeend){
$timelvl =($cota[1]*60);
$uplvl =($cot_b[1]+$timelvl)+$lvlvip;
}
else{
$timelvl =intval(($time-$cota[2])/60);
$uplvl =($cot_b[1]+$timelvl);
}
if($uplvl >= $cauhinh['maxlvl']){$uplvl =$cauhinh['maxlvl']; }
if($db->Execute("Update Character set cLevel ='$uplvl',Experience ='-472819216', CtlCode='0' WHERE AccountID ='".secure($login)."' and Name ='".secure($charid)."'")){
echo("<script type=\"text/javascript\">
$('#list_uythac').load('op.php?ok=uythac.cl&list_uythac');
</script><div class=xanh><b>$charid</b> ".uythac_end."</div>");
$db->Execute("delete from uy_thac where AccountID ='".secure($login)."' and Name ='".secure($charid)."'");
}
else{die(bugquery); }
}
}
else{die(chardie); }
}
else{ die("<div class=do><b>$charid</b> ".nocharuy."</div>"); }
}
}
}
else{die($nologin);}
?>
PHP Code:
<?php
if (eregi("uythac.php", $_SERVER['SCRIPT_NAME'])) { die(""); }
include("error.php");
include("anti.php");
include('cauhinh/bat_mo.php');
if ($modu['uythac']==0) { echo(khoa_mod); }
else if(isset($_SESSION['t_k']) && isset($_SESSION['m_k'])){
$login = stripslashes($_SESSION['t_k']);
$pass = stripslashes($_SESSION['m_k']);
require("mssql.php");
require("mysql.php");
include("fuc.php");
$a =$db->Execute("Select name from Character where AccountID ='".secure($login)."' order by name asc");
$numa =$a->numrows();
if($numa>=1){
for($j=0;$j<$numa;++$j){
$cota =mssql_fetch_row($a);
$char .="<option value=\"$cota[0]\">$cota[0]</option>";
}
$b =mysql_query("Select thoigian,zen,cash from cauhinh_uythac order by thoigian asc");
$numb =mysql_num_rows($b);
if($numb >=1){
for($g=0;$g<$numb;++$g){
$id =$g+1;
$cotb =mysql_fetch_row($b);
$option .="<option value=\"$cotb[0]\">$cotb[0] Tiếng</option>";
$scriptzen .=" if( ida == eval($cotb[0]) )
{ $('#reuythac').html('".uythac2."<b class=vang>".number_format($cotb[1])." ".zen."</b>'); }
";
$scriptcash .=" if( ida == eval($cotb[0]) )
{ $('#reuythac').html('".uythac2."<b class=xanh>".number_format($cotb[2])." ".cash."</b>'); }
";
}
}
echo("<script type=\"text/javascript\">
function showuythac(ida,idb){
if(ida=='')
{ $('#reuythac').html('".uythac1."'); }
else if(idb=='yzen')
{
$scriptzen
}
else if(idb=='ycash')
{
$scriptcash
}
}
function uythacstart(ida,idb){
var you =$('#you').val();
times =$('#ytime').val();
var loai =$('#ytype').val();
if(you=='' || times=='' || loai=='' )
{ $('#msguythac').html('".notin."'); }
else
{
$.post('op.php?ok=uythac.cl',{ mod: 'uy_thac', charid: you, thoigian: times, loai: loai},function(txt) {
$('#msguythac').html(txt);
} );
}
}
function unsetuythac(charter) {
if (confirm(charter+' ".un_ut."'))
$.post('op.php?ok=uythac.cl&mod=end_uythac',{charid: charter},function(txt)
{ $('#msguythac').html(txt); } );
}
function uythacok(charter) {
$.post('op.php?ok=uythac.cl&mod=end_uythac',{charid: charter},function(txt)
{ $('#msguythac').html(txt); } );
}
</script><div align=left>
".uythac0."
</div>
<div id=\"msguythac\" class=loi align=center></div>
<form action=\"\" method=\"post\">
<table align=\"center\" width=\"480\" cellpadding=\"5\" cellspacing=\"5\" border=\"0\">
<tr>
<td align=\"right\" width=\"50%\">
<select name=\"you\" id=\"you\" class=\"nganhang\">
<option value=\"\">".sechar."</option>
".$char."
</select>
</td>
<td>
</td>
</tr>
<tr>
<td align=\"right\" width=\"50%\">
<select name=\"ytime\" id=\"ytime\" class=\"nganhang\" onchange=\"showuythac(this.value,$('#ytype').val())\">
<option value=\"\">".uttime."</option>
$option
</select>
</td>
<td align=\"left\"><div id=\"reuythac\" class=tim>".uythac1."</div>
</td>
</tr>
<tr>
<td align=\"right\" width=\"50%\">
<select id=\"ytype\" class=\"nganhang\" onchange=\"showuythac($('#ytime').val(),this.value)\">
<option value=\"yzen\">".utzen."</option>
<option value=\"ycash\">".utcash."</option>
</select>
</td>
</tr>
<tr>
<td align=\"right\"><input class=\"submit\" type=\"button\" value=\"".utsart."\" onclick=\"uythacstart();\"></td>
<td align=\"left\"><input class=\"submit\" type=\"reset\" value=\"".rs."\"></td>
</tr>
<tr>
<td align=\"left\" colspan=2>".uythac4."</td>
</tr>
</table>
</form>
<div id=\"list_uythac\"><script type=\"text/javascript\">
$('#list_uythac').load('op.php?ok=uythac.cl&list_uythac');
</script></div>");
}
else{die(empty_char); }
}
else {echo ($nologin); }
?>