Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/lib/internal/Customweb/Database/Driver/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/lib/internal/Customweb/Database/Driver/AbstractDriver.php
<?php 



abstract class Customweb_Database_Driver_AbstractDriver implements Customweb_Database_IDriver {
	
	private $transactionRunning = false;
	
	public function isTransactionRunning() {
		return $this->transactionRunning;
	}
	
	protected function setTransactionRunning($running) {
		if ($running) {
			$this->transactionRunning = true;
		}
		else {
			$this->transactionRunning = false;
		}
	}
	
	public function insert($tableName, $data){
		$sql = 'INSERT INTO ' . $tableName . ' SET ';
		$sql .= implode(',', $this->getDataPairs($data));
		$statement = $this->query($sql);
		$statement->setParameters($data);
		return $statement->getInsertId();
	}
	
	
	public function update($tableName, $data, $whereClause){
		$sql = 'UPDATE ' . $tableName . ' SET ';
		$sql .= implode(',', $this->getDataPairs($data));
		$sql .= $this->getWhereClause($whereClause);
		$statement = $this->query($sql);
		if (is_array($whereClause)) {
			$statement->setParameters(array_merge($data, $whereClause));
		}
		else {
			$statement->setParameters($data);
		}
		return $statement->getRowCount();
	}
	
	public function remove($tableName, $whereClause){
		$sql = 'DELETE FROM ' . $tableName . ' ';
		$sql .= $this->getWhereClause($whereClause);
		$statement = $this->query($sql);
		if (is_array($whereClause)) {
			$statement->setParameters($whereClause);
		}
		return $statement->getRowCount();
	}
	

	protected function getDataPairs($data) {
		return Customweb_Database_Util::getDataPairs($data);
	}
	
	protected function getWhereClause($whereClause) {
		return Customweb_Database_Util::getWhereClause($whereClause);
	}
	
}

Spamworldpro Mini