forked from Athtar42/oingo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
current.php
31 lines (28 loc) · 1008 Bytes
/
current.php
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
<?php
//update current time
session_start();
require_once("functions.php");
$server="localhost";
$db_username="root";
$db_password="";
$db_name="proj1";
$con=mysqli_connect($server, $db_username, $db_password, $db_name);
if(!$con)
{
die("can't connect".mysqli_error());
}
//if ((isset($_POST["userid"]))&&(isset($_POST["tag"]))&&(isset($_POST["starttime"]))&&(isset($_POST["endtime"]))&&(isset($_POST["startdate"]))&&(isset($_POST["enddate"]))&&(isset($_POST["repetition"]))&&(isset($_POST["Location"]))&&(isset($_POST["apply"])))
//{
$userid=$_SESSION['userid'];
$ctime=$_POST['currenttime'];
$lat=$_POST['lat'];
$lng=$_POST['lng'];
$clocation=$_POST['bLocation'];
$weekday=getweekday($ctime);
$sql="update current set cTime='$ctime', cWeekday='$weekday', cLongitude='$lng', cLatitude='$lat', cLocation='$clocation' where userID='$userid'";
$result=mysqli_query($con, $sql);
if($result)
{
echo "<script type='text/javascript'>alert('Update the current condition.');location='test.php';</script>";
}
?>