コード例 #1
0
ファイル: oci.dbresultset.php プロジェクト: mdouchin/jelix
 public function fetch()
 {
     if ($this->_fetchMode == jDbConnection::FETCH_CLASS || $this->_fetchMode == jDbConnection::FETCH_INTO) {
         $res = oci_fetch_object($this->_idResult);
         if ($res) {
             $values = get_object_vars($res);
             $classObj = new $this->_fetchModeParam();
             foreach ($values as $k => $value) {
                 $attrName = strtolower($k);
                 $ociClassName = 'OCI-Lob';
                 // Check if we have a Lob, to read it correctly
                 if ($value instanceof $ociClassName) {
                     $classObj->{$attrName} = $value->read($value->size());
                 } else {
                     $classObj->{$attrName} = $value;
                 }
             }
             $res = $classObj;
         }
     } else {
         $res = oci_fetch_object($this->_idResult);
     }
     if ($res && count($this->modifier)) {
         foreach ($this->modifier as $m) {
             call_user_func_array($m, array($res, $this));
         }
     }
     return $res;
 }
コード例 #2
0
 public function fetch($stid)
 {
     $result = array();
     while (($data = oci_fetch_object($stid)) != false) {
         $result[] = $data;
     }
     return $result;
 }
コード例 #3
0
ファイル: sgbd_oracle.php プロジェクト: clavat/mkframework
 public function findOneSimple($tSql, $sClassRow)
 {
     $pRs = $this->query($this->bind($tSql));
     if (empty($pRs)) {
         return null;
     }
     $oRow = oci_fetch_object($pRs);
     return $oRow;
 }
コード例 #4
0
 function getUltimaRevisioVehicle($codi_vehicle)
 {
     $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
     $req = "SELECT \r\n\t\t\t\t\t\tdata_l, \r\n\t\t\t\t\t\tkms \r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t\trevisio \r\n\t\t\t\t\tWHERE codi IN ( \r\n\t\t\t\t\t\tselect max(rev.codi) \r\n\t\t\t\t\t\tfrom revisio rev \r\n\t\t\t\t\t\twhere rev.codi_vehicle = :codi_vehicle \r\n\t\t\t\t\t\tgroup by rev.codi_vehicle \r\n\t\t\t\t\t)";
     $stid = oci_parse($oci->getConnection(), $req);
     oci_bind_by_name($stid, ":codi_vehicle", $codi_vehicle);
     oci_execute($stid);
     $ultima = oci_fetch_object($stid);
     return $ultima;
 }
コード例 #5
0
 private function buscarMesJove()
 {
     $codi_delegacio = $this->_infos->CODI_DELEGACIO;
     $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
     $req = "SELECT codi_delegacio, min(data_alta), max(codi) as CODI FROM venedor WHERE codi_delegacio = :codi_delegacio group by codi_delegacio";
     $stid = oci_parse($oci->getConnection(), $req);
     oci_bind_by_name($stid, ":codi_delegacio", $codi_delegacio);
     oci_execute($stid);
     $jove = oci_fetch_object($stid);
     return $jove->CODI;
 }
コード例 #6
0
ファイル: testEvent.php プロジェクト: slovoslagac/New_Report
 function getAllEvents()
 {
     global $conn_oracle;
     $sql = oci_parse($conn_oracle, "select *\nfrom TELEBET.SP_EVENT e\nwhere E.DATE_TIME > sysdate - interval '1' day\nand e.date_time < sysdate + interval '2' day");
     oci_execute($sql);
     while (($row = oci_fetch_object($sql)) != false) {
         $testEvent[] = $row;
     }
     //        $testEvent = $sql->fetchAll(PDO::FETCH_OBJ );
     return $testEvent;
 }
