Viewing file: view_students_1.php (32.77 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
{
$not_id=$_GET['id'];
if($not_id=='send')
{
//echo 'inside';
?>
<script>
// alert('Message sent Successfully!');
// swal('Message sent Successfully!');
setTimeout(function(){
window.location.href = "view_students.php";
}, 1000);
</script>
<?php
}
?>
<style type="text/css">
.modal-footer
{
border-top:0px solid #e5e5e5;
}
</style>
<div class="page-container">
<div class="left-content">
<div class="mother-grid-inner">
<!--header start here-->
<div class="header-main">
<div class="header-left">
<div class="logo-name">
<a href="admin_index.php"> <h3>SICS ADMIN</h3>
</br>
</a>
</div>
<div class="clearfix"> </div>
</div>
<!--notification menu end -->
<div class="profile_details">
<ul>
<li class="dropdown profile_details_drop">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<div class="profile_img">
<span class="prfil-img"><!-- <img src="images/p1.png" alt=""> --> </span>
<div class="user-name">
<p>Srishti Innovative</p>
<span><?php echo $_SESSION["name"];?></span>
</div>
<i class="fa fa-angle-down lnr"></i>
<i class="fa fa-angle-up lnr"></i>
<div class="clearfix"></div>
</div>
</a>
<ul class="dropdown-menu drp-mnu">
<!-- <li> <a href="#"><i class="fa fa-cog"></i> Settings</a> </li>
<li> <a href="#"><i class="fa fa-user"></i> Profile</a> </li> -->
<li> <a href="logout.php"><i class="fa fa-sign-out"></i> Logout</a> </li>
</ul>
</li>
</ul>
</div>
</div>
<div class="inner-block" style="overflow-x: auto;
width: 100%;">
<?php
if(isset($not_id)){
echo '<div class="alert alert-success" role="alert">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
Message sent Successfully
</div>';
}?>
<h3 style="text-align: left;color: #337ab7;margin-bottom: 1%;">Registered Students</h3>
<a href="" class="btn btn-success" data-toggle="modal" data-target="#myModal1" style="margin-left: 1000px;">Send Message</a>
<div class="modal fade" id="myModal1" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Send Message</h4>
</div>
<div class="modal-body">
<form action="stud_action.php" method="post">
<label>Message:</label>
<textarea name="message" style="width: 500px;height: 150px;margin-left: 30px;"></textarea>
<br>
<button type="submit" class="btn btn-success" style="margin-left: 400px;"><i class="fa fa-send-o"></i> Send</button>
</form>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<br><br>
<?php
if($_SESSION['role']=='staff'){
$id=$_SESSION['user_id'];
$query = "SELECT *
FROM user_details
INNER JOIN enrolldetails ON user_details.user_id=enrolldetails.user_id LEFT JOIN student_batch_plan ON enrolldetails.enrollid=student_batch_plan.enrollid where enrolldetails.admin_status=1 and enrolldetails.staff=$id ORDER BY user_details.user_id desc";
$result = $con->query($query);
?>
<div class="table-responsive">
<table id="requests" class="table table-striped table-bordered table-condensed" >
<thead style="background: #7ab9f3;">
<tr>
<th>Sl.No</th>
<th>Name</th>
<th>Email</th>
<th>Contact</th>
<th>Course</th>
<th>Date</th>
<th>Start Date</th>
<th>End Date</th>
<th>Exam Date</th>
<th>Schedule</th>
<th>Change Days</th>
<th>View Resume</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while ($row = $result->fetch_assoc()) {
$entr=$row["enrollid"];
?>
<tr id="row_<?php echo $row["enrollid"]; ?>">
<td><?php echo $i; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["course"]; ?></td>
<td>
<!-- <?php //if($row["created_at"]!='0000-00-00'){ echo date('d-m-Y',strtotime($row["created_at"])); } ?> -->
<?php echo $row["created_at"]; ?>
</td>
<td><?php echo $row['start_date']?></td>
<td><?php echo $row['end_date']?></td>
<td><?php echo $row['exam_dates']?></td>
<td><?php echo $row['days'];?></td>
<td><a href="" data-toggle="modal" class="btn btn-success get edit" onclick="" data-id="<?php echo $row["enrollid"] ?>">Edit Schedule</a>
</td>
<td>
<!-- <a href="admin_view_resume.php?id=<?php //echo $row["name"].'_'.$row["user_id"]; ?>" target="_blank" class="btn btn-success get" >View Resume</a> -->
<?php
$row["name"];
$uname = $row['name'];
$uname = str_replace(' ', '', $uname);
?>
<a href="https://www.srishticampus.com/Profile/<?php echo $uname.'_'.$row["user_id"]; ?>" target="_blank" class="btn btn-success get view" >View Resume</a>
</td>
<td>
<form action="send_message.php" method="post">
<input type="hidden" name="toid" value="<?php echo $row['user_id'];?>">
<input type="hidden" name="fromid" value="<?php echo $stf;?>">
<textarea class="form-control" name="msg"></textarea>
<input type="submit" name="submit" value="Send">
</form>
</td>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Upload Batch Plan</h4>
</div>
<div class="modal-body">
<form action="updatedate.php" method="post">
<?php
$sql="select * student_batch_plan where enrollid='$enrollid'";
?>
<input type="hidden" name="enrollid" id="enrollid">
<label> Days</label><br><br>
<select multiple="" name="day[]" id="day">
<option value="">Select</option>
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
</select>
<br><br>
<label>Start Date</label><br><br><input type="date" name="startdate" placeholder="Start date" id="startdate" value="<?php echo $row['start_date']?>">
<br><br>
<label>End Date</label><br><br><input type="date" name="enddate" id="enddate" placeholder="End date" value="<?php echo $row['end_date']?>">
<br><br>
<div class="field_wrapper">
<label>Exam Date</label><br><br>
<input type="date" name="exam_date[]" id="exam_date1" placeholder="Exam date" class="examda">
<div class="examd"></div>
<a href="javascript:void(0);" class="add_button" title="Add field" style="font-size: 29px;color: black;text-align: center;">+</a>
</div>
<br><br>
<input type="submit" class="btn btn-primary" name="submit" value="Submit">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php
$i++;
}
?>
</tr>
</tbody>
</table>
</div>
<?php
}else{
$query = "SELECT *
FROM user_details
INNER JOIN enrolldetails ON user_details.user_id=enrolldetails.user_id LEFT JOIN student_batch_plan ON enrolldetails.enrollid=student_batch_plan.enrollid where enrolldetails.admin_status=1 ORDER BY user_details.user_id desc";
$result = $con->query($query);
?>
<div class="table-responsive">
<table id="requests" class="table table-striped table-bordered table-condensed" >
<thead style="background: #7ab9f3;">
<tr>
<th>Sl.No</th>
<th>Name</th>
<!-- <th>Email</th> -->
<th>Contact</th>
<th>Course</th>
<!-- <th>Date</th> -->
<th>Staff</th>
<th>Assign Staff</th>
<!-- <th>Start Date</th>
<th>End Date</th>
<th>Exam Date</th>
<th>Days</th>
<th>Change Days</th>
<th>View Resume</th> -->
<th>Message</th>
<th>more</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while ($row = $result->fetch_assoc()) {
$entr=$row["enrollid"];
?>
<tr id="row_<?php echo $row["enrollid"]; ?>">
<td><?php echo $i; ?></td>
<td><?php echo $row["name"]; ?></td>
<!-- <td><?php echo $row["email"]; ?></td> -->
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["course"]; ?></td>
<!-- <td> -->
<!-- <?php //if($row["created_at"]!='0000-00-00'){ echo date('d-m-Y',strtotime($row["created_at"])); } ?> -->
<!-- <?php //echo $row["created_at"]; ?>
</td> -->
<td>
<?php
$stf=$row['staff'];
$res=$con->query("select * from admin where id='$stf'");
$ro=$res->fetch_assoc();
$name= $ro['name'];
if($name==""){
echo 'Not Assigned';
}
else{
echo $name;
}
?>
</td>
<td>
<form action="staff_allocate.php" method="post">
<input type="hidden" name="enid" value="<?php echo $row['enrollid'];?>">
<?php
$enrollid=$row['enrollid'];
$course= $row["course"];
$s=$con->query("select * from course_details where name='$course'");
$r=$s->fetch_assoc();
$tech=$r['technology'];
$s1=$con->query("select * from technologies where id='$tech'");
$r1=$s1->fetch_assoc();
$tech1=$r1['id'];
$query1 = "SELECT *
FROM admin
WHERE id IN (SELECT staff_id
FROM staff_technology
WHERE technology_id='$tech1') ";
$result1 = $con->query($query1);
?>
<select class="form-controls" id="staff" name="staff" required style="width:100%;">
<option value="">Select Staff</option>
<?php
while ($row1 = $result1->fetch_assoc()) {
?>
<option value="<?php echo $row1["id"]; ?>"><?php echo $row1["name"]; ?></option>
<?php
}
?>
</select>
<br><br>
<?php
if($enrollid=='')
{
echo "Please Schedule Class";
}
else
{
?>
<input type="submit" class="staff-update" name="submit" value="Update">
<?php
}
?>
<!-- <input type="submit" class="staff-update" name="submit" value="Update"> -->
</form>
</td>
<!-- <td><?php echo $row['start_date']?></td>
<td><?php echo $row['end_date']?></td>
<td><?php echo $row['exam_dates']?></td>
<td><?php echo $row['days'];?></td> -->
<!-- <td><a href="#myModal" data-toggle="modal" class="btn btn-success get edit" onclick="" data-id="<?php echo $row["enrollid"] ?>">Edit Schedule</a>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Upload Batch Plan</h4>
</div>
<div class="modal-body">
<form action="updatedate.php" method="post">
<?php
$sql="select * student_batch_plan where enrollid='$enrollid'";
?>
<input type="hidden" name="enrollid" id="enrollid">
<label> Days</label><br><br>
<select multiple="" name="day[]" id="day">
<option value="">Select</option>
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
</select>
<br><br>
<label>Start Date</label><br><br><input type="date" name="startdate" placeholder="Start date" id="startdate" value="<?php echo $row['start_date']?>">
<br><br>
<label>End Date</label><br><br><input type="date" name="enddate" id="enddate" placeholder="End date" value="<?php echo $row['end_date']?>">
<br><br>
<div class="field_wrapper">
<label>Exam Date</label><br><br>
<input type="date" name="exam_date[]" id="exam_date1" placeholder="Exam date" class="examda">
<div class="examd"></div>
<a href="javascript:void(0);" class="add_button" title="Add field" style="font-size: 29px;color: black;text-align: center;">+</a>
</div>
<br><br>
<input type="submit" class="btn btn-primary" name="submit" value="Submit">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</td> -->
<!-- <td> -->
<!-- <a href="admin_view_resume.php?id=<?php //echo $row["name"].'_'.$row["user_id"]; ?>" target="_blank" class="btn btn-success get" >View Resume</a> -->
<!-- <?php
//$row["name"];
// $uname = $row['name'];
//$uname = str_replace(' ', '', $uname);
?>
<a href="https://www.srishticampus.com/Profile/<?php //echo $uname.'_'.$row["user_id"]; ?>" target="_blank" class="btn btn-success get view" >View Resume</a>
</td> -->
<td>
<form action="send_message.php" method="post">
<input type="hidden" name="toid" value="<?php echo $row['user_id'];?>">
<input type="hidden" name="fromid" value="<?php echo $stf;?>">
<textarea name="msg"></textarea>
<input type="submit" class="send" name="submit" value="Send">
</form>
</td>
<td><a href="#myModal_new<?php echo $row["enrollid"] ?>" data-toggle="modal" class="btn btn-success get edit" onclick="" data-id="<?php echo $row["enrollid"] ?>">more</a></td>
<div id="myModal_new<?php echo $row["enrollid"] ?>" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Details</h4>
</div>
<div class="modal-body">
<div class="field_wrapper">
<div class="col-lg-6"><label>Email</label></div>
<div class="col-lg-6"><label><?php echo $row['email']?></label></div>
</div>
<div class="field_wrapper">
<div class="col-lg-6"><label>Start Date</label></div>
<div class="col-lg-6"><label><?php echo $row['start_date']?></label></div>
</div>
<div class="field_wrapper">
<div class="col-lg-6"><label>End Date</label></div>
<div class="col-lg-6"><label><?php echo $row['end_date']?></label></div>
</div>
<div class="field_wrapper">
<div class="col-lg-6"><label>Exam Date</label></div>
<div class="col-lg-6"><label><?php echo $row['exam_dates']?></label></div>
</div>
<div class="field_wrapper">
<div class="col-lg-6"><label>Days</label></div>
<div class="col-lg-6"><label><?php echo $row['days']?></label></div>
</div>
<div class="field_wrapper">
<div class="col-lg-6"><label>Change Days</label></div>
<div class="col-lg-6"><a href="#myModal_cd<?php echo $row["enrollid"] ?>" data-toggle="modal" class="btn btn-success get edit" onclick="" data-id="<?php echo $row["enrollid"] ?>">Edit Schedule</a></div>
<div id="myModal_cd<?php echo $row["enrollid"] ?>" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Upload Batch Plan</h4>
</div>
<div class="modal-body">
<form action="updatedate.php" method="post">
<?php
$sql="select * student_batch_plan where enrollid='$enrollid'";
?>
<input type="hidden" name="enrollid" id="enrollid">
<label> Days</label><br><br>
<select multiple="" name="day[]" id="day">
<option value="">Select</option>
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
</select>
<br><br>
<label>Start Date</label><br><br><input type="date" name="startdate" placeholder="Start date" id="startdate" value="<?php echo $row['start_date']?>">
<br><br>
<label>End Date</label><br><br><input type="date" name="enddate" id="enddate" placeholder="End date" value="<?php echo $row['end_date']?>">
<br><br>
<div class="field_wrapper">
<label>Exam Date</label><br><br>
<input type="date" name="exam_date[]" id="exam_date1" placeholder="Exam date" class="examda">
<div class="examd"></div>
<a href="javascript:void(0);" class="add_button" title="Add field" style="font-size: 29px;color: black;text-align: center;">+</a>
</div>
<br><br>
<input type="submit" class="btn btn-primary" name="submit" value="Submit">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<div class="field_wrapper">
<div class="col-lg-6" style="top: 10px;"><label>View Resume</label></div>
<div class="col-lg-6" style="top: 10px;">
<?php
$row["name"];
$uname = $row['name'];
$uname = str_replace(' ', '', $uname);
?>
<a href="https://www.srishticampus.com/Profile/<?php echo $uname.'_'.$row["user_id"]; ?>" target="_blank" class="btn btn-success get view" >View Resume</a>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php
$i++;
}
?>
</tr>
</tbody>
</table>
</div>
<?php
}?>
</div>
</div>
<!--heder end here-->
<!-- script-for sticky-nav -->
<div class="inner-block">
</section>
</div>
</div>
</div>
<!--slider menu-->
<?php include('includes/sidebar.php'); ?>
<!--slide bar menu end here-->
<?php include('includes/footer.php'); ?>
<?php
if(isset($_GET['id']))
{
$t = $_GET['id'];
if($t=='success')
{
?>
<script type="text/javascript">
//alert("Course request activated Successfully!");
swal("Staff allocated Successfully!");
</script>
<script type="text/javascript">
window.location = 'https://www.srishticampus.com/admin/view_students.php';
</script>
<?php
}
}
?>
<script>
$(document).ready(function () {
$('#requests').DataTable({
"fnInitComplete": function(){
// Disable TBODY scoll bars
$('.dataTables_scrollBody').css({
'overflow': 'hidden',
'border': '0'
});
// Enable TFOOT scoll bars
$('.dataTables_scrollFoot').css('overflow', 'auto');
$('.dataTables_scrollHead').css('overflow', 'auto');
// Sync TFOOT scrolling with TBODY
$('.dataTables_scrollFoot').on('scroll', function () {
$('.dataTables_scrollBody').scrollLeft($(this).scrollLeft());
});
$('.dataTables_scrollHead').on('scroll', function () {
$('.dataTables_scrollBody').scrollLeft($(this).scrollLeft());
});
},
"scrollX": true,
"scrollCollapse": true,
"colResize": {
"tableWidthFixed": true,
//"handleWidth": 10,
"resizeCallback": function(column)
{
}
},
"searching": true,
"paging": true,
"info": true,
"deferRender": true,
"sScrollX": "190%"
});
var navoffeset = $(".header-main").offset().top;
$(window).scroll(function () {
var scrollpos = $(window).scrollTop();
if (scrollpos >= navoffeset) {
$(".header-main").addClass("fixed");
$(".sidebar-menu").addClass("fixed");
} else {
$(".header-main").removeClass("fixed");
$(".sidebar-menu").removeClass("fixed");
}
});
var x = 1;
var maxField = 3;
//Input fields increment limitation
var addButton = $('.add_button'); //Add button selector
var wrapper = $('.field_wrapper'); //Input field wrapper
var c=2
//New input field html
//Initial field counter is 1
//Once add button is clicked
$(addButton).click(function(){
//Check maximum number of input fields
var fieldHTML = '<br><br><div class="no"><input type="date" name="exam_date[]" class="examda" id="exam_date'+c+'" placeholder="Exam date"><a href="javascript:void(0);" class="remove_button" style="font-size: 29px;color: black;text-align: center;">-</a></div>';
if(x <= maxField){
x=x+1;
c++; //Increment field counter
$(wrapper).append(fieldHTML); //Add field html
}
});
//Once remove button is clicked
$(wrapper).on('click', '.remove_button', function(e){
e.preventDefault();
$(this).parents('.no').remove(); //Remove field html
x--;
//Decrement field counter
});
$('.get').click(function(){
var ids = $(this).data('id');
$.ajax({
url:"getData.php",
type:"get",
data:{enroll:ids},
success:function(data){
var obj = jQuery.parseJSON(data);
$('#startdate').val(obj['start_date']);
$('#enddate').val(obj['end_date']);
var exam=obj['exam_dates'];
var exam1=exam.split(" , ");
var i=0;
while(i<exam1.length){
$('.examd').val('<input type="date" name="exam_date[]" id="exam_date'+i+'" placeholder="Exam date" value="'+exam1[i]+'" class="examda">');
i++;
}
var days=obj['days'];
var day=days.split(" , ");
$('#day').val(day);
$('#myModal').modal('show');
}
});
});
});
</script>
<script>
$(document).on("click", ".get", function () {
var ids = $(this).data('id');
$(".modal-body #enrollid").val( ids );
});
</script>
<?php
}
?>
|