[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 78/107: Purpose is to contain all the prepare
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 78/107: Purpose is to contain all the prepared query called from different locations |
Date: |
Mon, 26 Aug 2019 10:32:05 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 18486175c8775a421298ba13b6a6467a67dbc5e5
Author: Dany De Bontridder <address@hidden>
Date: Thu Aug 15 11:46:57 2019 +0200
Purpose is to contain all the prepared query called from different locations
---
include/class/prepared_query.class.php | 83 ++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
diff --git a/include/class/prepared_query.class.php
b/include/class/prepared_query.class.php
new file mode 100644
index 0000000..64b26af
--- /dev/null
+++ b/include/class/prepared_query.class.php
@@ -0,0 +1,83 @@
+<?php
+
+/*
+ * Copyright (C) 2019 Dany De Bontridder <address@hidden>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+/***
+ * @file
+ * @brief contains prepared query used in different classes of the application
+ *
+ *
+ */
+class Prepared_Query {
+ private $db; //!< Database connection
+
+ function __construct(Database $cn)
+ {
+ $this->db=$cn;
+ }
+
+ public function get_db()
+ {
+ return $this->db;
+ }
+
+ public function set_db($db)
+ {
+ $this->db=$db;
+ return $this;
+ }
+
+ /**
+ * Prepare the query for fetching the linked operation. ONE paramete is
needed : jrn.jr_id , returns all columns
+ * from the table PUBLIC.JRN, column qcode_bank (default card for fin
ledger) of the operation concerning
+ * to the payment
+ *
+ * @see export_ledger_pdf.php
+ * @see Acc_Ledger_History
+ *
+ */
+ public function prepare_reconcile_date()
+ {
+ $prepare=$this->db->is_prepare("reconcile_date");
+ if ($prepare==FALSE)
+ {
+ $this->db->prepare('reconcile_date',
+ 'select *
+ , (select ad_value from fiche_detail where ad_id=23
and f_id=jrn_def.jrn_def_bank ) as qcode_bank
+ from
+ jrn
+ join jrn_def on (jrn.jr_def_id=jrn_def.jrn_def_id)
+ where
+ jr_id in
+ (select
+ jra_concerned
+ from
+ jrn_rapt
+ where jr_id = $1
+ union all
+ select
+ jr_id
+ from jrn_rapt
+ where jra_concerned=$1)');
+ }
+ }
+
+
+}
- [Noalyss-commit] [noalyss] 50/107: Documentation : automatic format breaks doxygen tag, (continued)
- [Noalyss-commit] [noalyss] 50/107: Documentation : automatic format breaks doxygen tag, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 43/107: fixup! Code cleaning : split database into database (for noalyss) and databasecore , with the functions, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 65/107: Code cleaning : remove obsolete, and direct access to, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 74/107: New : manage_table_sql has new function (input_custom and display_row_custom) for handling special data, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 73/107: Cosmetic & bug fix for SELECT_BOX, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 28/107: Debug : add function tracedebug, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 32/107: Cosmetic : font new symbol Cosmetic : CSS padding for div.menu2 a.mtitle, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 58/107: javascript Add new function json_response, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 52/107: Adapt Unit Test, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 76/107: fixup! Improve message progress bar + translation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 78/107: Purpose is to contain all the prepared query called from different locations,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 83/107: Task#1734 New : Add PRINTTVA to have a summary of VAT by ledger, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 93/107: Documentation, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 92/107: Code : remove direct use of $_GET, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 39/107: Code cleaning : split database into database (for noalyss) and databasecore , with the functions, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 98/107: New :: function Icon_Action::tips for short comment New : Icon_Action::unlock, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 84/107: Task #1734 Upgrade patch for PRINTTVA, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 46/107: Code Cleaning split PDF into PDF_Core and PDF, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 105/107: fixup! New Task 1728: Aide à l'encodage - Journaux négatifs (note de crédit), Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 106/107: cosmetic, Dany De Bontridder, 2019/08/26
- [Noalyss-commit] [noalyss] 64/107: Add demo for fontello, Dany De Bontridder, 2019/08/26