Current File : /home/inlingua/public_html/sensoriumpsychologists.com/admin/result_publish.php
<?php 
include_once('include/include.script.php');
include_once('include/navigation.php');
include_once('../classes/config.php');
?>
<?php
$result=$query->select('shristi_result_publish');
?>
<?php
//multiple value
// Check if delete button active, start this 
	error_reporting(0);
//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_result_publish  SET status='1' WHERE id='$status'";
				$result=$conn->query($sql);
			}
// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=result_publish.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_result_publish  SET status='0' WHERE id='$status'";
				$result =$conn->query($sql);
			 }
// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=result_publish.php\">";
				}
			}
		}
?>
<div id="main">
			<div class="container-fluid">
				<div class="page-header">
					<div class="pull-left">
						<h1>system Activity</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="">system Activity 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>
									system Activity List
								</h3>
							</div>
                            <form method="post" enctype="multipart/form-data">
							<div class="box-content nopadding">
                            <table class="table table-hover">
									<thead>
										<tr>
											<th class='with-checkbox'><input type="checkbox" name="check_all" id="check_all"></th>
                                            <th>S No</th>
                                            <th>Title</th>
											<th>Status</th>
                                        </tr>
									</thead>
									<tbody>
             <?php 
			 	$count=$result->num_rows;
				for($i=0;$i<=$count;$i++){
				while($row[$i]=$result->fetch_assoc()){
			 ?>       
										<tr>
											<td class="with-checkbox">
											<input type="checkbox" name="checkbox[]" value="<?php echo $row[$i]['id'];?>">											</td>
                                            <td><?php echo ($i+1)?></td>
                                            <td><?php echo $row[$i]['tital'];?></td>  
		
                          <td class='hidden-350'><?php
												if($row[$i]['status']==1){echo "<span class='label label-satgreen'>Active</span>";}
												if($row[$i]['status']==0){echo "<span class='label label-lightred'>Inactive</span>";}?></td>
                                              
										</tr>
					<?php $i++;} }?>					
									</tbody>
								</table>
                            </div>
                            <i class="icon-ok"><input type="submit" name="enable" value="Active" class="btn btn-info delet" onclick="return confirm('sure to Active !');"></i>
                           <i class=" icon-off"> <input type="submit" name="disable" value="Inactive" class="btn btn-warning delet" onclick="return confirm('sure to Inactive !');"></i>
                        </div>
                        </form>
					</div>
				</div>
			</div>
		</div>
	</div>
	
<?php include_once('include/footer.php');?>