-
Notifications
You must be signed in to change notification settings - Fork 0
/
unlockWallet.php
executable file
·62 lines (51 loc) · 1.9 KB
/
unlockWallet.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
57
58
59
60
61
62
<?php
ob_start();
include 'checkUser.php';
if (!canEdit()){
header('Location: ./consult.php');
exit();
}
include 'connectionFactory.php';
$mysqli= ConnectionFactory::GetConnection();
$pid=$_GET['id'];
$add=$_GET['add'];
$validation = isset($_GET['inv'])?0:1;
//echo $validation.'<br/>';
// insert address
$query = 'UPDATE Reg_Wallet SET Validated=?, valid_date=now() WHERE address=? and PersonId=? ';
$stmt = $mysqli->prepare($query);
$stmt->bind_param("isi",$validation,$add,$pid);
$stmt->execute();
$stmt->close();
if($validation){
// get data
$query_data = 'SELECT
Reg_Person.Email,
Reg_Person.RecordTypeId,
Reg_Wallet.Currency,
Reg_Individual.FirstName,
Reg_Individual.LastName,
Reg_Legal.Name,
Reg_Legal.Contact,
Reg_Legal.ContactSurname
FROM Reg_Person
LEFT OUTER JOIN Reg_Individual on Reg_Individual.Id=Reg_Person.Id
LEFT OUTER JOIN Reg_Legal on Reg_Legal.Id=Reg_Person.Id
LEFT OUTER JOIN Reg_Wallet on Reg_Wallet.PersonId=Reg_Person.Id AND address=?
WHERE Reg_Person.Id = ?';
$stmt = $mysqli->prepare($query_data);
$stmt->bind_param("si",$add, $pid);
$stmt->bind_result($mail, $type, $currency, $ind_first, $ind_last, $leg_name, $leg_c_last, $leg_c_first);
$stmt->execute();
$stmt->fetch();
$stmt->close();
$full_name = "".$ind_first;
if ($type == 1) {
$full_name = "".$leg_name;
}
include 'p_mail.php';
sendUnlockingMail($mail, $add, $full_name, $type, $currency);
}
header('Location: ./consultPerson.php?id='.$pid);
exit();
?>