Example #1
0
require_once "Classes/view.class.php";
// html output increment
$OUTPUT = NULL;
// set the menu based on tables
$OUTPUT .= View::MenuTable($MODEL->Name_DB(), $MODEL->List_Table());
// set the table description (values)
if (isset($_GET['T'])) {
    $TAB = $MODEL->List_Values($_GET['T']);
    $TABLE = $MODEL->getCURRENTTABLE();
    $TITLES = $MODEL->getTITLES();
    $OUTPUT .= View::TABLE_DESCRIPTION($TABLE, $TAB, $TITLES);
}
// add a value in the selected table
if (isset($_POST['add'])) {
    unset($_POST['add']);
    $v = $MODEL->Add_Value($_POST);
    if ($v = true) {
        $OUTPUT .= View::Notice("Succes");
    } else {
        $OUTPUT .= View::Notice("Failure");
    }
}
// delete the selected value
if (isset($_GET['del']) && !empty($_GET['del'])) {
    $v = $MODEL->Delete_Value($_GET['del']);
    if ($v = true) {
        $OUTPUT .= View::Notice("Succes");
    } else {
        $OUTPUT .= View::Notice("Failure");
    }
}