Şuanki Dizin: /home/wwwdreamtechnolo/public_html/balajimall.com/admin/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/balajimall.com/admin/sub-category.php |
<?php require_once("../lib/functions.php"); $db = new login_function(); $flag = 0; $success_msg = 0; $category = ""; $menubar_error = ""; $sub_category = ""; $category_error = ""; $succ_msg= 0 ; if(!isset($_SESSION['current_login_admin'])) { header("Location:index.php"); } if(isset($_SESSION['current_login_admin'])) { $email = $_SESSION['current_login_admin']; } if(isset($_POST['add_btn'])) { $sub_category = $_POST['sub_category']; $category = $_POST['category']; if($category == "Select Category") { $menubar_error = "Please select Category"; $flag = 1; } if($flag == 0) { echo $check_category = $db->check_sub_category_exist_or_not($category,$sub_category); if($check_category == "") { if($db->add_sub_category($category,$sub_category)) { $success_msg = 1 ; $sub_category = ""; $category = ""; } } else { $category_error = "This Category Already Exists"; } } } if(isset($_GET['delete_id'])) { $del_id = $_GET['delete_id']; $db->delete_sub_category($del_id); $succ_msg = 1; } ?> <?php require_once('header.php'); ?> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> Sub Category </h1> <?php if($success_msg == 1) { ?> <div class="alert alert-success"> Category Added Successfully. </div> <?php } ?> <?php if($succ_msg == 1) { ?> <div class="alert alert-danger"> Category Deleted Successfully. </div> <?php } ?> </div> </div> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Sub Category </div> <div class="panel-body"> <div class="row"> <div class="col-lg-6"> <form role="form" method="post" enctype="multipart/form-data"> <div class="form-group"> <label>Select Category</label> <select class="form-control" name="category" required /> <option value="Select Category">Select Category</option> <?php $report_details = $db->get_all_main_category_for_sub_category(); if(!empty($report_details)) { $counter =0; foreach($report_details as $record) { $id = $report_details[$counter][0]; $menubar = $report_details[$counter][1]; $category = $report_details[$counter][2]; ?> <option value="<?php echo $category; ?>"><?php echo $category; ?></option> <?php $counter ++; } } ?> </select> <span style="color:red;"><?php echo $menubar_error; ?></span> </div> <div class="form-group"> <label>Sub Category Name</label> <input class="form-control" placeholder="Enter Sub Category Name" name="sub_category" type="text" value="<?php echo $sub_category; ?>" required> <span style="color:red;"><?php echo $category_error; ?></span> </div> <button type="submit" class="btn btn-success" name="add_btn">Category</button> <br /><br /> </form> </div> </div> </div> </div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover" id="table2excel"> <thead> <tr class="noExl"> <th width="20">Sr. No</th> <th>Menubar</th> <th>Category</th> <th width="50">Action</th> <th width="50">Action</th> </tr> </thead> <tbody> <?php $report_details = $db->get_all_sub_category(); if(!empty($report_details)) { $counter =0; foreach($report_details as $record) { $id = $report_details[$counter][0]; $category = $report_details[$counter][1]; $sub_category = $report_details[$counter][2]; ?> <tr> <td><?php echo $counter+1; ?></td> <td><?php echo $category; ?></td> <td><?php echo $sub_category; ?></td> <td><a href="edit-sub-category.php?up_id=<?php echo $id; ?>">Edit</a></td> <td><a href="sub-category.php?delete_id=<?php echo $id;?>" onclick="return confirm('Are you sure?');">Delete</a></td> </tr> <?php $counter ++; } }else { ?> <td colspan="11">No Data Found...</td> <?php } ?> </tbody> </table> </div> <!-- /.table-responsive --> </div> </div> </div> </div> </div> </body> </html>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4