ok

Mini Shell

Direktori : /home2/selectio/www/lilyexpresslive/software/admin/
Upload File :
Current File : /home2/selectio/www/lilyexpresslive/software/admin/get_total_report.php

<?php 

include("inc/config.php");
    $from = $_POST['from'];
    $to = $_POST['to'];
    $status = $_POST['status'];
    $role = $_POST['role'];
    $role_id = $_POST['role_id'];
  
   
    
    
        
    if($role=="Admin") 
    {
          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 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.status='$status' order by pickup_entry.id DESC");   
        }
    }
    else
    {
        
        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 and pickup_entry.client_id=$role_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.status='$status' and pickup_entry.client_id=$role_id order by pickup_entry.id DESC");   
        }
        
        
    }
        
    	    
            	$statement->execute();
            	$result = $statement->fetchAll(PDO::FETCH_ASSOC);							
                $i=1;
                 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>'; }
                       elseif($row['status']=='picked'){ echo '<td><button class="btn btn-xs btn-primary">Picked</button></td>'; }
                       elseif($row['status']=='manifest'){ echo '<td><button class="btn btn-xs btn-success">Manifest</button></td>'; }
                       elseif($row['status']=='In Transit'){ echo '<td><button class="btn btn-xs btn-success">In Transit</button></td>'; }
                       elseif($row['status']=='Received at destination'){ echo '<td><button class="btn btn-xs btn-success">Received at Destination</button></td>'; }
                       elseif($row['status']=='Out for delivery'){ echo '<td><button class="btn btn-xs btn-success">Out for Delivery</button></td>'; }
                       elseif($row['status']=='Delivered'){ echo '<td><button class="btn btn-xs btn-success">Delivered</button></td>'; }
                       elseif($row['status']=='Undelivery'){ echo '<td><button class="btn btn-xs btn-success">Undelivery</button></td>'; }
                        else{ echo '<td><button class="btn btn-xs btn-success">Nill</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>'; }
                       elseif($row['status']=='picked'){ echo '<td><button class="btn btn-xs btn-primary">Picked</button></td>'; }
                       elseif($row['status']=='manifest'){ echo '<td><button class="btn btn-xs btn-success">Manifest</button></td>'; }
                       elseif($row['status']=='In Transit'){ echo '<td><button class="btn btn-xs btn-success">In Transit</button></td>'; }
                       elseif($row['status']=='Received at destination'){ echo '<td><button class="btn btn-xs btn-success">Received at Destination</button></td>'; }
                       elseif($row['status']=='Out for delivery'){ echo '<td><button class="btn btn-xs btn-success">Out for Delivery</button></td>'; }
                       elseif($row['status']=='Delivered'){ echo '<td><button class="btn btn-xs btn-success">Delivered</button></td>'; }
                       elseif($row['status']=='Undelivery'){ echo '<td><button class="btn btn-xs btn-success">Undelivery</button></td>'; }
                        else{ echo '<td><button class="btn btn-xs btn-success">Nill</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++;
        } 
    }
       
    ?>

Zerion Mini Shell 1.0