Current File : /home/inlingua/public_html/sensoriumpsychologists.com/backup/admin/list_contact_reg_stdudent.php
<?php 
include_once('include/include.script.php');
include_once('include/navigation.php');
include_once('../classes/config.php');
 $year=date('Y');
$start=$year.'-01-01';
$end=$year.'-12-31';
 $sql="SELECT * FROM shristi_student 
where registration_date between '".$start."'  and '".$end."'  ORDER BY student_id DESC ";
$result = $conn->query($sql);

//print_r($_POST); exit;

//multiple value
// Check if delete button active, start this 
	error_reporting(0);
		if(isset($_POST['delete'])){
	  	  $checkbox = $_POST['checkbox'];
			if($checkbox==""){
			echo "<script>alert('please select at list one id');</script>";	
			}else{
				for($i=0;$i<count($checkbox);$i++){
					$del_id = $checkbox[$i];
					$sql ="DELETE FROM shristi_student  WHERE student_id='$del_id'";
					$result = $conn->query($sql);
			}
			// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
			}
		}
}
//multiple enable
		if(isset($_POST['enable'])){
	  		$checkbox = $_POST['checkbox'];
			if($checkbox==""){
			echo "<script>alert('please select at list one id');</script>";	
			}else{
				for($i=0;$i<count($checkbox);$i++){
				$status = $checkbox[$i];
				$sql = "UPDATE shristi_student  SET class_attendance='1' WHERE student_id='$status'";
				$result=$conn->query($sql);
			}
// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
				}
			}
	}
//multiple Disable
if(isset($_POST['disable'])){
	$checkbox = $_POST['checkbox'];
		if($checkbox==""){
		echo "<script>alert('please select at list one id');</script>";	
		}else{
			for($i=0;$i<count($checkbox);$i++){
				$status = $checkbox[$i];
				$sql = "UPDATE shristi_student  SET class_attendance='0' WHERE student_id='$status'";
				$result =$conn->query($sql);
			 }
// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
				}
			}
		}

@$ids=$_GET['ids'];
extract($_REQUEST);
if(isset($ids)){
$sql = "UPDATE shristi_student  SET assignmebt_status='0' WHERE student_id='$ids'";
$result =$conn->query($sql);
if($result){
	echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_student.php\">";
		}
}

@$idss=$_GET['idss'];
extract($_REQUEST);
if(isset($idss)){
$sql = "UPDATE shristi_student  SET study_mat_status='0' WHERE student_id='$idss'";
$result =$conn->query($sql);
if($result){
	echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
		}
}

@$ides=$_GET['ides'];
extract($_REQUEST);
if(isset($ides)){
$sql = "UPDATE shristi_student  SET assignmebt_status='1' WHERE student_id='$ides'";
$result =$conn->query($sql);
if($result){
	echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
		}
}

