<?php

    include '../../../admin/config.php';
    $conn = mysqli_connect($HostName, $HostUser, $HostPass, $DatabaseName);

	if (isset($_GET["email"])) {
		
		$email_check = $_GET["email"];
        $pass = $_GET["pass"];
		
		$query = "SELECT email FROM USERS WHERE email='$email_check' AND pass='$pass' ";
        $result = mysqli_query($conn,$query);
        if(!$row = mysqli_fetch_array($result)) {
		  	echo " ERROR email or password " ;
			return ;
         }
		 
	}else{
		echo " ERROR..." ;
	    return ;
	}
		
		
		

?>

<!DOCTYPE html>
<html dir="rtl" lang="ar">
<head>
<meta  charset="utf-8"/>
<style>
div {
    border: 1px solid gray;
    padding: 8px;
}
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 6px 18px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    margin: 4px 2px;
    cursor: pointer;
}

.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */ 
.button4 {background-color: #e7e7e7; color: black;} /* Gray */ 
.button5 {background-color: Orange;} /* Black */
.button6 {background-color: #555555;} /* Black */

div {
    border: 1px solid gray;
    padding: 8px;
}
</style>

</head>

</html>
<center><b>طلبـاتـي   </b></center>

 <li><a href="http://mobdi3.online/qodorate/web/terms.php">شروط وأحكام التطبيق</a></li>
 
<?php

//echo "aaaaaaaaaaaaaaaaaaaaaaaaaa" ;

include '../../../admin/config.php';
$conn = mysqli_connect($HostName, $HostUser, $HostPass, $DatabaseName);


$sql = "SELECT id, email, orders, date, status FROM ORDERS WHERE email='$email_check'";
$result = $conn->query($sql);

 $number = 1 ;
if ($result->num_rows > 0) {
  // output data of each row
  while($row = $result->fetch_assoc()) {
    $email =  $row["email"] ;
	    $orders =  $row["orders"] ;
	    $date =  $row["date"] ;
	    $status =  $row["status"] ;
	   	    
			if ($status == "true" ){
				echo " <hr> <b>حالة الطلب : </b> <font color='#0000FF'> الطلب قيد الانتظار ... </font> </div>";
			}
			if($status == "false"){
				echo " <hr> <b>حالة الطلب : </b> <font color='#0000FF'> مكتملة </font> </div>";
			} 
			if($status == "rejected"){
				echo " <hr> <b>حالة الطلب : </b> <font color='#0000FF'> مرفوضة </font> </div>";
			}
			
			echo " $date <br> <pre>$orders</pre> ";	  
  }
}


$conn->close();

?>