<?php
session_start();

if ($_SESSION['company'] == "") { 
    exit("Please Login");
}
if ($_SESSION['CURRENT_USER'] == "") { 
    exit("Please Login");
}
require_once("connectioni.php");
 
$GLOBALS['hostname'] = 'localhost';	
$GLOBALS['username'] = 'coolmans_db';
$GLOBALS['password'] = 'e1E]0Mfua.0T4LL';
$GLOBALS['db'] = 'coolmans_pt2';
$GLOBALS['dbinvx'] = mysqli_connect($GLOBALS['hostname'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db']);
	
		$sql="select * from s_mas where BRAND_NAME !='Dag CustomeDag Customerr' and BRAND_NAME !='Dag Customer' and BRAND_NAME !='Dag Custormer' and BRAND_NAME !='Rebuild Customer' and BRAND_NAME !='Dag Sale' and BRAND_NAME !='rebuild sale' and BRAND_NAME !='Dag Customer'  "; 
	$result =mysqli_query($GLOBALS['dbinvx'],$sql) ; 
	while ($row = mysqli_fetch_array($result)){
	    
	    
            $sql2="select * from s_mas where STK_NO='".$row["STK_NO"]."' ";
            $result2 =mysqli_query($GLOBALS['dbinv'],$sql2) ; 
            $row2 = mysqli_fetch_array($result2);
            
            
        if($row2['QTYINHAND'] !=$row['QTYINHAND'] ){
           echo $row['STK_NO'].'    /   '. $row['QTYINHAND'].' ---- ' .  $row2['STK_NO'].'    /   '. $row2['QTYINHAND'].'<br>'; 
        }
		
		
// 	    $sql2 = mysqli_query($GLOBALS['dbinv'], "select * from s_mas where STK_NO='".$row["STK_NO"]."' and  QTYINHAND='".$row["QTYINHAND"]."'") or die(mysqli_error());
//         if ($row2 = mysqli_fetch_array($sql2)) {
             
            
            
//         }else{
            
//         	$sql2="select * from s_mas where STK_NO='".$row["STK_NO"]."' ";
// 			$result2 =mysqli_query($GLOBALS['dbinv'],$sql2) ; 
// 			$row2 = mysqli_fetch_array($result2);
			
//     //             $sql="update s_mas set  SELLING='".$row["SELLING"]."' where STK_NO='".$row["STK_NO"]."' ";ECHO $sql;
//     // 			$result =mysqli_query($GLOBALS['dbinv'],$sql) ; 
				
//           echo $row['STK_NO'].' - '.$row['SELLING'].' - '.$row2['SELLING'].'<br>';
//         }
        
        
				
		 
	}

?>