Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
// filter special characters
$searchq = htmlentities($searchq, ENT_QUOTES, "UTF-8");
// convert search cases to lower to ignore sensitivity
strtolower($searchq);
$sql = "SELECT * FROM " . $SQL_FROM . " WHERE lower(" . $SQL_WHERE . ") LIKE '%" . $searchq . "%'";
$stmt = OCIParse($db, $sql);
if (!$stmt) {
    echo "An error occurred in parsing the sql string.\n";
    exit;
}
OCIExecute($stmt);
// build result object
while (OCIFetch($stmt)) {
    $title = OCIResult($stmt, "TITLE");
    $cover = OCIResult($stmt, "COVER");
    $id = OCIResult($stmt, "ID");
    $output[] = '<div class="new_prod_box">';
    $output[] = '<a href="details.php?id=' . $id . '">' . $title . '</a>';
    $output[] = '<div class="new_prod_bg">';
    $output[] = '<a href="details.php?id=' . $id . '"><img src="bookimages/' . $cover . '" class="thumb" alt="" border="0" /></a>';
    $output[] = '</div></div>';
}
// print results
if ($title == "") {
    echo "<div class='new_prod_box'><strong>No results, try again</strong></div>";
} else {
    echo join('', $output);
}
?>
        
        <div class="clear"></div>
Exemplo n.º 3
0
$user_ID = "";
$email = "";
$phone = "";
$address = "";
$city = "";
$postalcode = "";
$sql = "SELECT * FROM USERS WHERE USERNAME = '******'username'] . "'";
$stmt = OCIParse($conn, $sql);
OCIExecute($stmt);
while (OCIFetch($stmt)) {
    $user_ID = OCIResult($stmt, 'USERID');
    $email = OCIResult($stmt, 'EMAIL');
    $phone = OCIResult($stmt, 'PHONE');
    $address = OCIResult($stmt, 'ADDRESS');
    $city = OCIResult($stmt, 'CITY');
    $postalcode = OCIResult($stmt, 'POSTAL_CODE');
}
$_SESSION['userid'] = $user_ID;
//print_r("Total amount" . $amount);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-bookstore</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel='stylesheet' type='text/css' href='menustyles.css' />
<script type="text/javascript" src="js/get_book.js"></script>
<script type="text/javascript" src="livevalidation_standalone.compressed.js"></script>
<script type="text/javascript" src="shoppingcart.js"></script>
Exemplo n.º 4
0
$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");
    $publisher = OCIResult($stmt, "PUBLISHER");
    $isbn = OCIResult($stmt, "ISBN");
    $year = OCIResult($stmt, "YEAR");
    $cover = OCIResult($stmt, "COVER");
    $price = OCIResult($stmt, "PRICE");
    $description = OCIResult($stmt, "DESCRIPTION");
}
?>
			
			
			<?php 
print '<div class="title"><span class="title_icon"><img src="images/bullet1.gif" alt="" /></span>' . $title . '</div>';
print '<div class="feat_prod_box_details">';
print '<div class="prod_img"><img src="images/' . $cover . '" alt="" border="0" width="98" height="150"/>';
print '<br /><br />';
print '<a href="images/' . $cover . '" rel="lightbox"><img src="images/zoom.gif" alt="" border="0" /></a>';
print '</div>';
?>
			
			<div class="prod_det_box">
			<div class="box_top"></div>
Exemplo n.º 5
0
                    </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&ntilde;a</span><br>
                    <input id="password" name="password" value="" type="password" placeholder="Contrase&ntilde;a" required><br>
                    </label>
Exemplo n.º 6
0
        }
        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;
    }
Exemplo n.º 7
0
                    <ul data-role="listview">
                          
                          <!-- This php code fetches the database info above - Comment Heidi Biggin -->   
                          <?php
                               // fetch each record - Comment Heidi Biggin
                               while(OCIFetch($stmt))  
                                {
                                     // build list to display results - Comment Heidi Biggin
									 // This also includes a link to a details page - Comment Heidi Biggin
									 // Unfortunately all records in the list go to the same page - Comment Heidi Biggin
									 // I was unable to work out how to select ONLY the record that had been selected - Comment Heidi Biggin
                                   print( "<li><a href=#pagetwentytwo>" );
                                    
                                    // This each individual record into a variable then prints the variable in the list  - Comment Heidi Biggin
                             		// This will do this for every record in the database in the table selected - Comment Heidi Biggin
								   $fg1 = OCIResult($stmt,"REST_NAME");
                                   
                                      print( $fg1); 
                                                                                       
                                   print( "</a></li>" );
                                } 
                    
							    // Close the database connection - Comment Heidi Biggin
							   OCILogOff ($db); 
                                    
                          ?>
                           <!-- end PHP script - Comment Heidi Biggin-->
                          
                     </ul>
              	   </div>
                </div>
