Example #1
1
File: db.php Project: anisinfo/osi
 function select_data($req)
 {
     $stmt = oci_parse($this->connection, $req);
     oci_execute($stmt, OCI_DEFAULT);
     while (oci_fetch($stmt)) {
         echo oci_result($stmt, "TEST") . "<br>\n";
     }
 }
Example #2
0
function register($login, $password, $name, $surname)
{
    $conn = connect();
    $stid = oci_parse($conn, 'SELECT ID FROM USERS WHERE ID = :0');
    oci_bind_by_name($stid, ':0', $login);
    oci_execute($stid);
    oci_fetch($stid);
    if (oci_result($stid, 'ID') > 0) {
        notify('Пользователь с таким номером уже существует!');
        oci_close($conn);
    } else {
        $salt = rand(1, 1000000);
        $hash = md5($password . $salt);
        $stid = oci_parse($conn, "INSERT INTO USERS (ID, HASH, SALT, NAME, SURNAME) VALUES (:0, :1, :2, :3, :4)");
        oci_bind_by_name($stid, ':0', $login);
        oci_bind_by_name($stid, ':1', $hash);
        oci_bind_by_name($stid, ':2', $salt);
        oci_bind_by_name($stid, ':3', $name);
        oci_bind_by_name($stid, ':4', $surname);
        if (oci_execute($stid)) {
            oci_close($conn);
            session_start();
            $_SESSION['ID'] = $login;
            header('Location: ./profile.php');
        }
    }
}
 public function consultar()
 {
     //$prub = Conexion::getInstancia("system", "admin");
     //$p=new Persona();
     $persina = new PersonaDAO();
     $aa = new ConexionDB("apoyo_alimentario", "apoyo_alimentario");
     if ($aa->conectarDB()) {
         $sesion = $aa->getConn();
         $facultades = array();
         $i = 0;
         $sqltxt = "select * from facultad";
         $stid = oci_parse($sesion, $sqltxt);
         oci_execute($stid);
         while (oci_fetch($stid)) {
             $facultad = new Facultad();
             $facultad->setIdfacultad(oci_result($stid, 'ID_FACULTAD'));
             $facultad->setNombre_facultad(oci_result($stid, 'NOMBRE_FACULTAD'));
             $facultades[$i] = $facultad;
             $i += 1;
         }
         return $facultades;
         //oci_parse($a, $sql_text);
         //echo $a;
     }
 }
/** Helper function for printing out core fulfillment options */
function printCoreSet($num)
{
    global $conn;
    $query = "SELECT core_code, description FROM vw_core_requirement WHERE core_set_id=" . $num . " ORDER BY report_order";
    $data = oci_parse($conn, $query);
    oci_execute($data);
    while (oci_fetch($data)) {
        echo "<option value='" . oci_result($data, 'CORE_CODE') . "'>" . oci_result($data, 'CORE_CODE') . "-" . oci_result($data, 'DESCRIPTION') . "</option>\n";
    }
    oci_free_statement($data);
}
 public function buscarIdSolicitud($idestu, $idconvoc)
 {
     $idsol;
     $sqltxt = "select k_idsolicitud from s_solicitud where k_estudiante = '" . $idestu . "' and k_convocatoria =" . $idconvoc;
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         $idsol = oci_result($stid, 'K_IDSOLICITUD');
     }
     return $idsol;
 }
