vid, [0 => _('*** unassigned ***')]); // ========== ACTIONS START =================================================== switch ($submit = form_get_action()) { case NULL: break; case 'add': $action = ACT_ADD; break; case 'view': $action = ACT_VIEW; break; case 'edit': $action = ACT_EDIT; break; case 'del': $action = ACT_DELETE; break; case 'insert': $p[':vid'] = $user->vid; $p[':eid'] = gpc_get_int($_POST, 'eid'); $p[':activities'] = gpc_get_string($_POST, 'activities', 80); $id = db_exec_insert('maintenance', $p); $action = ACT_VIEW; break; case 'update': $p[':maintid'] = $id; $p[':eid'] = gpc_get_int($_POST, 'eid'); $p[':activities'] = gpc_get_string($_POST, 'activities', 80); $p[':remarks'] = gpc_get_string($_POST, 'remarks', 150); db_exec_update('maintenance', $p, 'maintid'); $action = ACT_VIEW; break; case 'delete': break; default: $g_error->Add(sprintf(_("Unknown function '%s'!"), $submit)); $valid = FALSE; } // ========== ACTIONS END ===================================================== require 'header.php'; // ========== PAGE CONTENT ==================================================== if ($action == ACT_DEFAULT): // ========== VARIANT: default behavior ======================================= echo '