@$idess=$_GET['idess'];
extract($_REQUEST);
if(isset($idess)){
$sql = "UPDATE shristi_student  SET study_mat_status='1' WHERE student_id='$idess'";
$result =$conn->query($sql);
if($result){
	echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_contact_reg_stdudent.php\">";
		}
}
?>
<div id="main">
			<div class="container-fluid">
				<div class="page-header">
					<div class="pull-left">
						<h1>All Student List</h1>
					</div>
					<div class="pull-right">
						<ul class="stats">
							<li class='lightred'>
								<i class="icon-calendar"></i>
								<div class="details">
									<span class="big">February 22, 2013</span>
									<span>Wednesday, 13:56</span>
								</div>
							</li>
						</ul>
					</div>
				</div>
				<div class="breadcrumbs">
					<ul>
						<li>
							<a href="home.php">Home</a>
							<i class="icon-angle-right"></i>
						</li>
						<li>
							<a href="">All Student List</a>
							<i class="icon-angle-right"></i>
						</li>
						
					</ul>
					<div class="close-bread">
						<a href="#">
							<i class="icon-remove"></i>
						</a>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div class="box box-bordered">
							<div class="box-title">
								<h3>
									<i class="icon-table"></i>
									All Student List
								</h3>
							</div>
                            <form method="post" enctype="multipart/form-data">
							<div class="box-content nopadding">
                            <table class="table table-hover table-nomargin dataTable dataTable-tools table-bordered">
									<thead>
										<tr>
											<th class='with-checkbox'><input type="checkbox" name="check_all" id="check_all"></th>
											<th>Name</th>
                                            <th>Email</th>
                                            <th>Registration No</th>
                                            <th>Course</th>
                                            <th>Join Batch</th>
                                            <th>Center</th>
                                            <!--<th>Assignment</th>
                                            <th>Study material</th>-->
                                            <th>Reg Date</th>
                                            <th>Expired Date</th>
                                            <th>Status</th>
                                           
											
										</tr>
									</thead>
									<tbody>
             <?php 
			 
			 	while($row=$result->fetch_assoc()){
			 ?>       
										<tr>
											<td class="with-checkbox">
											<input type="checkbox" name="checkbox[]" value="<?php echo $row['student_id'];?>">						   				</td>
                                           <td><?php echo $row['fname'].$row['lname'];?></td>
                                            <td><?php echo $row['email'];?></td>
                                            <td><?php echo $row['registration_no'];?></td>
                                            <td align="center"><?php 
												$cresult=$query->select_where('shristi_course','courses_id',$row['courses_id']);
												$crow=$cresult->fetch_assoc();
												echo $crow['name'];
											?></td>
                                            <td align="center"><?php echo $row['join_batch'];?></td>
                                             <td align="center"><?php 
												$cresult=$query->select_where('shristi_center','center_id',$row['center_id']);
												$crow=$cresult->fetch_assoc();
												echo $crow['name'];//echo "&nbsp;//&nbsp;";
											?></td>
                                           <?php /*?>  <td>
                                <?php if($row['assignmebt_status']==1){  ?>           
                                <a href="list_student.php?ids=<?php echo $row['student_id'];?>" class="btn  label label-satgreen" onclick="return confirm('sure to Inactive !');">Active</a><?php } else {?>
                                  <a href="list_student.php?ides=<?php echo $row['student_id'];?>" class="btn  label label-lightred" onclick="return confirm('sure to Active !');">Not Active</a>     
                                <?php }?></td>
                                             <td>
                               <?php if($row['study_mat_status']==1){  ?>           
                                <a href="list_student.php?idss=<?php echo $row['student_id'];?>" class="btn  label label-satgreen" onclick="return confirm('sure to Inactive !');">Active</a><?php } else {?>
                                  <a href="list_student.php?idess=<?php echo $row['student_id'];?>" class="btn  label label-lightred" onclick="return confirm('sure to Active !');">Not Active</a>     
                                <?php }?>
                                             </td><?php */ ?>
                                             <td><?php echo $row['registration_date'];?></td>
                                             <td><?php echo $row['next_end_date'];?></td>
                                     	<td><?php if($row['class_attendance']=='1'){
										
										 echo '<input type="button" name="enable" value="Present" class="btn btn-info delet" ">';
										}
							if($row['class_attendance']=='0'){			
                           echo '<input type="button"  value="Absent" class="btn btn-warning delet" ">';
							}
										
										?></td>	
											
                                            
										</tr>
					<?php } ?>					
									</tbody>
								</table>
                                
							</div>
                             
                            <i class="icon-ok"><input type="submit" name="enable" value="Present" class="btn btn-info delet" onclick="return confirm('sure to Present !');"></i>
                           <i class=" icon-off"> <input type="submit" name="disable" value="Absent" class="btn btn-warning delet" onclick="return confirm('sure to Absent !');"></i>
                        </div>
                        </form>
					</div>
				</div>
			</div>
		</div>
	</div>
	
<?php include_once('include/footer.php');?>