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_postgre.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 PostgreSQL
**/
class PostgreDBDataWrapper extends DBDataWrapper{
	public function query($sql){
		LogMaster::log($sql);
		
		$res=pg_query($this->connection,$sql);
		if ($res===false) throw new Exception("Postgre - sql execution failed\n".pg_last_error($this->connection));
		
		return $res;
	}
	
	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.=" OFFSET ".$start." LIMIT ".$count;
		return $sql;
	}
		
	public function get_next($res){
		return pg_fetch_assoc($res);
	}
	
	protected function get_new_id(){
		$res  = pg_query( $this->connection, "SELECT LASTVAL() AS seq");
		$data = pg_fetch_assoc($res);
				pg_free_result($res);
		return $data['seq'];
	}
	
	public function escape($data){
		//need to use oci_bind_by_name
		return pg_escape_string($this->connection,$data);
	}

	public function tables_list() {
		$sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'";
		$res = pg_query($this->connection, $sql);
		$tables = array();
		while ($table = pg_fetch_assoc($res)) {
			$tables[] = $table['table_name'];
		}
		return $tables;
	}

	public function fields_list($table) {
		$sql = "SELECT * FROM information_schema.constraint_column_usage";
		$result = pg_query($this->connection, $sql);
		$field = pg_fetch_assoc($result);
		$id = $field['column_name'];

		$sql = "SELECT * FROM information_schema.columns WHERE table_name ='".$table."';";
		$result = pg_query($this->connection, $sql);
		$fields = array();
        $id = "";
		while ($field = pg_fetch_assoc($result)) {
		    $fields[] = $field["column_name"];
		}
		return array('fields' => $fields, 'key' => $id );
	}
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit