<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
		include ABS_PATH.'/admin/header.php';	
?>  

<script> 
$(function() {
		$( "#dateselect" ).datepicker(); 
});
	
function del_record(val)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {dellabor:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
}

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3>Escalation List </h3></div>
					
					
					 
					 
					 
					
					
					<div align="left"> 
					 <form method="post" autocomplete="off">
					<div class="col-sm-2">
					
					<?php 
						$stmt=$conn->prepare("select * from myworks  where randNo=:randNo ");   
						$stmt->bindValue(':randNo', $_REQUEST['randNo']  , PDO::PARAM_STR);  
						$stmt->execute();    
						$neAgen = $stmt->fetchAll(PDO::FETCH_OBJ);     
						?>
						
						<select  class="form-control" name="AgencyName">
									<option value="">Select </option>
									<?php   
									$stmt=$conn->prepare("select  name,id from    pw__newage  ");  
									$stmt->execute();   
									$agencyD = $stmt->fetchAll(PDO::FETCH_OBJ); 
									foreach($agencyD as $mpp) {
									?>
									 <option value="<?php echo $mpp->id;?>"><?php echo $mpp->name;?></option>
								   <?php } ?>   
					  </select>
					</div>
					
					 
				 
					
					 
					<input   class="btn btn-warning"  type="submit" value="Apply" name="filterSub"/>
					
					</form>
						
					</div>
					
					<div align="right"> 
					 
					<input type="button"    class="btn btn-warning" name="btnback" id="btnback" value=" Reset " onClick="javascript:location.href='myworks.php';" />
					</div>
					
					
					
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>
								<th>Agency</th>   
								<th>Name of Work</th> 
								<th>Agg No</th>  
								<th>Randum No</th>  
								<th>Short Name</th> 
								<th>Work order No</th> 
								<th>Work order Date</th> 
								<th>Limit</th> 
								<th>Extention</th> 
								<th>Tender Acc @</th> 
								<th>Date of Rec Of Tender</th> 
								<th>Basic Indices Qtr Be4</th> 
								<th>FIne</th> 
							</tr>
						</thead>
						<tbody>
							<?php
									 
									$a = 1;
									if(isset($_POST['filterSub']))
									{       
										$a = " agency=".$_POST['AgencyName']."";     
									}
									 
                                    $stmt=$conn->prepare("select  * from    myworks   where $a   order by id ");  
                                    $stmt->execute(); 
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                    $sr = 1; 
                                    
									  foreach($AllUsers as $users)
								     {

										$stmt=$conn->prepare("select  name  from   pw__newage  where id=:id   ");  
										$stmt->bindValue(':id',$users->agency, PDO::PARAM_STR); 			
										$stmt->execute(); 
										$agency = $stmt->fetch(PDO::FETCH_OBJ);  
								   ?> 
									   
								<tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td><?php echo $agency->name;?></td>
								<td><?php echo  $users->workN;?></td>
								<td><?php echo  $users->AggNo;?></td>
								<td><?php echo  $users->randNo;?></td>
								<td><?php echo  $users->shortName;?></td>
								<td><?php echo  $users->workorderNo;?></td>
								<td><?php echo  $users->workOrderdate;?></td>
								<td><?php echo  $users->timeLimit;?></td>
								<td><?php echo  $users->extention;?></td>
								<td><?php echo  $users->TenderAccAt;?></td>
								<td><?php echo  $users->recDate;?></td>
								<td><?php echo  $users->basicIndices;?></td>
								<td><?php echo  111;;?></td>  
							</tr>       
								 <?php  
							    }
							?>
						</tbody>
					</table>
  				</div>
  			</div>



		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    