287 lines
11 KiB
PHP
287 lines
11 KiB
PHP
<?php
|
|
if(!defined('GAME'))die();
|
|
|
|
header('location:/core/comission/');
|
|
die();
|
|
|
|
if($u->room['file']=='commision')
|
|
{
|
|
if(isset($u->stats['shopSale'],$_GET['sale']))
|
|
{
|
|
$bns = 0+$u->stats['shopSale'];
|
|
if($bns!=0)
|
|
{
|
|
if($bns>0)
|
|
{
|
|
$bns = '+'.$bns;
|
|
}
|
|
$shopProcent -= $bns;
|
|
if($shopProcent>99){ $shopProcent = 99; }
|
|
if($shopProcent<1){ $shopProcent = 1; }
|
|
echo '<div style="color:grey;"><b>Ó Âàñ äåéñòâóåò áîíóñ ïðè ïðîäàæå: '.$bns.'%</b><br><small>Âû ñìîæåòå ïðîäàâàòü ïðåäìåòû çà '.(100-$shopProcent).'% îò èõ ñòîèìîñòè</small></div>';
|
|
}
|
|
}
|
|
|
|
if(!isset($_GET['otdel'])) $_GET['otdel'] = 1;
|
|
|
|
$sid = 1;
|
|
|
|
$error = '';
|
|
|
|
# Âûïîëíåíèå ôóíêöèè ïîêóïêè ïðåäìåòà
|
|
if(isset($_GET['buy']))
|
|
{
|
|
if($u->info['allLock'] > time()) {
|
|
$re = '<div align="left">Âàì çàïðåùàåòñÿ ïîëüçîâàòüñÿ äàííûì ìàãàçèíîì äî '.date('d.m.y H:i',$u->info['allLock']).'</div>';
|
|
}elseif($u->info['align'] == 2 || $u->info['haos'] > time()) {
|
|
$re = '<div align="left">Õàîñíèêàì çàïðåùàåòñÿ ïîëüçîâàòüñÿ äàííûì ìàãàçèíîì</div>';
|
|
}elseif($u->newAct($_GET['sd4'])==true)
|
|
{
|
|
$re = $u->buyItemCommison($sid,(int)$_GET['itemid'],(int)$_GET['buy']);
|
|
}else{
|
|
$re = 'Âû óâåðåíû ÷òî õîòèòå êóïèòü ýòîò ïðåäìåò?';
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Âûïîëíåíèå ôóíêöèè "ïîëîæèòü ïðåäìåò â êîìèñèîíêó"
|
|
* Èëè çàáðàòü ïðåäìå èç êîììèñèîíêè.
|
|
*/
|
|
|
|
if($u->info['align'] == 2 || $u->info['haos'] > time()) {
|
|
$re = '<div align="left">Õàîñíèêàì çàïðåùàåòñÿ ïîëüçîâàòüñÿ äàííûì ìàãàçèíîì</div>';
|
|
}elseif(isset($_POST['PresTR'])){
|
|
$u->commisonRent(mysql_real_escape_string($_POST['PresTR']),(int)$_POST['iid'],(int)$_POST['summTR']);
|
|
}
|
|
|
|
if($re!=''){ echo '<div align="right"><font color="red"><b>'.$re.'</b></font></div>'; } ?>
|
|
|
|
<script type="text/javascript">
|
|
function AddCount(name, txt)
|
|
{
|
|
document.getElementById("hint4").innerHTML = '<table border=0 width=100% cellspacing=1 cellpadding=0 bgcolor="#CCC3AA"><tr><td align=center><B>Êóïèòü íåñê. øòóê</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</TD></tr><tr><td colspan=2>'+
|
|
'<form method=post><table border=0 width=100% cellspacing=0 cellpadding=0 bgcolor="#FFF6DD"><tr><INPUT TYPE="hidden" name="set" value="'+name+'"><td colspan=2 align=center><B><I>'+txt+'</td></tr><tr><td width=80% align=right>'+
|
|
'Êîëè÷åñòâî (øò.) <INPUT TYPE="text" NAME="count" id=count size=4></td><td width=20%> <INPUT TYPE="submit" value=" »» ">'+
|
|
'</TD></TR></form></TABLE></td></tr></table>';
|
|
document.getElementById("hint4").style.visibility = 'visible';
|
|
document.getElementById("hint4").style.left = '100px';
|
|
document.getElementById("hint4").style.top = '100px';
|
|
document.getElementById("count").focus();
|
|
}
|
|
function closehint3() {
|
|
document.getElementById('hint4').style.visibility='hidden';
|
|
Hint3Name='';
|
|
}
|
|
</script>
|
|
<style type="text/css">
|
|
|
|
.pH3 { COLOR: #8f0000; FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; }
|
|
.class_ {
|
|
font-weight: bold;
|
|
color: #C5C5C5;
|
|
cursor:pointer;
|
|
}
|
|
.class_st {
|
|
font-weight: bold;
|
|
color: #659BA3;
|
|
cursor:pointer;
|
|
}
|
|
.class__ {
|
|
font-weight: bold;
|
|
color: #FFFFFF;
|
|
cursor:pointer;
|
|
background-color: #659BA3;
|
|
}
|
|
.class__st {
|
|
font-weight: bold;
|
|
color: #FFFFFF;
|
|
cursor:pointer;
|
|
background-color: #659BA3;
|
|
font-size: 10px;
|
|
}
|
|
.class_old {
|
|
font-weight: bold;
|
|
color: #919191;
|
|
cursor:pointer;
|
|
}
|
|
.class__old {
|
|
font-weight: bold;
|
|
color: #FFFFFF;
|
|
cursor:pointer;
|
|
background-color: #838383;
|
|
font-size: 10px;
|
|
}
|
|
</style>
|
|
<TABLE width="100%" cellspacing="0" cellpadding="0">
|
|
<tr><td valign="top"><?php
|
|
echo '<b style="color:red">'.$error.'</b>';
|
|
?>
|
|
<br />
|
|
<TABLE width="100%" cellspacing="0" cellpadding="4">
|
|
<TR>
|
|
<form name="F1" method="post">
|
|
<TD valign="top" align="left">
|
|
<!--Ìàãàçèí-->
|
|
<table width="100%" cellspacing="0" cellpadding="0" bgcolor="#a5a5a5">
|
|
<div id="hint3" style="visibility:hidden"></div>
|
|
<tr>
|
|
<td align="center" height="21">
|
|
<?php
|
|
/*íàçâàíèÿ ðàçäåëîâ (ñâåðõó)*/
|
|
if(!isset($_GET['sale']) && isset($_GET['otdel']))
|
|
{
|
|
$otdels_small_array = array (1050=>'<b>Îòäåë "Ïðî÷èå ïðåäìåòû"</b>',1=>'<b>Îòäåë "Îðóæèå: êàñòåòû,íîæè"</b>',2=>'<b>Îòäåë "Îðóæèå: òîïîðû"</b>',3=>'<b>Îòäåë "Îðóæèå: äóáèíû,áóëàâû"</b>',4=>'<b>Îòäåë "Îðóæèå: ìå÷è"</b>',5=>'<b>Îòäåë "Îðóæèå: ìàãè÷åñêèå ïîñîõè"</b>',6=>'<b>Îòäåë "Îäåæäà: ñàïîãè"</b>',7=>'<b>Îòäåë "Îäåæäà: ïåð÷àòêè"</b>',8=>'<b>Îòäåë "Îäåæäà: ðóáàõè"</b>',9=>'<b>Îòäåë "Îäåæäà: ëåãêàÿ áðîíÿ"</b>',10=>'<b>Îòäåë "Îäåæäà: òÿæåëàÿ áðîíÿ"</b>',11=>'<b>Îòäåë "Îäåæäà: øëåìû"</b>',12=>'<b>Îòäåë "Îäåæäà: íàðó÷è"</b>',13=>'<b>Îòäåë "Îäåæäà: ïîÿñà"</b>',14=>'<b>Îòäåë "Îäåæäà: ïîíîæè"</b>',15=>'<b>Îòäåë "Ùèòû"</b>',16=>'<b>Îòäåë "Þâåëèðíûå òîâàðû: ñåðüãè"</b>',17=>'<b>Îòäåë "Þâåëèðíûå òîâàðû: îæåðåëüÿ"</b>',18=>'<b>Îòäåë "Þâåëèðíûå òîâàðû: êîëüöà"</b>',19=>'<b>Îòäåë "Çàêëèíàíèÿ: íåéòðàëüíûå"</b>',20=>'<b>Îòäåë "Çàêëèíàíèÿ: áîåâûå è çàùèòíûå"</b>',21=>'<b>Îòäåë "Àìóíèöèÿ"</b>',22=>'<b>Îòäåë "Ýëèêñèðû"</b>',23=>'<b>Îòäåë "Ïîäàðêè"</b>',24=>'<b>Îòäåë "Ïîäàðêè: íåäîáðûå"</b>',25=>'<b>Îòäåë "Ïîäàðêè: óïàêîâêà"</b>',26=>'<b>Îòäåë "Ïîäàðêè: îòêðûòêè"</b>',27=>'<b>Îòäåë "Ïîäàðêè: ôåéåðâåðêè"</b>');
|
|
if(isset($otdels_small_array[$_GET['otdel']]))
|
|
{
|
|
echo $otdels_small_array[$_GET['otdel']];
|
|
}
|
|
|
|
}
|
|
?>
|
|
</tr>
|
|
<tr><td>
|
|
<!--Ðþêçàê / Ïðèëàâîê-->
|
|
<table width="100%" CELLSPACING="1" CELLPADDING="1" bgcolor="#a5a5a5">
|
|
<?php
|
|
|
|
/**
|
|
* Âûâîä ñïèñêà âåùåé ïðîäàâàåìûõ â êîìèñèîíêå
|
|
* Âûâîä âåùåé êîòîðûå óæå ñäàëè â êîìîê
|
|
*/
|
|
if(!isset($_GET['toRent'])){
|
|
/*
|
|
* Âûâîäèì âñå âåùè ïðîäîâàåìûå â êîìêå
|
|
* Â ðåæèìå ïðåäâàðèòåëüíîãî ïðîñìîòðà
|
|
*/
|
|
$u->commisionShop($sid,"preview");
|
|
}elseif($_GET['toRent'] == 1){
|
|
/*
|
|
* Âûâîäèì âåùè èç èíâåíòàðàÿ
|
|
* êîòîðûå õîòèì ñäàòü â êîìîê
|
|
*/
|
|
if($u->info['allLock'] < time()) {
|
|
$itmAll = $u->genInv(30,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`!="30" AND `iu`.`gift` = "" ORDER BY `lastUPD` DESC');
|
|
}else{
|
|
$itmAll[0] = 0;
|
|
}
|
|
if($itmAll[0]==0){
|
|
$itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">ÏÓÑÒÎ</td></tr>';
|
|
}else{
|
|
$itmAllSee = $itmAll[2];
|
|
}
|
|
echo $itmAllSee;
|
|
}elseif($_GET['toRent'] == 2){
|
|
/*
|
|
* Âûâîäèì âåùè êîòîðûå ìû ñäàëè â êîìîê
|
|
*/
|
|
$itmAll = $u->genInv(31,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="30" AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%fromshop=2%" ORDER BY `lastUPD` DESC');
|
|
if($itmAll[0]==0){
|
|
$itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">ÏÓÑÒÎ</td></tr>';
|
|
}else{
|
|
$itmAllSee = $itmAll[2];
|
|
}
|
|
echo $itmAllSee;
|
|
}elseif($_GET['toRent'] == 3){
|
|
/*
|
|
* Âûâîäèì ïîëíûé ïåðå÷åíü âåùåé
|
|
* ïðîäîâàåìûõ â êîìêå ïî îïðåäåëåííîìó
|
|
* âûáðàííîìó àéòåìó
|
|
*/
|
|
$u->commisionShop($sid,"full");
|
|
}
|
|
?>
|
|
</TABLE>
|
|
</TD></TR>
|
|
</TABLE>
|
|
</TD>
|
|
</FORM>
|
|
</TR>
|
|
</TABLE>
|
|
<td width="280" valign="top">
|
|
<TABLE cellspacing="0" cellpadding="0"><TD width="100%"> </TD><TD>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr align="right" valign="top">
|
|
<td>
|
|
<!-- -->
|
|
<? echo $goLis; ?>
|
|
<!-- -->
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
|
<tr>
|
|
<td nowrap="nowrap">
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
|
|
<tr>
|
|
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
|
|
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.9',1); ?>">Öåíòðàëüíàÿ Ïëîùàäü</a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td></table>
|
|
</td></table>
|
|
<div><br />
|
|
<div align="right">
|
|
<small>
|
|
Ìàññà: <?=$u->aves['now']?>/<?=$u->aves['max']?> <br />
|
|
Ó âàñ â íàëè÷èè: <b style="color:#339900;"><?php echo round($u->info['money'],2); ?> êð.</b>
|
|
</small>
|
|
</div>
|
|
<br />
|
|
<?php
|
|
/*êíîïî÷êè*/
|
|
|
|
echo '
|
|
<INPUT TYPE="button" value="Ñäàòü âåùè" onclick="location=\'?toRent=1\'">
|
|
<INPUT TYPE="button" value="Çàáðàòü âåùè" onclick="location=\'?toRent=2\'">
|
|
';
|
|
|
|
?>
|
|
|
|
</div>
|
|
<div style="background-color:#A5A5A5;padding:1"><center><B>Îòäåëû ìàãàçèíà</B></center></div>
|
|
<div style="line-height:17px;">
|
|
<?php
|
|
/*íàçâàíèÿ ðàçäåëîâ (ñïðàâà)*/
|
|
$otdels_array = array (1=>'Îðóæèå: êàñòåòû,íîæè',2=>' òîïîðû',3=>' äóáèíû,áóëàâû',4=>' ìå÷è',5=>' ìàãè÷åñêèå ïîñîõè',6=>'Îäåæäà: ñàïîãè',7=>' ïåð÷àòêè',8=>' ðóáàõè',9=>' ëåãêàÿ áðîíÿ',10=>' òÿæåëàÿ áðîíÿ',11=>' øëåìû',12=>' íàðó÷è',13=>' ïîÿñà',14=>' ïîíîæè',15=>'Ùèòû',16=>'Þâåëèðíûå òîâàðû: ñåðüãè',17=>' îæåðåëüÿ',18=>' êîëüöà',19=>'Çàêëèíàíèÿ',20=>'Ýëèêñèðû');
|
|
$i=1;
|
|
while ($i!=-1)
|
|
{
|
|
if(isset($otdels_array[$i]))
|
|
{
|
|
if(isset($_GET['otdel']) && $_GET['otdel']==$i)
|
|
{
|
|
$color = 'C7C7C7';
|
|
} else {
|
|
$color = 'e2e0e0';
|
|
}
|
|
|
|
echo '
|
|
<A HREF="?otdel='.$i.'"><DIV style="background-color: #'.$color.'">
|
|
'.$otdels_array[$i].'
|
|
</A></DIV>
|
|
';
|
|
} else {
|
|
$i = -2;
|
|
}
|
|
$i++;
|
|
}
|
|
if(isset($_GET['otdel']) && $_GET['otdel']==1050)
|
|
{
|
|
$color = 'C7C7C7';
|
|
} else {
|
|
$color = 'e2e0e0';
|
|
}
|
|
echo '
|
|
<A HREF="?otdel=1050"><DIV style="background-color: #'.$color.'">
|
|
Ïðî÷èå ïðåäìåòû
|
|
</A></DIV>
|
|
';
|
|
?>
|
|
</div>
|
|
</td>
|
|
</table>
|
|
<br>
|
|
<div id="textgo" style="visibility:hidden;"></div>
|
|
<?
|
|
}
|
|
?>
|