PATH:
home
/
dkwgdcnelloreac
/
public_html
/
admin
/
Editing: home-blocks.php
<?php include("config.php"); admin_protect(); $home_blocks = $db->selectAll('home_blocks', '*', 'ORDER BY sort_order ASC'); if(isset($_GET['delete_id'])) { $where = array('id' => $_GET['delete_id']); $delete = $db->delete('home_blocks', $where); if($delete){ $msg = "delete"; header("Location: home-blocks.php?msg=$msg"); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php echo $settings->name; ?> | Admin Panel</title> <!-- Site favicon --> <link rel='shortcut icon' type='image/x-icon' href='images/favicon.ico' /> <!-- /site favicon --> <!-- Entypo font stylesheet --> <link href="css/entypo.css" rel="stylesheet"> <!-- /entypo font stylesheet --> <!-- Font awesome stylesheet --> <link href="css/font-awesome.min.css" rel="stylesheet"> <!-- /font awesome stylesheet --> <!-- Bootstrap stylesheet min version --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- /bootstrap stylesheet min version --> <!-- Integral core stylesheet --> <link href="css/integral-core.css" rel="stylesheet"> <!-- /integral core stylesheet --> <link href="css/integral-forms.css" rel="stylesheet"> <link href="plugins/datatables/css/jquery.dataTables.css" rel="stylesheet"> <link href="plugins/datatables/extensions/Buttons/css/buttons.dataTables.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="js/html5shiv.min.js"></script> <script src="js/respond.min.js"></script> <![endif]--> <script type="text/javascript"> function delete_id(id){ if(confirm('Are you Sure to Delete This Record ?')) { window.location.href='home-blocks.php?delete_id='+id; } } </script> </head> <body> <!-- Loader Backdrop --> <div class="loader-backdrop"> <!-- Loader --> <div class="loader"> <div class="bounce-1"></div> <div class="bounce-2"></div> </div> <!-- /loader --> </div> <!-- loader backgrop --> <!-- Page container --> <div class="page-container"> <!-- Page sidebar --> <?php include("includes/sidebar.php"); ?> <!-- /page sidebar --> <!-- Main container --> <div class="main-container"> <!-- Main header --> <?php include("includes/header.php"); ?> <!-- /main header --> <!-- Main content --> <div class="main-content"> <div class="row"> <div class="col-lg-8"> <h1 class="page-title">Home Blocks</h1> <!-- Breadcrumb --> <ol class="breadcrumb breadcrumb-2"> <li><a href="dashboard.php"><i class="fa fa-home"></i>Home</a></li> <li class="active"><strong>Home Blocks</strong></li> </ol> </div> <div class="col-lg-4 "> <a href="block-add.php" class="btn btn-success pull-right">Add Block</a> </div> </div> <div class="line-dashed"></div> <?php if(isset($_GET['msg'])){ if($_GET['msg']=='delete'){ echo "<div class='alert alert-success'> <button class='close' data-dismiss='alert'>×</button> <strong>Deleted Successfully.</strong> </div>"; } } ?> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover dataTables-example" > <thead> <tr> <th width="2%">S.No.</th> <th>Title</th> <th>Category</th> <th>Type</th> <th>Sort</th> <th width="20%">Action</th> </tr> </thead> <tbody> <?php $i = 1; foreach($home_blocks as $home_block){ $block_info = $db->selectRow('category', '*', $home_block->category); ?> <tr> <td><?php echo $i; ?></td> <td><?php echo $home_block->title; ?></td> <td><?php echo $block_info->name; ?></td> <td><?php echo $home_block->content_type; ?></td> <td><?php echo $home_block->sort_order; ?></td> <td><a href="block-edit.php?id=<?php echo $home_block->id; ?>" class="btn btn-success btn-sm">Edit</a> <a href="#" onClick="delete_id(<?php echo $home_block->id; ?>);" class="btn btn-danger btn-sm">Delete</a> </td> </tr> <?php $i++; } ?> </table> </div> </div> </div> </div> </div> <!-- Footer --> <?php include("includes/footer.php"); ?> <!-- /footer --> </div> <!-- /main content --> </div> <!-- /main container --> </div> <!-- /page container --> <!--Load JQuery--> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="plugins/metismenu/js/jquery.metisMenu.js"></script> <script src="plugins/blockui-master/js/jquery-ui.js"></script> <script src="plugins/blockui-master/js/jquery.blockUI.js"></script> <script src="js/functions.js"></script> <script src="plugins/datatables/js/jquery.dataTables.min.js"></script> <script src="plugins/datatables/js/dataTables.bootstrap.min.js"></script> <script src="plugins/datatables/extensions/Buttons/js/dataTables.buttons.min.js"></script> <script src="plugins/datatables/js/jszip.min.js"></script> <script src="plugins/datatables/js/pdfmake.min.js"></script> <script src="plugins/datatables/js/vfs_fonts.js"></script> <script src="plugins/datatables/extensions/Buttons/js/buttons.html5.js"></script> <script src="plugins/datatables/extensions/Buttons/js/buttons.colVis.js"></script> <script src="plugins/datatables/js/dataTables-script.js"></script> <script src="js/loader.js"></script> </body> </html>
SAVE
CANCEL