<!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>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<title>all</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>

<?
			include("config.php");
			
			$i=1;
			$g=1;
			$result = mysql_query('select * from p1_order_info'); 
            while($row = mysql_fetch_array($result)){ 
				$i=$i+1;
				
			//	echo substr($row['factory_dt'],0,10)."<br />";
				//259200 == 4 Day
				if ((strtotime(substr($row['add_dt'],0,10))-strtotime(substr($row['Date_a'],0,10))) > 259200 ) 
					{
					$g=$g+1;
						echo "<span class=style1>".substr($row['add_dt'],0,10)."</span> | ";
						echo '<a href="update_all1.php?oid='.$row['oid'].'&change='.substr($row['Date_a'],0,10).'">'.substr($row['Date_a'],0,10).'</a> | ';
						echo substr($row['factory_dt'],0,10)." | ";
						echo strtotime(substr($row['add_dt'],0,10))." | ";
						echo strtotime(substr($row['Date_a'],0,10))." | ";
						
						echo strtotime(substr($row['add_dt'],0,10))-strtotime(substr($row['Date_a'],0,10))."<br />";
						
						
						//echo strtotime(substr("2011-04-04",0,10))-strtotime(substr("2011-04-01",0,10))."<br />";
						//echo "ERROR";
					}
				
						
				
			/*	$oid = $row['oid'];
				$query = mysql_query("select * from p1_out_order where status = 4 and stop1 = 1 and oid = ".$oid); 	
					if (mysql_num_rows($query) <> "0")
						{
							$g=$g+1;
							$date1 = substr(mysql_result($query,0,"status4_dt"),0,10);
							$time1 = substr(mysql_result($query,0,"status4_dt"),11,8); 
							mysql_query("UPDATE p1_order_info SET  delivered  = 1 , delivered_d = '".$date1."' , delivered_t = '".$time1."' where oid = $oid");	
						}*/
						
			}

			echo $i;
			echo "<br />".$g;
			
			

?>



</body>
</html>
