ok

Mini Shell

Direktori : /home/gainstransformin/public_html/Gains_admin/cron_job/
Upload File :
Current File : /home/gainstransformin/public_html/Gains_admin/cron_job/cronning.php

<?php

require_once 'config.php';

$response = array();
$response["reading_entry"] = array();
$response["payment"] = array();
$response["expense"] = array();
if(1) 
{  

// echo "<pre>";
// print_r($_REQUEST);die();
  
	
	date_default_timezone_set('Asia/Kolkata');  
	
	$t=date('h:i:a');     
	
	$ttime=date('Y-m-d');
	
	$result= mysql_query("SELECT * FROM  `tbl_reading_entry` WHERE 
	                          `fk_emp_id`='".$_REQUEST['fk_emp_id']."' AND `reading_date`='".$ttime."'
	                          ");
	 $result->result_array();
	 echo "<pre>";
	 print_r($result);die();
	   if (mysql_num_rows($result) > 0)
	   {
            echo "<pre>";
            print_r($result);die();
        while($row = mysql_fetch_array($result)) 
	    {
            $product = array();
            $reading_date = $row["reading_date"];
            //echo $reading_date;exit;
            $opening= $row["opening_meter_reading"];
            //echo "opening ".$opening;
            $closing = $row["closing_meter_reading"];
            //echo "<pre>";
            //echo "closing ".$closing;
            $testing = $row["testing_fuel"];
            //echo "<pre>";
            //echo "testing ". $testing;
            $rate = $row["fuel_rate"];
            //$rate=number_format(round((float)$rate,2),2);
            //echo "<pre>";
            //echo "rate ". $rate;
            $tot=$closing-$opening;
            //$tot=number_format(round((float)$tot,2),2);
            //echo "<pre>";
            //echo "closing-opening ".$tot;
            $total=$tot-$testing;
             //$total=number_format(round((float)$total,2),2);
             //echo "<pre>";
             //echo "tot-testing ".$total;
            $all_total=$total*$rate;
            //$all_total=number_format(round((float)$all_total,2),2);
            
            //echo "<pre>";
            //echo "all total :".$all_total;
            $product["all_total"]=$all_total;
            array_push($response["reading_entry"], $product);
            
            
        	$result1= mysql_query("SELECT * FROM  `tbl_payment_entry` WHERE 
	                        AND `payment_date`='".$reading_date."'
	                         AND `fk_emp_id`='".$_REQUEST['fk_emp_id']."'
	                          ");
        
         if (mysql_num_rows($result1) > 0)
         {
             
            while($row11 = mysql_fetch_array($result1)) 
    	    {
            
              $product["pay_id"] = $row11["pay_id"];
            
              $product["pay_mode"] = $row11["pay_mode"];
              
              $product["fk_bank_id"] = $row11["fk_bank_id"];
               
                $product["payment_date"] = $row11["payment_date"];
                
                 $product["payment_amount"] = $row11["payment_amount"];
                 
                  $product["fk_emp_id"] = $row11["fk_emp_id"];
                  array_push($response["payment"], $product);
            }
         
          $result2= mysql_query("SELECT * FROM  `tbl_expense_entry` WHERE 
	                        AND `exp_entry_date`='".$reading_date."'
	                         AND `fk_emp_id`='".$_REQUEST['fk_emp_id']."'
	                          ");
        
                     if (mysql_num_rows($result2) > 0)
                     {
                         while($row12 = mysql_fetch_array($result1)) 
            	        {
                    
                         
                        // $product["exp_entry_id"] = $row12["exp_entry_id"];
                       
                        // $product["fk_exp_id"] = $row12["fk_exp_id"];
                        
                        $totalexp = $exp+$row12["expense_amount"];
                        
                     
                        // $product["exp_entry_date"] = $row12["exp_entry_date"];
                        // $product["fk_emp_id"] = $row12["fk_emp_id"];
                        
                  
             
                        array_push($response["expense"], $product);
            	        }
                     }
	            }
	    }
	   }
	  
        else
        {
        
        	        $response["Sucess"] = "Record Not Found";
        
        }
	        
                	        
	echo json_encode($response); 


}
	 ?>
	
	
	 
		
			

Zerion Mini Shell 1.0