Mini Shell

Direktori : /home/rizant5/public_html_old/admin/
Upload File :
Current File : /home/rizant5/public_html_old/admin/get-topic-ajax.php

<?php 
require_once("../config.php");
$chapter_id=$_POST['chapter_id'];
$subid=$_POST['subid'];
$datas=$conn->prepare("select * from chapters where chapter_id='$chapter_id'");
$datas->execute();$results=$datas->fetch();?>
<div class="box-header with-border">
              <h3 class="box-title">Topics</h3>
              <div class="box-tools pull-right">
               <a href="courses.php" class="btn btn-info btn-sm" ><i class="fa fa-angle-double-left"></i> Back</a>&nbsp;&nbsp;
               <a href="topic-new.php?chapter_id=<?php echo $chapter_id;?>&subid=<?php echo $subid;?>" class="btn btn-primary btn-sm" ><i class="fa fa-plus"></i> Add New Topic</a>
              </div>
            </div>
<div class="box-body">
			   <?php
echo "<h4 style='color:red'>$results[chapter_name]</h4>";
?>
 <table class="table table-bordered table-striped dataTable" id="subject-table">
                <thead><tr><th>Topic Name</th><th>Action</th></tr></thead>
                 <tbody>
                 	<?php  $data=$conn->prepare("select * from topics where chapter_id='$chapter_id'");
					$data->execute();$result=$data->fetchall();
					foreach($result as $row){
						echo "<tr>";
						echo "<td>$row[topic_name]</td>";
						echo "<td><a href='topic-edit.php?topic_id=$row[topic_id]&subid=$subid' title='Edit Subject' class='btn btn-info btn-xs'>Edit</a>&nbsp;&nbsp;";?><button onclick="deletetopic('<?php echo $row['topic_id'];?>','<?php echo $row['chapter_id'];?>','<?php echo $subid;?>')" title='Delete Chapter' class='btn btn-danger btn-xs'>Delete</button>&nbsp;&nbsp;<a href='read-topic.php?topic_id=<?php echo $row['topic_id']?>' title='View' class='btn btn-warning btn-xs'>View</a>&nbsp;&nbsp;<a href='practice.php?topic_id=<?php echo $row['topic_id']?>&subid=<?php echo $subid;?>' title='Practice' class='btn btn-primary btn-xs'>Practice</a></td><?php
						echo "</tr>";
					}
					?>
                 </tbody>
                 </table>
            </div><!-- /.box-body -->                 
<script>
$('#subject-table').dataTable({
     responsive: true,
     "dom": 'T<"clear">lfrtip',
	 "bFilter" : false,  
	  "ordering": false,             
	"bLengthChange": false,
	"bInfo":false,
	"bPaginate":false,
     "tableTools": {
           "sSwfPath": "../apptheme/plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
		   "aButtons": [
            {
                "sExtends": "copy",
                "mColumns": [0]
            },
   			{
                "sExtends": "xls",
                 "mColumns": [0]
            },
                        {
                "sExtends": "pdf",
                 "mColumns": [0]
            },
        ]
      }
});
</script>

Zerion Mini Shell 1.0