Viewing file: view_syllabus.php (5.91 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
include('includes/header.php');
?>
<?php
// Storing session data
$_SESSION["role"];
if(!isset($_SESSION["role"]))
{
header("location:admin_login.php");
?>
<script type="text/javascript">
window.location.href = "admin_login.php";
</script>
<?php
}
else
{
?>
<style>
.inner-block {
padding: 3em 2em 4em 2em;
}
</style>
<div class="page-container">
<div class="left-content">
<div class="mother-grid-inner">
<!--header start here-->
<?php include('includes/head.php'); ?>
<div class="inner-block">
<h3 style="text-align: left;color: #337ab7;margin-bottom: 1%;">View Syllabus</h3>
<div class="row" style="margin-top:30px;margin-left:5px;">
<form class="forms-sample" id="add_assign" method="post">
<div class="txt-field">
<?php
$query1 = "select * from technologies order by id desc";
$result1 = $con->query($query1);
?>
<label>Technology</label>
<select id="technology" name="technology" required style="width:25%;">
<option value="">------------Select------------</option>
<?php
while ($row1 = $result1->fetch_assoc()) {
?>
<option value="<?php echo $row1["id"]; ?>" ><?php echo $row1["name"]; ?></option>
<?php
}
?>
</select>
<label>Package</label>
<select id="semester" placeholder="Package" name="semester" required="">
<option value="">------------Select------------</option>
</select>
<input type="button" class="logins" id="gettopics" name="submit" value="Submit">
</div>
</form>
</div>
</div>
</div>
<!--heder end here-->
<!-- script-for sticky-nav -->
<div class="inner-block" style="padding: 0em 2em 4em 2em;">
<!-- <h3 style="text-align: left;color: #337ab7;margin-bottom: 1%;">Available Syllabus</h3> -->
<table id="technologies" class="table table-striped table-bordered table-condensed">
<thead>
<th>Sl No</th>
<th>Topics</th>
<th>No Of Days</th>
<th>Action</th>
</thead>
<tbody id="tcontent">
</tbody>
</table>
</div>
</div>
</div>
<!--slider menu-->
<?php include('includes/sidebar.php'); ?>
<!--slide bar menu end here-->
<?php include('includes/footer.php'); ?>
<script type="text/javascript">
$(document).ready(function () {
$('#technologies').DataTable();
$('#technology').on('change', function () {
// alert('hai');
var technology = $(this).val();
if (technology) {
$.ajax({
type: 'POST',
url: 'ajaxPackage.php',
data: 'technology=' + technology,
success: function (html) {
$('#semester').html(html);
}
});
} else {
$('#semester').html('<option value="">Select </option>');
}
});
var datatable= $('#technologies').DataTable();
$('#gettopics').click(function() {
var technology = $('#technology').val();
var package = $('#semester').val();
$.ajax({
url: 'gettopics.php',
type: "POST",
dataType:'json',
data: { technology:technology ,package:package },
success: function(response) {
datatable.clear().draw();
datatable.rows.add(response); // Add new data
datatable.columns.adjust().draw();
}
});
//$('#technologies').columns.adjust().draw();
});
});
$(document).on('click', '.delete', function() {
var id= $(this).data('id');
$(this).hide();
swal({
title: "Are you sure?",
text: "You want to delete this topic?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonText: "No",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm){
if (isConfirm) {
$.ajax({
url: 'delete_topic.php',
type: "POST",
data: { id:id },
success: function(response) {
if(response!=0){
swal("Successfully deleted !","","success");
$("button[data-id='"+id+"']").css('visibility', 'hidden');
} else{
swal("Something went wrong !", "", "error");
}
}
});
} else {
swal("Cancelled", "", "error");
}
});
});
</script>
<?php
}
?>
|