<?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"];
    $date = date("Y-m-d");

    //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 = "insert into master_staff (name,mobile,place,assigned_pincode,address_line1,address_line2,address_line3,added_on,shop_id) 
                values('$staff_name','$mobile','$place',$pincode,'$address_line1','$address_line2','$address_line3','$date','$shop_id')";
      $conn->exec($sql);
      echo "Success";
    } catch(PDOException $e) {
      echo $sql . "<br>" . $e->getMessage();
    }
    $conn = null;
    
?>