Example #1
0
<?php

$actionID = $this->id();
Command::captureUrl();
if (TasksappValidator::checkInteger($actionID)) {
    $db = Database::getInstance();
    $inputArray = $db->getActionByActionID($actionID);
    $action = $inputArray[0];
} else {
    $action = new Action($_POST);
    if ($action->verifyActionData()) {
        $action->save();
        header("Location: " . Command::retrieveUrl());
        exit;
    }
}
$projectsArray = Command::getProjectList($action->client_id());
include_once '../views/showEditActionForm.php';
    if ($context == $action->context()) {
        print " selected>{$context}";
    } else {
        print ">{$context}";
    }
}
?>
</select>

</div>

<div class="formTable">
<span>project</span>
<select name="project_id">
<?php 
foreach (Command::getProjectList() as $id => $val) {
    print "<option value=\"{$id}\"";
    if ($id == $action->project_id()) {
        print " selected>{$val}";
    } else {
        print ">{$val}";
    }
}
?>
</select>
</div>

<div class="formTable">
<span>notes</span>
<textarea name="notes" rows="6" cols="74" class="textArea"><?php 
echo $action->notes();