  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                อยากได้รายงานออกมาตามรูปครับผมไม่ทราบว่าต้องเขียงอย่างไร 
 
  
 
 
Code 
 
Code (PHP) 
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<?php
require_once("dbconnect.php");
require_once("pagination_function.php");
session_name('LoginForm');
@session_start();
error_reporting(0);
include("config.php");
 //echo $_SESSION['user_info']['levels']
$suser = $_SESSION['user_info']['id'] ;
$ssu = $_SESSION['user_info']['levels'] ;
//echo "$suser" ;
//echo "$ssu" ;
 if($ssu == "")
 	{
    header( "location: index.php" );
    exit(0);
  	}
?>
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" >
    <style type="text/css">
        html{
            font-family:tahoma, Arial,"Times New Roman";
            font-size:14px;
        }
        body{
            font-family:tahoma, Arial,"Times New Roman";
            font-size:14px;
        }
        .margin_top_5{
            margin-top: 5px;
        }
    </style>
<div class="table-responsive-sm">
<table class="table table-bordered table-striped table-hover table-sm">
  <thead >
    <tr class="table-primary">
      <th class="text-left" scope="col" >Date</th>
      <th class="text-left" scope="col" >Stock Sale</th>
	    <th class="text-left" scope="col">Stock inventory</th>
    </tr>
  </thead>
  <tbody>
<?php
//echo "$ssu";
$num = 0;
  $sql = "
  SELECT *, sum(allqualitys) as sumPQ FROM tb_orders WHERE 1
  ";
//////////////////// MORE QUERY
$result=$mysqli->query($sql);
$total=$result->num_rows;
$e_page=30; // ¡Ó˹´ ¨Ó¹Ç¹ÃÒ¡Ò÷ÕèáÊ´§ã¹áµèÅÐ˹éÒ
$step_num=0;
if(!isset($_GET['page']) || (isset($_GET['page']) && $_GET['page']==1)){
    $_GET['page']=1;
    $step_num=0;
    $s_page = 0;
}else{
    $s_page = $_GET['page']-1;
    $step_num=$_GET['page']-1;
    $s_page = $s_page*$e_page;
}
$sql.=" GROUP BY ordates ORDER BY ID DESC LIMIT ".$s_page.",$e_page";
$result=$mysqli->query($sql);
if($result && $result->num_rows>0){  // ¤ÔÇÃÕè¢éÍÁÙÅÊÓàÃç¨ËÃ×ÍäÁè áÅÐÁÕÃÒ¡ÒâéÍÁÙÅËÃ×ÍäÁè
    while($row = $result->fetch_assoc()){ // ǹÅÙ»áÊ´§ÃÒ¡ÒÃ
        $num++;
?>
    <tr>
      <td class="text-left" ><?=$row['ordates']?></td>
	    <td class="text-left" ><?=$row['sumPQ']?></td>
      <td class="text-left" ><?
    //$row['imps_ads']
    $con = mysqli_connect('localhost','cp603386_addwara','jaya2554','cp603386_orderwara');
    //$ddm = $row['date_ads'];
    //echo "$ddm";
    //echo "<BR>";
      $query = "SELECT *, sum(pur_num) as sumPPQ from tb_purchese  GROUP BY pur_product ";
       $exec = mysqli_query($con,$query);
       while($rows = mysqli_fetch_array($exec)){
//echo $row['sumPPQ'];
$ap = $rows['sumPPQ'];
$pp = $row['sumPQ'] ;
$aapp = $ap-$pp;
echo "$aapp";
        }
      ?></td>
	</tr>
<?php
    }
}
?>
  </tbody>
</table>
</div>
<script language="JavaScript">
	function ClickCheckAll(vol)
	{
		var i=1;
		for(i=1;i<=document.frmMain.hdnCount.value;i++)
		{
			if(vol.checked == true)
			{
				eval("document.frmMain.chkprint"+i+".checked=true");
			}
			else
			{
				eval("document.frmMain.chkprint"+i+".checked=false");
			}
		}
	}
</script>
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function(){
});
</script>
 
 
  Tag : PHP               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2019-05-05 09:31:52 | 
                      By :
                          sensaiya | 
                      View :
                          940 | 
                      Reply :
                          3 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |