D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
epksuofuukz9
/
www
/
admin
/
Filename :
view_section.php
back
Copy
<?php include("includes/header.php"); ?> <?php $the_id=$_GET['view'];?> <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"></li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <!-- left column --> <div class="col-md-6"> <!-- general form elements --> <div class="card card-primary"> <div class="card-header" style="background:#040202;"> <h3 class="card-title">Add New Section</h3> </div> <!-- /.card-header --> <!-- form start --> <form role="form" method="POST" action="" enctype="multipart/form-data"> <div class="card-body"> <div class="form-group"> <label for="exampleInputEmail1">Section Name</label> <input type="text" class="form-control" name="section_name" id="exampleInputEmail1" placeholder="Section Name" required> </div> </div> <!-- /.card-body --> <div class="card-footer"> <button type="submit" name="add" class="btn btn-primary" style="background:#040202">Submit</button> </div> </form> </div> <!-- /.card --> </div> <!--/.col (left) --> <!-- left column --> <div class="col-md-6"> <!-- general form elements --> <div class="card"> <div class="card-header"> <h3 class="card-title">View Section</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>Section Name</th> <th>Action</th> </tr> </thead> <tbody> <?php $i=0; $get="SELECT DISTINCT(section_name) FROM section WHERE course_id='$the_id'"; $run=query($get); while($row=fetch($run)) { $section_name=$row['section_name']; $i++; ?> <tr> <td><?php echo $i; ?></td> <td><?php echo $section_name; ?></td> <td> <button type="button" class="btn btn-block btn-secondary btn-sm" data-toggle="modal" data-target="#modal-default<?php echo $section_name; ?>"> Edit </button> <div class="modal fade" id="modal-default<?php echo $section_name; ?>" 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="" enctype="multipart/form-data"> <div class="modal-body"> <div class="form-group"> <label for="exampleInputEmail1">Section Name</label> <input type="text" class="form-control" name="countryname" id="exampleInputEmail1" value="<?php echo $section_name; ?>" placeholder="Section Name" required> <input type="hidden" name="section_id" value="<?php echo $section_name; ?>"> </div> </div> <div class="modal-footer justify-content-between"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" name="submit" class="btn btn-primary">Save changes</button> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <a href="view_section.php?delete=<?php echo $section_id; ?>"><button type="button" class="btn btn-block btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete it?');">Delete</button></a></td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th>S.N.</th> <th>Section Name</th> <th>Action</th> </tr> </tfoot> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!--/.col (left) --> </div> <!-- /.row --> </div><!-- /.container-fluid --> </section> <!-- /.content --> <!-- /.content --> <!-- /.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> <?php if(isset($_GET['delete'])) { $the_id=$_GET['delete']; $delete="DELETE FROM countries WHERE `countries_id`='$the_id'"; $run_delete=query($delete); confirm($run_delete); if($run_delete) { echo "<script>alert('Country has been deleted');</script>"; echo "<script>window.open('country.php','_self');</script>"; } } if(isset($_POST['submit'])) { $section_name=$_POST['section_name']; $section_ide=$_POST['section_id']; } if(isset($_POST['add'])) { $section_name=$_POST['add']; } ?> </body> </html>