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('subcategoy',$data); if($add_data){ echo "<script>"; echo "window.location.href='subcategory.php'; </script>"; }else{ echo "<script>"; echo "alert('Something Went Wrong !'); window.location.href='subcategory.php'; </script>"; } } if(isset($_REQUEST['action'])&& $_REQUEST['action']=='delete') { $id=($_REQUEST['cid']); $data = array("status"=>2); $add_data = $user->updateQuery('subcategoy',$data,'id',$id); if ($data_deleted) { echo "<script>window.location.href='subcategory.php'; </script>"; die; }else{ echo "<script>"; echo "window.location.href='subcategory.php'; </script>"; } } $resultCat = $user->selectByCondition('category','status',1); $result = $user->qry("SELECT categoryName,subCategoryName,sc.id FROM subcategoy sc LEFT JOIN category c ON c.id=sc.category WHERE sc.status=1 AND c.status=1 ORDER BY sc.id DESC"); ?> <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">Hosting Details</h4> <div class="ml-auto text-right"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <button type="button" class="btn btn-primary margin-5 text-white" data-toggle="modal" data-target="#addnewCategory"> <i class="fa fa-plus"></i> Add New </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>Action</th> </tr> </thead> <tbody> <?php for ($i=0; $i < count($result) ; $i++) { ?> <tr> <td><?php echo $i+ 1; ?></td> <td><?php echo returnString($result[$i]['categoryName']); ?></td> <td><?php echo returnString($result[$i]['subCategoryName']); ?></td> <td> <a href="edit-subcategory.php?subcatid=<?php echo stripslashes($result[$i]['id']);?>" class="btn btn-primary"><i class="fas fa-edit"></i> Change</a> <a href="javascript://" onclick="del(<?php echo stripslashes($result[$i]['id'])?>)" class="btn btn-danger"><i class="fas fa-trash"></i> Delete</a> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th>Id</th> <th>Hosting Name</th> <th>Category</th> <th>Action</th> </tr> </tfoot> </table> </div> </div> </div> </div> </div> </div> </div> </div> <?php include('footer.php');?> <div class="modal fade" id="addnewCategory" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" style="display: none;"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Add New Data</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> <div class="form-group row"> <label for="cono1" class="col-sm-3 text-right control-label col-form-label">Hosting Name</label> <div class="col-sm-9"> <select class="form-control" id="cono1" placeholder="Hosting Name Here" name="category"> <option disabled="" selected="">Select Hosting first</option> <?php for ($i=0; $i < count($resultCat) ; $i++) { ?> <option value="<?php echo stripslashes($resultCat[$i]['id']);?>"> <?php echo returnString($resultCat[$i]['categoryName']); ?> </option> <?php } ?> </select> </div> </div> <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" id="cono1" placeholder="Category Name Here" name="subCategoryName"> </div> </div> </div> <div class="modal-footer"> <input type="submit" name="adddata" class="btn btn-success" value="Save"> </form> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div>