Example #6
0
function count_rows(&$conn, $select, $binds)
{
    $sql = "SELECT COUNT(*) AS num_rows FROM({$select})";
    $stmt = oci_parse($conn, $sql);
    foreach ($binds as $handle => $var) {
        oci_bind_by_name($stmt, $handle, $binds[$handle]);
    }
    oci_define_by_name($stmt, "NUM_ROWS", $num_rows);
    oci_execute($stmt);
    oci_fetch($stmt);
    return $num_rows;
}
 public function verTipoCondicionxSolicitud($idcond)
 {
     //echo $idcond.">-----------id";
     $sqltxt = "select t_condicion from s_condicion_se where k_idcondicion = " . $idcond;
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         // echo "---------->".oci_result($stid, 'T_CONDICION')."<----ENTRO WHILE";
         $idtipo = oci_result($stid, 'T_CONDICION');
     }
     //echo "(".$idtipo.")";
     return $idtipo;
 }
 public function buscarFacultad($id_facultad)
 {
     $facultad = new Facultad();
     $sqltxt = "select * from s_facultad where k_idfacultad = " . $id_facultad . "";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         $facultad->setIdfacultad(oci_result($stid, 'K_IDFACULTAD'));
         $facultad->setNombre_facultad(oci_result($stid, 'N_NOMFACULTAD'));
     }
     //echo $persona->getApellido_persona();
     return $facultad;
 }
 function getId($db, $sql, $idName)
 {
     echo "{$this->log} - {$sql} <br />";
     $idName = strtoupper($idName);
     $stid = oci_parse($db, $sql);
     oci_execute($stid);
     $id = NULL;
     while (oci_fetch($stid)) {
         //echo "dbfunctions.php - oci_result for $idName: " . oci_result($stid, $idName) . '<br />';
         $id = oci_result($stid, $idName);
     }
     oci_free_statement($stid);
     return $id;
 }
 function isUserPresent($userName, $password)
 {
     ini_set('display_errors', 'On');
     $db = "w4111c.cs.columbia.edu:1521/adb";
     $conn = oci_connect("kpg2108", "test123", $db);
     $stmt = oci_parse($conn, "select count(*) as NUM_ROWS from users where login_id = '{$userName}' and password ='******'");
     oci_define_by_name($stmt, 'NUM_ROWS', $this->num_rows);
     oci_execute($stmt);
     oci_fetch($stmt);
     oci_close($conn);
     if ($this->num_rows > 0) {
         return true;
     } else {
         return false;
     }
 }
 public function verDias()
 {
     $dias = array();
     $i = 0;
     $sqltxt = "select * from s_dia";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     //echo $sqltxt;
     oci_execute($stid);
     while (oci_fetch($stid)) {
         $dia = new DiaSolicitud();
         $dia->setId_dia(oci_result($stid, 'K_IDDIA'));
         $dia->setNombre_dia(oci_result($stid, 'N_NOMDIA'));
         $dias[$i] = $dia;
         $i += 1;
     }
     return $dias;
 }
Example #12
0
 public function buscarPersonaxUsuario($usuario)
 {
     $persona = new Persona();
     $sqltxt = "select * from s_persona where usuario = '" . $usuario . "'";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         //$persona->setCodigo_persona(oci_result($stid, 'CODIGO'));
         $persona->setNombre_persona(oci_result($stid, 'NOMBRE_PER'));
         $persona->setApellido_persona(oci_result($stid, 'APELLIDO_PER'));
         $persona->setTipo_persona(oci_result($stid, 'TIPO'));
         $persona->setUsuario_persona(oci_result($stid, 'USUARIO'));
         $persona->setGenero_persona(oci_result($stid, 'GENERO'));
         $persona->setDocumento_persona(oci_result($stid, 'DOCUMENTO'));
     }
     //echo $persona->getApellido_persona();
     return $persona;
 }
 public function verBeneficiadoValidado()
 {
     //$condicionxsolicitud=new CondicionxSolicitud();
     $beneficiados = array();
     $i = 0;
     $sqltxt = "SELECT n_nomper, n_apeper, n_correo FROM s_BeneficiarioValidado B, s_Solicitud S, s_Estudiante E, s_Persona P WHERE B.k_idsolicitud = S.k_idsolicitud AND S.k_estudiante = E.k_codigo_est AND E.k_documento = P.k_documento";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         $persona = new Persona();
         $persona->setNombre_persona(oci_result($stid, 'N_NOMPER'));
         $persona->setApellido_persona(oci_result($stid, 'N_APEPER'));
         $persona->setCorreo_persona(oci_result($stid, 'N_CORREO'));
         $beneficiados[$i] = $persona;
         $i += 1;
     }
     return $beneficiados;
 }
