

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script> 

<script type="text/javascript" src="https://homeofretailer.com/admin_pnl/alib/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="https://homeofretailer.com/admin_pnl/alib/js/jquery-ui-1.7.1.custom.min.js"></script>
    
 
<script type="text/javascript">
  $(document).ready(function(){ 
						   
	$(function() {
		$(".contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; 
			$.post("hooks/sprocess.php", order, function(theResponse){
				$("#contentRight").html(theResponse);
			}); 															 
		}								  
		});
	});

});	
</script>

<style>
    #sort_button{width:auto; height:35px; background:#f8f8f8; vertical-align:top; line-height:35px; text-align:center; padding:0px 10px 0px 10px; font-size:12px; border-bottom:1px outset #e5e5e5; border-right:1px outset #e5e5e5; margin-top:3px; margin-left:10px; color:#0A77D4; display:inline-block; margin-bottom:20px;}
#sort_button:hover{background:#e5e5e5;}
#srt_d { width:60px; padding:3px; display:inline-block; vertical-align:top;  border:1px solid #e5e5e5; background:#f5f5f5; margin-left:1px; margin-top:0px; text-align:center; overflow: hidden; line-height:30px;}
#srt_dtls { padding:3px 6px 3px 6px; display:inline-block; vertical-align:top; background:#f8f8f8; margin-left:1px; margin-top:0px; text-align:center; overflow: hidden; line-height:30px;}
.contentLeft { float: left; }
.contentLeft li { list-style: none; margin: 0 0 4px 0; padding: 2px; background-color:#f8f8f8; border:1px solid #e5e5e5; color:#333; }
#contentRight { float: right; width: 150px; padding:10px; background:#8c52ff; color:#FFFFFF; margin-right:20px; border: #8c52ff solid 1px; border-radius: 10px; }

</style>

 
    
            <!--  body content -->
            <div id="main-content">
				<div class="page-heading">
                    <div class="page-title">
                        <div class="row">
                            <div class="col-12 col-md-6 order-md-1 order-last">
                                <h3>Sort Coupons</h3>
                                <p class="text-subtitle text-muted">Sort Coupon And Grant Relevant Premission</p>
                            </div>
                            <div class="col-12 col-md-6 order-md-2 order-first">
                                <nav aria-label="breadcrumb" class="breadcrumb-header float-start float-lg-end">
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item"><a href="">Dashboard</a></li>
                                      <li class="breadcrumb-item active" aria-current="page">Sort Coupon Page
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                        </div>
                    </div>
								      

	
	
					
					<section id="basic-horizontal-layouts">
                    <div class="row match-height">
                        <div class="col-md-12 col-12">
                        <div class="card">
                       
                            <div class="card-header">
                                
                        <div class="row">
				 
				 <div class="col-6 col-lg-3 col-md-6 ">
                                <div class="card border border-white bg-light" style="height:115px;">
                                    <div class="card-body px-3 py-2-3">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <div class="stats-icon " style="background-color: #8c52ff;">
                                                    <i class="iconly-boldShow"></i>
                                                </div>
                                            </div>
                                            <div class="col-md-8">
                                                <h6 class="text-muted font-semibold">Featured Coupons</h6>
                                                <h6 class="font-extrabold mb-0"><?php  echo $view->totalIndexCoupons("featured", 1); ?></h6>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div><!--col6 end-->
                            
                            <div class="col-6 col-lg-3 col-md-6 ">
                                <div class="card border border-white bg-light" style="height:115px;">
                                    <div class="card-body px-3 py-2-3">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <div class="stats-icon " style="background-color: #8c52ff;">
                                                    <i class="iconly-boldProfile"></i>
                                                </div>
                                            </div>
                                            <div class="col-md-8">
                                                <h6 class="text-muted font-semibold">Coupons Code</h6>
                                                <h6 class="font-extrabold mb-0"><?php  echo $view->totalIndexCoupons("code", 1); ?></h6>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div><!--col6 end-->
                            
                            <div class="col-6 col-lg-3 col-md-6 ">
                                <div class="card border border-white bg-light" style="height:115px;">
                                    <div class="card-body px-3 py-2-3">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <div class="stats-icon " style="background-color: #8c52ff;">
                                                   <i class="iconly-boldAdd-User"></i>
                                                </div>
                                            </div>
                                            <div class="col-md-8">
                                                <h6 class="text-muted font-semibold">Free Shipping</h6>
                                                <h6 class="font-extrabold mb-0"><?php  echo $view->totalIndexCoupons("freeship", 1); ?></h6>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div><!--col6 end-->
                            
                            <div class="col-6 col-lg-3 col-md-6 ">
                                <div class="card border border-white bg-light" style="height:115px;">
                                    <div class="card-body px-3 py-2-3">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <div class="stats-icon " style="background-color: #8c52ff;">
                                                     <i class="iconly-boldBookmark"></i>
                                                </div>
                                            </div>
                                            <div class="col-md-8">
                                                <h6 class="text-muted font-semibold">Deals</h6>
                                                <h6 class="font-extrabold mb-0"><?php  echo $view->totalIndexCoupons("deals", 1); ?></h6>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div><!--col6 end-->
						
					</div><!--row end-->
					
						
	<h4>Sort Coupons By Store Name:</h4>
	
	
<div class="col-12">
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<div class="text-secondary mt-3" style="font-size: 18px;" >Select Store</div>

<select name="sort_stor_list" class="col-12 p-2 mb-3 form-group mt-3">
<option value="" class="text-secondary">Select Store</option>
<?php
$needle = array("_stor_nam", "_frgn_ky");
$tb = "copn_storbnk";
$heystack = ''; 
$qu = $query->queryBuilder($needle, $tb, $heystack);
while($store = mysqli_fetch_array($qu, MYSQLI_NUM)) {
?>

<option value="<?php echo $store[0]; ?>"><?php echo $store[0]; ?></option>
<?php
} // end whl
?>
</select>

 <div class="col-sm-12 d-flex justify-content-end">
              <input type="submit" class="btn btn-primary me-1 mb-1" name="list_coupon" value="Get Coupons List">
               
   </div>


</form>

<?php



	if(isset($_POST['list_coupon']) && $_POST['list_coupon'] == "Get Coupons List" && isset($_POST['sort_stor_list'])){
	echo "<h4>".ucwords($_POST['sort_stor_list'])."</h4>";
	    echo "<h6 class='text-left text-secondary pb-4'>"."Drag and Drop Fields To Save"."</h6>";
		echo $view->storeCouponSortView($_POST['sort_stor_list']);
		?>
		
		<div id="contentRight" class="col-sm-3">
		  Drag and Drop Fields To Save
		  <p>&nbsp; </p>
		</div>
		<?php
	}
                  
     ?>

</div>



     
     
 </div>
 </div>
                  

                  
 