/
home
/
jeevanjyotigroup
/
public_html
/
jeevan_master
/
Upload File
HOME
<?php include("include/header.php"); if(!empty($_POST['news'])){ $obj->news(); } if(!empty($_POST['mul_del'])){ $col= 'news_id'; $table= 'latest_news'; $page= 'news.php'; $img= "news_img"; $path= "_saving/news/"; /*foreach($_POST['mul_del'] as $del) { $sql2= "SELECT * FROM $table WHERE $col=$del"; $rs2= mysqli_query($obj->mysqli,$sql2); $data= mysqli_fetch_assoc($rs2); if(is_file($path.$data['news_img'])) { unlink($path.$data['news_img']); } }*/ $obj->delete_multiple($col,$table,$page,$path); } if(!empty($_REQUEST['edit'])){ $val= $_REQUEST['edit']; $row= $obj->getRecord('latest_news','news_id',$val); } ?> <div class="container-fluid page-body-wrapper"> <?php include("include/menu.php")?> <!-- partial --> <div class="main-panel"> <div class="content-wrapper"> <div class="row"> <div class="col-md-12 grid-margin stretch-card"> <div class="card"> <div class="card-body"> <h4 class="card-title">Latest News</h4> <div class="template-demo"> <nav aria-label="breadcrumb"> <ol class="breadcrumb breadcrumb-custom bg-inverse-primary"> <li class="breadcrumb-item"><a href="#">Dashboard</a></li> <li class="breadcrumb-item active" aria-current="page"><span>Latest News</span></li> </ol> </nav> </div> </div> </div> </div> <div class="col-lg-12"> <?php if(!empty($_REQUEST['msg'])){ echo '<section class="content-header"> <div class="row"> <div class="col-md-12"> <div class="alert alert-success alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <p><i class="icon fa fa-check"></i>'.$_REQUEST['msg'].'</p> </div> </div> </div> </section>'; } ?> <?php if(!empty($obj->errorMsg)){ ?> <section class="content-header" id="error"> <div class="row"> <div class="col-md-12"> <div class="alert alert-success alert-dismissable" > <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <p><i class="icon fa fa-check"></i><?php echo $obj->errorMsg; ?></p> </div> </div> </div> </section> <?php } ?> <div class="card"> <div class="card-body"> <form class="cmxform" id="news_form" method="post" action="#" enctype="multipart/form-data"> <fieldset> <div class="row"> <div class="form-group col-6"> <label for="firstname">News Title </label> <input type="text" class="form-control" name="news_title" id="news_title" placeholder="Enter a News Title..." value="<?= isset($row)? $row['news_title'] : ''?>" autocomplete="off" onkeyup="livesearch('news_title','[^A-Za-z-(){}., ]')" onkeydown="livesearch('news_title','[^A-Za-z-(){}., ]')"> </div> <div class="form-group col-6"> <label for="lastname">Date</label> <input type="text" class="form-control" name="news_date" id="datepicker-example1" value="<?= isset($row)? $row['news_date'] : ''?>" placeholder="Enter a News Date..."> </span> </div> </div> <div class="row"> <div class="form-group col-12"> <label for="username">Discription</label> <textarea class="form-control" rows="3" name="news_description" id="news_description" placeholder="Enter News Discription..." required autocomplete="off" onkeyup="livesearch('news_description','[^A-Za-z0-9(){}.*, ]')" onkeydown="livesearch('news_description','[^A-Za-z0-9(){}.*, ]')"><?= isset($row)? $row['news_description'] : ''?></textarea> </div> </div> <?php if(isset($row)== TRUE){ ?> <input type="hidden" name="news_id" value="<?= $row['news_id']?>" /> <?php } ?> <input type="hidden" name="news" value="1"> <button type="submit" name="submit" class="btn btn-primary btn-sm"><?= isset($row)? 'Update News' : 'Save News'?></button> <button type="reset" name="reset" class="btn btn-danger btn-sm">Reset News</button> </fieldset> </form> </div> </div> </div> </div> <!-----------formend------------------> <!---================view===============------> <div class="row mt-5"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <h4 class="card-title">News View</h4> <div class="row"> <div class="col-12"> <div class="table-responsive"> <form id="vnews" action="news.php" method="post"> <table id="order-listing" class="table"> <thead> <tr> <th>#</th> <!-- <th>Sr. No.</th> --> <th>News Tittle</th> <th>News Date</th> <th>News Discirption</th> <th>Action</th> </tr> </thead> <?php $res= $obj->getTable('latest_news','news_id desc'); if($res){ $i=1; foreach($res as $news_data){ ?> <tr> <td scope="col"><input type="checkbox" name="mul_del[]" id="mul_del[]" value="<?= $news_data['news_id'] ?>" /></td> <!-- <td scope="col"><?= $i++ ?></td> --> <td scope="col"><?= $news_data['news_title'] ?></td> <td scope="col"><?= date('d M Y',strtotime($news_data['news_date'])) ?></td> <td scope="col"><?= $news_data['news_description']?></td> <td class="center"> <a class="btn btn-info btn-xs" href="news.php?edit=<?= $news_data['news_id']?>"> <i class="glyphicon glyphicon-edit icon-white"></i> <i class="mdi mdi-square-edit-outline menu-icon"></i> </a> <a class="btn btn-danger btn-xs" href="javascript:muldelete()"> <i class="glyphicon glyphicon-trash icon-white"></i> <i class="mdi mdi-delete menu-icon"></i> </a> </td> </tr> <?php } } ?> </table> </form> </div> </div> </div> </div> </div> </div> </div> <!----==============================view==============---------> </div> <!-- content-wrapper ends --> <!-- partial:../../partials/_footer.html --> <?php include("include/footer.php")?> <!-- partial --> </div> <!-- main-panel ends --> </div> <!-- page-body-wrapper ends --> </div> <!-- container-scroller --> <!-- base:js --> <script src="vendors/js/vendor.bundle.base.js"></script> <!-- endinject --> <!-- inject:js --> <script src="js/off-canvas.js"></script> <script src="js/hoverable-collapse.js"></script> <script src="js/template.js"></script> <script src="js/settings.js"></script> <script src="js/todolist.js"></script> <!-- endinject --> <!-- plugin js for this page --> <script src="vendors/jquery-validation/jquery.validate.min.js"></script> <script src="vendors/bootstrap-maxlength/bootstrap-maxlength.min.js"></script> <!-- End plugin js for this page --> <!-- Custom js for this page--> <script src="js/form-validation.js"></script> <script src="js/bt-maxLength.js"></script> <!-- End custom js for this page--> <script src="vendors/datatables.net/jquery.dataTables.js"></script> <script src="vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script> <!-- End plugin js for this page --> <!-- Custom js for this page--> <script src="js/data-table.js"></script> <script src="js/core.js"></script> <script src="js/zebra_datepicker.js"></script> <script src="//cdn.ckeditor.com/4.5.9/full/ckeditor.js"></script> <script> CKEDITOR.replace('news_description'); function muldelete() { element_lenght= vnews.elements.length; for(i=0;i<element_lenght;i++) { if(vnews.elements[i].name=="mul_del[]") { if(vnews.elements[i].checked==true) { if(confirm("Are you sure delete record(s)?")) { this.vnews.submit(); break; } } } } } </script> </body> </html>