<?php

include_once'db/connect_db.php';

if (isset($_POST['view'])) {
     $a =$_POST['ty'];
     $stid=$_POST['pq'];
    $dt1=$_POST['dt1'];
    $dt2=$_POST['dt2'];   
          
           
           echo' <div class="row">';
           
             echo'<div class="col-md-10">';
               
                  //echo'  <div class="input-group date">';
                    
                        echo'<h4> <b> Report Type :</b>   &nbsp;'.$a.'</h4>';
                        
                          echo'<h4> <b> Duration  From Date :</b> &nbsp;'.$dt1.' &nbsp;    To Date : &nbsp;'.$dt1.'</h4>';
                          echo'<h4></h4>';
                   // echo'</div>';
                
             echo'</div>';
                 
                
                
               
                
                        
            echo'</div>';
           
              
               echo'<div style="overflow-x:auto;">';
                   echo'<table class="table table-bordered table-striped" id="myProduct">';
                        echo'<thead>';
                            echo'<tr>';
                                     echo'<th width="3%" align="left" style="border-bottom:1px solid #999999">Date</th>';
                                     echo'<th width="12%" align="left" style="border-bottom:1px solid #999999">Itm.Name</th>';
                                     echo'<th width="8%"align="left" style="border-bottom:1px solid #999999">Remove From</th>';
                                      echo'<th width="12%"align="left" style="border-bottom:1px solid #999999">Discription</th>';
                                           echo'<th width="3%"align="left" style="border-bottom:1px solid #999999">Remove.Qty</th>';
                                      echo'<th width="3%"align="left" style="border-bottom:1px solid #999999">User</th>';
                                      
                                      //
                                       echo'<th width="8%"align="left" style="border-bottom:1px solid #999999">App.by</th>';
                                        echo'<th width="8%"align="left" style="border-bottom:1px solid #999999">App.Date</th>';
                                       
                                      echo'<th width="8%"align="left" style="border-bottom:1px solid #999999">Status</th>';
                                     //echo'<th width="4%" align="left" style="border-bottom:1px solid #999999">Value</th>';
                                    // echo'<th width="4%" align="left" style="border-bottom:1px solid #999999">Status</th>';
                                    // echo'<th width="4%" align="right">Update By</th>';
                             echo'</tr>';

                           echo'</thead>';
                        
                           echo'<tbody>';
                        
                          //  $no = 1;
                                          
                                                           
                           $selectst2 = $pdo->prepare("SELECT itemremove.remdate, itemremove.itemname, itemremove.discription, itemremove.qty, itemremove.usrname, itemremove.appdate, itemremove.appby,
                                                       itemremove.status,site.sname
                                                       FROM itemremove

                                                       inner join site on itemremove.sid=site.sid
                                                       WHERE itemremove.remdate between '$dt1' and '$dt2' Order By  itemremove.srl");
                                 
                              $selectst2->execute();
                                 
                                                  
                            while($rowst2 = $selectst2->fetch(PDO::FETCH_ASSOC)){     
                                
                                                          
                                
                          
                            echo'<tr>';
                               //  echo'<td style="width:10px;">'.$no++.'</td>';
                                 
                                 
                                   echo'<td>'.$rowst2['remdate'].'</td>';
                                  echo'<td>'.$rowst2['itemname'].'</td>';
                                   echo'<td>'.$rowst2['sname'].'</td>';
                                   echo'<td>'.$rowst2['discription'].'</td>';
                                   echo'<td>'. number_format($rowst2['qty']).'</td>';
                                   
                                 echo '<td>'.$rowst2['usrname'].'</td>';
                                  echo '<td>'. $rowst2['appby'].'</td>';
                                  echo '<td>'. $rowst2['appdate'].'</td>';
                                  
                                  echo '<td>'. $rowst2['status'].'</td>';
                                 // echo '<td align="right">'.$rowst2['usrname'].'</td>';
                                 
                              
                               
                            echo'</tr>';
                                                         
                        
                       //echo'<tr>';
			//<th colspan="4" style="border-top:1px solid #999999"> Total: </th>
			//<th colspan="1" style="border-top:1px solid #999999"> 
			
			
			//</th>
				//<th colspan="1" style="border-top:1px solid #999999">
		
		//400
				//</th>
		//</tr>    
                            }
                    
               echo'</tbody>';
       echo'</table>';
                    
     echo'<hr></hr>';
 echo'</div>';  
            
               // <!-- /.Report1***************************************************************************************** -->
                
    
    
    
    
     
    
    
    
    
                
        
 } elseif(isset($_POST['prid123']) && !empty($_POST['prid123'])) {

	 
     
 } elseif(isset($_POST['itrid']) && !empty($_POST['itrid'])) {  
     
    
     
     
    
}
