<?php
//mysql server
    $dbserver = "localhost";
    $dbuser = "root";
    $dbpass = "Gold@53743001";
    $dbname = "app";
    //$con =mysqli_connect($dbserver,$dbuser,$dbpass,$dbname);
    
    date_default_timezone_set('Asia/Taipei');
    echo date('Y-m-d H:i:s');
    $date= date("'Y-m-d H:i:s'");
    $pd_name= $_POST["Name"];
    $count= $_POST["Count"];
    $location= $_POST["Location"];
    //$img= $_POST["Img"];
    
    $con =mysqli_connect($dbserver,$dbuser,$dbpass,$dbname);
    if ($con->connect_error) {
    die("connect error: " . $con->connect_error);
    }
    if (empty($name).empty($job).empty($account).empty($password)){
      echo 'value :null';
    }else{
      $sql = "INSERT INTO `erp_app`(`Date`,`Name`, `Count`, `Location`) VALUES(now(),'$pd_name','$count','$location')";
      mysqli_query($con,$sql) or die(mysqli_error($con). "<hr/>Line:".__LINE__."br/>$sql");

      mysqli_close($con);
      echo 'OK';}
    //}else echo 'failed';
    //echo $data;
?>
