Webgui: user definable menu implemented
This commit is contained in:
+16
-2
@@ -72,6 +72,8 @@ switch ($submit = form_get_action()) {
|
||||
$p[':projname'] = gpc_get_string($_POST, 'projname');
|
||||
$p[':startdate'] = gpc_get_date($_POST, 'startdate');
|
||||
$p[':duration'] = gpc_get_int($_POST, 'duration');
|
||||
$p[':costs_plan'] = gpc_get_currency($_POST, 'costs_plan');
|
||||
$p[':costs_final'] = gpc_get_currency($_POST, 'costs_final');
|
||||
$p[':projstate'] = gpc_get_string($_POST, 'projstate');
|
||||
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
|
||||
db_exec_update('project', $p, 'projid');
|
||||
@@ -296,7 +298,8 @@ form_create_select('responsible', _('Responsible'), $opt_user, $project->respons
|
||||
elseif ($action == ACT_VIEW):
|
||||
// ========== VARIANT: view single record =====================================
|
||||
|
||||
$sql = "SELECT projname, startdate, duration, responsible, projstate, remarks "
|
||||
$sql = "SELECT projname, startdate, duration, responsible, projstate, "
|
||||
. " costs_plan, costs_final, remarks "
|
||||
. "FROM project "
|
||||
. "WHERE projid=?";
|
||||
$sth = $pdo->prepare($sql);
|
||||
@@ -308,6 +311,8 @@ echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", $project->
|
||||
echo '<tr><th scope="row">', _('Responsible'),"</th><td>", $opt_user[$project->responsible], "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('Start date'),"</th><td>", $project->startdate, "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('Duration'),"</th><td>", $project->duration, "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('Costs plan'),"</th><td>", format_currency($project->costs_plan), "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('Costs final'),"</th><td>", format_currency($project->costs_final), "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($project->projstate), "</td></tr>\n";
|
||||
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", nl2br($project->remarks), "</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
@@ -357,7 +362,8 @@ elseif ($action == ACT_EDIT):
|
||||
|
||||
echo '<h2>', _('Edit Project'), "</h2>\n";
|
||||
|
||||
$sql = "SELECT projname, responsible, startdate, duration, projstate, remarks "
|
||||
$sql = "SELECT projname, responsible, startdate, duration, projstate,"
|
||||
. " costs_plan, costs_final, remarks "
|
||||
. "FROM project "
|
||||
. "WHERE projid=?";
|
||||
$sth = $pdo->prepare($sql);
|
||||
@@ -382,6 +388,14 @@ form_create_select('responsible', _('Responsible'), $opt_user, $project->respons
|
||||
<label for="duration"><?=_('Duration, days')?></label>
|
||||
<input type="number" class="form-control" id="duration" name="duration" min="1" value="<?=$project->duration ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="costs_plan" class="form-label"><?=sprintf(_('Costs planned, %s'), $g_lconv['currency_symbol']); ?></label>
|
||||
<input type="text" class="form-control" id="costs_plan" name="costs_plan" value="<?=format_float($project->costs_plan) ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="costs_final" class="form-label"><?=sprintf(_('Costs final, %s'), $g_lconv['currency_symbol']); ?></label>
|
||||
<input type="text" class="form-control" id="costs_final" name="costs_final" value="<?=format_float($project->costs_final) ?>">
|
||||
</div>
|
||||
<?php
|
||||
form_create_select('projstate', _('Status'), $opt_state, $project->projstate);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user