File size: 14.2Kb
<?
require_once'../core/system.php';
print only_reg();
print ban();
print blok();
$header='Мастер';
require_once'../core/head.php';
mysql_query("UPDATE `user` set `mesto` = 'Мастер' where `id` = '".$user['id']."'");
if($user['level'] < 7){
header('location: /');
$_SESSION['err'] = 'Доступно только с 7 уровня';}
print"<img src='/images/master.jpg' width='100%'><div class='line'></div>";
$time = $_SERVER['REQUEST_TIME'];
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `status`!='1' and `time`<".$_SERVER['REQUEST_TIME']."");
$avto = mysql_num_rows($req);
if($avto > 0){
mysql_query("UPDATE `master` set `status` = '1' where `usr` = '".$user['id']."'");
header('location: ?'); exit;
}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '1'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
print'<table class="foot center" width="100%">
<tbody><tr><td class="center" width="50%">';
if($master['time'] > $time){
print'<a class="big-but" href="/master/accelerate?id=1">';
} else {
print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time'] < $time){
print'<img src="/images/icon/ok.png"> Готово';
} else {
print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >= 10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';
}
print'</a></td>';
} else {
print'<table class="foot center" width="100%"><tbody><tr><td class="center" width="50%"><a class="big-but" href="/master/order?id=1"><div class="imgwrap"><img src="/images/main/master.png"></div>Заказать камень</a></td>';
}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '2'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
print'<td class="center" width="50%">';
if($master['time'] > $time){
print'<a class="big-but" href="/master/accelerate?id=2">';
} else {
print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time'] < $time){
print'<img src="/images/icon/ok.png"> Готово';
}else{
print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >= 10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';
}
print'</a></td><tr>';
} else {
if($user['lot2']==0){
print'<td class="center" width="50%"><a class="big-but" href="/master/open?id=2"><div class="imgwrap"><img src="/images/icon/lock.png"></div>Открыть слот</a></td><tr>';
} else {
print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=2"><div class="imgwrap"><img src="/images/main/master.png"></div>Заказать камень</a></td><tr>';
}
}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '3'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){
print'<td class="center" width="50%">';
if($master['time'] > $time){print'<a class="big-but" href="/master/accelerate?id=3">';
} else {
print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time'] < $time){print'<img src="/images/icon/ok.png"> Готово';
} else {
print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';
}
print'</a></td>';
} else {
if($user['lot3']==0){
print'<td class="center" width="50%"><a class="big-but" href="/master/open?id=3"><div class="imgwrap"><img src="/images/icon/lock.png"></div>Открыть слот</a></td>';
} else {
print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=3"><div class="imgwrap"><img src="/images/main/master.png"></div>Заказать камень</a></td>';
}
}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '4'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){print'<td class="center" width="50%">';
if($master['time']>$time){print'<a class="big-but" href="/master/accelerate?id=4">';}else{print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time']<$time){print'<img src="/images/icon/ok.png"> Готово';}else{print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';
}
print'</a></td><tr>';
}else{
if($user['lot4']==0){
print'<td class="center" width="50%"><a class="big-but" href="/master/open?id=4">
<div class="imgwrap"><img src="/images/icon/lock.png"></div>
Открыть слот
</a></td>
<tr>';
}else{
print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=4">
<div class="imgwrap"><img src="/images/main/master.png"></div>
Заказать камень
</a></td><tr>';}}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '5'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){print'<td class="center" width="50%">';
if($master['time']>$time){print'<a class="big-but" href="/master/accelerate?id=5">';}else{print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time']<$time){print'<img src="/images/icon/ok.png"> Готово';}else{print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';}
print'</a></td>';
}else{
if($user['lot5']==0){
print'<td class="center" width="50%"><a class="big-but" href="/master/open?id=5">
<div class="imgwrap"><img src="/images/icon/lock.png"></div>
Открыть слот
</a></td>';
}else{
print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=5">
<div class="imgwrap"><img src="/images/main/master.png"></div>
Заказать камень
</a></td>';}}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '6'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){print'<td class="center" width="50%">';
if($master['time']>$time){print'<a class="big-but" href="/master/accelerate?id=6">';}else{print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time']<$time){print'<img src="/images/icon/ok.png"> Готово';}else{print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';}print'
</a></td><tr>';}else{
if($user['lot6']==0){print'
<td class="center" width="50%"><a class="big-but" href="/master/open?id=6">
<div class="imgwrap"><img src="/images/icon/lock.png"></div>
Открыть слот
</a></td>
<tr>';}else{print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=6">
<div class="imgwrap"><img src="/images/main/master.png"></div>
Заказать камень
</a></td><tr>';}}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '7'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){print'<td class="center" width="50%">';
if($master['time']>$time){print'<a class="big-but" href="/master/accelerate?id=7">';}else{print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time']<$time){print'<img src="/images/icon/ok.png"> Готово';}else{print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';}print'
</a></td>';}else{
if($user['lot7']==0){print'
<td class="center" width="50%"><a class="big-but" href="/master/open?id=7">
<div class="imgwrap"><img src="/images/icon/lock.png"></div>
Открыть слот
</a></td>';}else{print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=7">
<div class="imgwrap"><img src="/images/main/master.png"></div>
Заказать камень
</a></td>';}}
$req = mysql_query("SELECT * FROM `master` WHERE `usr` = '".$user['id']."' and `lot` = '8'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto>0){print'<td class="center" width="50%">';
if($master['time']>$time){
print'<a class="big-but" href="/master/accelerate?id=8">';
} else {
print'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
}
print'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';
if($master['time']<$time){
print'<img src="/images/icon/ok.png"> Готово';
} else {
print'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
$h='0'.$hours.'';
}
if($hours >= 10){
$h=''.$hours.'';
}
if($hours == 0){
$h='00';
}
$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m='0'.$minutes.'';
}
if($minutes >= 10){
$m=''.$minutes.'';
}
if($minutes == 0){
$m='00';
}
$seconds = $difference -$days*24*60*60- $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds<10){
$s='0'.$seconds.'';
}
if($seconds >=10){
$s=''.$seconds.'';
}
if($seconds == 0){
$s='00';
}
print ''.$h.':'.$m.':'.$s.'</font></div></span>';
}
print'</a></td></tbody></table>';
} else {
if($user['lot8']==0){
print'<td class="center" width="50%"><a class="big-but" href="/master/open?id=8"><div class="imgwrap"><img src="/images/icon/lock.png"></div>Открыть слот</a></td></tbody></table>';
} else {
print'<td class="center" width="50%"><a class="big-but" href="/master/order?id=8"><div class="imgwrap"><img src="/images/main/master.png"></div>Заказать камень</a></td></tbody></table>';
}
}
print'<div class="line"></div><div class="mli"><div class="empty"></div><div class="grey center mli">Драгоценные камни нужны для повышения уровня Ваших вещей.</div><div class="empty"></div></div>';
require_once'../core/foot.php';
?>