<?php 
    include_once('../../config.php');
    include ABS_PATH.'/admin/header1.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>  

     <?php           
                        
                        $result = mysql_query("select * from expandBazzar where fdate >='2022-01-01' and  fdate <='2022-01-31'  order by bazzarId");
                        while($rw = mysql_fetch_object($result))
                        { 
                     
                            $old_date = $rw->fdate;
                            $old_date_timestamp = strtotime($old_date);
                            $bus_main_jrny =  date('D', $old_date_timestamp); 
                            $bus_main_jrny1=  date('d', $old_date_timestamp); 
                           
                            
                            if($rw->bazzarId==4) {
                                $sridevi[] = $rw->val2; 
                                $srideviD[] = $bus_main_jrny;
                                $srideviS[] = $bus_main_jrny1;
                            }
                            
                            
                            if($rw->bazzarId==7) {
                                $Time[] = $rw->val2; 
                                $TimeD[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==8) {
                                $Milan[] = $rw->val2; 
                                $MilanD[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==9) {
                                $RajdhaniD[] = $rw->val2; 
                                $RajdhaniDD[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==11) {
                                $kalyn[] = $rw->val2; 
                                $kalynD[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==12) {
                                $srdevin[] = $rw->val2; 
                                $srdevinN[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==15) {
                                $milann[] = $rw->val2; 
                                $milannN[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==16) {
                                $rajdhanin[] = $rw->val2; 
                                $rajdhaninN[] = $bus_main_jrny;
                            }
                            
                             if($rw->bazzarId==22) {
                                $kalyann[] = $rw->val2; 
                                $kalyannN[] = $bus_main_jrny;
                            }
                            
                            
                             if($rw->bazzarId==23) {
                                $mainb[] = $rw->val2; 
                                $mainB[] = $bus_main_jrny;
                            }
                            
                            
                             if($rw->bazzarId==16) {
                                $RajdhaniN[] = $rw->val2; 
                                $RajdhaniND[] = $bus_main_jrny;
                            }
  			              
  			              
  			            }
  			            
  			            //style='color:red'
  			            
          ?>
		<div class="col-md-12">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"> </div>
					
				     
				</div> 
				
  				<div class="panel-body">  
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example"> 
						<thead>
						    
						        <h3 style="text-align:center;font-weight:bold">January</h3>
							
							<tr> 
								<th>Date </th>  
                                    <?php 
                                    
                                   
                                    $jodi[1]="11";
                                    $jodi[2]="22";
                                    $jodi[3]="33";
                                    $jodi[4]="44";
                                    $jodi[5]="55";
                                    $jodi[6]="66";
                                    $jodi[7]="77";
                                    $jodi[8]="88";
                                    $jodi[9]="99";
                                    $jodi[11]="00";
                                    
                                    
                                    $jodi[12]="16";
                                    $jodi[13]="27";
                                    $jodi[14]="38";
                                    $jodi[15]="49";
                                    $jodi[16]="50";
                                    $jodi[17]="61";
                                    $jodi[18]="72";
                                    $jodi[19]="83";
                                    $jodi[20]="94";
                                    $jodi[21]="05";
                                    
                                    foreach($srideviS as $dr)
                                    { 
                                        
                                        echo "<td>".$dr."</td>"; 
                                        
                                    } ?>
                        	</tr> 
                        	
							<tr> 
								<th>Bazar</th>  
                                    <?php 
                                    foreach($srideviD as $dr)
                                    {   
                                        echo "<td>".$dr."</td>"; 
                                    } ?>
                        	</tr> 
                             
                        	<tr> 
                        	    <th>Sridevi</th>  
								 <?php 
                                    foreach($sridevi as $dr)
                                    {   
                                        
                                         if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                            echo "<td>".$dr."</td>"; 
                                            
                                    
                                    } ?>   
				        	</tr> 
				        	
                    		<tr> 
                    		    <th>Time</th>  
                                <?php 
                                foreach($Time as $dr)
                                {   
                                      if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                            echo "<td>".$dr."</td>"; 
                                } ?>
                             </tr>  
                             
                             
                         	<tr> 
                    		    <th>Milan Dy</th>  
                                <?php 
                                foreach($Milan as $dr)
                                {   
                                      if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                            echo "<td>".$dr."</td>"; 
                                } ?>
                             </tr>  
                             
                             
                             
                         	<tr> 
                    		    <th>Rajdhani Dy</th>  
                                <?php 
                                $sr  =0;
                                $sr1  =0;
                                foreach($RajdhaniD as $k=>$dr)
                                { 
                                        if($sr1==1)
                                        {
                                            echo "<td>XX</td>";
                                            
                                         if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            
                                        }
                                        else if($sr==6)
                                        {
                                             echo "<td>XX</td>";
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            $sr = 0;
                                          
                                        }
                                        else  if(array_search($dr,$jodi)!='')
                                                 echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                                echo "<td>".$dr."</td>"; 
                                                
                                        if($sr1!=1)
                                             $sr++;  
                                             
                                        $sr1++;        
                                          
                                                
                                 }
                                  
                                ?>
                             </tr>  
                             
                             
                         	<tr> 
                    		    <th>Kalyan </th>  
                                <?php 
                                $sr  =0;
                                $sr1  =0;
                                foreach($kalyn as $k=>$dr)
                                { 
                                        if($sr1==1)
                                        {
                                           echo "<td>XX</td>";
                                            if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            
                                        }
                                        else if($sr==6)
                                        {
                                           echo "<td>XX</td>";
                                         if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            $sr = 0;
                                          
                                        }
                                        else  if(array_search($dr,$jodi)!='')
                                                 echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                                echo "<td>".$dr."</td>"; 
                                                
                                        if($sr1!=1)
                                             $sr++;  
                                             
                                        $sr1++;        
                                          
                                                
                                 }
                                  
                                ?>
                             </tr>  
                             
                             
                             <tr> 
                    		    <th>Sridevi N</th>  
                                <?php 
                                foreach($srdevin as $dr)
                                {   
                                      if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                            echo "<td>".$dr."</td>"; 
                                } ?>
                             </tr>  
                             
                             
                             <tr> 
                    		    <th>Milan N </th>  
                                <?php 
                                $sr  =0;
                                $sr1  =0;
                                foreach($milann as $k=>$dr)
                                { 
                                        if($sr1==1)
                                        {
                                            echo "<td>XX</td>";
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            
                                        }
                                        else if($sr==6)
                                        {
                                            echo "<td>XX</td>";
                                         if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                            $sr = 0;
                                          
                                        }
                                        else  if(array_search($dr,$jodi)!='')
                                                 echo "<td style='color:red;'>".$dr."</td>"; 
                                        else 
                                                echo "<td>".$dr."</td>"; 
                                                
                                        if($sr1!=1)
                                             $sr++;  
                                             
                                        $sr1++;        
                                          
                                                
                                 }
                                  
                                ?>
                             </tr> 
                             
                             
                        	<tr> 
                    		    <th>Kalyan Night N</th>  
                                <?php 
                              
                                $sr = 1; 
                                while($sr<=2)
                                {
                                     echo "<td>XX</td>";
                                    $sr++;
                                }
                                $sr=1;
                                foreach($kalyann as $k=>$dr)
                                {     
                                       
                                    if($sr>5)
                                    {
                                        echo "<td>XX</td>";
                                         echo "<td>XX</td>";
                                       if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                        $sr=1;
                                    }
                                    else
                                     {
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                    }     
                                        
                                    $sr++;
                                    
                                } ?>
                             </tr>  
                             
                             
                             
                             
                    		<tr> 
                    		    <th>Rajdhani N</th>  
                                <?php 
                              
                                $sr = 1; 
                                while($sr<=2)
                                {
                                    echo "<td>XX</td>";
                                    $sr++;
                                }
                                $sr=1;
                                foreach($RajdhaniN as $k=>$dr)
                                {     
                                       
                                    if($sr>5)
                                    {
                                        echo "<td>XX</td>";
                                         echo "<td>XX</td>";
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                        $sr=1;
                                    }
                                    else {
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                    }
                                        
                                    $sr++;
                                    
                                } ?>
                             </tr>  
                             
                             
                             <tr> 
                    		    <th>Main Bazar</th>  
                                <?php 
                              
                                $sr = 1; 
                                while($sr<=2)
                                {
                                    echo "<td>XX</td>";
                                    $sr++;
                                }
                                $sr=1;
                                foreach($mainb as $k=>$dr)
                                {     
                                       
                                    if($sr>5)
                                    {
                                         echo "<td>XX</td>";
                                         echo "<td>XX</td>";
                                        if(array_search($dr,$jodi)!='')
                                             echo "<td style='color:red;'>".$dr."</td>"; 
                                          else   
                                            echo "<td>".$dr."</td>"; 
                                        $sr=1;
                                    }
                                    else
                                        echo "<td>".$dr."</td>";       
                                        
                                    $sr++;
                                    
                                } ?>
                             </tr>  
                                 
						</thead>
						<tbody>
							 
							<tr class="odd gradeX">
								 
							
                                
						</tbody>
					</table>  
  				</div> 
 
  			</div>
		  </div>
		</div>
    </div>  
<?php  include ABS_PATH.'/admin/footer.php';	?>    