hjkhghtjhjjhjhjhjhjjhjhjjhrrtrtoirh
bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg
/
home
/
u506006416
/
public_html
/
public_html
/
clients_portal
/
Upload FileeE
HOME
<?php include('header.php'); ?> <div class="page-wrapper"> <div class="page-breadcrumb"> <div class="row"> <div class="col-12 d-flex no-block align-items-center"> <h2 class="page-title">Dashboard > <a href='expiresoon.php'> Expired soon</a> </h2> <div class="ml-auto text-right"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> </ol> </nav> </div> </div> </div> </div> <?php $result = $user->qry("SELECT categoryName,subCategoryName,cd.id,products,clientName,expiryDate,clientDetails FROM clientdata cd LEFT JOIN category c ON c.id=cd.category LEFT JOIN subcategoy sc ON cd.subCategory=sc.id WHERE cd.status=1 AND c.status=1 AND cd.status=1 ORDER BY cd.id DESC"); if (isset($_POST['adddata'])) { $data = dataReturn($_POST); $add_data = $user->insertQuery('clientdata',$data); if($add_data){ echo "<script>"; echo "window.location.href='index.php'; </script>"; }else{ echo "<script>"; echo "alert('Something Went Wrong !'); window.location.href='index.php'; </script>"; } } if (isset($_POST['updateData'])) { $data = array("expiryDate"=>$_POST['expiryDate']); $prodId = $_POST['id']; $add_data = $user->updateQuery('clientdata',$data,'id',$prodId); if($add_data){ echo "<script>"; echo "window.location.href='index.php'; </script>"; }else{ echo "<script>"; echo "alert('Something Went Wrong !'); window.location.href='index.php'; </script>"; } } if(isset($_REQUEST['action'])&& $_REQUEST['action']=='delete') { $id=($_REQUEST['cid']); $newstatus=$_REQUEST['newstatus']; $data = array("status"=>$newstatus); $add_data = $user->updateQuery('clientdata',$data,'id',$id); if ($data_deleted) { echo "<script>window.location.href='index.php'; </script>"; die; }else{ echo "<script>"; echo "window.location.href='index.php'; </script>"; } } $resultCat = $user->selectByCondition('category','status',1); $result = $user->qry("SELECT categoryName,subCategoryName,cd.id,products,clientName,expiryDate,clientDetails FROM clientdata cd LEFT JOIN category c ON c.id=cd.category LEFT JOIN subcategoy sc ON cd.subCategory=sc.id WHERE cd.status=1 AND c.status=1 AND cd.status=1 ORDER BY cd.id DESC"); ?> <script language="javascript"> function delup(aa,bb){ if(bb==2){var msg='Do you really want to delete this?'}else{var msg='Do you really want to change this?'} if(confirm(msg)==true){ window.location.href = window.location.href + '?action=delete&cid='+aa+'&&newstatus='+bb; return true;} else return false; } </script> <div class="container-fluid"> <div class="row"> <div class="col-md-12 col-lg-12 col-xlg-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table id="zero_config" class="table table-striped table-bordered"> <thead> <tr> <th>Id</th> <th>Data Details</th> <th>Client Name</th> <th>Expiry</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php $start=1; for ($i=0; $i < count($result) ; $i++) { $now = time(); $dateExiry = date('d-M-Y',strtotime(returnString($result[$i]['expiryDate']))); $your_date = strtotime($dateExiry); $datediff = $your_date - $now; $remaingDate = round($datediff / (60 * 60 * 24)); if($remaingDate <= 30 && $remaingDate > -1){ ?> <tr> <td><?php echo $start;$start++;?></td> <td> Hosting : - <b><?php echo returnString($result[$i]['categoryName']); ?></b><br><br> Category : - <b><?php echo returnString($result[$i]['subCategoryName']); ?> </br></b><br> Category Name : -<br> <b><?php echo returnString($result[$i]['products']); ?></b> </td> <td><?php echo returnString($result[$i]['clientName']); ?> <br><br> <a class='btn btn-primary margin-5 text-white' onclick='viewDetails(<?php echo stripslashes($result[$i]['id'])?>)'><i class='fas fa-eye'></i> View Details </a> </td> <td><?php echo $dateExiry;?></td> <td><?php if(strtotime($dateExiry) > time() || $remaingDate ==0){ if($remaingDate ==0) { $newStatus = "<span class='badge badge-warning'>Expired Today</span>"; $showRen = 1; }elseif($remaingDate ==1){ $newStatus="<span class='badge badge-warning'>Expired Tomorrow</span>"; $showRen = 1; }elseif($remaingDate >1 && $remaingDate < 31){ $newStatus="<span class='badge badge-warning'>Expired in $remaingDate Day</span>"; $showRen = 1; }else{ $newStatus= "<span class='badge badge-success'>Active</span>"; $showRen = 0; } }else{ $newStatus= "<span class='badge badge-danger'>Expired</span>"; $showRen = 1; } echo $newStatus; ?></td> <td> <a href='javascript:void(0)' onclick="updateRen(<?=$result[$i]['id']?>)" class="btn btn-success"><i class="fas fa-sync"></i> Renewal</a> </td> </tr> <?php } } ?> </tbody> <tfoot> <tr> <th>Id</th> <th>Data Details</th> <th>Client Name</th> <th>Expiry</th> <th>Status</th> <th>Action</th> </tr> </tfoot> </table> </div> </div> </div> </div> </div> </div> </div> <?php include('footer.php');?> <script> function viewDetails(dataid){ $.ajax({ url : "ajax_req.php", type : "post", dataType :"html", data : {getDetailas:"getDetailas",dataids:dataid}, success: function(response){ $("#productDetailsData").html(response); jQuery(".myModal_3").trigger("click"); } }); } function updateRen(dataid){ $.ajax({ url : "ajax_req.php", type : "post", dataType :"json", data : {getSyn:"getSyndata",dataids:dataid}, success: function(response){ $(".product").val(response.products); $(".clientName").val(response.clientName); $(".expiryDate").val(response.expiryDate); $(".productId").val(dataid); jQuery(".myModal_2").trigger("click"); } }); } </script> <button class="btn btn-success myModal_3" data-toggle="modal" data-target="#myModal_3" style="display: none;"></button> <button class="btn btn-success myModal_2" data-toggle="modal" data-target="#myModal_2" style="display: none;"></button> <style>div#productDetailsData {text-align: center; font-size: 20px;}</style> <div id="myModal_3" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-body" id="productDetailsData"> </div> <div class="modal-footer"> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div> <div id="myModal_2" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <form method="post" action="" enctype="multipart/form-data"> <input type="hidden" name="id" class="productId"> <div class="modal-body"> <div class="form-group row"> <label for="cono1" class="col-sm-3 text-right control-label col-form-label">Category name</label> <div class="col-sm-9"> <input type="text" class="form-control product" placeholder="domain.com Or hosting" disabled=""> </div> </div> <div class="form-group row"> <label for="cono1" class="col-sm-3 text-right control-label col-form-label">Client Name</label> <div class="col-sm-9"> <input type="text" class="form-control clientName" placeholder="Client Name Here" disabled=""> </div> </div> <div class="form-group row"> <label for="cono1" class="col-sm-3 text-right control-label col-form-label">Expiry Date</label> <div class="col-sm-9"> <input type="date" class="form-control expiryDate" placeholder="Category Name Here" disabled=""> </div> </div> <div class="form-group row"> <label for="cono1" class="col-sm-3 text-right control-label col-form-label">New expiry</label> <div class="col-sm-9"> <input type="date" class="form-control" placeholder="Category Name Here" required="" name="expiryDate"> </div> </div> </div> <div class="modal-footer"> <input type="submit" class="btn btn-success" value="Submit data" name="updateData"> </form> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div>