-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.php
More file actions
38 lines (31 loc) · 946 Bytes
/
time.php
File metadata and controls
38 lines (31 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// Database
include 'database.php';
$start = $_POST['start'];
$finish = $_POST['finish'];
$s_oy = explode('-',$start)[1];
$s_kun = explode('-',$start)[2];
$f_oy = explode('-',$finish)[1];
$f_kun = explode('-',$finish)[2];
$vaqt_oraliq = $s_kun .'.'. $s_oy .'-'. $f_kun .'.'. $f_oy;
$bomdod = $_POST['bomdod'];
$peshin = $_POST['peshin'];
$asr = $_POST['asr'];
$shom = $_POST['shom'];
$xufton = $_POST['xufton'];
$sql = "SELECT COUNT(*) FROM vaqtlar";
$count = $db->query($sql);
$row = $count->fetch_assoc();
$num = $row["COUNT(*)"];
if ($num > 0){
$db->query("UPDATE vaqtlar SET
vaqt_oraliq = '$vaqt_oraliq',
bomdod = '$bomdod',
peshin = '$peshin',
asr = '$asr',
shom = '$shom',
xufton = '$xufton'");
}else{
$db->query("INSERT INTO vaqtlar (vaqt_oraliq,bomdod,peshin,asr,shom,xufton) VALUES ('$vaqt_oraliq','$bomdod','$peshin','$asr','$shom','$xufton')");
}
header('location:vaqtlar.php?status=success');