diff --git a/db/mariadb.sql b/db/mariadb.sql index 69d7e18..3bfdfb9 100644 --- a/db/mariadb.sql +++ b/db/mariadb.sql @@ -137,6 +137,7 @@ CREATE TABLE equipment ( price decimal(12,2) DEFAULT NULL, weight float(5,2) UNSIGNED DEFAULT NULL, remarks varchar(150) DEFAULT NULL, + flags set('ordered','deleted') DEFAULT NULL, PRIMARY KEY(eid) ); diff --git a/webgui/documents.php b/webgui/documents.php index fb32aef..50f0899 100644 --- a/webgui/documents.php +++ b/webgui/documents.php @@ -1,7 +1,7 @@ $v) { query($sql); +foreach ($sth->fetchAll() as $row) { + if (!in_array($row['vid'], $vids)) { + $opt_vessel[$row['vid']] = $row['vesselname']; + } +} +?> +
+ + + + + +
+ $user->vid); -if ($flt->cat == -1) { - $w[] = 'ecat IS NULL'; -} elseif ($flt->cat > 0) { +if ($flt->cat > 0) { $w[] = 'ecat=:ecat'; $p[':ecat'] = $flt->cat; +} elseif ($flt->cat == -1) { + $w[] = 'ecat IS NULL'; } if ($flt->manuf > 0) { $w[] = 'manufacturer=:manuf'; $p[':manuf'] = $flt->manuf; +} elseif ($flt->manuf == -1) { + $w[] = 'manufacturer IS NULL'; } if ($flt->supp > 0) { $w[] = 'supplier=:supp'; $p[':supp'] = $flt->supp; +} elseif ($flt->supp == -1) { + $w[] = 'supplier IS NULL'; } if (strlen($flt->txt) > 1) { $w[] = '(ename LIKE :txt OR model LIKE :txt OR remarks LIKE :txt)'; @@ -216,7 +220,7 @@ if (strlen($flt->txt) > 1) { $where = join(' AND ', $w); $order = ' ORDER BY ename'; -// get total recond count for pagination and limit +// get total record count for pagination and limit $sth = $pdo->prepare("SELECT COUNT(*) FROM equipment WHERE " . $where); try { $sth->execute($p); @@ -379,7 +383,7 @@ echo '
'; prepare($sql); $sth->execute([$id]); diff --git a/webgui/index.php b/webgui/index.php index a43e27c..2478dc9 100644 --- a/webgui/index.php +++ b/webgui/index.php @@ -310,21 +310,21 @@ $sth = $pdo->prepare($sql); $sth->execute([$vid]); $res = $sth->fetchAll(PDO::FETCH_NUM); echo '', "\n"; -echo '"; +echo '"; foreach ($res as $row) { - echo "\n"; + echo "\n"; } // Boxes $sth = $pdo->prepare("SELECT COUNT(*) FROM box INNER JOIN storage USING (sid) WHERE vid=?"); $sth->execute([$user->vid]); -echo '\n"; +echo '\n"; // Equipment $sth = $pdo->prepare("SELECT COUNT(*) FROM equipment WHERE vid=?"); $sth->execute([$user->vid]); -echo '"; -echo '\n"; +echo '"; +echo '\n"; // Inventory // All items from vessel storage and all items from boxes in vessel storage @@ -337,8 +337,14 @@ $sth = $pdo->prepare($sql); $sth->bindValue(':vid', $user->vid, PDO::PARAM_INT); $sth->execute(); -echo '"; -echo '\n"; +echo '"; +echo '\n"; + +// Documents +$sth = $pdo->query("SELECT COUNT(*) FROM document"); +echo '"; +echo '\n"; + echo "
', _('Storage type') , "
', _('Storage type') , "
", $stype[$row[0]], "", $row[1], "
 ", $stype[$row[0]], "", $row[1], "
', _('Boxes'), '', $sth->fetchColumn(), "
 ', _('Boxes'), '', $sth->fetchColumn(), "
', _('Equipment') , "
', _('Count'), '', $sth->fetchColumn(), "
', _('Equipment') , "
 ', _('Count'), '', $sth->fetchColumn(), "
', _('Inventory') , "
', _('Count'), '', $sth->fetchColumn(), "
', _('Inventory') , "
 ', _('Count'), '', $sth->fetchColumn(), "
', _('Documents') , "
 ', _('Count'), '', $sth->fetchColumn(), "
\n"; diff --git a/webgui/projects.php b/webgui/projects.php index 77775cf..4a349bf 100644 --- a/webgui/projects.php +++ b/webgui/projects.php @@ -85,7 +85,7 @@ if ($action == ACT_DEFAULT): page_caption_search($pagetitle); -$sql = "SELECT projid, projname, startdate, duration, remarks " +$sql = "SELECT projid, projname, startdate, duration, projstate, remarks " . "FROM project " . "WHERE vid=? " . "ORDER BY projid"; @@ -98,6 +98,7 @@ echo ""; echo "" . _('Name') . ""; echo "" . _('Start date') . ""; echo "" . _('Duration') . ""; +echo "" . _('State') . ""; echo "" . _('Remarks') . ""; echo " "; echo "\n"; @@ -107,6 +108,7 @@ foreach ($res as $row) { echo "". $row['projname'] ."\n"; echo "". $row['startdate'] ."\n"; echo "". $row['duration'] ."\n"; + echo "". $row['projstate'] ."\n"; echo "". $row['remarks'] ."\n"; // Action buttons form_action_buttons($g_scriptname, $row['projid']); @@ -121,7 +123,7 @@ form_add_button($g_scriptname); echo "

", _('Generic Tasks'), "

\n"; echo "

", _('Tasks not assigned to any project'), "

\n"; -$sql = "SELECT taskid, taskname " +$sql = "SELECT taskid, taskname, taskstate " . "FROM task " . "WHERE vid=? AND projid IS NULL " . "ORDER BY taskid"; @@ -132,11 +134,13 @@ echo '', "\n"; echo "\n"; echo ""; echo ""; +echo ""; echo "\n"; echo "\n"; foreach ($res as $row) { echo "\n"; echo "\n"; + echo "\n"; form_action_buttons('task.php', $row['taskid']); echo "\n"; } diff --git a/webgui/search.php b/webgui/search.php index 7f9da9f..501e6e2 100644 --- a/webgui/search.php +++ b/webgui/search.php @@ -14,6 +14,8 @@ $needle = gpc_get_string($_REQUEST, 'needle', 40); require 'header.php'; echo "

$pagetitle

\n"; + + ?>
" . _('Name') . "" . _('State') . "
". $row['taskname'] ."". $row['taskstate'] ."