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;
 }
 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;
 }
 public function verCondiciones_SExid($id_tipo)
 {
     //$facultades=new ArrayObject($array);
     $condicion = new Condicion_SE();
     $sqltxt = "select * from s_condicion_se where k_idcondicion =" . $id_tipo;
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch_array($stid)) {
         $condicion->setId_condicion(oci_result($stid, 'K_IDCONDICION'));
         //setIdfacultad(oci_result($stid, 'ID_FACULTAD'));
         $condicion->setId_tipo_condicion(oci_result($stid, 'T_CONDICION'));
         $condicion->setNombre_condicion(oci_result($stid, 'N_NOMCONDICION'));
         $condicion->setPuntaje(oci_result($stid, 'C_PUNTAJE'));
         //echo $facultades[$i]->getNombre_facultad();
     }
     return $condicion;
 }
 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 #9
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;
 }
Example #10
0
 public function verFacultades()
 {
     $facultades = array();
     $i = 0;
     //$facultades=new ArrayObject($array);
     $sqltxt = "select * from s_facultad";
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch_array($stid)) {
         $facultad = new Facultad();
         $facultad->setIdfacultad(oci_result($stid, 'K_IDFACULTAD'));
         $facultad->setNombre_facultad(oci_result($stid, 'N_NOMFACULTAD'));
         $facultades[$i] = $facultad;
         //echo $facultades[$i]->getNombre_facultad();
         $i += 1;
     }
     return $facultades;
 }
 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;
 }
 public function verTipos_Condiciones()
 {
     $tipos_condiciones = array();
     $i = 0;
     //$facultades=new ArrayObject($array);
     $sqltxt = "select * from s_Tipo_Condicion";
     //echo $sqltxt;
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch_array($stid)) {
         $tipo = new Tipo_Condicion_SE();
         $tipo->setId_tipo_condicion(oci_result($stid, 'ID_TIPO_COND'));
         $tipo->setNombre_tipo_condicion(oci_result($stid, 'NOMBRE_TIPO_COND'));
         $tipos_condiciones[$i] = $tipo;
         //echo $tipos_condiciones[$i]->getNombre_tipo_condicion();
         $i += 1;
     }
     return $tipos_condiciones;
 }
Example #13
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;
 }
 public function verCondiciones_SExtipo($id_tipo)
 {
     $condiciones = array();
     $i = 0;
     //$facultades=new ArrayObject($array);
     $sqltxt = "select * from s_condicion_se where id_tipo_cond =" . $id_tipo;
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch_array($stid)) {
         $condicion = new Condicion_SE();
         $condicion->setId_condicion(oci_result($stid, 'ID_CONDICION'));
         //setIdfacultad(oci_result($stid, 'ID_FACULTAD'));
         $condicion->setId_tipo_condicion(oci_result($stid, 'ID_TIPO_COND'));
         $condicion->setNombre_condicion(oci_result($stid, 'NOMBRE_CONDICION'));
         $condicion->setPuntaje(oci_result($stid, 'PUNTAJE'));
         $condiciones[$i] = $condicion;
         //echo $facultades[$i]->getNombre_facultad();
         $i += 1;
     }
     return $condiciones;
 }
 public function verCondicionxSolicitudxSolicitud($solicitud)
 {
     $condiciones = array();
     //$solicitud=new Solicitud();
     $i = 0;
     //$facultades=new ArrayObject($array);
     $sqltxt = "select * from s_condicionsolicitud where k_solicitud =" . $solicitud->getId_solicitud();
     $stid = oci_parse($_SESSION['sesion_logueado'], $sqltxt);
     oci_execute($stid);
     while (oci_fetch_array($stid)) {
         $condicionxsolicitud = new CondicionxSolicitud();
         $condicionxsolicitud->setId_condicion(oci_result($stid, 'K_CONDICION'));
         $condicionxsolicitud->setId_solicitud(oci_result($stid, 'K_SOLICITUD'));
         $condicionxsolicitud->setDescripcion(oci_result($stid, 'N_DESCRIPCION'));
         $condicionxsolicitud->setSoportes_solicitud(oci_result($stid, 'N_SOPORTE'));
         $condicionxsolicitud->setValidado(oci_result($stid, 'N_VALIDADO'));
         $condiciones[$i] = $condicionxsolicitud;
         //echo $facultades[$i]->getNombre_facultad();
         $i += 1;
     }
     return $condiciones;
 }
 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 #19
0
										<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');
    ?>
</li>
										<a 	role="button" 
											class="btn btn-info" 
											href="ticket.php?h_id=<?php 
    echo oci_result($igenylesek, 'H_ID');
    ?>
"
											>
											Megtekint
										</a>
									</ul>
								</div>
							</div>
				
				<?php 
}
?>

		    </div>
		  </div>
Example #20
0
									<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');
        ?>
</li>
									<a 	role="button" 
										class="btn btn-info" 
										href="profile.php?sz_id=<?php 
        echo oci_result($kereses, 'SZ_ID');
        ?>
"
										>
										Megtekint
									</a>
								</ul>
							</div>
						</div>
				<?php 
    }
}
?>
		    </div>
		  </div>
		</div>
Example #21
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;
 }
    $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>
            <input type="text" name="lastname" value="<?php 
    echo $lastname;
    ?>
"/><label>Last Name</label></br>
            <input type="text" name="address" value="<?php 
