<?php
if($_GET["deid"]*1)
{
	$db->query("delete from ".EAR." where id='$_GET[deid]'");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE><?php echo lang_show('admin_system');?></TITLE> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="main.js"></script>
</HEAD>
<body>

<div class="bigbox">
		<div class="bigboxhead tb">
		<span class="cbox on"><a href="module.php?m=company&s=earnest_list.php"><?php echo lang_show('man_cash');?></a></span>
		<span class="cbox"><a href="module.php?m=company&s=earnest_add.php"><?php echo lang_show('add_cash');?></a></span>
	</div>
	<div class="bigboxbody">
  <table width="100%" border="0" cellpadding="2" cellspacing="0" >
    <tr class="theader"> 
      <td><?php echo lang_show('business_info_com');?></td>
      <td width="228"><?php echo lang_show('money');?></td>
      <td width="145"><?php echo lang_show('delivery_time');?></td>
      <td width="145"><?php echo lang_show('change_p');?></td>
      <td width="108" align="center"><?php echo lang_show('manager');?></td>
      </tr>
    <?php
	$sql="SELECT a.*,b.company FROM ".EAR." a,".COMPANY." b WHERE
	  	  a.company_id=b.company_id order by id desc ";
	//=============================
	include_once("../includes/page_utf_class.php");
	$page = new Page;
	$page->listRows=20;
	if (!$page->__get('totalRows')){
		$db->query($sql);
		$page->totalRows = $db->num_rows();
	}
	$sql .= "  limit ".$page->firstRow.",20";
	$pages = $page->prompt();
	//=====================
	$db->query($sql);
	$re=$db->getRows();
	foreach($re as $v)
	{ 
	?> 
      <tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this,'odd')"> 
        <td align="left"><?php echo $v["company"]; ?></td>
        <td align="left"><?php echo $v["money"]; ?></td>
        <td align="left"><?php echo date("Y-m-d",$v["time"]); ?></td>
        <td align="left"><?php echo $v["admin"]; ?></td>
        <td align="center"> 
        <a href="module.php?m=company&s=earnest_add.php&name=<?php echo $v['user']; ?>"><?php echo $editimg;?></a>  
        <a href="module.php?m=company&s=earnest_list.php&deid=<?php echo $v["id"]; ?>" onClick="return confirm('<?php echo lang_show('are_you_sure');?>')"><?php echo $delimg;?></a>
		</td>
	  </tr>
        <?php 
    	}
		?>
      <tr>
        <td colspan="6" align="right"><div class="page"><?php echo $pages?></div></td>
      </tr>
  </table>
  </div>
</div>
</body>
</html>