/
home
/
cicjhs
/
public_html
/
cicjhs_master
/
Upload File
HOME
<?php include("include/header1.php"); $_SESSION['page_menu']=array('website','ncc_activites'); if(!empty($_POST['nccact'])) { $obj->ncc_activites(); } if(!empty($_POST['mul_del'])) { foreach($_POST['mul_del'] as $code) { $id= $code; $photo_sql= "SELECT ncc_image FROM ncc_activites WHERE ncc_activites_id='".$id."'"; $rs= mysqli_query($obj->mysqli,$photo_sql); $photo= mysqli_fetch_assoc($rs); if(is_file('upload/ncc/'.$photo['ncc_image'])) { unlink('upload/ncc/'.$photo['ncc_image']); } } $col= 'ncc_activites_id'; $table= 'ncc_activites'; $page= 'ncc_activites.php'; $img= "ncc_image"; $path= "upload/ncc/"; $obj->delete_multiple($col,$table,$page,$path); } if(!empty($_REQUEST['edit'])) { $val= $_REQUEST['edit']; $row= $obj->getRecord('ncc_activites','ncc_activites_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($_REQUEST['msg'])){ echo '<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> <span><i class="icon fa fa-check"></i>'.$_REQUEST['msg'].'</span> </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> <h4><i class="icon fa fa-check"></i><?php echo $obj->errorMsg; ?></h4> </div> </div> </div> </section> <?php } ?> <section class="content-header"> <h1> NCC Activites 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">NCC Activites Entry</li> </ol> </div> </section> <section class="content"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <form role="form" action="" method="post" id="ncc_form" enctype="multipart/form-data" name="testimonial_form" autocomplete="off"> <div class="box-body"> <div class="col-sm-12 form-group"> <label for="exampleInputEmail1">Title</label> <input type="text" class="form-control" name="ncc_title" placeholder="Enter a Name..." value="<?= isset($row)? $row['ncc_title'] : ''?>" onkeyup="livesearch('ncc_title','[^A-Za-z-() .]')" onkeydown="livesearch('ncc_title','[^A-Za-z-() .]')"> </div> <div class="col-sm-12 form-group"> <label>Image</label> <?php if(isset($row)){ echo '<input type="file" class="form-control" name="ncc_image" id="experts_img">'; } else{ echo '<input type="file" class="form-control" name="ncc_image" id="experts_img" required>'; } ?> <?php if(isset($row)) { if(is_file('upload/ncc/'.$row['ncc_image'])) { echo "<br><br>"; echo "<img src='upload/ncc/$row[ncc_image]' height='80'>"; } } ?> </div> <input type="hidden" name="nccact" value="1"> <?php if(isset($row)== TRUE){ ?> <input type="hidden" name="ncc_activites_id" value="<?= $row['ncc_activites_id']?>" /> <input type="hidden" name="ncc_image" value="<?= $row['ncc_image']?>" /> <?php } ?> <button type="submit" name="submit" class="btn btn-primary"><?= isset($row)? 'Update' : 'Save'?></button> <button type="reset" name="reset" class="btn btn-primary">Reset</button> </div> </form> </div> </div> </div> </section> <!-- /.content --> <section class="content-header"> <h1>NCC Activites 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> <div class="box-body"> <form id="vnews" action="ncc_activites.php" method="post"> <table id="example1" class="table table-bordered table-striped table-responsive"> <thead> <tr> <th>#</th> <th>Sr. No.</th> <th>Photo</th> <th>Title</th> <th>Sub Date</th> <th>Action</th> </tr> </thead> <?php $res= $obj->getTable('ncc_activites','ncc_activites_id desc'); if($res){ $i=1; foreach($res as $exp_data){ ?> <tr> <td scope="col"><input type="checkbox" name="mul_del[]" id="mul_del[]" value="<?= $exp_data['ncc_activites_id'] ?>" /></td> <td scope="col"><?= $i++ ?></td> <td scope="col"><img src="upload/ncc/<?= $exp_data['ncc_image'] ?>" width="60" height="60"/></td> <td scope="col"><?= $exp_data['ncc_title'] ?></td> <td scope="col"><?= date('d M Y',strtotime($exp_data['sub_date'])) ?></td> <td class="center"> <a class="btn btn-info btn-xs" href="ncc_activites.php?edit=<?= $exp_data['ncc_activites_id']?>"> <i class="glyphicon glyphicon-edit icon-white"></i> Edit </a> <a class="btn btn-danger btn-xs" 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/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables/dataTables.bootstrap.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('message_l'); $(function () { $("#example1").DataTable(); $('#example2').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": true }); }); </script> <script type="text/javascript" src="js/jquery-ui.js"></script> <script type="text/javascript"> $(function() { $("#pickup").datepicker({ dateFormat: 'yy-mm-dd', minDate: 0, maxDate: '+12M' }); $("#arrival").datepicker({ dateFormat: 'yy-mm-dd', minDate: 0, maxDate: '+12M', showSplitDay: true, isTo1: true, minRangeDuration: 2, doneText: "Ready to book", clearText: "Oh no, I want to select another period" }); $("#single").datepicker({ dateFormat: 'yy-mm-dd' }); $("#pickup, #arrival, #single").click(function() { $(this).focus(); }); $("#return, #departure").bind("click focus", function() { $($(this).data("date-range-start")).click(); }); }); </script> <script src="js/jquery.validate.min.js"></script> <script> $(document).ready(function(){ $('#ncc_form').validate({ rules: { ncc_title: { required: true }, }, messages: { name: { required: "Please Enter name", }, }, highlight: function(element){ $(element).closest('.form-group').addClass('has-error').removeClass('has-success'); //$(element).next('span').addClass('fa fa-times-circle').removeClass('fa fa-check-circle'); }, unhighlight: function(element){ $(element).closest('.form-group').addClass('has-success').removeClass('has-error'); //$(element).next('span').addClass('fa fa-check-circle').removeClass('fa fa-times-circle'); }, errorElement: 'span', errorClass: 'help-block', //errorPlacement: '', }); }); $('#serial_check').change(function(){ if(this.checked== true){ $("#serial_no").show(); } else{ $("#serial_no").hide(); } }); $('#smart_card').keyup(function () { $('#customer_account').val($(this).val()); }); function livesearch(e,r) { var textfield= document.getElementById(e); var regx= new RegExp(r, 'g'); textfield.value= textfield.value.replace(regx,''); } </script> </body> </html>