Файловый менеджер - Редактировать - /home/amitahospital/public_html/amita_master/upload/news/news.php.tar
Назад
home/amitahospital/public_html/amita_master/news.php 0000644 00000022272 14721141657 0017005 0 ustar 00 <?php include("include/header1.php"); $_SESSION['page_menu']=array('website','news'); if(!empty($_POST['news'])) { $obj->news(); } if(!empty($_POST['mul_del'])) { foreach($_POST['mul_del'] as $code) { $id= $code; $photo_sql= "SELECT news_photo FROM news WHERE news_id='".$id."'"; $rs= mysqli_query($obj->mysqli,$photo_sql); $photo= mysqli_fetch_assoc($rs); if(is_file('upload/news/'.$photo['news_photo'])) { unlink('upload/news/'.$photo['news_photo']); } } if(!empty($_POST['mul_del'])) { $col= 'news_id'; $table= 'news'; $page= 'news.php'; $img= "news_photo"; $path= "upload/news/"; $obj->delete_multiple($col,$table,$page,$path); } } if(!empty($_REQUEST['edit'])) { $val= $_REQUEST['edit']; $row= $obj->getRecord('news','news_id',$val); } ?> <!-- Left side column. contains the logo and sidebar --> <aside class="main-sidebar"> <!-- sidebar: style can be found in sidebar.less --> <section class="sidebar"> <!-- Sidebar user panel --> <!-- /.search form --> <!-- sidebar menu: : style can be found in sidebar.less --> <?php include ('include/sidebar.php'); ?> <?php include 'include/admin-menu.php'; ?> </section> <!-- /.sidebar --> </aside> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <?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> <h4><i class="icon fa fa-check"></i><?php echo $obj->errorMsg; ?></h4> </div> </div> </div> </section> <?php } ?> <section class="content-header"> <h1> News Entry </h1> <div class="col-lg-12"> <ol class="breadcrumb"> <li><a href="admin-dashboard.php"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li class="active">News Entry</li> </ol> </div> </section> <section class="content"> <div class="row"> <!-- left column --> <div class="col-md-12"> <div class="box box-primary"> <!-- <div class="box-header with-border"> <h3 class="box-title"></h3> </div>--> <!-- form start --> <form role="form" action="" method="post" enctype="multipart/form-data" name="news_form"> <div class="box-body"> <div class="form-group col-sm-9"> <label for="exampleInputEmail1">News Title</label> <input type="text" class="form-control" name="news_title" placeholder="Enter a News Title..." value="<?= isset($row)? $row['news_title'] : ''?>" required> </div> <div class="form-group col-sm-3"> <label for="exampleInputPassword1">News 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..." required> </div> <div class="form-group col-sm-12"> <label>Description</label> <textarea class="form-control" rows="3" name="news_msg" id="Discirption" placeholder="Enter Description..." autocomplete="off" onkeyup="livesearch('Discirption','[^A-Za-z0-9(){}.*, ]')" onkeydown="livesearch('Discirption','[^A-Za-z0-9(){}.*, ]')"><?= isset($row)? $row['news_msg'] : ''?></textarea> </div> <div class="form-group col-sm-12"> <label>News Image</label> <input type="file" class="form-control" name="news_photo"> <?php if(isset($row)){ if(is_file('upload/news/'.$row['news_photo'])){ echo "<br><br>"; echo "<img src='upload/news/$row[news_photo]' height='80'>"; } } ?> </div> <input type="hidden" name="news" value="1"> <?php if(isset($row)== TRUE){ ?> <input type="hidden" name="news_id" value="<?= $row['news_id']?>" /> <input type="hidden" name="news_photo" value="<?= $row['news_photo']?>" /> <?php } ?> <button type="submit" name="submit" class="btn btn-primary"><?= isset($row)? 'Update News' : 'Save News'?></button> <button type="reset" name="reset" class="btn btn-primary">Reset News</button> </div> </form> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- right column --> <!-- /.row --> </section> <!-- /.content --> <section class="content-header"> <h1>News View <small></small> </h1> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title"></h3> </div> <!-- /.box-header --> <?php if(!empty($_REQUEST['msg'])){ echo "<center style='margin-top:20px; color:green;'><h2>".$_REQUEST['msg']."</h2></center>"; } ?> <div class="box-body"> <form id="vnews" action="news.php" method="post"> <table id="example1" class="table table-bordered table-striped table-responsive"> <thead> <tr> <th>#</th> <th>Sr. No.</th> <th>Title</th> <th>News Description</th> <th>Image</th> <th>Date</th> <th>Action</th> </tr> </thead> <?php $res= $obj->getTable('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"><?= $news_data['news_msg']?></td> <td scope="col"><img src="upload/news/<?= $news_data['news_photo'] ?>" width="60" height="60"/></td> <td scope="col"><?= date('d M Y',strtotime($news_data['news_date'])) ?></td> <td class="center"> <a class="btn btn-info" href="news.php?edit=<?= $news_data['news_id']?>"> <i class="glyphicon glyphicon-edit icon-white"></i> Edit </a> <a class="btn btn-danger" href="javascript:muldelete()"> <i class="glyphicon glyphicon-trash icon-white"></i> Delete </a> </td> </tr> <?php } } ?> </table> </form> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include 'include/footer.php'; ?> <div class="control-sidebar-bg"></div> </div> <!-- ./wrapper --> <script src="plugins/jQuery/jQuery-2.1.4.min.js"></script> <script type="text/javascript"> 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> <script src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="js/jquery.dateselect.js"></script> <script src="js/jquery-ui.min.js"></script> <script> $.widget.bridge('uibutton', $.ui.button); </script> <script src="bootstrap/js/bootstrap.min.js"></script> <script src="plugins/sparkline/jquery.sparkline.min.js"></script> <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script> <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script> <script src="plugins/knob/jquery.knob.js"></script> <script src="plugins/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables/dataTables.bootstrap.min.js"></script> <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script> <script src="plugins/slimScroll/jquery.slimscroll.min.js"></script> <script src="plugins/fastclick/fastclick.min.js"></script> <script src="dist/js/app.min.js"></script> <script src="//cdn.ckeditor.com/4.5.9/full/ckeditor.js"></script> <script> CKEDITOR.replace('Discirption'); $.widget.bridge('uibutton', $.ui.button); $(function () { $("#example1").DataTable(); $('#example2').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": true }); }); $(function () { $("#example1").DataTable(); $('#example2').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": true }); }); </script> <script src="js/core.js"></script> <script src="js/zebra_datepicker.js"></script> </body> </html> home/amitahospital/public_html/news.php 0000644 00000002655 14721156424 0014340 0 ustar 00 <?php include('include/header.php'); ?> <main id="main"> <!-- ======= Breadcrumbs ======= --> <section class="breadcrumbs"> <div class="container"> <div class="d-flex justify-content-between align-items-center"> <h2>Latest Update</h2> <ol> <li><a href="index.php">Home</a></li> <li>News</li> </ol> </div> </div> </section><!-- End Breadcrumbs --> <section class="inner-page"> <div class="container"> <div class="row"> <div class="section-title"> <h2>News</h2> </div> <?php $res= $obj->getTable('news','news_id desc'); if($res){ $i=1; foreach($res as $news_data){ ?> <div class="col-lg-6 col-md-12 pb-3"> <div class="info new"> <img src="amita_master/upload/news/<?= $news_data['news_photo'] ?>" class="img-thumbnail" height="100% "> <h4><?= $news_data['news_title'] ?></h4> <h5><?= date('d M Y',strtotime($news_data['news_date'])) ?></h5> <p><?= $news_data['news_msg']?></p> </div> </div> <?php } } ?> </div> </div> </section> </main><!-- End #main --> </main><!-- End #main --> <?php include('include/footer.php'); ?>