<?php if($activestatus_merchant=='0'){ ?>
<div class="card-body ">
   <div class="profile-box">
      <h6 class="h5">Your account is disabled right now. Kindly raise a ticket for approval your account.</h6>
   </div>
</div>
<?php } ?>
<?php if($activestatus_merchant=='1'){   
   ?>  
<?php
   if($_SESSION["uploaded"]!=''){
       
       if($_SESSION["uploaded"]=='success'){
   
   ?>
<script> swal("Successfully!", "Your file has been uploaded!", "success");  </script>
<?php }elseif($_SESSION["uploaded"]=='failed'){
   ?>
<script>  swal("Oops...", "csv not uploaded!", "error");  </script>
<?php
   }
   unset($_SESSION["uploaded"]);
   }
   ?>
<?php
   if($_SESSION["uploaded_image"]!=''){
       
       if($_SESSION["uploaded_image"]=='success'){
   
   ?>
<script> swal("Successfully!", "Your Logos has been uploaded!", "success");  </script>
<?php }elseif($_SESSION["uploaded_image"]=='failed'){
   ?>
<script>  swal("Oops...", "csv not uploaded_image!", "error");  </script>
<?php
   }
   unset($_SESSION["uploaded_image"]);
   }
   
    $sqlcou = "SELECT * FROM coupon WHERE created_by='$user_id' AND created_type='vendor' ";  
      
       $myquerycou=$conn->query($sqlcou);
      $mydaracou= $myquerycou->fetchAll()  ;
      
      $rows_foundcou = $myquerycou->rowCount();
   ?>
<div class="card-body ">
   <div class="profile-box">
      <div class="bottom-line">
         <h6 class="h5 mb-5">Upload Your Coupon</h6>
      </div>
      <div class="bg-light p-4 rounded-4 mb-4">
         <p class="lead fw-light mb-3">Carefully upload the coupon in our CSV format</p>
         <!--Download CSV-->
         <div class="col-md-12 mb-4">
            <div class="d-grid text-center">
               <button class="btn btn-secondary" type="button" onclick="coupon_download_csv()">
               <i class="fas fa-download text-white pe-2"></i>Download CSV sample format
               </button>
            </div>
         </div>
         <div class="col-md-12">
            <form name="upload_data_csv" enctype="multipart/form-data" action="forms/upload_csv_coupon.php" method="POST">
               <input type="file" name="<?=SESS_MASTER?>upload_data"  class="form-control form-control-sm mb-sm-10" id="fileUpload">
               <input type="hidden" name="<?=SESS_MASTER?>userid" value="<?=$user_id?>">
               <input type="submit" class="btn btn-secondary my-3" value="SAVE">
            </form>
         </div>
         <small class="fst-italic"><strong class="text-danger pe-1">Note:</strong>Please Check the Formate Before Upload</small>
      </div>
      <!-- <div class="bg-light p-4 rounded-4 mb-4">
         <div class="col-lg-12 col-sm-12 pt-1">
            <div class="mb-3">
               <label for="companyformFile" class="form-label">Logo<span class="text-danger">*</span><small class="fs-11">(Image Recommended size 93*55 in .jpg format)</small></label>
               <form name="upload_company_logo" enctype="multipart/form-data" action="./forms/upload_logo.php" method="POST">
               <input class="form-control form-control-sm" type="file" id="companyformFile" name="<?=SESS_MASTER?>company_logo[]" required="" multiple>
               <input type="submit" class="btn btn-secondary mt-3" value="SAVE">
            </form>
            </div>
            <small class="fst-italic"><strong class="text-danger pe-1">Note:</strong>If you want to upload more than one logo. Kindly select multiple logo and upload.</small>
         </div>
         </div> -->
      <p class="lead p-0 m-0">You can see listed your coupon and deals <a class="text-danger" href="./search-merchant/<?=($user_id)?>">click here.</a></p>
      <p class="lead p-0 m-0">Total uploaded recored : <a class="text-muted" href="#"><?=$rows_foundcou?></a></p>
      <p class="lead p-0 m-0">Last uploaded date :</p>
      <p class="lead p-0 m-0"><a href="./forms/delete_csv_coupon" class="text-danger">Delete all old record</a></p>
   </div>
</div>
<?php } 
   ?>