<?php 	include_once('../../config.php');
		 
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>   
<style> 
    td
    {
        font-size:18px;
         
    }  
    th
    {    
        font-weight:bold;
        color:orange;
    } 
</style>
<script>
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: {delLive:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
	
	
}

function delD(val)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {delLiveDigit: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> Day Bazar List</h3></div>
					
					<div align="right">   
						<input type="button"    class="btn btn-warning" name="btnback" id="btnback" value=" Add New Record" onClick="javascript:location.href='addbazar.php';" />
					</div>       
				</div> 
				
  				<div class="panel-body"> 
  				    	<Br>	<Br>	<Br>	<Br>
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>  
								<th>Date</th>  
								<th>Sridevi</th> 
								<th>Time</th> 
								<th>Madhur Day</th> 
								<th>Milan Day</th> 
								<th>Rajdhani Day</th> 
								<th>Kalyan</th>   
								<th>Supreme Day</th> 
								<th>Action</th>  
							</tr>
						</thead>
						<tbody>
							<?php   
                                     
                                  $tDate = date("Y-m-d"); 
                                  $resultx = mysql_num_rows(mysql_query("select * from   calcBazar  where    tDate = '$tDate' ")); 
                                  
                                 if($resultx < 1)
                                 {
                                     mysql_query("insert into  calcBazar (tDate,sridevi,timeb,madhurd,miland,rajdhanid,supremed,kalyan,sridevin,madhurn,milann,supremen,kalyann,mainb) values('$tDate',00,00,00,00,00,00,00,00,00,00,00,00,00) ");
                                 }
                                  
                                  
								  $sr = 1;
								  $result = mysql_query("select * from   calcBazar  order by tDate "); 
								  while($row = mysql_fetch_object($result))
								  {  
										$old_date = $row->tDate;
                                        $old_date_timestamp = strtotime($old_date);
                                        $Date =  date('D-m-y', $old_date_timestamp);   
							?>
							<tr class="odd gradeX">
								<td><b><?php echo $sr++;?></b> </td>  
								<td> <?php echo $Date;?></td>     
								<td> <?php echo $row->sridevi;?></td>     
								<td> <?php echo $row->timeb;?></td>     
								<td> <?php echo $row->madhurd;?></td>     
								<td> <?php echo $row->miland;?></td>     
								<td> <?php echo $row->rajdhanid;?></td>  
								<td> <?php echo $row->kalyan;?></td>        
								<td> <?php echo $row->supremed;?></td>   
								<td class="center" > 
										<a  style="font-size:12px;" href="UpdateaddrecordB.php?id=<?php echo $row->id;?>"> Update</a>
								</td> 
							</tr>  
							<?php } 
						 
							?>
						</tbody>
					</table>
					
					 
  				</div>
  				
  				  <div class="panel-title"><h3> Night Bazar List</h3></div>      
  					<div class="panel-body"> 
  				    	<Br>	<Br>	<Br>	<Br>
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>  
								<th>Date</th>  
								<th>Sridevi N</th> 
								<th>Madhur N</th> 
								<th>Milan N</th> 
								<th>Supreme N</th> 
								<th>Kalyan N</th> 
								<th>Main Bazar </th>  
								<th>Action</th>  
							</tr>
						</thead>
						<tbody>
							<?php   
                                     
								  $sr = 1;
								  $result = mysql_query("select * from   calcBazar  order by tDate "); 
								  while($row = mysql_fetch_object($result))
								  {  
										$old_date = $row->tDate;
                                        $old_date_timestamp = strtotime($old_date);
                                        $Date =  date('D-m-y', $old_date_timestamp);   
							?>
							<tr class="odd gradeX">
								<td><b><?php echo $sr++;?></b> </td>  
								<td> <?php echo $Date;?></td>     
								<td> <?php echo $row->sridevin;?></td>     
								<td> <?php echo $row->madhurn;?></td>     
								<td> <?php echo $row->milann;?></td>     
								<td> <?php echo $row->supremen;?></td>     
								<td> <?php echo $row->kalyann;?></td>     
								<td> <?php echo $row->mainb;?></td>      
								<td class="center" > 
										<a  style="font-size:12px;" href="UpdateaddrecordB.php?id=<?php echo $row->id;?>"> Update</a>
								</td> 
							</tr>  
							<?php } 
						 
							?>
						</tbody>
					</table>
					
					 
  				</div>
  			</div>
		  </div>
		</div>
    </div>  
<?php  include ABS_PATH.'/admin/footer.php';	?>    