-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayNowProcess.php
56 lines (43 loc) · 1.55 KB
/
payNowProcess.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
55
56
<?php
session_start();
require "connection.php";
if(isset($_SESSION["student"])){
$email = $_GET["email"];
$array;
function generateUniqId($startNum, $idLenght)
{
$uniqId = uniqid();
$newUniqId = substr($uniqId, intval($startNum), intval($idLenght));
return $newUniqId;
}
$billId = "bill_".generateUniqId(6,5);
$cityResultset = Database::search("SELECT * FROM `student_has_address` WHERE `student_email`='".$email."'");
$cityRownumber = $cityResultset->num_rows;
if($cityRownumber == 1){
$cityData = $cityResultset->fetch_assoc();
$cityId = $cityData["city_id"];
$address = $cityData["line1"].", ".$cityData["line2"];
$districtresultset = Database::search("SELECT * FROM `city` WHERE `id`='".$cityId."'");
$districtData = $districtresultset->fetch_assoc();
$amount = 2000;
$fname = $_SESSION["student"]["first_name"];
$lanme = $_SESSION["student"]["last_name"];
$mobile = $_SESSION["student"]["mobile"];
$studentAddress = $address;
$city = $districtData["name"];
$array["id"] = $billId;
$array["amount"] = $amount;
$array["first_name"] = $fname;
$array["last_name"] = $lanme;
$array["mobile"] = $mobile;
$array["address"] = $studentAddress;
$array["city"] = $city;
$array["email"] = $email;
echo(json_encode($array));
}else{
echo("2");
}
}else{
echo("1");
}
?>