More webgui code improvements and some new vessel data
This commit is contained in:
1 parent
72571ede53
commit
3a43f749f5
13 files changed
+398
-306
No files matched your search
+22
-14
@@ -13,6 +13,9 @@ require 'lib/svg.inc';
|
||||
|
||||
$pagetitle = _('Start');
|
||||
|
||||
$opt_htype = db_load_enum('vessel', 'htype', true, true);
|
||||
$opt_vtype = db_get_options(DD_VESSEL_TYPE);
|
||||
|
||||
// ========== ACTIONS START ===================================================
|
||||
|
||||
switch ($submit = form_get_action()) {
|
||||
@@ -64,9 +67,10 @@ switch ($submit = form_get_action()) {
|
||||
break;
|
||||
}
|
||||
$p[':vid'] = gpc_get_int($_POST, 'id');
|
||||
// $p[':vtype'] = gpc_get_string($_POST, 'vtype');
|
||||
$p[':vesselname'] = gpc_get_string($_POST, 'vesselname');
|
||||
$p[':model'] = gpc_get_string($_POST, 'model');
|
||||
$p[':htype'] = gpc_get_enum($_POST, 'htype', $opt_htype, 'mono');
|
||||
$p[':vtype'] = gpc_get_int($_POST, 'vtype', NULL, -1);
|
||||
$p[':vesselname'] = gpc_get_string($_POST, 'vesselname', 40);
|
||||
$p[':model'] = gpc_get_string($_POST, 'model', 20);
|
||||
$p[':loa'] = gpc_get_float($_POST, 'loa');
|
||||
$p[':lwl'] = gpc_get_float($_POST, 'lwl');
|
||||
$p[':beam'] = gpc_get_float($_POST, 'beam');
|
||||
@@ -76,15 +80,10 @@ switch ($submit = form_get_action()) {
|
||||
$p[':ballast'] = gpc_get_int($_POST, 'ballast');
|
||||
$p[':beltpos_aft'] = gpc_get_float($_POST, 'beltpos_aft');
|
||||
$p[':beltpos_bow'] = gpc_get_float($_POST, 'beltpos_bow');
|
||||
$p[':shapefile'] = gpc_get_string($_POST, 'shapefile');
|
||||
if ($p[':shapefile'] == '-1') {
|
||||
$p[':shapefile'] = NULL;
|
||||
}
|
||||
$p[':shipyard'] = gpc_get_int($_POST, 'shipyard');
|
||||
if ($p[':shipyard'] == '-1') {
|
||||
$p[':shipyard'] = NULL;
|
||||
}
|
||||
$p[':shapefile'] = gpc_get_string($_POST, 'shapefile', 40, NULL, '-1');
|
||||
$p[':shipyard'] = gpc_get_int($_POST, 'shipyard', NULL, -1);
|
||||
$p[':year_built'] = gpc_get_int($_POST, 'year_built');
|
||||
$p[':hull_number'] = gpc_get_string($_POST, 'hull_number', 20);
|
||||
$p[':sid_default'] = gpc_get_uint($_POST, 'sid');
|
||||
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
|
||||
db_exec_update('vessel', $p, 'vid');
|
||||
@@ -531,9 +530,9 @@ foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
|
||||
$opt_shipyard[$row[0]] = $row[1];
|
||||
}
|
||||
|
||||
$sql = "SELECT vesselname, vtype, model, loa, lwl, beam, draught, draught_min,"
|
||||
$sql = "SELECT vesselname, vtype, htype, model, loa, lwl, beam, draught, draught_min,"
|
||||
. " displacement, ballast, beltpos_aft, beltpos_bow, shapefile,"
|
||||
. " shipyard, year_built, sid_default, remarks "
|
||||
. " shipyard, year_built, hull_number, sid_default, remarks "
|
||||
. "FROM vessel "
|
||||
. "WHERE vid=?";
|
||||
$sth = $pdo->prepare($sql);
|
||||
@@ -551,6 +550,9 @@ $vessel = $sth->fetch(PDO::FETCH_OBJ);
|
||||
<label for="model" class="form-label"><?=_('Model')?></label>
|
||||
<input type="text" class="form-control" id="model" name="model" value="<?=$vessel->model ?>">
|
||||
</div>
|
||||
<?php
|
||||
form_create_select('vtype', _('Vessel type'), $g_opt_unknown + $opt_vtype, $vessel->vtype);
|
||||
?>
|
||||
<div class="mb-3">
|
||||
<label for="year_built" class="form-label"><?=_('Year built')?></label>
|
||||
<input type="number" class="form-control" id="year_built" name="year_built" value="<?=$vessel->year_built ?>">
|
||||
@@ -596,10 +598,16 @@ $vessel = $sth->fetch(PDO::FETCH_OBJ);
|
||||
<label for="shapefile" class="form-label"><?=_('Shapefile')?></label>
|
||||
<input type="text" class="form-control" id="shapefile" name="shapefile" value="<?=$vessel->shapefile ?>">
|
||||
</div> */
|
||||
form_create_select('htype', _('Hull type'), $opt_htype, $vessel->htype);
|
||||
form_create_select('shapefile', _('Shape file'), $opt_shapefiles, $vessel->shapefile);
|
||||
form_create_select('shipyard', _('Shipyard'), $opt_shipyard, $vessel->shipyard);
|
||||
?>
|
||||
<div class="mb-3">
|
||||
<label for="hull_number" class="form-label"><?=_('Hull number')?></label>
|
||||
<input type="text" class="form-control" id="hull_number" name="hull_number" value="<?=$vessel->hull_number ?>">
|
||||
</div>
|
||||
<?php
|
||||
form_create_select('sid', _('Default Storage'), $g_opt_none + $opt_storage, $vessel->sid_default);
|
||||
|
||||
?>
|
||||
<div class="mb-3">
|
||||
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
|
||||
|
||||
Reference in new issue
Block a user