D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
epksuofuukz9
/
www
/
admin
/
Filename :
edit_section.php
back
Copy
<?php include("includes/header.php"); ?> <?php $the_id=$_GET['edit']; ?> <body class="hold-transition sidebar-mini"> <div class="wrapper"> <!-- Navbar --> <?php include("includes/top_nav.php");?> <!-- /.navbar --> <!-- Main Sidebar Container --> <?php include("includes/side_nav.php");?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>Section</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#" style="color:#111;">Dashboard</a></li> <li class="breadcrumb-item active">View Course</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <?php $get_d_section="SELECT DISTINCT(section_name) FROM section WHERE `course_id`='$the_id'"; $run_d_section=query($get_d_section); while($row_d_section=fetch($run_d_section)) { $section_name=$row_d_section['section_name']; ?> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h3 class="card-title"><?php echo $section_name; ?></h3> </div> <!-- /.card-header --> <div class="card-body table-responsive"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>S.N.</th> <th>Lesson</th> <th>Description</th> <th>Action</th> </tr> </thead> <tbody> <?php $i=0; $get_section_detail="SELECT * FROM section WHERE section_name='$section_name' AND course_id='$the_id'"; $run_section_detail=query($get_section_detail); while($row_section_detail=fetch($run_section_detail)) { $i++; $section_id=$row_section_detail['section_id']; $section_lesson=$row_section_detail['section_lesson']; $section_description=$row_section_detail['section_description']; ?> <tr> <td><?php echo $i;?></td> <td><?php echo $section_lesson;?></td> <td><?php echo $section_description;?></td> <td><button type="button" class="btn btn-block btn-secondary btn-sm" data-toggle="modal" data-target="#modal-default<?php echo $section_id; ?>"> Edit </button> <div class="modal fade" id="modal-default<?php echo $section_id; ?>" style="display: none;" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Edit Section</h4> </div> <form role="form" method="POST" action="php/edit_section.php" enctype="multipart/form-data"> <div class="modal-body"> <div class="form-group"> <label for="exampleInputEmail1">Lesson Name</label> <input type="text" class="form-control" name="lesson" id="exampleInputEmail1" value="<?php echo $section_lesson; ?>" placeholder="Lesson Name" required> <input type="hidden" name="section_id" value="<?php echo $section_id; ?>"> <input type="hidden" name="course_id" value="<?php echo $the_id; ?>"> </div> <div class="form-group"> <label for="exampleInputEmail1">Lesson Description</label> <textarea class="form-control" name="description" id="exampleInputEmail1" placeholder= "Description" rows="4" required><?php echo $section_description; ?></textarea> </div> <div class="modal-footer justify-content-between"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Save changes</button> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th>S.N.</th> <th>Lesson</th> <th>Description</th> <th>Action</th> </tr> </tfoot> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> </div> <!-- /.row --> <?php } ?> </section> <!-- /.content --> <?php if(isset($_GET['final_delete'])) { $the_section_id=$_GET['final_delete']; $the_id=$_GET['id']; $delete_section="DELETE FROM `section` WHERE `section_id`='$the_section_id'"; $run_delete_section=query($delete_section); confirm($run_delete_section); if($run_delete_section) { echo "<script>alert('Section has been deleted');</script>"; echo "<script>window.open('delete_section.php?delete=$the_id','_self');</script>"; } } ?> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("includes/footer.php");?> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> </div> <!-- ./wrapper --> <?php include("includes/scripts.php"); ?> <script> $(function () { $("#example1").DataTable(); $('#example2').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": false, }); }); </script> </body> </html>