Exemplo n.º 8
0
 }
 // 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) {
         echo "An error occurred in parsing the sql string.\n";
Exemplo n.º 9
0
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);
}
Exemplo n.º 10
0
function F_OCIResult($Res, $s)
{
    return OCIResult($Res, $s);
}
Exemplo n.º 11
0
if (oci_execute($stmt)) {
    while (oci_fetch($stmt)) {
        $bldg_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
    }
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'\n\t\t\t\t\t\t\t\tAND T170_TYPE = 'pkng'\n\t\t\t\t\t\t\t\tORDER BY T170_BLDG_NAME";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
    while (oci_fetch($stmt)) {
        $pkng_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
    }
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'\n\t\t\t\t\t\t\t\tAND T170_TYPE = 'labs'\n\t\t\t\t\t\t\t\tORDER BY T170_BLDG_NAME";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
    while (oci_fetch($stmt)) {
        $labs_list .= "<li><a href=\"javascript:scrollToMarker('" . OCIResult($stmt, "T170_ID") . "')\")>" . OCIResult($stmt, "T170_BLDG_NAME") . "</a></li>";
    }
}
oci_free_statement($stmt);
$sql = "select T170_ID, T170_BLDG_NAME, T170_BLDG_NAME2, T170_ANALYTICS, T170_LINK, T170_LATITUDE, T170_LONGITUDE, T170_ADDRESS, T170_CITY, T170_STATE, T170_ZIP, T170_THUMBNAIL, T170_DESCRIPTION, T170_TYPE, T170_TAGS, T170_IMAGE\n\t\t\t\t\t\t\t\tFROM A932T170\n\t\t\t\t\t\t\t\tWHERE T170_DISPLAY = 'Y'";
$stmt = oci_parse($connection, $sql);
if (oci_execute($stmt)) {
    while (oci_fetch($stmt)) {
        $locations .= '{"name":	"' . oci_result($stmt, "T170_BLDG_NAME") . '", "analytics_name": "' . oci_result($stmt, "T170_ANALYTICS") . '", "name2": "' . oci_result($stmt, "T170_BLDG_NAME2") . '", "link": "' . oci_result($stmt, "T170_LINK") . '", "location": [' . oci_result($stmt, "T170_LATITUDE") . ', ' . oci_result($stmt, "T170_LONGITUDE") . '], "display_address": "' . oci_result($stmt, "T170_ADDRESS") . '<br />' . oci_result($stmt, "T170_CITY") . ', ' . oci_result($stmt, "T170_STATE") . ' ' . oci_result($stmt, "T170_ZIP") . '", "address": "' . oci_result($stmt, "T170_ADDRESS") . '", "address_maps": "' . oci_result($stmt, "T170_ADDRESS") . ' ' . oci_result($stmt, "T170_CITY") . ', ' . oci_result($stmt, "T170_STATE") . ' ' . oci_result($stmt, "T170_ZIP") . ' [' . oci_result($stmt, "T170_LATITUDE") . ', ' . oci_result($stmt, "T170_LONGITUDE") . ']", "thumb": "' . oci_result($stmt, "T170_THUMBNAIL") . '", "thumb_using_id": "' . oci_result($stmt, "T170_ID") . '", "image": ' . oci_result($stmt, "T170_IMAGE") . ', "description": "' . oci_result($stmt, "T170_DESCRIPTION") . '", "type": "' . oci_result($stmt, "T170_TYPE") . '", "id": "' . oci_result($stmt, "T170_ID") . '", "tags": "' . oci_result($stmt, "T170_TAGS") . '"},';
    }
}
oci_free_statement($stmt);
$locations = substr($locations, 0, -1);
Exemplo n.º 12
0
$stmt = OCIParse($conn, $sql);
$givenname = "";
OCIExecute($stmt);
while (OCIFetch($stmt)) {
    $user = OCIResult($stmt, 'USERNAME');
    //$first = OCIResult($stmt, 'FIRSTNAME');
    $passwordDb = OCIResult($stmt, 'PASSWORD');
    $email = OCIResult($stmt, 'EMAIL');
    $phone = OCIResult($stmt, 'PHONE');
    $company = OCIResult($stmt, 'COMPANY');
    $address = OCIResult($stmt, 'ADDRESS');
    $city = OCIResult($stmt, 'CITY');
    $pcode = OCIResult($stmt, 'POSTAL_CODE');
    $firstname = OCIResult($stmt, 'FIRSTNAME');
    $lastname = OCIResult($stmt, 'LASTNAME');
    $state = OCIResult($stmt, 'STATE');
}
if ($user != "") {
    if ($passwordDb == $passwordGet) {
        $_SESSION['username'] = $user;
        $_SESSION['email'] = $email;
        $_SESSION['phone'] = $phone;
        $_SESSION['company'] = $company;
        $_SESSION['address'] = $address;
        $_SESSION['firstname'] = $firstname;
        $_SESSION['lastname'] = $lastname;
        $_SESSION['postcode'] = $pcode;
        $_SESSION['state'] = $state;
        $_SESSION['city'] = $city;
        $_SESSION['myvar'] = $user;
        //$_SESSION['firstname'] = $first;
Exemplo n.º 13
0
 function sql_fetchfield($field, $rownum = -1, $query_id = 0)
 {
     if (!$query_id) {
         $query_id = $this->query_result;
     }
     if ($query_id) {
         if ($rownum > -1) {
             // Reset the internal rownum pointer.
             @OCIExecute($query_id, OCI_DEFAULT);
             for ($i = 0; $i < $rownum; $i++) {
                 // Move the interal pointer to the row we want
                 @OCIFetch($query_id);
             }
             // Get the field data.
             $result = @OCIResult($query_id, strtoupper($field));
         } else {
             // The internal pointer should be where we want it
             // so we just grab the field out of the current row.
             $result = @OCIResult($query_id, strtoupper($field));
         }
         return $result;
     } else {
         return false;
     }
 }
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
//echo "SQL: $query<br>";
if (!$stmt) {
    echo "An error occurred in parsing the sql string.\n";
    exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
    //get and store data from results of query
    $goalname = OCIResult($stmt, "GOALNAME");
    $day = OCIResult($stmt, "DAY");
    $month = OCIResult($stmt, "MONTH");
    $year = OCIResult($stmt, "YEAR");
    $tags = OCIResult($stmt, "TAGS");
    $description = OCIResult($stmt, "DESCRIPTION");
    $privacy = OCIResult($stmt, "PRIVACY");
    $completed = OCIResult($stmt, "COMPLETED");
    echo '<div class="data">';
    echo '<p>Goalname: ' . $goalname . '</p>';
    echo '<p>Date: ' . $day . '/' . $month . '/' . $year . '</p>';
    echo '<p>Tags: ' . $tags . '</p>';
    echo '<p>Description: ' . $description . '</p>';
    echo '<p>Privacy: ' . $privacy . '</p>';
    echo '<p>Completed: ' . $completed . '</p>';
    echo '</div>';
}
?>
		<a href="index.php" class="ui-btn ui-icon-user ui-btn-icon-left ui-corner-all" id = "profilebutton">Return to Profile</a>
 		</div>
 	</div>
	<!-- End Content -->
Exemplo n.º 16
0
    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">
         <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
Exemplo n.º 17
0
<?php

session_start();
//start the session
// Include database connection
require_once 'global-connect.inc.php';
$user = $_SESSION['username'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$city = $_POST['city'];
$address = $_POST['address'];
$pcode = $_POST['pcode'];
$state = $_POST['state'];
//check whether the user name and password is valid
$sql = "SELECT userid FROM users WHERE USERNAME = '******'";
$stmt = OCIParse($conn, $sql);
OCIExecute($stmt);
$userid = "";
while (OCIFetch($stmt)) {
    $userid = OCIResult($stmt, 'USERID');
}
$queryupdate = "UPDATE users SET USERNAME ='******',EMAIL = '{$email}',PHONE='{$phone}',COMPANY='{$company}',ADDRESS='{$address}',CITY='{$city}',\r\n\t\t\t\tPOSTAL_CODE='{$pcode}',FIRSTNAME='{$firstname}',LASTNAME='{$lastname}',STATE='{$state}' where userid = {$userid} ";
//print_r($queryupdate);
$registerSQL = oci_parse($conn, $queryupdate);
oci_execute($registerSQL);
header('Location: user_priv.php');
Exemplo n.º 18
0
if (!$connect) {
    echo "Error connecting to database";
    exit;
}
$query = "SELECT Firstname,Lastname FROM Following";
$stmt = OCIParse($connect, $query);
//echo "SQL: $query<br>";
if (!$stmt) {
    echo "An error occurred in parsing the sql string.\n";
    exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
    //get and store data from results of query
    $fname = OCIResult($stmt, "FIRSTNAME");
    $lname = OCIResult($stmt, "LASTNAME");
    echo '<div class = "find">';
    echo '<img src ="images/UserImage.jpg" alt = "UserImage" class = "findImg"/>';
    echo '<p>' . $fname . ' ' . $lname . '</p>';
    echo '</div>';
}
OCILogOff($connect);
?>
			</div>
			<div id="find" class="ui-body-d tablist-content">
				<h3>Find</h3>
				<p>Find Users or Groups</p>
				<form method="post" action="find.php">
					<div class="ui-field-contain">
						<label for="search">Search:</label>
						<input type="search" name="search" id="search" placeholder="Search for users or groups..." />
Exemplo n.º 19
0
$query = "SELECT * FROM Goals WHERE COMPLETED = 'completed'";
$stmt = OCIParse($connect, $query);
//echo "SQL: $query<br>";
if (!$stmt) {
    echo "An error occurred in parsing the sql string.\n";
    exit;
}
OCIExecute($stmt);
while (OCIFetch($stmt)) {
    //get and store data from results of query
    $goalname = OCIResult($stmt, "GOALNAME");
    $time = OCIResult($stmt, "TIME");
    $timeType = OCIResult($stmt, "TIMETYPE");
    $tags = OCIResult($stmt, "TAGS");
    $description = OCIResult($stmt, "DESCRIPTION");
    $privacy = OCIResult($stmt, "PRIVACY");
    echo '<div class="data">';
    echo '<p>Goalname: ' . $goalname . '</p>';
    echo '<p>Time: ' . $time . ' ' . $timeType . '</p>';
    echo '<p>Tags: ' . $tags . '</p>';
    echo '<p>Description: ' . $description . '</p>';
    echo '<p>Privacy: ' . $privacy . '</p>';
    echo '</div>';
}
?>
		<a href="index.php" class="ui-btn ui-icon-user ui-btn-icon-left ui-corner-all" id = "profilebutton">Return to Profile</a>
 		</div>
 	</div>
	<!-- End Content -->

   <footer data-role="footer" data-position="fixed"><h1>Goal Tracker</h1></footer>  
Exemplo n.º 20
0
 /**
  * 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;
 }
Exemplo n.º 21
0
</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>
		  <option value="3">3</option>
Exemplo n.º 22
0
 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;
 }
Exemplo n.º 23
0
// 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>
 <body>
</body>
</html>
Exemplo n.º 24
0
 /**
  * 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;
 }
Exemplo n.º 25
0
?></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>
		  <option value="1">1</option>
		  <option value="2">2</option>
Exemplo n.º 26
0
        echo "<td>Publisher</td>";
        $fg4 = OCIResult($stmt, "PUBLISHER");
        echo "<td>";
        echo $fg4;
        echo "</td>";
        echo "</tr>";
        echo "<tr>";
        echo "<td>Year</td>";
        $fg5 = OCIResult($stmt, "YEAR");
        echo "<td>";
        echo $fg5;
        echo "</td>";
        echo "</tr>";
        echo "<tr>";
        echo "<td>Price</td>";
        $fg6 = OCIResult($stmt, "PRICE");
        echo "<td>";
        echo $fg6;
        echo "</td>";
        echo "</tr>";
    }
    OCILogOff($connect);
}
?>
				</table>
				<script type="text/javascript">
					$(document).ready(function () {
						$('.slideout-menu-toggle').on('click', function(event){
							event.preventDefault();
							// create menu variables
							var slideoutMenu = $('.slideout-menu');
Exemplo n.º 27
0
<?php

session_start();
//start the session
// Include database connection
require_once 'global-connect.inc.php';
$SQL_FROM = 'booklist';
$SQL_WHERE = 'Title';
$searchq = strip_tags($_GET['q']);
$sql = "SELECT * FROM " . $SQL_FROM . " WHERE " . $SQL_WHERE . " LIKE '" . $searchq . "%'";
//print_r("Query".$sql);
$stmt = OCIParse($db, $sql);
if (!$stmt) {
    echo "An error occurred in parsing the sql string.\n";
    exit;
}
OCIExecute($stmt);
$output[] = '<ul>';
while (OCIFetch($stmt)) {
    $title = OCIResult($stmt, "TITLE");
    $output[] = '<li><small>' . $title . '</small></li>';
}
$output[] = '</ul>';
echo join('', $output);
?>