Added InvoiceJob

This commit is contained in:
Frank Schubert
2024-08-29 14:51:37 +02:00
parent 248013423d
commit 1ed2dddb97
13 changed files with 1051 additions and 30 deletions
+6
View File
@@ -50,6 +50,12 @@ class FronkDB {
$this->query("SET NAMES utf8mb4");
}
}
public function reconnect() {
$this->instances = [];
$this->link = false;
$this->connect();
}
public function disconnect() {
if($this->link) {
+10 -1
View File
@@ -39,7 +39,12 @@ class mfBaseController
if (!defined('MFUSELOGIN')) define('MFUSELOGIN', false);
if (!defined('MFUSEMENU')) define('MFUSEMENU', false);
if (MFUSELOGIN) {
$nologin = false;
if(defined("MFBASE_BYPASS_LOGIN")) {
$nologin = MFBASE_BYPASS_LOGIN;
}
if (MFUSELOGIN && !$nologin) {
// if protected area and not logged in, redirect to mfLogin
if ($this->needlogin == true) {
if (!mfLoginController::isLoggedIn()) {
@@ -138,6 +143,10 @@ class mfBaseController
}
public function reconnectDB() {
$this->db()->reconnect();
}
public function __call($name, $params)
{
$methodname = false;
+8 -1
View File
@@ -32,7 +32,7 @@ class mfBaseModel {
* Takes ID or DB row as arguments
* @param id or table row $_
*/
public function __construct($_ = NULL) {
public function __construct($_ = NULL, $new_db_connection = false) {
$this->log = mfLoghandler::singleton();
$this->table = get_class($this);
$this->data = new stdClass();
@@ -46,6 +46,9 @@ class mfBaseModel {
if(FRONKDB) {
$this->db = FronkDB::singleton();
if($new_db_connection) {
$this->db->reconnect();
}
}
if(method_exists($this, "init")) {
@@ -59,6 +62,10 @@ class mfBaseModel {
}
}
public function reconnectDB() {
$this->db->reconnect();
}
public function load($row) {
if(!is_object($this->data)) {
$this->data = new stdClass();