<?php

    $staff_name = $_POST["staff_name"];
    $mobile = $_POST["mobile"];
    $place = $_POST["place"];
    $pincode = $_POST["pincode"];
    $address_line1 = $_POST["address_line1"];
    $address_line2 = $_POST["address_line2"];
    $address_line3 = $_POST["address_line3"];
    $shop_id = $_POST["shop_id"];
    $sid = $_POST["sid"];

    //include 'common/connection.php';
    $servername = "localhost";
    $username = "finstech_sales";
    $password = "SalesApp@123";
    $dbname = "finstech_salesapp";

    try {
      $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
      $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $sql = "update master_staff set name='$staff_name',mobile='$mobile',place='$place',assigned_pincode=$pincode,address_line1='$address_line1',address_line2='$address_line2',address_line3='$address_line3', 
                shop_id='$shop_id' where staff_id= $sid";
      $conn->exec($sql);
      echo "Success";
    } catch(PDOException $e) {
      echo $sql . "<br>" . $e->getMessage();
    }
    $conn = null;
    
?>