Example #14
0
 public function buscarPersonaxDocumento($documento)
 {
     $persona = new Persona();
     echo $documento;
     $sqltxt = "select * from s_persona where k_documento = '" . $documento . "'";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         $persona->setDocumento_persona(oci_result($stid, 'K_DOCUMENTO'));
         $persona->setNombre_persona(oci_result($stid, 'N_NOMPER'));
         $persona->setApellido_persona(oci_result($stid, 'N_APEPER'));
         $persona->setUsuario_persona(oci_result($stid, 'N_USUARIO'));
         $persona->setTipo_persona(oci_result($stid, 'T_TIPO'));
         $persona->setGenero_persona(oci_result($stid, 'N_GENERO'));
         $persona->setCorreo_persona(oci_result($stid, 'N_CORREO'));
     }
     //echo $persona->getApellido_persona();
     return $persona;
 }
 public function buscarFuncionarioxDocumento($documento)
 {
     $funcionario = new Funcionario();
     $sqltxt = "select * from s_funcionario where k_documento = " . $documento . "";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     //echo $sqltxt;
     oci_execute($stid);
     while (oci_fetch($stid)) {
         //$persona->setCodigo_persona(oci_result($stid, 'CODIGO'));
         $funcionario->setId_funcionario(oci_result($stid, 'K_IDFUNCIONARIO'));
         $funcionario->setDocumento_funcionario(oci_result($stid, 'K_DOCUMENTO'));
         $funcionario->setCargo_funcionario(oci_result($stid, 'N_CARGO'));
     }
     //echo (string)$estudiante->getCodigo_estudiante();
     //echo $estudiante->getCarrera_estudiante();
     //echo $estudiante->getMatriculas_estudiante();
     //echo $estudiante->getCodigo_estudiante();
     //echo $persona->getApellido_persona();
     return $funcionario;
 }
Example #16
0
 /**
  * Voer insert uit en return last inserted id
  *
  * @param string $sequence
  * @param bool $commit
  * @return int|false $lastId
  */
 public function insert($sequence = null, $commit = self::COMMIT)
 {
     if ($this->statement->getStatementType() != 'INSERT') {
         return false;
     }
     if (empty($sequence)) {
         return false;
     }
     if (!$this->execute($commit)) {
         return false;
     }
     // try to return the currval of the given sequence
     $resource = oci_parse($this->statement->getConnectionResource(), "select " . $sequence . ".currval cv from dual");
     oci_define_by_name($resource, 'CV', $lastId);
     $flag = $commit === true ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT;
     if (!oci_execute($resource, $flag)) {
         return false;
     }
     oci_fetch($resource);
     return $lastId;
 }
Example #17
0
function displaySchedule()
{
    $dao = new DAO();
    $stmt = oci_parse($dao->con, "SELECT TO_CHAR(TIMESTART, 'MM-DD-YYYY HH24:MI') AS TS ,TO_CHAR(TIMEEND, 'MM-DD-YYYY HH24:MI') AS TE, ID, THEATREID, MOVIEID FROM SCREENROOM");
    OCIDefineByName($stmt, "TS", $timeS);
    OCIDefineByName($stmt, "TE", $timeE);
    OCIDefineByName($stmt, "ID", $scroomID);
    OCIDefineByName($stmt, "THEATREID", $tID);
    OCIDefineByName($stmt, "MOVIEID", $mID);
    oci_execute($stmt, OCI_DEFAULT);
    echo '<table border=1>';
    while (oci_fetch($stmt)) {
        echo '<tr>';
        // Use the uppercase column names for the associative array indices
        $bookLink = '<a href=order.php?sID=' . $scroomID . '>&nbsp book</a>';
        $detailLink = '<a href=movieDetail.php?mID=' . $mID . '>&nbsp detaile</a>';
        echo '<td> MOVIE: ' . $dao->fetchMovieName($mID) . '</td>' . ' <td>Start: ' . $timeS . ' </td><td>End: ' . $timeE . ' </td><td> theatre: ' . $dao->fetchTheatreName($tID) . '</td><td>' . $bookLink . ' </td><td>' . $detailLink . '</td>';
        echo '</tr>';
    }
    echo '</table>';
}
 public function verConvocatoriasActivas()
 {
     $convocatorias = array();
     $i = 0;
     $sqltxt = "select * from s_convocatoria where fecha_inicio< sysdate AND fecha_fin > sysdate";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch($stid)) {
         //$persona->setCodigo_persona(oci_result($stid, 'CODIGO'));
         $convocatoria = new Convocatoria();
         $convocatoria->setId_convocatoria(oci_result($stid, 'ID_CONVOCATORIA'));
         $convocatoria->setId_facultad(oci_result($stid, 'ID_FACULTAD'));
         $convocatoria->setFecha_inicio(oci_result($stid, 'FECHA_INICIO'));
         $convocatoria->setFecha_fin(oci_result($stid, 'FECHA_FIN'));
         $convocatoria->setCupos(oci_result($stid, 'CUPOS'));
         $convocatoria->setPeriodo(oci_result($stid, 'PERIODO'));
         $convocatorias[$i] = $convocatoria;
         $i += 1;
     }
     //echo $convocatoria->getId_convocatoria()."aaaaaaaaaaaaaaaaadwwqqwd";
     return $convocatorias;
 }
 public function buscarEstudiantexDocumento($documento)
 {
     $estudiante = new Estudiante();
     $sqltxt = "select * from s_estudiante where documento = " . $documento . "";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     //echo $sqltxt;
     oci_execute($stid);
     while (oci_fetch($stid)) {
         //$persona->setCodigo_persona(oci_result($stid, 'CODIGO'));
         $estudiante->setCodigo_estudiante(oci_result($stid, 'CODIGO_EST'));
         $estudiante->setDocumento_estudiante(oci_result($stid, 'DOCUMENTO'));
         $estudiante->setMatriculas_estudiante(oci_result($stid, 'MATRICULAS_EST'));
         $estudiante->setActivo_estudiante(oci_result($stid, 'ACTIVO'));
         $estudiante->setCarrera_estudiante(oci_result($stid, 'CARRERA'));
         $estudiante->setPromedio_estudiante(oci_result($stid, 'PROMEDIO'));
     }
     //echo (string)$estudiante->getCodigo_estudiante();
     //echo $estudiante->getCarrera_estudiante();
     //echo $estudiante->getMatriculas_estudiante();
     //echo $estudiante->getCodigo_estudiante();
     //echo $persona->getApellido_persona();
     return $estudiante;
 }
