diff --git a/html/pages/about.inc.php b/html/pages/about.inc.php
index 6df610abec..d65c1b6936 100644
--- a/html/pages/about.inc.php
+++ b/html/pages/about.inc.php
@@ -38,29 +38,29 @@ along with this program. If not, see htt
");
$i=1;
- while ($bill = mysql_fetch_assoc($query))
+ foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill)
{
#echo("
");
#print_r($permissions);
diff --git a/html/pages/customers.inc.php b/html/pages/customers.inc.php
index fd9c5cd5b6..4dc274c561 100644
--- a/html/pages/customers.inc.php
+++ b/html/pages/customers.inc.php
@@ -1,8 +1,5 @@
");
echo("
@@ -19,7 +16,7 @@ echo("
$i = 1;
-while ($customer = mysql_fetch_assoc($cust_query))
+foreach (dbFetchRows("SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' GROUP BY `port_descr_descr` ORDER BY `port_descr_descr`") as $customer)
{
$i++;
@@ -72,4 +69,4 @@ while ($customer = mysql_fetch_assoc($cust_query))
echo("
");
-?>
\ No newline at end of file
+?>
diff --git a/html/pages/pseudowires.inc.php b/html/pages/pseudowires.inc.php
index 637b74bc3d..3f0e49f05b 100644
--- a/html/pages/pseudowires.inc.php
+++ b/html/pages/pseudowires.inc.php
@@ -12,10 +12,7 @@ list($opta, $optb, $optc, $optd, $opte) = explode("/", $_GET['opta']);
echo("
");
-$sql = "SELECT * FROM pseudowires AS P, ports AS I, devices AS D WHERE P.interface_id = I.interface_id AND I.device_id = D.device_id ORDER BY D.hostname,I.ifDescr";
-$query = mysql_query($sql);
-
-while ($pw_a = mysql_fetch_assoc($query))
+foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D WHERE P.interface_id = I.interface_id AND I.device_id = D.device_id ORDER BY D.hostname,I.ifDescr") as $pw_a)
{
$i = 0;
while ($i < count($linkdone))
@@ -25,10 +22,8 @@ while ($pw_a = mysql_fetch_assoc($query))
$i++;
}
- $pw_b = mysql_fetch_assoc(mysql_query("SELECT * from `devices` AS D, `ports` AS I, `pseudowires` AS P WHERE D.device_id = '".$pw_a['peer_device_id']."' AND
- D.device_id = I.device_id AND
- P.cpwVcID = '".$pw_a['cpwVcID']."' AND
- P.interface_id = I.interface_id"));
+ $pw_b = dbFetchRow("SELECT * from `devices` AS D, `ports` AS I, `pseudowires` AS P WHERE D.device_id = ? AND D.device_id = I.device_id
+ AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pw_a['peer_device_id'], $pw_a['cpwVcID']));
if (!port_permitted($pw_a['interface_id'])) { $skip = "yes"; }
if (!port_permitted($pw_b['interface_id'])) { $skip = "yes"; }
@@ -88,4 +83,4 @@ while ($pw_a = mysql_fetch_assoc($query))
echo("
");
-?>
\ No newline at end of file
+?>
diff --git a/html/pages/purgeports.inc.php b/html/pages/purgeports.inc.php
index 462a17b0ac..200bfd8db7 100644
--- a/html/pages/purgeports.inc.php
+++ b/html/pages/purgeports.inc.php
@@ -1,46 +1,10 @@
Deleting IPv4 address " . $ipaddr['addr'] . "/" . $ipaddr['cidr']);
- mysql_query("DELETE FROM addr WHERE id = '".$addr['id']."'");
- echo("");
- }
-
- $ip6addr = mysql_query("SELECT * FROM `ip6addr` WHERE `interface_id` = '$interface_id'");
- while ($ip6addr = mysql_fetch_assoc($ip6addrs))
- {
- echo("
Deleting IPv6 address " . $ip6addr['ip6_comp_addr'] . "/" . $ip6addr['ip6_prefixlen']);
- mysql_query("DELETE FROM ip6addr WHERE ip6_addr_id = '".$ip6addr['ip6_addr_id']."'");
- echo("
");
- }
-
- $ip6addr = mysql_query("SELECT * FROM `ip6addr` WHERE `interface_id` = '$interface_id'");
- while ($ip6addr = mysql_fetch_assoc($ip6addrs))
- {
- echo("
Deleting IPv6 address " . $ip6addr['ip6_comp_addr'] . "/" . $ip6addr['ip6_prefixlen']);
- mysql_query("DELETE FROM ip6addr WHERE ip6_addr_id = '".$ip6addr['ip6_addr_id']."'");
- echo("
");
- }
-
- mysql_query("DELETE FROM `pseudowires` WHERE `interface_id` = '$interface_id'");
- mysql_query("DELETE FROM `mac_accounting` WHERE `interface_id` = '$interface_id'");
- mysql_query("DELETE FROM `links` WHERE `local_interface_id` = '$interface_id'");
- mysql_query("DELETE FROM `links` WHERE `remote_interface_id` = '$interface_id'");
- mysql_query("DELETE FROM `ports_perms` WHERE `interface_id` = '$interface_id'");
- mysql_query("DELETE FROM `ports` WHERE `interface_id` = '$interface_id'");
-}
-
-$ports = mysql_query("SELECT * FROM `ports` WHERE `deleted` = '1'");
-while ($port = mysql_fetch_assoc($ports))
+foreach (dbFetchRows("SELECT * FROM `ports` WHERE `deleted` = '1'") as $port)
{
echo("