forked from zunaidm/MoneyTransferSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreceive.php
More file actions
104 lines (89 loc) · 2.76 KB
/
receive.php
File metadata and controls
104 lines (89 loc) · 2.76 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php include 'config/Database.php' ?>
<?php
session_start();
if($_SESSION['type'] == 'admin'){
include 'inc/headeradmin.php';
}
else if($_SESSION['type'] == 'employee'){
include 'inc/headeremployee.php';
}
else
{
header("Location: "."index.php");
}
?>
<div class="desh-main-content">
<br>
<div class="title">
Receive Money
</div>
<?php
if($_SERVER["REQUEST_METHOD"]=="POST"){
$invcode = $_POST['invcode'];
$sentvcode = $_POST['sentvcode'];
$trxid = $_POST['trxid'];
$receivedby = $_SESSION['username'];
$rphone1 = $_POST['rphone1'];
$amount1 = $_POST['amount1'];
$db = new Database();
$receivedby = $_SESSION['username'];
if($invcode == $sentvcode ){
$upquery = "UPDATE money SET type = 'received' , receivedby = '$receivedby' WHERE trxid = '$trxid' ";
$upresult = $db->insert($upquery);
if($upresult){
echo "<div class='success'>Withdraw Successful !</div>";
//SMS
require('textlocal.class.php');
$textlocal = new Textlocal('amarallmail@gmail.com', '3b98c30288b4a9bbfc067a1a4a3929');
$numbers = array($rphone1);
$sender = 'GET MONEY';
$message = 'Withdrawn '.$amount1.' TK Successful .';
$response = $textlocal->sendSms($numbers, $message, $sender);
//print_r($response);
//END SMS
}
else{
echo "<div class='error'>Withdraw Not Successful !</div>";
}
}
else
echo "<div class='error'>Verification Not Successful !</div>";
}
?>
<script type="text/javascript">
function rcvphncheck(){
var rphone = receive.rphone.value ;
var prtn = /^\+880[0-9]{10}/;
var testrphone = prtn.test(rphone);
if(!testrphone){
document.getElementById("rphneror").innerHTML = "Please give a valid Sender Phone With +88 !!";
return false;
}
document.getElementById("rphneror").innerHTML ="";
return true;
}
</script>
<div>
<div class="reg-container">
<form name="receive" action="receive1.php" method="POST">
<br><br><br><br><br><br>
<div>
<input type="text" name="rphone" placeholder="Receiver Phone Number" required onblur="rcvphncheck();">
</div>
<span id="rphneror" style="color:red"></span>
<div>
<input type="text" name="amount" placeholder="Amount" required>
</div>
<div>
<input type="text" name="pin" placeholder="Withdraw Pin" required>
</div>
<div>
<input type="hidden" name="vcode" value= <?php echo rand(1000,9999);?>>
</div>
<input type="submit" name="submit" value="Verify" class="btn-login" onclick="return rcvphncheck();">
</form>
</div>
</div>
</div>
</body>
</html>