Example #20
0
function getRowNbSel($from, $dbcnx)
{
    if (!$dbcnx) {
        return null;
    }
    // $req = pg_query($sql_count) or die('echec sql : ' . pg_last_error());
    // $req = pg_query($sql_count);
    $sql_count = "select count(*) NUMBER_OF_ROWS FROM {$from}";
    $req = ociparse($dbcnx, $sql_count);
    // oracle
    oci_define_by_name($req, 'NUMBER_OF_ROWS', $number_of_rows);
    if (!oci_execute($req, OCI_DEFAULT)) {
        oci_rollback($dbcnx);
        $e = oci_error($req);
        print "<pre><font color='red'>" . $e['sqltext'] . ': ' . $e['message'] . '</font></pre>';
        $_url = "../index.php?ong=" . $_POST['ong'];
        echo "<br><br><b><a href={$_url}>Retour</a></b>";
        die;
    }
    oci_fetch($req);
    return $number_of_rows;
}
    $projectNumberSql = "SELECT PROJ.PROJECT_NO PROJECTNUMBER, PROJ.CLIENT_ID CLIENTID " . "FROM PROJECT PROJ WHERE PROJ.PROJECT_NAME = :PROJNAME";
    $projectNumberParse = oci_parse($conn, $projectNumberSql);
    oci_bind_by_name($projectNumberParse, ":PROJNAME", $row['PROJECT_NAME']);
    oci_define_by_name($projectNumberParse, "PROJECTNUMBER", $projectNo);
    oci_define_by_name($projectNumberParse, "CLIENTID", $client);
    oci_execute($projectNumberParse);
    while (oci_fetch($projectNumberParse)) {
        $projectNo;
        $client;
    }
    $clientInitialSql = "SELECT CLIENT.CLIENT_INITIAL CLIENTINITIAL FROM CLIENT WHERE CLIENT.CLIENT_ID = :CLID";
    $clientInitialParse = oci_parse($conn, $clientInitialSql);
    oci_bind_by_name($clientInitialParse, ":CLID", $client);
    oci_define_by_name($clientInitialParse, "CLIENTINITIAL", $clientInitial);
    oci_execute($clientInitialParse);
    while (oci_fetch($clientInitialParse)) {
        $clientInitial;
    }
    $no = $no + 1;
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$baris}", $row['SUBCONT_ID'])->setCellValue("B{$baris}", $projectNo)->setCellValue("C{$baris}", $clientInitial)->setCellValue("D{$baris}", $row['PROJECT_NAME'])->setCellValue("E{$baris}", $row['TOTALASSIGNED']);
    $baris = $baris + 1;
}
// nama dari sheet yang aktif
$objPHPExcel->getActiveSheet()->setTitle('DRAWING ASSIGNED TO SUBCONT');
$objPHPExcel->setActiveSheetIndex(0);
$formattedFileName = date("m/d/Y_h:i", time());
// simpan file excel dengan nama umr2013.xls
//saat file berhasil di buat, otomatis pop up download akan muncul
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="DrawingAssignedToSubcont_on_' . $date1 . '_' . $formattedFileName . '.xls"');
header('Cache-Control: max-age=0');
	<!--Currently logged in-->
	<?php 
} else {
    include "./PHPconnectionDB.php";
    $conn = connect();
    $pid = $_SESSION['pid'];
    $sql = "SELECT * FROM persons P WHERE P.person_id='{$pid}'";
    $stid = oci_parse($conn, $sql);
    $res = oci_execute($stid);
    if (!$res) {
        oci_free_statement($stid);
        oci_close($conn);
        header("Location: login.php");
        exit;
    }
    $row = oci_fetch($stid);
    $firstname = oci_result($stid, 'FIRST_NAME');
    $lastname = oci_result($stid, 'LAST_NAME');
    $address = oci_result($stid, 'ADDRESS');
    $email = oci_result($stid, 'EMAIL');
    $phone = oci_result($stid, 'PHONE');
    oci_free_statement($stid);
    oci_close($conn);
    ?>


        <form action="user-settings.php" method="post">
            <input type="text" name="firstname" value="<?php 
    echo $firstname;
    ?>
"/><label>First Name</label></br>
 oci_define_by_name($query1, "Type", $Type1);
 oci_define_by_name($query1, "IMAGE", $image1);
 oci_define_by_name($query1, "Prodid", $Prodid1);
 oci_define_by_name($query1, "Quantity", $qty1);
 oci_define_by_name($query1, "SALEPRICE", $price1);
 oci_execute($query1);
 $Count1 = oci_num_rows($query1);
 print "SELECT * from product WHERE Name LIKE '%{$searchq}%' OR Type LIKE '%{$searchq}%'";
 //	print($Count1);
 //	exit;
 //	if ($Count1==0)
 //	{
 //		$output= 'There was no search results!';
 //}else	{;
 $output = '<table border="0" cellpadding="10"><tr>';
 while (oci_fetch($query1)) {
     /*
     $Name = $row["Name"];
     $Type = $row["Type"];
     $image=$row["prod_image"];
     $Prodid = $row["Prodid"];
     $qty = $row["Quantity"];
     $price = $row["Price"];
     */
     if ($i % 3 == 0) {
         $output .= '</tr><tr>';
         /*$dyn_table .='<td>'.$Name;
         		$dyn_table .='<br>'.$Type.'<br>';
         		$dyn_table .='<img src="'.$image.'" width = 200, height = 200/></td>';
         */
     }
Example #24
0
		<div class="container">
		  <div class="row">
				<?php 
$felh_id_sql = "SELECT F_ID FROM FELHASZNALO WHERE FELHASZNALONEV = '{$_SESSION['user']}'";
$felh_id_lekerdez = oci_parse($conn, $felh_id_sql);
oci_execute($felh_id_lekerdez);
while (oci_fetch($felh_id_lekerdez)) {
    $f_id = oci_result($felh_id_lekerdez, 'F_ID');
}
$sql = 'SELECT * FROM IGENYLES WHERE F_ID= ' . $f_id;
$igenylesek = oci_parse($conn, $sql);
oci_execute($igenylesek);
?>
				
				<?php 
while (oci_fetch($igenylesek)) {
    ?>
			        		<div class="col-md-4 col-xs-4">
								<div class="panel panel-default">
									<ul>
										<h3><li><?php 
    echo oci_result($igenylesek, 'MUNKAKAT');
    ?>
</li></h3>
										<i><li><?php 
    echo oci_result($igenylesek, 'SZOVEG');
    ?>
</li></i>
										<li><?php 
    echo oci_result($igenylesek, 'DATUM');
    ?>
Example #25
0
 /**
  * Returns a single column from the next row of a result set.
  *
  * @param int $col OPTIONAL Position of the column to fetch.
  * @return string
  * @throws \Zend\Db\Statement\Exception
  */
 public function fetchColumn($col = 0)
 {
     if (!$this->_stmt) {
         return false;
     }
     if (!oci_fetch($this->_stmt)) {
         // if no error, there is simply no record
         if (!($error = oci_error($this->_stmt))) {
             return false;
         }
         throw new OracleException($error);
     }
     $data = oci_result($this->_stmt, $col + 1);
     //1-based
     if ($data === false) {
         throw new OracleException(oci_error($this->_stmt));
     }
     if ($this->getLobAsString()) {
         // instanceof doesn't allow '-', we must use a temporary string
         $type = 'Oci-Lob';
         if ($data instanceof $type) {
             $data = $data->read($data->size());
         }
     }
     return $data;
 }
Example #26
0
<?php

$path = join(DIRECTORY_SEPARATOR, array('..', 'conn', 'OracleProske.php'));
include $path;
$sql0 = oci_parse($conn, 'select max(roundid) as round from telebet.match');
oci_define_by_name($sql0, 'ROUND', $round);
oci_execute($sql0);
oci_fetch($sql0);
$sql = oci_parse($conn, 'select cl.id, to_char(CL.CHANGE_DATE, \'dd.mm.yyyy HH24:mi\'), CL.OLD_DATE, to_char(CL.NEW_DATE, \'dd.mm.yyyy HH24:mi\'), concat(concat(CBP.NAME,\' \'),CBP.LASTNAME) NAME, m.matchnumber, l1.string, l2.string, cl.change_date
from TELEBET.MATCH m, TELEBET.BET_MATCH_TELEBET_INFO bmti, TELEBET.BET_MATCH bm, TELEBET.SP_EVENT_CHANGE_DATE_LOG cl,TELEBET.CB_PERSONS cbp, telebet.team t1, telebet.languagestring l1, telebet.team t2, telebet.languagestring l2
where matchnumber in (\'' . $selected_matchnumber . '\')
and roundid=\'' . $selected_round . '\'
and M.IS_GERMANIA_MATCH=\'' . $selected_kladionica . '\'
and BMTI.TELEBET_MATCH_ID=m.id
and BM.ID=BMTI.BET_MATCH_ID
and CL.EVENT_ID=BM.EVENT_ID
and CL.PERSON_ID=CBP.ID
and m.hometeamid = t1.id
and t1.name = l1.stringvaluesid
and l1.languageid=1
and m.visitorteamid = t2.id
and t2.name = l2.stringvaluesid
and l2.languageid=1
order by 9 desc');
oci_execute($sql);
$TimeChanged = array();
while ($row = oci_fetch_array($sql)) {
    array_push($TimeChanged, $row);
}
//print_r($TimeChanged);
Example #27
0
 /**
  * Returns a single column from the next row of a result set.
  *
  * @param int $col OPTIONAL Position of the column to fetch.
  * @return string
  * @throws Zend_Db_Statement_Exception
  */
 public function fetchColumn($col = 0)
 {
     if (!$this->_stmt) {
         return false;
     }
     if (!oci_fetch($this->_stmt)) {
         // if no error, there is simply no record
         if (!($error = oci_error($this->_stmt))) {
             return false;
         }
         /**
          * @see Zend_Db_Adapter_Oracle_Exception
          */
         require_once 'Zend/Db/Statement/Oracle/Exception.php';
         throw new Zend_Db_Statement_Oracle_Exception($error);
     }
     $data = oci_result($this->_stmt, $col + 1);
     //1-based
     if ($data === false) {
         /**
          * @see Zend_Db_Adapter_Oracle_Exception
          */
         require_once 'Zend/Db/Statement/Oracle/Exception.php';
         throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
     }
     if ($this->getLobAsString()) {
         // instanceof doesn't allow '-', we must use a temporary string
         $type = 'OCI-Lob';
         if ($data instanceof $type) {
             $data = $data->read($data->size());
         }
     }
     return $data;
 }
$assignedQtySql = "SELECT SUM (MDA.ASSIGNED_QTY) AS ASSIGN_QTY " . " FROM MASTER_DRAWING_ASSIGNED MDA INNER JOIN MASTER_DRAWING MD ON MD.HEAD_MARK = MDA.HEAD_MARK AND MD.DWG_STATUS = 'ACTIVE' " . " WHERE MD.PROJECT_NAME = :PROJNAME AND MD.COMP_TYPE = :COMP AND MD.HEAD_MARK = :HM";
$assignedQtyParse = oci_parse($conn, $assignedQtySql);
oci_bind_by_name($assignedQtyParse, ":PROJNAME", $projectName);
oci_bind_by_name($assignedQtyParse, ":COMP", $componentType);
oci_bind_by_name($assignedQtyParse, ":HM", $headmarkType);
oci_define_by_name($assignedQtyParse, "ASSIGN_QTY", $assignmentQty);
oci_execute($assignedQtyParse);
?>

    <?php 
while (oci_fetch($qtyParse)) {
    $unitQty;
}
?>
    <?php 
while (oci_fetch($assignedQtyParse)) {
    $assignmentQty;
}
?>

    <?php 
$availQty = $unitQty - $assignmentQty;
?>

    <label for="name" class="col-sm-2 control-label">SUBCONTRACTOR</label>
        <div class="col-sm-10">
            <?php 
$subcontSql = "SELECT SUBCONT_ID FROM SUBCONTRACTOR";
$subcontParse = oci_parse($conn, $subcontSql);
oci_execute($subcontParse);
echo '<select class="form-control" name="subcontAssign" id="subcontAssign" onchange="bootstrapValidatorOpen();" data-bv-notempty="true" data-bv-notempty-message="SUBCONTRACTOR is required and cannot be empty">' . '<br>';
Example #29
0
<?php

include "../../config.php";
include "../../function.php";
include "../../ibs_connector.php";
connect_to_base();
$query = mysql_query("SELECT * FROM `user` WHERE `id_in_ibs` = '0'");
if (mysql_num_rows($query) == 0) {
    echo 'Не обнаруженно в базе данных агентов с пустым полем id_in_ibs';
    exit;
}
while ($row = mysql_fetch_assoc($query)) {
    $oracle_sql = oci_parse($conn, "\n    select distinct c.contact_id, c.obj_name_orig\n \tfrom contact c\n\twhere c.contact_id in (select h.agent_id from ag_contract_header h)\n  \tand c.contact_type_id = 3\n    and c.obj_name_orig = '" . iconv('utf-8', 'windows-1251', trim($row['second_name']) . ' ' . trim($row['first_name']) . ' ' . trim($row['third_name'])) . "'  \n  ");
    oci_execute($oracle_sql);
    while (oci_fetch($oracle_sql)) {
        mysql_query("UPDATE `user` SET `id_in_ibs` = '" . oci_result($oracle_sql, "CONTACT_ID") . "' WHERE `user_id` = '" . $row['user_id'] . "'");
    }
}
Example #30
0
    }
    if (!empty($_GET['munkanev'])) {
        $kereses_lekerdez .= "MUNKANEV = '{$_GET['munkanev']}'";
    }
    if (!empty($_GET['rend'])) {
        if ($_GET['rend'] == 2) {
            $kereses_lekerdez .= " ORDER BY MUNKANEV";
        } elseif ($_GET['rend'] == 1) {
            $kereses_lekerdez .= " ORDER BY NEVE";
        } elseif ($_GET['rend'] == 3) {
            $kereses_lekerdez .= " ORDER BY (SELECT AVG(PONT) FROM ERTEKELES WHERE SZAKI.SZ_ID = ERTEKELES.SZ_ID) DESC";
        }
    }
    $kereses = oci_parse($conn, $kereses_lekerdez);
    oci_execute($kereses);
    while (oci_fetch($kereses)) {
        ?>
		        		<div class="col-md-3 col-xs-3">
							<div class="panel panel-default">
								<ul>
								<img src="assets/img/szakik.png" style="width: 150px; height: 150px;">
									<b><li><?php 
        echo oci_result($kereses, 'NEVE');
        ?>
</li></b>
									<i><li><?php 
        echo oci_result($kereses, 'MUNKANEV');
        ?>
</li></i>
									<li><?php 
        echo oci_result($kereses, 'MUNKATERULET');