forked from arjaylc/PLDT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateNode.php
30 lines (28 loc) · 1.33 KB
/
updateNode.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
<?php
require_once('includes/database_master.inc.php');
require_once('includes/session_master.inc.php');
require_once('includes/page_master.inc.php');
$database_master = new DatabaseMaster();
$page_master = new PageMaster();
$session_master = new SessionMaster();
$cabinetNo = $_POST['cabinetNo'];
$nodeName = $_POST['nodeName'];
$nodeType = $_POST['nodeType'];
$sinNumber = $_POST['sinNumber'];
$ElectricMeterNo = $_POST['ElectricMeterNo'];
$office = $_POST['office'];
$nodeLocation = $_POST['nodelocation'];
$cabinetNo = $database_master->escapeString($cabinetNo);
$nodeName = $database_master->escapeString($nodeName);
$sinNumber = $database_master->escapeString($sinNumber);
$ElectricMeterNo = $database_master->escapeString($ElectricMeterNo);
$office = $database_master->escapeString($office);
$nodeLocation = $database_master->escapeString($nodeLocation);
$nodeName = $database_master->escapeString($nodeName);
$query = "UPDATE node SET nodeName='$nodeName', sinNo='$sinNumber', electricMeterNo='$ElectricMeterNo', node_type='$node_type', cabinetNo='$cabinetNo', central_officeName='$office', nodeLocation='$nodeLocation'
WHERE nodeName='$nodeName';";
if($database_master->queryUpdate($query)){
$page_master->redirectUser('index.php?add_node=success');
}
else $page_master->redirectUser('index.php?add_node=failed');
?>