



<?php require_once('Connections/lancrox.php'); ?>
<?  $query = "select customer.userid,customer.fullname, orderlist.quantity,orderlist.customer,orderlist.items , orderlist.amount, orderlist.datein from customer inner join orderlist on orderlist.customer = customer.userid WHERE customer.userid = 'EzW2nzBP' AND orderlist.datein = '1403113230'" /* do your selection*/;
	$result = mysqli_query($lancrox, $query);
	
		if($result != false){
			while($row = mysqli_fetch_assoc($result)){
				if ($row[quantity] <50){$quantity1 = $row[quantity];}elseif ($row[quantity] >50 && $row[quantity]<101){$quantity1 = $row[quantity]*1.06;}elseif($row[quantity] >100){$quantity1 = $row[quantity]*1.1;}
				$values = "";
				$values .= "'".$row['items']."','".$row['amount']."','".$datein."','".$row_Recordset1['fullname']."','".$row['userid']."','".$quantity1."','Sold','".$row[quantity]."'";
				//Append other values here as required following the format of the first one with a comma after the last single quote
				//if it is an integer then no need for the quote i.e $row['integer']
				//$values .= "'".$row['meefromPost']."'"; //the last value most be in this format, notice there is no comma after the ast single quote
		 $query2 = "INSERT INTO accounts (items, amount,datein,fullname,customer, quantity,status, actualqty) values ($values)";
				
					//mysql_query($query2) or die(mysql_error());
		;}	
	}
	
	 number_format(5465456.47);
	
	$me = '19th-June-2014';
 $me = strtotime($me);
$me1 = $me + (60*60*24)-1	;
	echo time();
	?>