'; echo ''; if ($update) { echo ''; } } // ========== 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[':title'] = gpc_get_string($_POST, 'title'); $id = db_exec_insert('checklist', $p); $action = ACT_VIEW; break; case 'update': $p[':title'] = gpc_get_string($_POST, 'title'); $p[':clstate'] = gpc_get_string($_POST, 'clstate'); $p[':clid'] = $id; db_exec_update('checklist', $p, 'clid'); $action = ACT_VIEW; break; case 'delete': $action = ACT_DEFAULT; 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 "
| # | =_('Title')?> | =_('State')?> | ', $row['clid'], " | \n"; echo '', $row['title'], " | \n"; echo '', $row['clstate'], " | \n"; form_action_buttons($g_scriptname, $row['clid']); echo "\n"; } // Table summary echo "\n"; echo '
|---|---|---|---|---|---|
| ', sprintf(_('%d records'), count($res)), ' | |||||
', _('Unknown function call: Please report to system development!'), "
\n"; endif; // $action == ... // ========== END OF VARIANTS ================================================= include 'footer.php';