From 02608271bb2a9f3a65ed536984d306ee14b48e34 Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Sun, 12 Jul 2026 15:51:52 +0300 Subject: initialize repository; add docker config; migrate configuration to new specs --- public/ui-search.php | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 public/ui-search.php (limited to 'public/ui-search.php') diff --git a/public/ui-search.php b/public/ui-search.php new file mode 100644 index 0000000..1a9b8ab --- /dev/null +++ b/public/ui-search.php @@ -0,0 +1,373 @@ + ccode [ certain id: ##.## --or-- 0 = any id ] +//////////////////////////////////////////////////////////////////////////////// + +$doSearch = false; // shall not do a search (if no search arguments passes) + +$totals = get_totals(); // get totals of categories + +if ((isset($_GET['id'])) && (mb_strlen($_GET['id']) < 6)) { + $ccid = $_GET['id']; // category id passed + $doSearch = true; +} + + +// get records +// ----------------------------------------------------------------------------- + + if ($doSearch) { + + $items = array(); + + // init database connection + $_dbc = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DBMS); + if ($_dbc->connect_errno) { + echo "Database connection failed; Please try in a few minutes. "; + if (TESTING) echo $_dbc->connect_error; + $_dbc->close(); die(); + } + $_dbc->set_charset("utf8"); + + // prepare statemet + if ($ccid != '0') { + $_stm = $_dbc->prepare("SELECT id, img, ccode, identity, summary, operator, `timestamp` FROM items WHERE ccode = ?"); + $_stm->bind_param("s", $ccid); + } + else { + $_stm = $_dbc->prepare("SELECT id, img, ccode, identity, summary, operator, `timestamp` FROM items"); + } + $_stm->execute(); // execute query + $_stm->store_result(); // store result + + if ($_stm->num_rows) { + + $_stm->bind_result($id, $imgfile, $ccode, $idnt, $sum, $opr, $tm); // bind result variables + + while ($_stm->fetch()) { + + $it_id = explode('.', $idnt); + $items[] = array( + 'id' => $id, + 'ccode' => $ccode, + 'img' => ( (strlen($imgfile) > 9) ? ("/". UPLOAD_DIR . intdiv($id,FOLDER_CPC) ."/pi". $imgfile) : "" ), + 'identity' => $idnt, + 'itemid' => end($it_id), + 'totalitems' => $totals[$ccode], + 'summary' => $sum, + 'operator' => $opr, + 'timestamp' => local_dt($tm) + ); + + } + } + + $_stm->close(); // close statement + $_dbc->close(); // close connection + + } + + // Script Workflow: + // --------------------------------------------------------------------------- + // 1. read fields options + // 2. generate HTML + // 3. generate JS needed + + // the UI + // --------------------------------------------------------------------------- + // Fields are grouped in sections + // These sections presented in tabs (or accordion if mobile device) + // Two (2) sections incduded to inform the user of empty fields or errors + + // Libraries and FrameWorks used + // --------------------------------------------------------------------------- + // Bootstrap 4.3 is used for easy responsive HTML code + // JQuery 3.3 is used to handle user interation + // Select2 is used to make select-boxes (single or multiple) easier to use + + + // read fields options (json format) ///////////////////////////////////////// + // --------------------------------------------------------------------------- + // --- depricated: $formJSON = file_get_contents('config/kallassa.json'); + // --- $formJSON has been readed already on functions.php and being a global constant + $formARRAY = json_decode(FORMJSON); + + // Init strigns for JS generator (needed to handle everything) /////////////// + // --------------------------------------------------------------------------- + $checkFilledJS = ""; // JS for checking empty fields + $ref2Select2JS = ""; // references to Select2-controls Javascript + $initSelectsJS = ""; // js to initialize select fields (single or multiple) + +?> + + + + + + + + <?=PROJECT?> : Αναζήτηση Εγγραφών + + + + + + + + + + + + + +
+

Αναζήτηση Εγγραφών

+ +

Κριτήρια Αναζήτησης

+
+
+ +
+ + +
+ +
+
+
+ + + +

Αναζήτηση με κωδικό αντικειμένου:

+ + +
+ $record) : ?> +
+

Κωδικός Αντικειμένου : + Επεξεργασία + Προεπισκόπιση +

+ +
+ +
+ + + +
+ +
+
+ +
+ Κωδ.Εγγραφής : + + + id?> : tag?> + local == '') ? '' : '('. $cc->local .')' */ ?> + +
+
+ Τεμάχιο : / +
+
+ Αριθμός εισαγωγής : +
+
+ Χειριστής (καταγραφέας) : +
+
+ Ημερομηνία καταγραφής : +
+
+ Γενική περιγραφή : +
+ +
+
+ +
+ + +
+ + + + + Δεν βρέθηκαν αντικείμενα + + + + +
+
+ + + + + + + + + + + -- cgit v1.2.3