403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.208
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/proc/thread-self/cwd/wp-content/plugins_old/dhtmlxspreadsheet/codebase/php/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/proc/thread-self/cwd/wp-content/plugins_old/dhtmlxspreadsheet/codebase/php/db_oracle.php
<?php

/**
 (c) DHTMLX Ltd, 2011
 Licensing: You allowed to use this component for free under GPL or you need to obtain Commercial/Enterprise license to use it in non-GPL project
 Contact: sales@dhtmlx.com
 **/



/*
	@author dhtmlx.com
	@license GPL, see license.txt
*/
require_once("db_common.php");
/*! Implementation of DataWrapper for Oracle
**/
class OracleDBDataWrapper extends DBDataWrapper{
	private $last_id=""; //id of previously inserted record
	private $insert_operation=false; //flag of insert operation
	
	public function query($sql){
		LogMaster::log($sql);
		$stm = oci_parse($this->connection,$sql);
		if ($stm===false) throw new Exception("Oracle - sql parsing failed\n".oci_error($this->connection));
		
		$out = array(0=>null);
		if($this->insert_operation){
			oci_bind_by_name($stm,":outID",$out[0],999);
			$this->insert_operation=false;
		}
		
		
		$mode = ($this->is_record_transaction() || $this->is_global_transaction())?OCI_DEFAULT:OCI_COMMIT_ON_SUCCESS;
		$res=oci_execute($stm,$mode);
		if ($res===false) throw new Exception("Oracle - sql execution failed\n".oci_error($this->connection));
		
		$this->last_id=$out[0];
		
		return $stm;
	}
	
	public function get_next($res){
		$data = oci_fetch_assoc($res);
		if ($data){
			if (array_key_exists("VALUE",$data))
				$data["value"]=$data["VALUE"];
			if (array_key_exists("LABEL",$data))
				$data["label"]=$data["LABEL"];
		}
		
		return $data;
	}
	
	protected function get_new_id(){
		/*
		Oracle doesn't support identity or auto-increment fields
		Insert SQL returns new ID value, which stored in last_id field
		*/
		return $this->last_id;
	}
	
	protected function insert_query($data,$request){
		$sql = parent::insert_query($data,$request);
		$this->insert_operation=true;
		return $sql." returning ".$this->config->id["db_name"]." into :outID";
	}		
	
	protected function select_query($select,$from,$where,$sort,$start,$count){
		if (!$from)
			return $select;
			
		$sql="SELECT ".$select." FROM ".$from;
		if ($where) $sql.=" WHERE ".$where;
		if ($sort) $sql.=" ORDER BY ".$sort;
		if ($start || $count) 
			$sql="SELECT * FROM ( select /*+ FIRST_ROWS(".$count.")*/dhx_table.*, ROWNUM rnum FROM (".$sql.") dhx_table where ROWNUM <= ".($count+$start)." ) where rnum >".$start;
		return $sql;
	}

	public function escape($data){
		/*
		as far as I can see the only way to escape data is by using oci_bind_by_name
		while it is neat solution in common case, it conflicts with existing SQL building logic
		fallback to simple escaping
		*/
		return str_replace("'","''",$data);
	}
	
	public function begin_transaction(){
		//auto-start of transaction
	}
	public function commit_transaction(){
		oci_commit($this->connection);
	}
	public function rollback_transaction(){
		oci_rollback($this->connection);
	}	
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit