<?php

// Created by Ibrohimjon Ahmadjonov Ilhomjon o'g'li on 09.02.2020
 
require "connect.php"; 

$us_id = $_GET['us_id'];     
$dok_id = $_GET['dok_id'];              
$tov_id = $_GET['tov_id'];              
$tov_nomi = $_GET['tov_nomi'];              
$soni = $_GET['soni'];              
$narxi = $_GET['narxi'];              
$qaysi = $_GET['qaysi'];              
$doc_turi = $_GET['doc_turi'];              
$vaqti = $_GET['vaqti'];              
$z_raqam = $_GET['z_raqam'];              

if($doc_turi == ""){
    $doc_turi = "0";
}

$arr = preg_split("/[_,\- ]+/", $z_raqam);

mysqli_set_charset($conn,"utf8");

$mysql_qry = "INSERT INTO zakazlar (user_id,dokon_id,tovar_id,tovar_nomi,soni,narxi,naqd_per,vaqti,zakaz_raqam, zakaz_int, doc_turi) VALUES ('$us_id','$dok_id','$tov_id','$tov_nomi','$soni','$narxi','$qaysi','$vaqti','$z_raqam','$arr[0]','$doc_turi')";

if($conn->query($mysql_qry) == TRUE){
	echo 'ok';
} else {
	echo 'no';
}

$conn->close();
?>