Example #23
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;
 }
Example #24
0
 /**
  * Returns the data from a single column in a result set.
  *
  * @param $col
  * @return $data
  * @throws Zend_Db_Statement_Oracle_Exception
  */
 public function fetchColumn($col = 0)
 {
     if (!$this->_stmt) {
         return false;
     }
     if (!oci_fetch($this->_stmt)) {
         /* TODO ERROR */
     }
     $data = oci_result($this->_stmt, $col + 1);
     //1-based
     if ($data === false) {
         throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
     }
     return $data;
 }
Example #25
0
 /**
  * Fetch
  * This function will fetch a result from the result set passed in.
  *
  * @see Query
  * @see SetError
  *
  * @return Mixed Returns false if the result is empty. Otherwise returns the next result.
  */
 function Fetch($resource = null)
 {
     if ($resource === null) {
         $this->SetError('Resource is a null object');
         return false;
     }
     if (!is_resource($resource)) {
         $this->SetError('Resource ' . $resource . ' is not really a resource');
         return false;
     }
     $tmpRow = array();
     $row = $this->magic_quotes_runtime_on ? $this->StripslashesArray(oci_fetch_assoc($resource)) : oci_fetch_assoc($resource);
     if ($row && is_array($row) && sizeof($row)) {
         foreach ($row as $k => $v) {
             if (is_object($v) && strtolower(get_class($v)) == 'oci-lob') {
                 $lob = oci_result($resource, $k);
                 $lobVal = $lob->load();
                 $tmpRow[strtolower($k)] = $lobVal;
             } else {
                 $tmpRow[strtolower($k)] = $v;
             }
         }
     }
     return $tmpRow;
 }
Example #26
0
<?php

session_start();
require 'connect.inc.php';
//felhasználói adatok megszerzése
$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');
}
$data = json_decode(file_get_contents("php://input"));
$sz_id = $data->f_id;
$pont = $data->pont;
$szoveg = $data->szoveg;
$beilleszt_sql = "INSERT INTO ERTEKELES(SZ_ID, F_ID, DATUM, PONT, SZOVEG ) VALUES(:sz_id, :f_id, sysdate, :pont, :szoveg)";
$beilleszt = oci_parse($conn, $beilleszt_sql);
oci_bind_by_name($beilleszt, ':sz_id', $sz_id);
oci_bind_by_name($beilleszt, ':f_id', $f_id);
oci_bind_by_name($beilleszt, ':pont', $pont);
oci_bind_by_name($beilleszt, ':szoveg', $szoveg);
oci_execute($beilleszt);
Example #27
0
if (isset($_SESSION['user'])) {
    //echo $_SESSION['user'] . '!';
    echo '<li><a href="logout.php"><span class="glyphicon glyphicon-remove"></span> Kilépés</a></li>';
    $user = $_SESSION['user'];
    $query = "SELECT COUNT(*) AS NUMBER_OF_ROWS FROM FELHASZNALO WHERE FELHASZNALONEV = '" . $user . "'";
    $stid = oci_parse($conn, $query);
    oci_define_by_name($stid, 'NUMBER_OF_ROWS', $number_of_rows);
    oci_execute($stid);
    oci_fetch($stid);
    if ($number_of_rows == 0) {
        $a = 1;
        $fejl_id_sql = "SELECT SZ_ID FROM SZAKI WHERE FELHASZNALONEV = '{$_SESSION['user']}'";
        $fejl_id_lekerdez = oci_parse($conn, $fejl_id_sql);
        oci_execute($fejl_id_lekerdez);
        while (oci_fetch($fejl_id_lekerdez)) {
            $fejl_id = oci_result($fejl_id_lekerdez, 'SZ_ID');
        }
        $munka_sql = 'SELECT COUNT(*) AS MUNKASZAM FROM IGENYLES WHERE MUNKAKAT= (SELECT MUNKANEV FROM SZAKI WHERE SZ_ID=' . $fejl_id . ")";
        $munka_szam = oci_parse($conn, $munka_sql);
        oci_define_by_name($munka_szam, 'MUNKASZAM', $munkaszam);
        oci_execute($munka_szam);
        oci_fetch($munka_szam);
        echo '<li id="munkak" class="last"><a href="munkat.php">Munkák <span class="badge">' . $munkaszam . '</span></a></li>';
        echo '<li id="elofizetes" class="last"><a href="elofizetes.php">Előfizetés</a></li>';
        echo '<li id="uzenet" class="last"><a href="uzenetek.php">Üzenetek</a></li>';
        oci_free_statement($munka_szam);
    } else {
        $a = 0;
        echo '<li id="kedvenceim" class="last"><a href="kedvenceim.php">Kedvenceim</a></li>';
        echo '<li id="uzenet" class="last"><a href="uzenetek.php">Üzenetek</a></li>';
        echo '<li id="panasz" class="last"><a href="panasz.php">Panasz</a></li>';
 function tableExistsForSqlStmt($db, $sql)
 {
     //echo "$this->log - $sql <br />";
     $stmt = oci_parse($db, $sql);
     oci_execute($stmt);
     $count = 0;
     if (oci_fetch($stmt)) {
         $count = oci_result($stmt, 1);
         if ($count == 0) {
             return false;
         } else {
             return true;
         }
     }
 }
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
 /**
  * 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)) {
         /* TODO 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));
     }
     return $data;
 }