hjkhghtjhjjhjhjhjhjjhjhjjhrrtrtoirh
bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg
/
home
/
u506006416
/
public_html
/
public_html
/
clients_portal
/
Upload FileeE
HOME
<?php include('header.php'); if (isset($_POST['adddata'])) { $data = dataReturn($_POST); $add_data = $user->insertQuery('clientdata',$data); if($add_data){ echo "<script>"; echo "window.location.href='notour.php'; </script>"; }else{ echo "<script>"; echo "alert('Something Went Wrong !'); window.location.href='notour.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='notour.php'; </script>"; }else{ echo "<script>"; echo "alert('Something Went Wrong !'); window.location.href='notour.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='notour.php'; </script>"; die; }else{ echo "<script>"; echo "window.location.href='notour.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=3 ORDER BY cd.id DESC"); ?> <script language="javascript"> function delup(aa,bb){ if(bb==1){var msg='Do you really want to change 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="page-wrapper"> <div class="page-breadcrumb"> <div class="row"> <div class="col-12 d-flex no-block align-items-center"> <h4 class="page-title">Client Details </h4> <div class="ml-auto text-right"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <button class="btn btn-success myModal_2" data-toggle="modal" data-target="#myModal_2" style="display: none;">Add Data</button> </ol> </nav> </div> </div> </div> </div> <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>Hosting Name</th> <th>Category</th> <th>Category Name</th> <th>Client Name</th> <th>Expiry Date</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php for ($i=0; $i < count($result) ; $i++) { $currentId = $result[$i]['id']; ?> <tr> <td><?php echo $i+ 1; ?></td> <td><?php echo returnString($result[$i]['categoryName']); ?></td> <td><?php echo returnString($result[$i]['subCategoryName']); ?></td> <td><?php echo returnString($result[$i]['products']); ?></td> <td><?php echo returnString($result[$i]['clientName']); ?></td> <td><?php $dateExiry = date('d-M-Y',strtotime(returnString($result[$i]['expiryDate']))); echo $dateExiry; ?></td> <td><?php $now = time(); $your_date = strtotime($dateExiry); $datediff = $your_date - $now; $remaingDate = round($datediff / (60 * 60 * 24)); 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 < 5){ $newStatus="<span class='badge badge-warning'>Expired Soon</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; echo "<br><br><a class='btn btn-primary margin-5 text-white' onclick='viewDetails($currentId)'><i class='fas fa-eye'></i> View </a>"; ?></td> <td> <a href="edit-products.php?prodid=<?php echo stripslashes($result[$i]['id']);?>" class="btn btn-info"><i class="fas fa-edit"></i> Change</a> <br><br> <a href="javascript://" onclick="delup(<?php echo stripslashes($result[$i]['id'])?>,2)" class="btn btn-danger"><i class="fas fa-trash"></i> Delete</a> <br><br> <a href="javascript://" onclick="delup(<?php echo stripslashes($result[$i]['id'])?>,1)" class="btn btn-success"><i class="fas fa-paper-plane"></i> Now Exist</a> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th>Id</th> <th>Hosting Name</th> <th>Category</th> <th>Category Name</th> <th>Client Name</th> <th>Expiry Date</th> <th>Status</th> <th>Action</th> </tr> </tfoot> </table> </div> </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){ $("#productDetails").html(response); jQuery(".myModal_2").trigger("click"); } }); } </script> <style>div#productDetails {text-align: center; font-size: 20px;}</style> <div id="myModal_2" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-body" id="productDetails"> </div> <div class="modal-footer"> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div>