<?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'];              
$vaqti = $_GET['vaqti'];              
$z_raqam = $_GET['z_raqam'];              

$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) VALUES ('$us_id','$dok_id','$tov_id','$tov_nomi','$soni','$narxi','$qaysi','$vaqti','$z_raqam','$arr[0]')";

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

$conn->close();
?>
