Mini Shell

Direktori : /home/rizant5/public_html_old/admin/
Upload File :
Current File : /home/rizant5/public_html_old/admin/test-papers.php.old

<?php 

require_once("../config.php");

require_once("function-file.php");

require_once("function-menu.php");

cookiecheck();

if((!empty($_GET['action']))&&($_GET['action']=='delete')){

	$que_id=$_GET['id'];

	$conn->exec("delete from test_papers where id='$que_id'");

	header("location:test-papers.php");

}?>

<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Test Papers</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();?>

    <style>
    .selected{color:red;}
    tr.child .dtr-title{ display: none !important; }
    </style>

  </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">Test Papers</h3>

              <div class="box-tools pull-right">

                <a href="test-papers-insert.php" class="btn btn-primary btn-sm" ><i class="fa fa-plus"></i> Add New Question</a>

              </div>

            </div>

            <div class="box-body">

              <table class="table table-bordered table-striped dataTable" id="data-table">

                <thead><tr><th>Question</th><th>Chapter</th><th>Subject</th><th>Course Name</th><th>Year</th><th>Action</th></tr></thead>

                <tfoot><tr><th>Question</th><th>Chapter</th><th>Subject</th><th>Course Name</th><th>Year</th><th>Action</th></tr></tfoot>

                 <tbody>

                 	<?php  $data=$conn->prepare("select * from test_papers t 
                    inner join courses c on c.course_id=t.course_id
                    inner join subjects s on s.subject_id=t.subject_id
                    inner join chapters c2 on c2.chapter_id=t.chapter_id
                    ");

					$data->execute();$result=$data->fetchall();$i=1;

					foreach($result as $row){

						echo "<tr>";

						echo "<td>".substr(strip_tags($row['question']),0,40)."</td>";

            echo "<td>".substr(strip_tags($row['chapter_name']),0,40)."</td>";

            echo "<td>".substr(strip_tags($row['subject_name']),0,40)."</td>";

						echo "<td>".substr(strip_tags($row['course_name']),0,40)."</td>";

            echo "<td>".strip_tags($row['year'])."</td>";

            // echo "<td><a class='btn btn-info btn-xs'>Edit</a>&nbsp;&nbsp;<a class='btn btn-danger btn-xs'>Delete</a></td>";
						echo "<td><a href='test-papers-edit.php?id=$row[id]' title='Edit Sample' class='btn btn-info btn-xs'>Edit</a>&nbsp;&nbsp;";?><a href='test-papers.php?action=delete&id=<?php echo $row['id'];?>' onclick="return confirm('Are you sure you want to delete?')" title='Delete Sample' class='btn btn-danger btn-xs'>Delete</a></td><?php

						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({

    initComplete: function () {
        this.api().columns().every( function () {
            var column = this;
            var select = $('<select><option value=""></option></select>')
                .appendTo( $(column.header()) )
                .on( 'change', function () {
                    var val = $.fn.dataTable.util.escapeRegex(
                        $(this).val()
                    );

                    column
                        .search( val ? '^'+val+'$' : '', true, false )
                        .draw();
                } );

            column.data().unique().sort().each( function ( d, j ) {
                select.append( '<option value="'+d+'">'+d+'</option>' )
            } );
        } );
    },
    
     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]

            },

   			{

                "sExtends": "xls",

                 "mColumns": [0, 1]

            },

                        {

                "sExtends": "pdf",

                "mColumns": [0, 1]

            },

        ]

      }

});

</script>

  </body>

</html>


Zerion Mini Shell 1.0