public function get_ams_student($student_id = NULL) { $conn = oci_connect('AMS_QUERIES', 'Oo_Hecha1_rohm3', '//192.168.170.171:1522/ACADEMIC'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } else { if ($student_id == NULL) { $sql = "SELECT * FROM GAOWNER.VIEW_STUDENT_DETAILS"; } else { $sql = 'SELECT * FROM GAOWNER.VIEW_STUDENT_DETAILS WHERE STUDENT_NO LIKE \'%' . $student_id . '%\''; } $rs4 = oci_parse($conn, $sql); oci_execute($rs4); $rows = oci_num_rows($rs4); $t = 0; while (OCIFetch($rs4)) { $t++; $name1 = ociresult($rs4, "SURNAME"); $dob = ociresult($rs4, "DOB"); $gender = ociresult($rs4, "GENDER"); $oname1 = ociresult($rs4, "OTHER_NAMES"); $STUDENT_NO = ociresult($rs4, "STUDENT_NO"); $COURSES = ociresult($rs4, "COURSES"); $GUARDIAN_NAME1 = ociresult($rs4, "GUARDIAN_NAME"); $MOBILE_NO = ociresult($rs4, "MOBILE_NO"); $EMAIL = ociresult($rs4, "EMAIL"); $FACULTIES = ociresult($rs4, "FACULTIES"); // details to be saved $name = str_replace("'", "", "{$name1}"); $oname = str_replace("'", "", "{$oname1}"); $GUARDIAN_NAME = str_replace("'", "", "{$GUARDIAN_NAME1}"); if (!empty($STUDENT_NO)) { $exists = $this->student_exists($STUDENT_NO); $data = array('title' => '', 'Surname' => $name, 'Other_names' => $oname, 'DOB' => $dob, 'contact' => $MOBILE_NO, 'gender' => $gender, 'student_Number' => $STUDENT_NO, 'courses' => $FACULTIES, 'GUARDIAN_NAME' => $GUARDIAN_NAME, 'faculty' => $FACULTIES); if (!$exists) { $this->db->insert('student', $data); } else { $this->db->where('student_Number', $STUDENT_NO); $this->db->update('student', $data); } $date = date("Y-m-d H:i:s"); // data for patients patient date, visit type, strath number created by and modified by fields if ($student_id != NULL) { $patient_data = array('patient_number' => $this->create_patient_number(), 'patient_date' => $date, 'visit_type_id' => 1, 'strath_no' => $STUDENT_NO, 'created_by' => $this->session->userdata('personnel_id'), 'modified_by' => $this->session->userdata('personnel_id')); $this->db->insert('patients', $patient_data); return $this->db->insert_id(); } } else { $this->session->set_userdata("error_message", "Student could not be found"); return FALSE; } } if ($student_id != NULL) { return TRUE; } } }
print "<center><A HREF=\"frame02.php\" target=\"principal\"><IMG SRC=\"img/volta.gif\" alt=\"Retorna à Página Anterior\" BORDER=0></a></center>"; } if ($aocobrarco == 'S') { print "<center><A HREF=\"consultit.php\" target=\"guia\"><IMG SRC=\"img/volta.gif\" alt=\"Retorna à Página Anterior\" BORDER=0></a></center>"; } } } if ($nrsequencia == '0') { if ($nrunimed == '127') { $stmt9 = ociparse($conn, "SELECT CDSERVICO FROM (SELECT CDSERVICO FROM SERVICO_ESPECIALISTA WHERE NRREGISTRO_PREST = '{$result1}' AND CDESPECIALIDADE = '{$cdespecial}' AND CDSERVICO LIKE '0001%' AND (AOEXCLUSAO IS NULL OR AOEXCLUSAO = 'N')) WHERE ROWNUM = '1'"); } else { $stmt9 = ociparse($conn, "SELECT CDSERVICO FROM(\n SELECT 1 A, CDSERVICO FROM SERVICO_ESPECIALISTA\n WHERE NRREGISTRO_PREST = '{$result1}'\n AND CDESPECIALIDADE = '{$cdespecial}' AND AOSERVICO_CONSULTA = 'S'\n UNION\n SELECT 2 A, CDSERVICO FROM SERVICO_ESPECIALIDADE\n WHERE CDESPECIALIDADE = '{$cdespecial}' AND AOSERVICO_CONSULTA = 'S'\n UNION\n SELECT 3 A, VLPARAMETRO CDSERVICO FROM PARAMETRO\n WHERE CDPARAMETRO = 'SERVCONS')\n WHERE ROWNUM = '1'\n ORDER BY A\n "); } OCIdefineByName($stmt9, "cdservico", $cdservico); OCIexecute($stmt9); OCIFetch($stmt9); $result4 = OCIResult($stmt9, 1); OCIFreeStatement($stmt9); } print "<center><form onSubmit=\"return disableForm(this);\" action=\"servc.php?btnptu={$btnptu}\" method=\"POST\" name=\"digitsv\">"; //if (!($sv != !1 and $qt != !1)&&($funcionario == 'AUTOWEB')) { if (!($sv != !1 and $qt != !1)) { //RAMON include "maecad.php"; include "cpfcad.php"; //RAMON } if ($nrsequencia == '0') { echo "<img src=\"img/barra.jpg\" width=\"603\" height=\"3\"><br>\n <font class='nome_campo'>Código: </font>\n <input onKeyUp=\"return autoTab(this, 8, event);\"\n type=\"text\" size=\"8\" maxlength=\"8\"\n name=\"sv\"\n onBlur=\"chkcampo(this,this.value);\"\n value=\""; if ($result4 != !1) { echo $result4;
/** * Returns information about a table or a result set. * * NOTE: only supports 'table' and 'flags' if <var>$result</var> * is a table name. * * NOTE: flags won't contain index information. * * @param object|string $result MDB2_result object from a query or a * string containing the name of a table * @param int $mode a valid tableInfo mode * @return array an associative array with the information requested * or an error object if something is wrong * @access public * @internal * @see MDB2_Driver_Common::tableInfo() */ function tableInfo($result, $mode = null) { $db =& $GLOBALS['_MDB2_databases'][$this->db_index]; if ($db->options['portability'] & MDB2_PORTABILITY_LOWERCASE) { $case_func = 'strtolower'; } else { $case_func = 'strval'; } if (is_string($result)) { /* * Probably received a table name. * Create a result resource identifier. */ if (MDB2::isError($connect = $db->connect())) { return $connect; } $result = strtoupper($result); $q_fields = 'SELECT column_name, data_type, data_length, ' . 'nullable ' . 'FROM user_tab_columns ' . "WHERE table_name='{$result}' ORDER BY column_id"; $db->last_query = $q_fields; if (!($stmt = @OCIParse($db->connection, $q_fields))) { return $db->raiseError(MDB2_ERROR_NEED_MORE_DATA); } if (!@OCIExecute($stmt, OCI_DEFAULT)) { return $db->raiseError($stmt); } $i = 0; while (@OCIFetch($stmt)) { $res[$i]['table'] = $case_func($result); $res[$i]['name'] = $case_func(@OCIResult($stmt, 1)); $res[$i]['type'] = @OCIResult($stmt, 2); $res[$i]['len'] = @OCIResult($stmt, 3); $res[$i]['flags'] = @OCIResult($stmt, 4) == 'N' ? 'not_null' : ''; if ($mode & MDB2_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & MDB2_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } $i++; } if ($mode) { $res['num_fields'] = $i; } @OCIFreeStatement($stmt); } else { /* * Probably received a result object. * Extract the result resource identifier. */ $id = $result->getResource(); if (empty($id)) { return $db->raiseError(); } # if ($result === $db->last_stmt) { $count = @OCINumCols($id); for ($i = 0; $i < $count; $i++) { $res[$i]['table'] = ''; $res[$i]['name'] = $case_func(@OCIColumnName($id, $i + 1)); $res[$i]['type'] = @OCIColumnType($id, $i + 1); $res[$i]['len'] = @OCIColumnSize($id, $i + 1); $res[$i]['flags'] = ''; if ($mode & MDB2_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & MDB2_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } } if ($mode) { $res['num_fields'] = $i; } # } else { # return $db->raiseError(MDB2_ERROR_NOT_CAPABLE); # } } return $res; }
<input id="Segundo apellido" name="Segundo_apellido" value="" type="text" placeholder="Segundo Apellido" required ><br> </label> </br></br> <?php echo "<select name=\"combo_genero\">"; while (OCIFetch($array_GENERO)) { $campo_GENERO = OCIResult($array_GENERO, 2); //aca va la columna echo "<option value=\"{$campo_GENERO}\">{$campo_GENERO}</option>"; } echo "</select>"; ?> </td> <td><?php echo "<select name=\"combo_CIUDAD\">"; while (OCIFetch($array_CIUDAD)) { $campo_CIUDAD = OCIResult($array_CIUDAD, 2); //aca va la columna echo "<option value=\"{$campo_CIUDAD}\">{$campo_CIUDAD}</option>"; } echo "</select>"; ?> </td> <br> <label class="email"> <span>Email</span><br> <input id="password" name="password" value="" type="password" placeholder="Email" required><br> </label> <label class="password"> <span>Contraseña</span><br> <input id="password" name="password" value="" type="password" placeholder="Contraseña" required><br>
$iserror = true; } // end if if (!$iserror) { require_once 'inc/dbconnect.php'; global $db; // count the record in plants table and use id number $count+1 for the new record $query_count = "SELECT max(ID) FROM accounts"; /* check the sql statement for errors and if errors report them */ $stmt = OCIParse($db, $query_count); if (!$stmt) { echo "An error occurred in parsing the sql string.\n"; exit; } OCIExecute($stmt); if (OCIFetch($stmt)) { $count = OCIResult($stmt, 1); //returns the data for column 1 //echo $count."</br>"; } else { echo "An error occurred in retrieving account id.\n"; exit; } $count++; // build INSERT query $query = "INSERT INTO accounts ( ID, Username, Password, Email, Phone, Address, City, Postcode ) " . "VALUES ( {$count}, '{$uname}', '{$pword}', '{$email}', " . "'" . quotemeta($phone) . "', '{$address}', '{$city}', '{$postcode}' )"; //echo "$query"; /* check the sql statement for errors and if errors report them */ $stmt = OCIParse($db, $query); //echo "SQL: $query<br>"; if (!$stmt) {
function sql_rowseek($rownum, $query_id = 0) { if (!$query_id) { $query_id = $this->query_result; } if ($query_id) { @OCIExecute($query_id, OCI_DEFAULT); for ($i = 0; $i < $rownum; $i++) { @OCIFetch($query_id); } $result = @OCIFetch($query_id); return $result; } else { return false; } }
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 while (OCIFetch($stmt)) { echo "<tr>"; echo "<td>IBSN</td>"; $fg1 = OCIResult($stmt, "IBSN"); echo "<td>"; echo $fg1; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Title</td>"; $fg2 = OCIResult($stmt, "TITLE"); echo "<td>"; echo $fg2; echo "</td>"; echo "</tr>"; echo "<tr>";
function LimitQuery($query, $offset, $rows) { $this->FreeResult(); $this->oid = 0; $this->cur = -1; $this->vcur = -1; $this->Record = array(); if ($this->conn) { if (!($this->res = OCIParse($this->conn, $query))) { trigger_error("Error parsing query: {$query}"); return $this->ReportError($this->conn); } if (OCIExecute($this->res)) { $this->cur = 0; // Push cursor to appropriate row in case next_record() is used while ($this->cur < $offset) { OCIFetch($this->res); $this->cur++; } $this->vcur = $offset + $rows - 1; return $this->res; } else { trigger_error("Error executing query: {$query}"); return -1; } } else { return -1; } }
print htmlentities($e['message']); exit; } // create SQL statement $sql = "Select * from Classes"; // parse SQL statement $sql_statement = OCIParse($conn, $sql); // execute SQL query OCIExecute($sql_statement); // get number of columns for use later $num_columns = OCINumCols($sql_statement); // start results formatting echo "<TABLE BORDER=1>"; echo "<TR><TH>SCU Core Class</TH><TH>Alternate Class</TH><TH>University</TH></TR>"; // format results by row while (OCIFetch($sql_statement)) { echo "<TR>"; for ($i = 1; $i <= $num_columns; $i++) { $column_value = OCIResult($sql_statement, $i); echo "<TD>{$column_value}</TD>"; } echo "</TR>"; } echo "</TABLE>"; OCIFreeStatement($sql_statement); OCILogoff($conn); ?> <html> <head> <title>Step 1</title> </head>
function SkipFirstRows($result) { $result_value = intval($result); $first = $this->limits[$result_value][0]; for (; $this->limits[$result_value][2] < $first; $this->limits[$result_value][2]++) { if (!OCIFetch($result)) { $this->limits[$result_value][2] = $first; return $this->SetError("Skip first rows", "could not skip a query result row"); } } return 1; }
?> </td> <td><?php echo "<select MULTIPLE name=\"combo_CATEGORIA_INTERES\">"; while (OCIFetch($array_CATEGORIA_INTERES)) { $campo_CATEGORIA_INTERES = OCIResult($array_CATEGORIA_INTERES, 2); //aca va la columna echo "<option value=\"{$campo_CATEGORIA_INTERES}\">{$campo_CATEGORIA_INTERES}</option>"; } echo "</select>"; ?> </td> <td> <?php echo "<select MULTIPLE name=\"combo_prueba\">"; while (OCIFetch($array_INTERES)) { $campo_interes = OCIResult($array_INTERES, 2); //aca va la columna echo "<option value=\"{$campo_interes}\">{$campo_interes}</option>"; } echo "</select>"; ?> </td> </table> <br> <b>Mascotas:</b> <br> <br> Gato: <select> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option>
function F_OCIFetch($Res) { return OCIFetch($Res); }
function readCart() { global $db; global $grandtotal; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',', $cart); $contents = array(); foreach ($items as $item) { $contents[$item] = isset($contents[$item]) ? $contents[$item] + 1 : 1; } $output[] = '<table class="cart_table">'; $output[] = '<tr class="cart_title">'; $output[] = '<td>Book name</td><td>Unit price</td><td>Qty</td><td>Total</td>'; $output[] = '</tr>'; foreach ($contents as $id => $qty) { $sql = 'SELECT * FROM books WHERE id = ' . $id; $stmt = OCIParse($db, $sql); if (!$stmt) { echo "An error occurred in parsing the sql string.\n"; exit; } OCIExecute($stmt); while (OCIFetch($stmt)) { $title = OCIResult($stmt, "TITLE"); $author = OCIResult($stmt, "AUTHOR"); $price = OCIResult($stmt, "PRICE"); $id = OCIResult($stmt, "ID"); } // calculate gst and shipping $gst = 0.1; $price = $price + $price * $gst; $price = number_format($price, 2); $subtotal = number_format($price * $qty, 2); $shipping += 4.95 * $qty; $total += $subtotal + $shipping; // display items in cart $output[] = '<tr>'; $output[] = '<td>' . $title . '</td>'; $output[] = '<td>$' . $price . '</td>'; $output[] = '<td>' . $qty . '</td>'; $output[] = '<td>$' . $subtotal . '</td>'; $output[] = '</tr>'; } // set global totals to use in session $grandtotal = number_format($total, 2); $_SESSION['grandtotal'] = $grandtotal; // display shipping $totalshipping = number_format($shipping, 2); $output[] = '<tr>'; $output[] = '<td colspan="3" class="cart_total"><span class="red">TOTAL SHIPPING:</span></td>'; $output[] = '<td>$' . $totalshipping . '</td>'; $output[] = '</tr>'; // display total $output[] = '<tr>'; $output[] = '<td colspan="3" class="cart_total"><span class="red">GRAND TOTAL:</span></td>'; $output[] = '<td>$' . $grandtotal . '</td>'; $output[] = '</tr>'; $output[] = '</table>'; } else { $output[] = '<p>Your shopping cart is empty.<br />Order books by selecting the <strong>Order Now</strong> button when viewing book details.</p>'; $grandtotal = 0; } return join('', $output); }
function DBNavStart() { if ($this->bFetched === true) { return; } $this->bFetched = true; $this->NavPageNomer = $this->PAGEN < 1 ? $_SESSION[$this->SESS_PAGEN] < 1 ? 1 : $_SESSION[$this->SESS_PAGEN] : $this->PAGEN; if ($this->NavShowAll) { $NavFirstRecordShow = 0; $NavLastRecordShow = 100000; } else { $NavFirstRecordShow = $this->NavPageSize * ($this->NavPageNomer - 1); $NavLastRecordShow = $this->NavPageSize * $this->NavPageNomer; } $temp_arrray = array(); $num_rows = 0; $rsEnd = false; $cache_arrray = array(); @ocisetprefetch($this->result, 100); while ($num_rows < $NavFirstRecordShow && !$rsEnd) { if (OCIFetchInto($this->result, $db_result_array, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS)) { $num_rows++; if (count($cache_arrray) == $NavPageSize) { $cache_arrray = array(); } $cache_arrray[] = $db_result_array; } else { $rsEnd = true; } } if ($rsEnd && count($cache_arrray) > 0) { $this->NavPageNomer = floor($num_rows / $this->NavPageSize); if ($num_rows % $this->NavPageSize > 0) { $this->NavPageNomer++; } $temp_arrray = $cache_arrray; } $bFirst = true; while ($num_rows < $NavLastRecordShow && !$rsEnd) { if (OCIFetchInto($this->result, $db_result_array, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS)) { $num_rows++; $temp_arrray[] = $db_result_array; } else { $rsEnd = true; if ($bFirst && count($cache_arrray) > 0) { $this->NavPageNomer = floor($num_rows / $this->NavPageSize); if ($num_rows % $this->NavPageSize > 0) { $this->NavPageNomer++; } $temp_arrray = $cache_arrray; } } $bFirst = false; } if (!$rsEnd) { while (OCIFetch($this->result)) { $num_rows++; } } $this->arResult = $temp_arrray; $this->NavRecordCount = $num_rows; if ($this->NavShowAll) { $this->NavPageSize = $this->NavRecordCount; $this->NavPageNomer = 1; } if ($this->NavPageSize > 0) { $this->NavPageCount = floor($this->NavRecordCount / $this->NavPageSize); } else { $this->NavPageCount = 0; } if ($this->NavRecordCount % $this->NavPageSize > 0) { $this->NavPageCount++; } }
function tableInfo($result, $mode = null) { $count = 0; $res = array(); /* * depending on $mode, metadata returns the following values: * * - mode is false (default): * $res[]: * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["nullable"] field can be null (boolean) * [0]["format"] field precision if NUMBER * [0]["default"] field default value * * - mode is DB_TABLEINFO_ORDER * $res[]: * ["num_fields"] number of fields * [0]["table"] table name * [0]["name"] field name * [0]["type"] field type * [0]["len"] field length * [0]["nullable"] field can be null (boolean) * [0]["format"] field precision if NUMBER * [0]["default"] field default value * ['order'][field name] index of field named "field name" * The last one is used, if you have a field name, but no index. * Test: if (isset($result['order']['myfield'])) { ... * * - mode is DB_TABLEINFO_ORDERTABLE * the same as above. but additionally * ["ordertable"][table name][field name] index of field * named "field name" * * this is, because if you have fields from different * tables with the same field name * they override each * other with DB_TABLEINFO_ORDER * * you can combine DB_TABLEINFO_ORDER and * DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER | * DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL */ // if $result is a string, we collect info for a table only if (is_string($result)) { $result = strtoupper($result); $q_fields = "select column_name, data_type, data_length, data_precision,\n nullable, data_default from user_tab_columns\n where table_name='{$result}' order by column_id"; if (!($stmt = OCIParse($this->connection, $q_fields))) { return $this->oci8RaiseError(); } if (!OCIExecute($stmt, OCI_DEFAULT)) { return $this->oci8RaiseError($stmt); } while (OCIFetch($stmt)) { $res[$count]['table'] = $result; $res[$count]['name'] = @OCIResult($stmt, 1); $res[$count]['type'] = @OCIResult($stmt, 2); $res[$count]['len'] = @OCIResult($stmt, 3); $res[$count]['format'] = @OCIResult($stmt, 4); $res[$count]['nullable'] = @OCIResult($stmt, 5) == 'Y' ? true : false; $res[$count]['default'] = @OCIResult($stmt, 6); if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$count]['name']] = $count; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$count]['table']][$res[$count]['name']] = $count; } $count++; } $res['num_fields'] = $count; @OCIFreeStatement($stmt); } else { // else we want information about a resultset if ($result === $this->last_stmt) { $count = @OCINumCols($result); for ($i = 0; $i < $count; $i++) { $res[$i]['name'] = @OCIColumnName($result, $i + 1); $res[$i]['type'] = @OCIColumnType($result, $i + 1); $res[$i]['len'] = @OCIColumnSize($result, $i + 1); $q_fields = "select table_name, data_precision, nullable, data_default from user_tab_columns where column_name='" . $res[$i]['name'] . "'"; if (!($stmt = OCIParse($this->connection, $q_fields))) { return $this->oci8RaiseError(); } if (!OCIExecute($stmt, OCI_DEFAULT)) { return $this->oci8RaiseError($stmt); } OCIFetch($stmt); $res[$i]['table'] = OCIResult($stmt, 1); $res[$i]['format'] = OCIResult($stmt, 2); $res[$i]['nullable'] = OCIResult($stmt, 3) == 'Y' ? true : false; $res[$i]['default'] = OCIResult($stmt, 4); OCIFreeStatement($stmt); if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } } $res['num_fields'] = $count; } else { return $this->raiseError(DB_ERROR_NOT_CAPABLE); } } return $res; }
} echo "</select>"; ?></td> <td><?php echo "<select MULTIPLE name=\"combo_CATEGORIA_INTERES\">"; while (OCIFetch($array_CATEGORIA_INTERES))//Ciclo para recorrer la tabla { $campo_CATEGORIA_INTERES=OCIResult($array_CATEGORIA_INTERES,2);//aca va la columna echo "<option value=\"$campo_CATEGORIA_INTERES\">$campo_CATEGORIA_INTERES</option>"; } echo "</select>"; ?></td> <td> <?php echo "<select MULTIPLE name=\"combo_prueba\">"; while (OCIFetch($array_INTERES))//Ciclo para recorrer la tabla { $campo_interes=OCIResult($array_INTERES,2);//aca va la columna echo "<option value=\"$campo_interes\">$campo_interes</option>"; } echo "</select>"; ?> </td> </table> <br> <b>Mascotas:</b> <br> <br> Gato: <select> <option value="0">0</option>
<?php require 'loginform.php'; if (isset($_POST['felhnev']) && isset($_POST['jelszo']) && isset($_POST['tipus'])) { $username = $_POST['felhnev']; $password = $_POST['jelszo']; $tipus = $_POST['tipus']; if ($tipus == 'szaki') { $query = "SELECT * FROM SZAKI WHERE FELHASZNALONEV = '" . $username . "' and JELSZO='" . $password . "'"; } else { if ($tipus == 'felhasz') { $query = "SELECT * FROM FELHASZNALO WHERE FELHASZNALONEV = '" . $username . "' and JELSZO='" . $password . "'"; } } $stid = oci_parse($conn, $query); oci_execute($stid); $tmpcount = OCIFetch($stid); if ($tmpcount == 1) { $count = OCIRowCount($stid); if ($count == 1) { $_SESSION['user'] = $username; header('Location: index.php'); } } else { echo '<div align="center" class="alert alert-danger" style="width:300px;">Hibás jelszó vagy felhasználó név vagy rossz típus választás.<div>'; } } ?> </div> </body> </html>
function nextid($seqname) { $this->connect(); $Query_ID = @OCIParse($this->Link_ID, "SELECT {$seqname}.NEXTVAL FROM DUAL"); if (!@OCIExecute($Query_ID)) { $this->Error = @OCIError($Query_ID); if (2289 == $this->Error["code"]) { $Query_ID = OCIParse($this->Link_ID, "CREATE SEQUENCE {$seqname}"); if (!OCIExecute($Query_ID)) { $this->Error = OCIError($Query_ID); $this->halt("<BR> nextid() function - unable to create sequence<br>" . $this->Error["message"]); } else { $Query_ID = OCIParse($this->Link_ID, "SELECT {$seqname}.NEXTVAL FROM DUAL"); OCIExecute($Query_ID); } } } if (OCIFetch($Query_ID)) { $next_id = OCIResult($Query_ID, "NEXTVAL"); } else { $next_id = 0; } OCIFreeStatement($Query_ID); return $next_id; }
/** * Returns information about a table or a result set * * NOTE: only supports 'table' and 'flags' if <var>$result</var> * is a table name. * * NOTE: flags won't contain index information. * * @param object|string $result DB_result object from a query or a * string containing the name of a table. * While this also accepts a query result * resource identifier, this behavior is * deprecated. * @param int $mode a valid tableInfo mode * * @return array an associative array with the information requested. * A DB_Error object on failure. * * @see DB_common::tableInfo() */ function tableInfo($result, $mode = null) { if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) { $case_func = 'strtolower'; } else { $case_func = 'strval'; } $res = array(); if (is_string($result)) { /* * Probably received a table name. * Create a result resource identifier. */ $result = strtoupper($result); $q_fields = 'SELECT column_name, data_type, data_length, ' . 'nullable ' . 'FROM user_tab_columns ' . "WHERE table_name='{$result}' ORDER BY column_id"; $this->last_query = $q_fields; if (!($stmt = @OCIParse($this->connection, $q_fields))) { return $this->oci8RaiseError(DB_ERROR_NEED_MORE_DATA); } if (!@OCIExecute($stmt, OCI_DEFAULT)) { return $this->oci8RaiseError($stmt); } $i = 0; while (@OCIFetch($stmt)) { $res[$i] = array('table' => $case_func($result), 'name' => $case_func(@OCIResult($stmt, 1)), 'type' => @OCIResult($stmt, 2), 'len' => @OCIResult($stmt, 3), 'flags' => @OCIResult($stmt, 4) == 'N' ? 'not_null' : ''); if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } $i++; } if ($mode) { $res['num_fields'] = $i; } @OCIFreeStatement($stmt); } else { if (isset($result->result)) { /* * Probably received a result object. * Extract the result resource identifier. */ $result = $result->result; } $res = array(); if ($result === $this->last_stmt) { $count = @OCINumCols($result); if ($mode) { $res['num_fields'] = $count; } for ($i = 0; $i < $count; $i++) { $res[$i] = array('table' => '', 'name' => $case_func(@OCIColumnName($result, $i + 1)), 'type' => @OCIColumnType($result, $i + 1), 'len' => @OCIColumnSize($result, $i + 1), 'flags' => ''); if ($mode & DB_TABLEINFO_ORDER) { $res['order'][$res[$i]['name']] = $i; } if ($mode & DB_TABLEINFO_ORDERTABLE) { $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i; } } } else { return $this->raiseError(DB_ERROR_NOT_CAPABLE); } } return $res; }
require_once "limpa_sessoes.php"; require_once "style.inc"; $sql1 = "SELECT COUNT(*) RESULT\n FROM FUNCIONARIO\n WHERE\n CDFUNCIONARIO=UPPER('{$PHP_AUTH_USER}')\n AND\n CDSENHA=CRIPT(UPPER('{$PHP_AUTH_PW}'),'')"; $noun_cpl = parameter('NOUN_CPL'); $nrunimed = parameter('NRUNIMED'); $stmt1 = OCIParse($conn, $sql1); OCIDefineByName($stmt1, "RESULT", $RESULT); OCIExecute($stmt1); OCIFetch($stmt1); OCIResult($stmt1, 1); if ($RESULT == '1') { $sql2 = "SELECT G.CDNIVEL NIV\n FROM FUNCIONARIO F,\n GRUPO_FUNCIONARIO G\n WHERE F.CDFUNCIONARIO = UPPER('{$PHP_AUTH_USER}')\n AND F.CDGRUPO = G.CDGRUPO"; $stmt2 = OCIParse($conn, $sql2); OCIdefineByName($stmt2, "niv", $niv); OCIexecute($stmt2); OCIFetch($stmt2); $nivel = OCIResult($stmt2, 1); $emissor = strtoupper($PHP_AUTH_USER); session_register('nivel'); session_register('emissor'); session_unregister('data1'); session_unregister('data2'); session_unregister('data2'); if ($aw_relpre != 'S' and $awe != 'S') { print "<SCRIPT LANGUAGE=JAVASCRIPT>alert('Não tem permissão para acessar esse módulo');window.history.back(1);</SCRIPT>"; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
function GetArrayLimit($nrows, $offset = -1) { if ($offset <= 0) { $arr = $this->GetArray($nrows); return $arr; } for ($i = 1; $i < $offset; $i++) { if (!@OCIFetch($this->_queryID)) { $arr = array(); return $arr; } } if (!@OCIfetchinto($this->_queryID, $this->fields, $this->fetchMode)) { $arr = array(); return $arr; } if ($this->fetchMode & OCI_ASSOC) { $this->_updatefields(); } $results = array(); $cnt = 0; while (!$this->EOF && $nrows != $cnt) { $results[$cnt++] = $this->fields; $this->MoveNext(); } return $results; }
function convert_value($var) { global $db; $table = $var[table]; $cs = strtoupper($var[cs]); $cd = $var[cd]; $vd = $var[vd]; $sql = "select {$cs} from {$table} where {$cd}='{$vd}'"; if ($var[print_query] == "1") { echo "{$sql}"; } // echo $sql; $stmt = @OCIParse($this->conn, $sql); @OCIExecute($stmt, OCI_DEFAULT); @OCIFetch($stmt); $result = @OCIResult($stmt, $cs); @OCIFreeStatement($stmt); return $result; }