/
latestRespond.php
78 lines (60 loc) · 1.96 KB
/
latestRespond.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
require "DBConnect.php";
$callid = $_POST['call'];
$rescue = $_POST['rescue'];
$utility = $_POST['utility'];
$brush = $_POST['brush'];
$latter = $_POST['latter'];
$tanker = $_POST['tanker'];
if(!empty($rescue)) {
foreach ($rescue as $value) {
$temp = (int) $value;
$sql = "INSERT INTO responded (`callid`, `ffid`, `type`) VALUES ('".$callid."','".$temp."', 'rescue')";
$retval = mysql_query( $sql);
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
}
}
if(!empty($utility)) {
foreach ($utility as $value) {
$temp = (int) $value;
$sql2 = "INSERT INTO responded (`callid`, `ffid`, `type`) VALUES ('".$callid."','".$temp."', 'utility')";
$retval = mysql_query( $sql2);
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
}
}
if(!empty($brush)) {
foreach ($brush as $value) {
$temp = (int) $value;
$sql3 = "INSERT INTO responded (`callid`, `ffid`, `type`) VALUES ('".$callid."','".$temp."', 'brush')";
$retval = mysql_query( $sql3);
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
}
}
if(!empty($latter)) {
foreach ($latter as $value) {
$temp = (int) $value;
$sql4 = "INSERT INTO responded (`callid`, `ffid`, `type`) VALUES ('".$callid."','".$temp."', 'latter')";
$retval = mysql_query( $sql4);
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
}
}
if(!empty($tanker)) {
foreach ($tanker as $value) {
$temp = (int) $value;
$sql5 = "INSERT INTO responded (`callid`, `ffid`, `type`) VALUES ('".$callid."','".$temp."', 'tanker')";
$retval = mysql_query( $sql5);
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
}
}
echo "call successfully entered"
?>