<?php
if(!isset($_SESSION)){ session_start(); } 
include 'load.php'; 
    if(isset($_POST['productid'])){
       $data = array();
       $productid = $_POST['productid'];
       $productinfo = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM mobileproducts WHERE prid='$productid'"));

       $data[0] = $productinfo['price'];
       $stockinfo = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM tbl_stock WHERE prid='$productid'"));
       $data[1] = $stockinfo['qty'];

      echo json_encode($data);
    
    }

    if(isset($_POST['key'])){
        $key = $_POST['key'];
        unset($_SESSION['quotation'][$key]);
    }
    

?>