ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/get_day_report.php

<?php include("inc/config.php");
  
    $from = $_POST['from'];
    $to = $_POST['to'];
     $role = $_POST['role'];
    $role_id = $_POST['role_id'];
   
    
    if($from!='' && $to!=''){
         if($role=="Admin") 
    {
    	       $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 and pickup_entry.client_id=$role_id order  by pickup_entry.id DESC");   
    }
            	$statement->execute();
            	$result = $statement->fetchAll(PDO::FETCH_ASSOC);							
                $i=1;
                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>';
	                   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 '<td>'. $row['destination'] .'</td>';
	                   echo '</tr>';
	  	                              $i++;
                    }
        } 
    }
        else{
            echo "No data available";
        }
    ?>

Zerion Mini Shell 1.0