<?php

    $staff_id =  $_POST["sid"];
    //include 'common/connection.php';
    $servername = "localhost";
    $username = "finstech_sales";
    $password = "SalesApp@123";
    $dbname = "finstech_salesapp";
    
    
    try {
        $conn = mysqli_connect($servername,$username,$password,$dbname);
        if(!$conn)
        {
            trigger_error('Could not Connect' .mysqli_connect_error());
        }
        $sql = "select master_documents.doc_id,master_documents.shop_id,master_documents.doc_type,master_documents.added_on, master_shop.shop_name 
        from master_documents, master_shop 
        where master_documents.staff_id=$staff_id and master_shop.shop_id = master_documents.shop_id"; echo $sql;
        $result = mysqli_query($conn, $sql);
        $array = array();
        while($row=mysqli_fetch_assoc($result))
        {
            echo $row;
            //$array[] = $row;
        }
        //echo'{"docs":'.json_encode($array).'}'; 
        $conn = null;
    }catch(PDOException $e) {
        echo $sql . "err" . $e->getMessage();
    }
    $pdo = null;
    
?>