
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php 

session_start();
//$_SESSION["user_id"] = $user_id;

if($_SESSION["user_id"] == ""){

header("Location: https://10yearsanniversary.autozone.sa/redeem/login.php");    
    
}


?>

<!DOCTYPE html>
<html lang="en">
<head>
  <title>10 Years Celebration | Autozone Balubaid</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

<style>

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {

.drw_bg{
background: transparent url(bg-mbl2.jpg) top center no-repeat; 
background-size: cover;
}	

.table-font{
font-size:9px;    
}

.mbl{
display:block;	
}
.pc{
display:none;	
}	
	
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {

.drw_bg{
background: transparent url(bg-mbl2.jpg) top center no-repeat; 
background-size: cover;
}

.mbl{
display:block;	
}
.pc{
display:none;	
}	
	
}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {

.drw_bg{
background: transparent url(bg-mbl2.jpg) top center no-repeat; 
background-size: cover;
}

.mbl{
display:none;	
}
.pc{
display:block;	
}	
	
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {

.drw_bg{
background: transparent url(bg-pc.jpg) top center no-repeat; 
background-size: cover;
}

.mbl{
display:none;	
}
.pc{
display:block;	
}	
	
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {

.drw_bg{
background: transparent url(bg-pc.jpg) top center no-repeat; 
background-size: cover;
}	

.mbl{
display:none;	
}
.pc{
display:block;	
}
	
}

@font-face {
  font-family: sansarabic;
  src: url(font.woff);
}

div {
  font-family: sansarabic;
}
a:hover{
    text-decoration: none;

</style>  
  
</head>
<body class="drw_bg">
<div style="height:20px;"></div>
<div style="margin-left:2%;margin-right:2%">
<img src="header_az_draw.png" class="img-fluid mbl" alt="Responsive image">
<img src="header_az_draw_pc.png" class="img-fluid pc" alt="Responsive image">
</div>
<div style="height:30px;"></div>
<div style="text-align:center;">
<img src="FB-Cover.jpg" class="img-fluid" alt="Responsive image">
</div>
<div style="text-align:center;color:white;">
 <div style="height:30px;"></div>   




<div style="height:30px;"></div>

<div class="container">
<div style="color:white;text-align:right;direction:rtl;">

<div style="height:1px;"></div>

<br><b style="color:#fbb715 !important">
خطوات تسليم الهدية
</b>
<br>

<br>
<ol style="direction:rtl;text-align:right;">
<li>
التحقق من بطاقة الهوية الخاصة بالعميل ومطابقتها بالقائمة المرفقة.
</li>

<li>
الدخول على الرابط https://10yearsanniversary.autozone.sa/redeem/ والبحث برقم الهوية.    
</li>

<li>
التحقق من نوع الهدية حسب الملف المرفق.    
</li>

<li>
تصوير بطاقة الهوية وتوقيع العميل على إقرار استلام الهدية حسب النص المرفق    
</li>

<li>
الضغط على زر " تسليم الهدية"    
</li>

<li>
الاحتفاظ بالإقرار الموقع في ملف لدى مدير الفرع وإرفاق الملف بالنظام قبل إنهاء المعاملة      
</li>


</ol>

    </div>

</div>


<form method="GET" name=WebToLeads1729050000000212695 onsubmit="javascript:document.charset=&quot;UTF-8&quot;;" action="">
<div style="height:30px;"></div>
<div style="margin-left:10%;margin-right:10%">
<div style="display:inline-block;width:100%;color:white;">
<div style="float:left;">ID Number</div><div style="float:right;">رقم الهوية</div>
</div>
<div style="text-align:center;background:#fbb715;color:#333333;border-radius:25px;padding:10px;font-size:20px;" >
<input type="text" style="width:100%;background:none;border:none;text-decoration:none;color:#333333;" name="natid"></input>
</div>
<div style="color:white;text-align:center;" id="natid"></div>

</div>

<div style="height:30px;"></div>
<div style="margin-left:10%;margin-right:10%">
<div style="text-align:center;background:#fbb715;color:#333333;border-radius:25px;padding:10px;font-size:20px;" >
<input type="submit" value="Search" style="width:100%;background:none;border:none;text-decoration:none;color:#333333;" ></input>
</div>

</form>

<div style="height:30px;"></div>

<?php 

if(isset($_GET['natid'])){
    
include 'api.php';    
    
$winner_details = get_winner_by_id($_GET['natid']);  

//print_r($winner_details);

?>

<div class="table-responsive">
    <table class="table table-bordered">
      <thead style="background: #fbb715;
    color: #333333;">
        <tr>
          <th>#</th>
          <th>Redeem</th>
          <th>Prize</th>
          <th>Participant Name</th>
          <th>Mobile</th>
          <th>Registration Date</th>
          <th>Email</th>
          <th>City</th>
          <th>National ID</th>
          
        </tr>
      </thead>
      <tbody style="background: #fff;">
<?php

if(count($winner_details) == 0){

?>

<tr>
<td colspan="9">Winner Record Not Found</td>

<?php
    
}
else{

foreach ($winner_details as $w_details){

$prize_id = $w_details['id'];
$natid = $w_details['natid'];
    
    
?>
        <tr>
          <td>#</td>
          <td>
              <?php if($w_details['is_prize_redeem'] == 'Y'){ ?>
              <a href="https://10yearsanniversary.autozone.sa/redeem/<?php echo $w_details['receiveing_letter']; ?>" class="btn btn-primary" style="background:grey;color:white;">تم تسليم الهدية</a>
              <?php
              }else { ?>
              <button type="button" href="#redeem.php?id=<?php echo $w_details['id']; ?>" data-toggle="modal" data-target="#myModal" class="btn btn-primary" style="background:#fbb715;color:#333333;">تسليم الهدية</button></td>
        <?php } ?>
        <td style="direction:rtl;"><?php echo $w_details['pirze']; ?></td>
          <td><?php echo $w_details['name']; ?></td>
          <td><?php echo $w_details['mbl']; ?></td>
          <td><?php echo $w_details['register_date']; ?></td>
          <td><?php echo $w_details['email']; ?></td>
          <td><?php echo $w_details['city']; ?></td>
          <td><?php echo $w_details['natid']; ?></td>
<?php }
}
?>          
        </tr>
      </tbody>
    </table>
    
</div>    

<?php
    
}

?>

<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>

<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>
<div style="height:30px;"></div>

</body>
<style>

 .custom2-file-input::-webkit-file-upload-button {
  visibility: hidden;
}
.custom2-file-input::before {
  content: 'إختيار ملف ';
  display: inline-block;
  background: -webkit-linear-gradient(top, #f9f9f9, #e3e3e3);
  border: 1px solid #999;
  border-radius: 3px;
  padding: 5px 8px;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
  cursor: pointer;
  text-shadow: 1px 1px #fff;
  font-weight: 700;
  font-size: 10pt;
}
.custom2-file-input:hover::before {
  border-color: black;
}
.custom2-file-input:active::before {
  background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}    

.custom-file-input:lang(en)~.custom-file-label::after {
    content: "إختيار ملف";
}
    
</style>
 <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content" style="direction:rtl;">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title" style="color:black">تم تسليم الهدية</h4>
        </div>
        <div class="modal-body">
          <p style="color:black;">
              يرجى تحميل خطاب الإقرار.
              </p>
              <div style="height:32px;"></div>
          <form name="myForm" action="redeem_gift.php?id=<?php echo $prize_id; ?>&natid=<?php echo $natid; ?>" method="post"
enctype="multipart/form-data" style="color:black;" onsubmit="return validateForm()">
 

<div class="custom-file mb-3">
      <input type="file" class="custom-file-input" id="customFile" name="file">
      <label class="custom-file-label" for="customFile">إقرار تسليم هداية:</label>
    </div>

<input type="hidden" name"id" value="<?php echo $prize_id; ?>" >
<input type="hidden" name"natid" value="<?php echo $natid; ?>" >
<br />
<div style="height:32px;"></div>
<input type="submit" name="submit" value="Submit" />

</form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
      
    </div>
  </div>

<script>
function validateForm() {
  let x = document.forms["myForm"]["file"].value;
  if (x == "") {
    alert("يرجى تحميل مذكرة التسليم");
    return false;
  }
}
</script>



</html>