-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathuserDetails.php
54 lines (45 loc) · 1.54 KB
/
userDetails.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include("init.php");//Includes all the necessary files
if($_SERVER['REQUEST_METHOD']=="POST"){
$messages=array();
$response=array();
$email=trim(clean($_POST['email']));
$sql= "SELECT * FROM alumnus WHERE email='$email'";
$result=query($sql);
if(row_count($result)==1){
$row=fetch_array($result);
$active=$row['active'];
if($active==1){
$messages['rollno']=$row['rollno'];
$messages['first_name']=$row['first_name'];
$messages['last_name']=$row['last_name'];
$messages['email']=$row['email'];
$messages['fb_link']=$row['fb_link'];
$messages['linkedin_link']=$row['linkedin_link'];
$messages['dob']=$row['dob'];
$messages['graduation_year']=$row['graduation_year'];
$messages['degree']=$row['degree'];
$messages['department']=$row['department'];
$messages['employment_type']=$row['employment_type'];
$messages['present_employer']=$row['present_employer'];
$messages['designation']=$row['designation'];
$messages['address']=$row['address'];
$messages['country']=$row['country'];
$messages['state']=$row['state'];
$messages['city']=$row['city'];
$messages['achievements']=$row['achievements'];
$messages['img_url']=$row['img_url'];
$response['status']=202;
$response['messages']=$messages;
}else{
$response['status']=402;
$messages[]="User Account Not verified";
}
}else{
$response['status']=402;
$messages[]="Failed to find user!";
}//End of query failed
//Sending the final response
$response['messages']=$messages;
echo json_encode($response);
}