blob: 3404008eb36c44a6198459aa68f01b1f163d3e45 (
plain) (
blame)
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
|
<?php
if(isset($_SESSION['userid'])){
$sql = "select user.login, user.fullname, user.email, cities.name from"
." `user` left join cities on user.city=cities.cityid"
." where user.userid= :userid";
$user=Database::queryFirst($sql, array("userid"=> $_SESSION['userid']));
$ret = array(
"login"=>$user['login'],
"name"=>$user['fullname'],
"email"=>$user['email'],
"city"=>$user['name'],
"errormsg" => "",
"status" => "ok",
"msg" => "Get informations of user successful"
);
echo json_encode($ret);
}else{
echo json_encode(array(
"errormsg"=> "Not logged in",
"status" => "error",
"msg" => ""));
}
|