ok

Mini Shell

Direktori : /home2/selectio/public_html/lilyexpresslive/software/admin/
Upload File :
Current File : /home2/selectio/public_html/lilyexpresslive/software/admin/get-client-wise-report.php

<?php 

include("inc/config.php");


  
    $from = $_POST['from'];
    $to = $_POST['to'];
    $client_id = $_POST['client_id'];
    $status = $_POST['status'];
    
  
   
    
    
        
        
          if($status=='all')
    {
         $statement = $pdo->prepare("SELECT pickup_entry.*,tbl_user.full_name as client_name,pickup_entry.created_at as added,tbl_customer.cust_code as cust_code,
    	       material_desc.full_desc as content,tbl_customer.cust_name as cust_name FROM pickup_entry INNER JOIN tbl_user INNER JOIN tbl_customer INNER JOIN material_desc 
    	       on pickup_entry.client_id=tbl_user.id AND pickup_entry.content_desc=material_desc.id AND pickup_entry.customer_id=tbl_customer.cust_id
    	       where pickup_entry.client_id='$client_id' order by pickup_entry.id DESC");   
    }
    else{
        
          $statement = $pdo->prepare("SELECT pickup_entry.*,tbl_user.full_name as client_name,pickup_entry.created_at as added,tbl_customer.cust_code as cust_code,
    	       material_desc.full_desc as content,tbl_customer.cust_name as cust_name FROM pickup_entry INNER JOIN tbl_user INNER JOIN tbl_customer INNER JOIN material_desc 
    	       on pickup_entry.client_id=tbl_user.id AND pickup_entry.content_desc=material_desc.id AND pickup_entry.customer_id=tbl_customer.cust_id 
    	       where pickup_entry.client_id='$client_id' and pickup_entry.status='$status' order by pickup_entry.id DESC");   
    }
        
        
    	     
            	$statement->execute();
            	$result = $statement->fetchAll(PDO::FETCH_ASSOC);	
            		$total_count = $statement->rowCount();
                $i=1;
                
                 if($total_count>0)
                {
                
    if($from!='' && $to!=''){
                foreach ($result as $row) {
                     $created=date_create($row['added']);
                     $da=date_format($created,'Y-m-d');
                     if ($from <= $da && $to >= $da)
                    {
                        echo'<tr>';
                       echo '<td>'. $i.'</td>';
                       echo '<td>'. $row['ref_no'] .'</td>';
                       echo '<td>'. $row['cust_code'] .'</td>';
                       if($row['status']=='pending'){ echo '<td><button class="btn btn-xs btn-danger">Pending</button></td>'; }
                       if($row['status']=='picked'){ echo '<td><button class="btn btn-xs btn-primary">Picked</button></td>'; }
                       if($row['status']=='manifest'){ echo '<td><button class="btn btn-xs btn-success">Manifest</button></td>'; }
                    
	                   echo '<td>'. $row['client_name'] .'</td>';
	                   echo '<td>'. $row['address'].'</td>';
	                   echo '<td>'. $row['pincode'] .'</td>';
	                   echo '<td>'. $row['phone'] .'</td>';
	                   echo '<td>'. $row['a_weight'] .'</td>';
	                   echo '<td>'. $row['c_weight'].'</td>';
	                   echo '<td>'. $row['pics'] .'</td>';
	                   echo '<td>'. date_format($created,'d/m/Y') .'</td>';
	                   echo '<td>'. $row['cust_name'] .'</td>';
	                   echo '</tr>';
	  	                              $i++;
                    }
        } 
    }
    else
    {
         foreach ($result as $row) {
                     $created=date_create($row['added']);
                     $da=date_format($created,'Y-m-d');
                    
                        echo'<tr>';
                       echo '<td>'. $i.'</td>';
                       echo '<td>'. $row['ref_no'] .'</td>';
                       echo '<td>'. $row['cust_code'] .'</td>';
                       if($row['status']=='pending'){ echo '<td><button class="btn btn-xs btn-danger">Pending</button></td>'; }
                       if($row['status']=='picked'){ echo '<td><button class="btn btn-xs btn-primary">Picked</button></td>'; }
                       if($row['status']=='manifest'){ echo '<td><button class="btn btn-xs btn-success">Manifest</button></td>'; }
                    
	                   echo '<td>'. $row['client_name'] .'</td>';
	                   echo '<td>'. $row['address'].'</td>';
	                   echo '<td>'. $row['pincode'] .'</td>';
	                   echo '<td>'. $row['phone'] .'</td>';
	                   echo '<td>'. $row['a_weight'] .'</td>';
	                   echo '<td>'. $row['c_weight'].'</td>';
	                   echo '<td>'. $row['pics'] .'</td>';
	                   echo '<td>'. date_format($created,'d/m/Y') .'</td>';
	                   echo '<td>'. $row['cust_name'] .'</td>';
	                   echo '</tr>';
	  	                              $i++;
        } 
    }
    
    
    
                }
        else{
            echo "No data available";
        }
    ?>

Zerion Mini Shell 1.0