コード例 #7
0
         }
         if ($login == '1') {
             return true;
         } else {
             return false;
         }
     }
 }
 function isAdmin()
 {
     global $database;
     $details = oci_parse($conn, "SELECT * FROM USERSETUP WHERE USER_ID='{$this->staff_id}'");
     oci_execute($details);
     while ($row = oci_fetch_object($details)) {
         $this->staffnames = $row->SURNAME;
コード例 #8
0
ファイル: xml.php プロジェクト: hiroyalty/sdpsports
function db_query($sql, $bind = null)
{
    $c = db_connect();
    $res = array();
    $s = oci_parse($c, $sql);
    if ($bind != null) {
        foreach ($bind as $key => $value) {
            oci_bind_by_name($s, ":" . $key, $value);
        }
    }
    oci_execute($s);
    while ($row = oci_fetch_object($s)) {
        $res[] = $row;
    }
    return $res;
}
コード例 #9
0
 function getVehiclesDisponibles()
 {
     $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
     $req = "SELECT \r\n\t\t\t\t\t\tv.codi, \r\n\t\t\t\t\t\tv.matricula, \r\n\t\t\t\t\t\tv.color, \r\n\t\t\t\t\t\tv.combustible,\r\n\t\t\t\t\t\tm.nom as MODEL \r\n\t\t\t\t\tFROM vehicle v JOIN model m ON v.model_codi = m.codi\r\n\t\t\t\t\tWHERE v.codi NOT IN (\r\n\t\t\t\t\t\tSELECT codi_vehicle \r\n\t\t\t\t\t\tFROM lloguer WHERE dataf is null) \r\n\t\t\t\t\tGROUP BY v.codi, v.matricula, v.color, v.combustible, m.nom";
     $stid = oci_parse($oci->getConnection(), $req);
     oci_execute($stid);
     if ($stid) {
         $result_array = array();
         $i = 0;
         while ($temp = oci_fetch_object($stid)) {
             $result_array[$i] = $temp;
             $i++;
         }
     }
     oci_free_statement($stid);
     $oci->tancarConnexio();
     return $result_array;
 }
コード例 #10
0
 private function consultarBdd()
 {
     $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
     $req = "SELECT  l.codi, \r\n\t\t\t\t\t\tc.nom || ' ' ||  c.cognoms as CLIENT, \r\n\t\t\t\t\t\tv.nom || ' ' || v.cognoms as VENEDOR, \r\n\t\t\t\t\t\tve.matricula,\r\n\t\t\t\t\t\tl.kmi, \r\n\t\t\t\t\t\tl.datai\r\n\t\t\t\t\tFROM\t\r\n\t\t\t\t\t\tlloguer l JOIN client c ON l.codi_client = c.codi \r\n\t\t  \t\t\t\t\t  JOIN venedor v ON l.codi_venedor = v.codi\r\n\t\t\t\t\t\t\t  JOIN vehicle ve ON l.codi_vehicle = ve.codi \r\n\t\t\t\t\t\tWHERE dataf is null\r\n\t\t\t\t\t";
     $stid = oci_parse($oci->getConnection(), $req);
     oci_execute($stid);
     if ($stid) {
         $result_array = array();
         $i = 0;
         while ($temp = oci_fetch_object($stid)) {
             $result_array[$i] = $temp;
             $i++;
         }
     }
     oci_free_statement($stid);
     $oci->tancarConnexio();
     $this->_llista = $result_array;
 }
function retornaTotal($mes, $ano)
{
    include '../bd/wint.php';
    //select que recebe parametros da funcao
    $sql = "SELECT \n                SUM(VLTOTAL) AS TOTAL\n            FROM \n                PCNFSAID\n            WHERE \n                CODFILIAL='3' AND\n                OBS IS NULL AND\n                EXTRACT(MONTH FROM dtsaida) = '{$mes}' AND\n                EXTRACT(YEAR FROM dtsaida) = '{$ano}'";
    //declaracao variaveis
    $faturamento = 0;
    //executa sql
    $std = oci_parse($conexao, $sql);
    oci_execute($std);
    while ($row = oci_fetch_object($std)) {
        $faturamento = $row->TOTAL;
    }
    //fecha conexao
    oci_close($conexao);
    //retarna valores
    return $faturamento;
}
コード例 #12
0
        if ($_SESSION['LoggedIn']) {
            return true;
        } else {
            return false;
        }
    }
    /**
	 * Check username and password against DB
	 *
	 * @return true/false
	 */
    function doLogin($username, $password)
    {
        global $conn;
        //$this->connect();
        $this->username = $username;
        $this->password = $password;
        // check db for user and pass here.
        $sql = sprintf("SELECT * FROM MEMBERPASS WHERE username = '******' and passwrd = '%s'", $this->clean($this->username), $this->clean(md5($this->password)));
        $result = oci_parse($conn, $sql);
        oci_execute($result);
        $i = 0;
        while ($row = oci_fetch_object($result)) {
            //$refno= $row->REFNO;
            $i++;
        }
        // If no user/password combo exists return false
        if ($i != 1) {
            $this->disconnect();
            return false;
        } else {
            //$row1 = ibase_fetch_assoc($result);
            $q = "select REFNO,CATEGORY, CODE from MEMBERPASS WHERE username ='******'";
            $q1 = oci_parse($conn, $q);
            oci_execute($q1);
            while ($row1 = oci_fetch_object($q1)) {
                $this->ref_no = $row1->REFNO;
                $this->category = $row1->CATEGORY;
                $this->codey = $row1->CODE;
            }
            // more secure to regenerate a new id.
            session_regenerate_id();
            //set session vars up
            $_SESSION['LoggedIn'] = true;
            $_SESSION['username'] = $this->username;
コード例 #13
0
 private function consultarBdd()
 {
     $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
     $req = 'SELECT a.descripcio as "DESC", codi_accessori as "CODI" FROM accessori a JOIN model_accessori ma ON a.codi = ma.codi_accessori WHERE codi_model=:cm';
     $stid = oci_parse($oci->getConnection(), $req);
     oci_bind_by_name($stid, ":cm", $this->_model);
     oci_execute($stid);
     if ($stid) {
         $result_array = array();
         $i = 0;
         while ($temp = oci_fetch_object($stid)) {
             $result_array[$i] = $temp;
             $i++;
         }
     }
     oci_free_statement($stid);
     $oci->tancarConnexio();
     $this->_llista = $result_array;
 }
コード例 #14
0
    private function consultarBdd()
    {
        $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
        $req = 'SELECT m.codi, m.nom FROM model m
					';
        $stid = oci_parse($oci->getConnection(), $req);
        oci_execute($stid);
        if ($stid) {
            $result_array = array();
            $i = 0;
            while ($temp = oci_fetch_object($stid)) {
                $result_array[$i] = $temp;
                $i++;
            }
        }
        oci_free_statement($stid);
        $oci->tancarConnexio();
        $this->_llista = $result_array;
    }
コード例 #15
0
 function obtenirDades()
 {
     if (empty($this->_infos)) {
         $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
         $req = "SELECT * FROM models WHERE codi = :codi";
         $stid = oci_parse($oci->getConnection(), $req);
         oci_bind_by_name($stid, ":codi", $this->_id);
         oci_execute($stid);
         if ($stid) {
             $result_array = array();
             while ($temp = oci_fetch_object($stid)) {
                 $result_array[] = $temp;
             }
         }
         oci_free_statement($stid);
         oci_close($oci);
         $this->_infos = $result_array;
     }
     return $this->_infos;
 }
コード例 #16
0
    private function consultarBdd()
    {
        $oci = new Oci($_SESSION['user']['usuari'], $_SESSION['user']['passwd']);
        $req = 'SELECT
						v.codi, v.nom, v.cognoms, d.nom as delegacio
					FROM 
						venedor v JOIN delegacio d ON v.codi_delegacio = d.codi
					';
        $stid = oci_parse($oci->getConnection(), $req);
        oci_execute($stid);
        if ($stid) {
            $result_array = array();
            $i = 0;
            while ($temp = oci_fetch_object($stid)) {
                $result_array[$i] = $temp;
                $i++;
            }
        }
        oci_free_statement($stid);
        $oci->tancarConnexio();
        $this->_llista = $result_array;
    }
コード例 #17
0
ファイル: oci8_result.php プロジェクト: srsman/89jian
 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @param	string	$class_name
  * @return	object
  */
 protected function _fetch_object($class_name = 'stdClass')
 {
     $row = $this->curs_id ? oci_fetch_object($this->curs_id) : oci_fetch_object($this->stmt_id);
     if ($class_name === 'stdClass' or !$row) {
         return $row;
     }
     $class_name = new $class_name();
     foreach ($row as $key => $value) {
         $class_name->{$key} = $value;
     }
     return $class_name;
 }
コード例 #18
0
ファイル: Oracle.php プロジェクト: rexmac/zf2
 /**
  * Fetches the next row and returns it as an object.
  *
  * @param string $class  OPTIONAL Name of the class to create.
  * @param array  $config OPTIONAL Constructor arguments for the class.
  * @return mixed One object instance of the specified class.
  * @throws \Zend\Db\Statement\Exception
  */
 public function fetchObject($class = 'stdClass', array $config = array())
 {
     if (!$this->_stmt) {
         return false;
     }
     $obj = oci_fetch_object($this->_stmt);
     if ($error = oci_error($this->_stmt)) {
         throw new OracleException($error);
     }
     /* @todo XXX handle parameters */
     return $obj;
 }
コード例 #19
0
 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @access  private
  * @return  object
  */
 function _fetch_object()
 {
     $result = array();
     // If PHP 5 is being used we can fetch an result object
     if (function_exists('oci_fetch_object')) {
         $id = $this->curs_id ? $this->curs_id : $this->stmt_id;
         return @oci_fetch_object($id);
     }
     // If PHP 4 is being used we have to build our own result
     foreach ($this->result_array() as $key => $val) {
         $obj = new stdClass();
         if (is_array($val)) {
             foreach ($val as $k => $v) {
                 $obj->{$k} = $v;
             }
         } else {
             $obj->{$key} = $val;
         }
         $result[] = $obj;
     }
     return $result;
 }
コード例 #20
0
ファイル: Statement.php プロジェクト: taq/pdooci
 /**
  * Fetch a value
  *
  * @param int $style       to fetch values
  * @param int $orientation cursor orientation
  * @param int $offset      offset
  *
  * @return mixed
  * @throws \PDOException
  */
 public function fetch($style = null, $orientation = null, $offset = null)
 {
     set_error_handler(array($this->_pdooci, "errorHandler"));
     try {
         $style = is_null($style) ? $this->_fetch_sty : $style;
         $this->_fetch_sty = $style;
         $rst = null;
         switch ($style) {
             case \PDO::FETCH_BOTH:
             case \PDO::FETCH_BOUND:
                 $rst = \oci_fetch_array($this->_stmt, \OCI_BOTH + \OCI_RETURN_NULLS);
                 break;
             case \PDO::FETCH_ASSOC:
                 $rst = \oci_fetch_array($this->_stmt, \OCI_ASSOC + \OCI_RETURN_NULLS);
                 $rst = $this->_fixResultKeys($rst);
                 break;
             case \PDO::FETCH_NUM:
                 $rst = \oci_fetch_array($this->_stmt, \OCI_NUM + \OCI_RETURN_NULLS);
                 break;
             case \PDO::FETCH_OBJ:
                 $rst = \oci_fetch_object($this->_stmt);
                 break;
         }
         $this->_current = $rst;
         $this->_checkBinds();
     } catch (\Exception $e) {
         throw new \PDOException($e->getMessage());
     }
     restore_error_handler();
     return $rst;
 }
コード例 #21
0
      <div class="post">
<?php 
include "PHP/connect.php";
$cursor = oci_new_cursor($conn);
$stmt = oci_parse($conn, "begin P_AUTOR.selByNome(:p_aut_nome, :error, :errorMsg, :result); end;");
oci_bind_by_name($stmt, ":p_aut_nome", $_REQUEST["p_aut_nome"]);
oci_bind_by_name($stmt, ":error", $error, 3);
oci_bind_by_name($stmt, ":errorMsg", $errorMsg, 512);
oci_bind_by_name($stmt, ":result", $cursor, -1, OCI_B_CURSOR);
oci_execute($stmt);
if ($error != 0) {
    echo "<h2 class=\"erro\">Erro: {$errorMsg}</h2>";
} else {
    echo "\n<table> \n<tr>\n<th>Nome</th>\n<th>Data de Nascimento</th>\n<th>&nbsp;</th>\n</tr>";
    oci_execute($cursor);
    while ($result = oci_fetch_object($cursor)) {
        echo "\n<tr>\n<td>{$result->AUT_NOME}</td>\n<td>{$result->AUT_DT_NASC}</td>\n</tr>";
    }
    echo "</table>";
}
oci_free_statement($stmt);
oci_free_cursor($cursor);
oci_close($conn);
?>
 <div class="entry">
          <p class="links"><a href="#" class="more">Voltar ao início</a> &nbsp;&nbsp;&nbsp;</p>
        </div>
      </div>
 
      </div>
   
コード例 #22
0
ファイル: sql_details.php プロジェクト: danhively/ASBO
  __hist_sqlstat__  ss
where   
  ss.dbid = s.dbid and     
  ss.instance_number = s.instance_number and     
  ss.snap_id = s.snap_id and     
  ss.sql_id = :sql_id and     
  ss.executions_delta > 0 and     
  s.begin_interval_time >= sysdate - 7
order by  
  s.snap_id desc
, ss.plan_hash_value
END_SQL;
include 'subs_for_history_tables.php';
$binds = '';
$binds[] = array(':sql_id', $sql_id);
$cur = $db_obj->exec_sql($sql, $binds);
$last_snap_time = $oracle_sysdate;
$db_obj->html_results($cur);
p('Current sql details');
p('');
#
# Current execution plans
#
$sql = "select plan_table_output plan_line from table(dbms_xplan.display_cursor(:sql_id, null, 'Advanced'))";
$binds = '';
$binds[] = array(":sql_id", $sql_id);
$cur = $db_obj->exec_sql($sql, $binds);
while ($rec = oci_fetch_object($cur)) {
    p($rec->PLAN_LINE);
}
include 'end.php';
コード例 #23
0
ファイル: profile.php プロジェクト: Kemallyson/Wizglobal
 * Time: 3:55 PM
 */
session_start();
require 'header.php';
require_once '../classes/aardb_conn.php';
$username = $_SESSION['username'];
$email = $_SESSION['e_mail'];
//echo $username;
//echo $email;
$user_info = "SELECT U.USER_ID, U.USERNAME, U.SURNAME, U.USER_TYPE,U.BRANCHID, U.BRANCHNAME, M.REFNO, M.E_MAIL, M.CATEGORY, M.CODE FROM MEMBERPASS M INNER JOIN USERSETUP U ON M.USERNAME = U.USERNAME where U.USERNAME ='******' ";
$user_details = oci_parse($conn, $user_info);
oci_execute($user_details);
$employee_info = "SELECT fullnames,surname, IDNO, dob, GENDER, demployed, deptcode, desig, haddress, regdate,email, type_, terms FROM EMPLOYEE where email ='" . $email . "'";
$empl = oci_parse($conn, $employee_info) or die("OCI Error");
oci_execute($empl);
while ($information = oci_fetch_object($empl)) {
    $full_name = $information->FULLNAMES;
    $surname = $information->SURNAME;
    $dob = $information->DOB;
    $id_no = $information->IDNO;
    $gender = $information->GENDER;
    $d_employed = $information->DEMPLOYED;
    $design = $information->DESIG;
    $dept = $information->DEPTCODE;
    $h_address = $information->HADDRESS;
    $reg_date = $information->REGDATE;
    $type = $information->TYPE_;
    $terms = $information->TERMS;
}
while ($user_details_returned = oci_fetch_array($user_details)) {
    $users[] = $user_details_returned;
コード例 #24
0
ファイル: Oracle.php プロジェクト: fredcido/cenbrap
 /**
  * Fetches the next row and returns it as an object.
  *
  * @param string $class  OPTIONAL Name of the class to create.
  * @param array  $config OPTIONAL Constructor arguments for the class.
  * @return mixed One object instance of the specified class.
  * @throws Zend_Db_Statement_Exception
  */
 public function fetchObject($class = 'stdClass', array $config = array())
 {
     if (!$this->_stmt) {
         return false;
     }
     $obj = oci_fetch_object($this->_stmt);
     if ($error = oci_error($this->_stmt)) {
         /**
          * @see Zend_Db_Adapter_Oracle_Exception
          */
         require_once 'Zend/Db/Statement/Oracle/Exception.php';
         throw new Zend_Db_Statement_Oracle_Exception($error);
     }
     /* @todo XXX handle parameters */
     return $obj;
 }
    $media_mesfim = $media_mesfim - 1;
    //se mes igual a 0 volta pra 12
    if ($media_mesfim == 0) {
        $media_mesfim = 12;
        $media_anofim = $media_anofim - 1;
    }
}
//consulta datas;
include '../bd/wint.php';
//select que recebe os parametros da funcao
$sql = "SELECT \n                P.CODCLI\n                ,M.CLI\n                ,cast(((SUM(P.VLTOTAL)/'{$diaAtual}')*'{$ultimo_dia}') as NUMERIC(15,2)) AS tendencia\n                ,SUM(P.VLTOTAL) AS MESATUAL\n                ,M.ANT AS ULTMES\n                ,M.DOZE AS MEDIA \n            FROM \n                PCNFSAID P\n                ,(\n                  SELECT \n                      SUM(T.VLTOTAL) AS ANT\n                      ,T.CODCLI\n                      ,D.TOTALDOZE AS DOZE\n                      ,D.CLIENTE AS CLI\n                  FROM PCNFSAID T\n                        ,(\n                          SELECT \n                            cast(SUM(N.VLTOTAL/3) AS NUMERIC(15,3)) AS TOTALDOZE\n                            ,N.CODCLI\n                            ,Q.CLIENTE AS CLIENTE\n                          FROM \n                            PCNFSAID N\n                            ,PCCLIENT Q\n                          WHERE  \n                            N.CODFILIAL = 3 \n                            AND EXTRACT(MONTH FROM N.DTSAIDA) >= '{$media_mesini}'--pega calculo media mes;\n                            AND EXTRACT(YEAR FROM N.DTSAIDA) >= '{$media_anoini}'\n                            AND EXTRACT(MONTH FROM N.DTSAIDA) <= '{$media_mesfim}'--pega calculo media ano;\n                            AND EXTRACT(YEAR FROM N.DTSAIDA) <='{$media_anofim}'\n                            AND N.OBS IS NULL \n                            AND N.DTDEVOL IS NULL\n                            AND Q.CODCLI(+)= N.CODCLI \n                          GROUP BY \n                            N.CODCLI \n                            ,Q.CLIENTE\n                        )D\n                  WHERE \n                      T.CODFILIAL = 3 \n                      AND EXTRACT(MONTH FROM T.DTSAIDA) = '{$mes_anterior}'       --pega calculo mes anterior;\n                      AND EXTRACT(YEAR FROM T.DTSAIDA) = '{$ano_anteriro}'        --pega calculo ano do mes anterior;\n                      AND T.OBS IS NULL \n                      AND T.DTDEVOL IS NULL\n                      AND D.CODCLI(+)= T.CODCLI\n                    GROUP BY \n                      T.CODCLI\n                      ,D.TOTALDOZE\n                      ,D.CLIENTE\n                )M\n            WHERE\n                P.CODFILIAL = 3\n                AND EXTRACT(MONTH FROM P.DTSAIDA) = '{$mesAtual}'                 --pega calculo mes atual;\n                AND EXTRACT(YEAR FROM P.DTSAIDA) = '{$anoAtual}'                  --pega calculo ano atual;\n                AND P.CODCLI(+)= M.CODCLI\n                AND P.OBS IS NULL\n                AND P.DTDEVOL IS NULL\n                AND M.CLI IS NOT NULL\n\n            GROUP BY \n                P.CODCLI\n                ,M.ANT\n                ,M.DOZE\n                ,M.CLI\n\n            ORDER BY \n                M.DOZE DESC";
//declaracao variaveis
$tabela = "<table id='tbldinamica' class='table table-bordered table-hover table-striped' >\n                        <thead>\n                            <tr>\n                                <th>CODIGO</th>\n                                <th>CLIENTE</th>\n                                <th>TENDENCIA</th>\n                                <th>MES ATUAL</th>\n                                <th>MES ANTERIOR</th>\n                                <th>MEDIA COMPRAS</th>\n                            </tr>\n                        </thead>\n                        <tbody>\n                      ";
//executa sql
$std = oci_parse($conexao, $sql);
oci_execute($std);
while ($row = oci_fetch_object($std)) {
    $tabela .= "<tr>";
    $tabela .= "<td>" . str_pad($row->CODCLI, 7, "0", STR_PAD_LEFT) . "</td>";
    $tabela .= "<td>" . utf8_encode($row->CLI) . "</td>";
    $tabela .= "<td>R\$ " . number_format($row->TENDENCIA, 2, ",", ".") . "</td>";
    $tabela .= "<td>R\$ " . number_format($row->MESATUAL, 2, ",", ".") . "</td>";
    $tabela .= "<td>R\$ " . number_format($row->ULTMES, 2, ",", ".") . "</td>";
    $tabela .= "<td>R\$ " . number_format($row->MEDIA, 2, ",", ".") . "</td>";
    $tabela .= "</tr>";
}
$tabela .= "</tbody></table>";
//fecha conexao
oci_close($conexao);
//retarna valores
echo $tabela;
コード例 #26
0
ファイル: Oracle.php プロジェクト: jorgenils/zend-framework
 /**
  * Fetches the next row and returns it as an object.
  *
  * @param $class
  * @param $config
  * @return $obj
  * @throws Zend_Db_Statement_Oracle_Exception
  */
 public function fetchObject($class = 'stdClass', $config = null)
 {
     if (!$this->_stmt) {
         return false;
     }
     $obj = oci_fetch_object($this->_stmt);
     if ($obj === false) {
         throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
     }
     /* @todo XXX handle parameters */
     return $obj;
 }
コード例 #27
0
<form method="post" action="buyproduct.php" style="position">
	<input type="submit" name="Food" value="Food" class="myButton">
	<input type="submit" name="Apparrel" value="Apparrel" class="myButton">
	<input type="submit" name="Electronics" value="Electronics" class="myButton">
	<input type="submit" name="Digital" value="Digital Products" class="myButton">
	<input type="submit" name="Vehicle" value="Vehicle" class="myButton">
	<input type="submit" name="Pets" value="Pets" class="myButton">
	<input type="submit" name="Books" value="Books" class="myButton">
	<input type="submit" name="Toys" value="Toys" class="myButton">
	<input type="submit" name="Other" value="Other" class="myButton">
	<input type="submit" name="All" value="All" class="myButton"><br><br>
	<input type="text" name="search" placeholder="Search Product">
	<input type="submit" name="bsearch" value="search" class="myButton">
</form>
<?php 
while (($object = oci_fetch_object($parseRequest)) != false) {
    $products[] = $object;
}
?>
<table>
  <thead>
    <tr>
      <th>Image</th>
      <th>Product Name</th>
      <th>Type</th>
      <th>Price</th>
      <th>Date</th>
      <th>Seller ID</th>
      <th>Status</th>
      <th>Detail</th>
    </tr>
コード例 #28
0
 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @access  protected
  * @return  object
  */
 protected function _fetch_object()
 {
     $id = $this->curs_id ? $this->curs_id : $this->stmt_id;
     return @oci_fetch_object($id);
 }
コード例 #29
0
ファイル: Oracle.php プロジェクト: TeamCodeStudio/fpmoz
 /**
  * fetch
  *
  * @see Doctrine_Core::FETCH_* constants
  * @param integer $fetchStyle           Controls how the next row will be returned to the caller.
  *                                      This value must be one of the Doctrine_Core::FETCH_* constants,
  *                                      defaulting to Doctrine_Core::FETCH_BOTH
  *
  * @param integer $cursorOrientation    For a PDOStatement object representing a scrollable cursor, 
  *                                      this value determines which row will be returned to the caller. 
  *                                      This value must be one of the Doctrine_Core::FETCH_ORI_* constants, defaulting to
  *                                      Doctrine_Core::FETCH_ORI_NEXT. To request a scrollable cursor for your 
  *                                      Doctrine_Adapter_Statement_Interface object,
  *                                      you must set the Doctrine_Core::ATTR_CURSOR attribute to Doctrine_Core::CURSOR_SCROLL when you
  *                                      prepare the SQL statement with Doctrine_Adapter_Interface->prepare().
  *
  * @param integer $cursorOffset         For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the
  *                                      $cursorOrientation parameter is set to Doctrine_Core::FETCH_ORI_ABS, this value specifies
  *                                      the absolute number of the row in the result set that shall be fetched.
  *                                      
  *                                      For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for 
  *                                      which the $cursorOrientation parameter is set to Doctrine_Core::FETCH_ORI_REL, this value 
  *                                      specifies the row to fetch relative to the cursor position before 
  *                                      Doctrine_Adapter_Statement_Interface->fetch() was called.
  *
  * @return mixed
  */
 public function fetch($fetchStyle = Doctrine_Core::FETCH_BOTH, $cursorOrientation = Doctrine_Core::FETCH_ORI_NEXT, $cursorOffset = null)
 {
     switch ($fetchStyle) {
         case Doctrine_Core::FETCH_BOTH:
             return oci_fetch_array($this->statement, OCI_BOTH + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
             break;
         case Doctrine_Core::FETCH_ASSOC:
             return oci_fetch_array($this->statement, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
             break;
         case Doctrine_Core::FETCH_NUM:
             return oci_fetch_array($this->statement, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
             break;
         case Doctrine_Core::FETCH_OBJ:
             return oci_fetch_object($this->statement, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
             break;
         default:
             throw new Doctrine_Adapter_Exception("This type of fetch is not supported: " . $fetchStyle);
             /*
                         case Doctrine_Core::FETCH_BOUND:
                         case Doctrine_Core::FETCH_CLASS:
                         case FETCH_CLASSTYPE:
                         case FETCH_COLUMN:
                         case FETCH_FUNC:
                         case FETCH_GROUP:
                         case FETCH_INTO:
                         case FETCH_LAZY:
                         case FETCH_NAMED:
                         case FETCH_SERIALIZE:
                         case FETCH_UNIQUE:
                            case FETCH_ORI_ABS:
                         case FETCH_ORI_FIRST:
                         case FETCH_ORI_LAST:
                         case FETCH_ORI_NEXT:
                         case FETCH_ORI_PRIOR:
                         case FETCH_ORI_REL:
             */
     }
 }
コード例 #30
0
 public function queryByRif($rif)
 {
     $this->conex = DataBase::getInstance();
     $consulta = "SELECT *\n\t\tFROM FISC_EMPRESA \n\t\tWHERE RIF_FISC_EMPRESA = :rif";
     $stid = oci_parse($this->conex, $consulta);
     if (!$stid) {
         $e = oci_error($this->conex);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Realizar la lógica de la consulta
     oci_bind_by_name($stid, ':rif', $rif);
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Obtener los resultados de la consulta
     $fila = oci_fetch_object($stid, OCI_ASSOC + OCI_RETURN_NULLS);
     $alm = new FiscEmpresa();
     try {
         $it = new ArrayIterator($fila);
         while ($it->valid()) {
             $alm->__SET(strtolower($it->key()), $it->current());
             $it->next();
         }
     } catch (InvalidArgumentException $e) {
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $alm;
 }