<?
				echo "
				<script language='JavaScript'>
				var elem = document.getElementById('se-pre-con');
				elem.parentNode.removeChild(elem);
				</script>
				";
if(!defined('GAME'))
{
	die();
}
$red = '';
$odate = time();
if(isset($_POST['date'])) {
	$_POST['date'] = explode('.',$_POST['date']);
	$odate = strtotime($_POST['date'][0].'-'.$_POST['date'][1].'-'.$_POST['date'][2].' 00:00:00');
	if($u->info['money'] >= 0.5) {
		$red = '<font color="red"><b>Îò÷åòû î ïåðåâîäàõ çà '.date('d.m.Y',$odate).' ïåðåäàí Âàì è íàõîäèòñÿ â ðàçäåëå &quot;Çàêëÿòèÿ&quot;.</b></font><br>';
		//ñîçäàåì îò÷åò
		$itm = $u->addItem(2435,$u->info['id'],'noodet=1|noremont=1');
		$u->info['money'] -= 0.5;
		mysql_query('UPDATE `users` SET `money` = `money` - 0.5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
		mysql_query('UPDATE `items_users` SET `use_text` = 100 WHERE `id` = "'.$itm.'" LIMIT 1');
		/* Çàíîñèì äàííûå íà Áóìàãó */
		mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("'.$itm.'","'.time().'","","'.mysql_real_escape_string("Äåéñòâèé è ïåðåâîäîâ ïåðñîíàæà <B>".$u->info['login']."</B> çà <B>".date('d.m.Y',$odate)."</B>.").'","'.$pl['city'].'","1","1")');
		$sp = mysql_query('SELECT * FROM `users_delo` WHERE `uid` = "'.$u->info['id'].'" AND `time` >= "'.$odate.'" AND `time` <= "'.($odate+86399).'" LIMIT 10000');
		$zps = 0;
		while($pl = mysql_fetch_array($sp))
		{
			$dl = explode('.',$pl['login']);
			$se = 0;		
			if($dl[1]=='Shop' || $dl[1] == 'ComShop' || $dl[1]=='EkrShop' || $dl[1]=='EkrShop' || $dl[1]=='Bank' || $dl[1]=='remont' || $dl[1]=='inventory' || $dl[1]=='transfer') {
				$se = 1;
			}			
			if($se==1)
			{
				mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("'.$itm.'","'.$pl['time'].'","'.$pl['login'].'","'.mysql_real_escape_string($pl['text']).'","'.$pl['city'].'","1")');				
				$zps++;
			}
		}
		if($zps == 0)
		{
			mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("'.$itm.'","'.mysql_real_escape_string($odate).'","Àðõèâàðèóñ","'.mysql_real_escape_string("Äåéñòâèé è ïåðåâîäû çà äàííîå ÷èñëî îòñóòñòâóþò.").'","'.$pl['city'].'","1","1")');
		}
	}else{
		echo '<font color="red"><b>Ó âàñ íåäîñòàòî÷íî äåíåã. Ñòîèìîñòü îò÷åòà ñîñòàâëÿåò 0.5 êð.</b></font>';
	}
}
?>
<FORM ACTION="main.php?act_trf=1" METHOD=POST>
<P align=right><INPUT class="btn" TYPE=button value="Ïîäñêàçêà" onclick="window.open('/encicl/help/schet.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
<INPUT TYPE="button" class="btn" onClick="top.frames['main'].location = 'main.php';" value="Âåðíóòüñÿ" name=edit></P>
<H3>Îò÷åò î ïåðåâîäàõ</H3>

Âû ìîæåòå ïîëó÷èòü îò÷åò î ïåðåâîäàõ êðåäèòîâ/âåùåé îò âàñ/ê âàì çà óêàçàííûé äåíü. Óñëóãà ïëàòíàÿ, ñòîèò <B>0.5 êð.</B><BR>
Ó âàñ íà ñ÷åòó: <FONT COLOR=339900><B><?=$u->info['money']?></B></FONT> êð.<BR>
Óêàæèòå äàòó, íà êîòîðóþ õîòèòå ïîëó÷èòü îò÷åò: <INPUT TYPE=text NAME=date value="<?=date('d.m.Y',$odate)?>"> <INPUT class="btn" TYPE=submit name=schet value="Çàêàçàòü îò÷åò">
</FORM>
<?='<br>'.$red?>