-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditcontact1.php
executable file
·61 lines (46 loc) · 1.76 KB
/
editcontact1.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
<?php session_start();
include('db_config.php');
if ($_POST["editdata"] == "Update"){
$sql = "select licenseclassid from ospotasettings";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$licenseclassid = $row["licenseclassid"];
}
$sql = "select sysbandsid from sysbands where band = '" . strtoupper($_POST['band']) . "' and licenseclassid = " . $licenseclassid . " and mode =1";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$sysbandsid = $row["sysbandsid"];
}
if (strtoupper($_POST["parkid"]) == ""){
$ospotaparkid = 76;
} else {
$sql = "select ospotaparkid from ospotaparks where parkid = '" . strtoupper($_POST["parkid"]) . "'";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$ospotaparkid = $row["ospotaparkid"];
}
}
if (strtoupper($_POST["stateabrv"]) == ""){
$sysstatesid = 52;
} else {
$sql = "select sysstatesid from sysstates where stateabrv = '" . strtoupper($_POST["stateabrv"]) . "'";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$sysstatesid = $row["sysstatesid"];
}
}
$sql = "update ospotalog ";
$sql .= "set contactcallsign = '" . strtoupper($_POST['callsign']) . "', ";
$sql .= "parkid = " . $ospotaparkid . ", ";
$sql .= "bandid = " . $sysbandsid . ", ";
$sql .= "stateid = " . $sysstatesid . " ";
$sql .= "where contactid = " . $_SESSION["contactid"];
$conn->query($sql);
header("location: index.php");
} else {
$sql = "delete from ospotalog where contactid = " . $_SESSION["contactid"];
$conn->query($sql);
header("location: index.php");
}
header("location: index.php");
?>