/home3/vehiclea/public_html/admin-appleiitfoundationschools-com/syllabus.php
<?php
session_start();
$_SESSION['active'] = 'Syllabus';
include('include/header.php');
if(!empty($_POST['submit'])){
syllabusData_insert();
}
if(!empty($_GET['delid'])){
delete_branch($_GET['delid']);
}
$select_SyllabusData = select_SyllabusData();
?>
<main id="main" class="main">
<div class="pagetitle">
<h1>Apple IIT Schools</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item ">Syllabus List</li>
</ol>
</nav>
</div>
<section class="section">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h5 class="card-title">Add Syllabus</h5>
<div id="fail">
<?php
if(!empty($_GET['failed'])){
?>
<div align="center"><h4 style="color:red;">Already Syllabus Data Inserted </h4></div>
<?php
}
?>
</div>
<div id="update">
<?php
if(!empty($_GET['upd'])){
?>
<div align="center"><h4 style="color:green;">Syllabus Data Updated Successfully </h4></div>
<?php
}
?>
</div>
<div id="succ">
<?php
if(!empty($_GET['succ'])){
?>
<div align="center"><h4 style="color:green;">Syllabus Data Inserted Sucessfully </h4></div>
<?php
}
?>
</div>
<div id="delete_data" style="display: none;">
<h4 style="color:red; text-align: center; ">Syllabus Data Deleted Successfully</h4>
</div>
<form method="post" onsubmit="return subject_validation()">
<div class="row">
<div class="col-md-6 mt-4">
<label for="exampleInputEmail1" class="form-label">Syllabus Name</label>
<input type="text" class="form-control" id="syllabus_name" name="syllabus_name" placeholder="Enter Syllabus name">
</div>
</div>
<div class="mt-4">
<input type="submit" class="btn" value="Add" name="submit" style="background-color: #69F0AE; color: #000000;">
</div>
</form>
<h5 class="card-title">Reports</h5>
<div class="col-md-6">
<table class="table">
<thead style="background-color:#7E57C2; color: #ffff;">
<tr>
<th>S.No</th>
<th>Syllabus Name</th>
<?php
if($_SESSION['user']=='admin'){
?>
<th>Action</th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
$i=1;
while($subject = mysqli_fetch_array($select_SyllabusData)){
?>
<tr>
<td><?= $i?></td>
<td><?= $subject['name']?></td>
<?php
if($_SESSION['user']=='admin'){
?>
<td>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" style="background-color:#69F0AE;">
Action
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item text-center" href="syllabus_edit.php?edit=<?= $subject['id']?>">EDIT</a></li>
<li><a class="dropdown-item text-center" href="javascript:void();" onclick="confirmDelete(<?php echo $subject['id']?>)">DELETE</a></li>
</ul>
</div>
</td>
<?php
}
?>
</tr>
<?php
$i++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</main><!-- End #main -->
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
function subject_validation()
{
var syllabus_name = $('#syllabus_name').val();
if(syllabus_name == '')
{
swal('Please Enter Syllabus Name');
return false;
}
else{
return true;
}
}
</script>
<script>
function confirmDelete(syllabusid)
{
if (syllabusid != '') {
var x = confirm('Are you sure to Delete?');
if(x){
$.ajax({
url : "delete.php",
data : {syllabusid : syllabusid},
type : 'POST',
success : function(response) {
if(response ==1){
$('#succ').hide();
$('#update').hide();
$('#fail').hide();
$('#delete_data').show();
window.location.href = "syllabus.php";
}
}
});
}
}
}
</script>
<?php include('include/footer.php'); ?>
@LwBee Strong Bypass
Upload File
Create New File