Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <?php header('Content-Type: application/json');
  2.  
  3. include_once '../incluedes/conn_cms.php'; //sesion started in here
  4. //include_once 'cart.php';
  5. if(isset($_GET["size_id"],$_GET["fabric_id"],$_GET['prod_id'])){
  6.     $size_id=$_GET["size_id"] ;
  7.     $fabric_id=$_GET["fabric_id"] ;
  8.     $id   = $_GET['prod_id'];
  9.     //$prodname = 'product_'.$prod;
  10.  
  11.  
  12.  $query3 =" SELECT * FROM valores_almofadas
  13.            WHERE size='$size_id'
  14.            AND price_id ='$fabric_id'";
  15.  
  16.         $result = mysqli_query($conn,$query3);
  17.         while($rows = mysqli_fetch_assoc($result)){
  18.  
  19.             if($_SESSION['estado'] == 'SP'){
  20.               $ICMS = $rows['icms_7'];
  21.              }else{
  22.               $ICMS = $rows['icms_12'];
  23.              }
  24.              $_SESSION['icms'.$id]=$ICMS;
  25.            }
  26. }      
  27.         $value = $_SESSION['product_'.$id];
  28.         $return = new stdClass;
  29.         $return->cost = $_SESSION['icms'.$id];
  30.         $return->subtotal = number_format($value * $_SESSION['icms'.$id], 2, '.', '');
  31.        
  32.         die(json_encode($return));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement