Exemplo n.º 1
0
</h1>

<?php 
$projectInst = new project();
if (!$loginInst->isCustomer()) {
    #######################################################################
    ## perform action
    $status = 1;
    if (tool::securePost('action') == "save" && tool::securePost('id')) {
        # fill project with submitted data
        $projectInst->id = tool::securePost('id');
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->update();
    } elseif (tool::securePost('action') == "save") {
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->insert();
    }
    if (tool::securePost('action') == "delete") {
        $projectInst->id = tool::securePost('id');
        $projectInst->delete();
    }
    if (tool::securePost('action') == "edit") {
        $status = 0;
        $projectInst->activate(tool::securePost('id'));
    }
    #######################################################################
    ## make edit / new form
    if (!$status) {
        echo "<h2>" . $lang['common_editRecord'] . " (<a href=\"" . $toolInst->encodeUrl("index.php?content=" . $content) . "\">" . $lang['common_newRecord'] . "</a>)</h2>\n";
    } else {
        $projectInst->clear();