database, "INSERT INTO service (servicecode, servicename, default_priority, max_priority) VALUES ('" . $_POST['servcode'] . "','" . $_POST['servname'] . "','" . $_POST['defprior'] . "','" . $_POST['maxprior'] . "')"); } if (isset($_POST['action']) && $_POST['action'] == 'Remove' && !empty($_POST['servcode'])) { pg_exec($this->database, "DELETE FROM service WHERE servicecode='" . $_POST['servcode'] . "'"); } if (isset($_GET['servcode'])) { echo "

Detailed information for service " . $_GET['servcode'] . "


\n"; if (isset($_POST['action']) && $_POST['action'] == 'Save Changes') { $qry = "UPDATE service SET servicename='" . $_POST['servname'] . "'"; $qry .= ", default_priority='" . $_POST['defprior'] . "'"; $qry .= ", max_priority='" . $_POST['maxprior'] . "'"; $qry .= " WHERE servicecode='" . $_GET['servcode'] . "'"; pg_exec($this->database, $qry); } $res = pg_exec($this->database, "SELECT * FROM service WHERE servicecode='" . $_GET['servcode'] . "'"); $srv = pg_fetch_object($res, 0); echo "
"; echo ""; echo ""; echo "
Service name
Default priority"; echo "
Maximum priority"; echo "
"; echo ""; echo "
"; } else { echo "

Service Administration


"; $res = pg_exec($this->database, "SELECT * FROM service ORDER BY servicecode"); echo ""; echo ""; $srv = 0; while ($srv < pg_numrows($res)) { $u = pg_fetch_object($res, $srv); ?> "; ?>

Create new service:

Service code: Service name: Default priority: Maximum priority:

Showpage(); ?>
Service codeNamePriorityMax priority

servicecode ?>
servicename ?> default_priority ?> max_priority ?>