示例#1
0
function Disp_Data()
{
    $con = new clscon();
    $link = $con->db_Connect();
    $qry = "select * from tbbook";
    $res = mysqli_query($link, $qry);
    $output[] = "<table border=2>";
    $i = 1;
    while ($r = mysqli_fetch_row($res)) {
        $i++;
        if ($i == 2) {
            $output[] = '<tr>';
            $i = 0;
        }
        $output[] = '<td>';
        $output[] = "<img src={$r['5']} height=100 width=75 />";
        $output[] = '</td>';
        $output[] = '<td>';
        $output[] = "Title: <a href=detail.php?bid={$r['0']}>{$r['1']} </a><br>";
        $output[] = "Author: {$r['2']} <br>";
        $output[] = "Pub: {$r['3']} <br>";
        $output[] = "Prc: {$r['4']} <br>";
        $output[] = "<a href=cart.php?bid={$r['0']}&action=add><img src=addtocart.jpg height=40 width=130 /></a> <br>";
        $output[] = '</td>';
        if ($i == 1) {
            $output[] = '</tr>';
        }
    }
    $output[] = "</table>";
    echo join($output);
}
示例#2
0
function GetDetail()
{
    if (isset($_REQUEST["bid"])) {
        $con = new clscon();
        $link = $con->db_Connect();
        $bid = $_REQUEST["bid"];
        $qry = "select * from tbbook where bookid={$bid}";
        $res = mysqli_query($link, $qry);
        $output[] = "<table border=2>";
        if ($r = mysqli_fetch_row($res)) {
            $output[] = "<tr>";
            $output[] = "<td>";
            $output[] = "<img src={$r['5']} width=70 height=100 >";
            $output[] = "</td>";
            $output[] = "<td>";
            $output[] = "ID: {$r['0']} <br>";
            $output[] = "Title: {$r['1']} <br>";
            $output[] = "Author: {$r['2']} <br>";
            $output[] = "Publisher: {$r['3']} <br>";
            $output[] = "Price: {$r['4']} <br>";
            $output[] = "<a href=cart.php?bid={$r['0']}&action=add>Add To Cart</a><br>";
            $output[] = "</td>";
            $output[] = "</tr>";
        }
        $output[] = "</table>";
        $con->db_Close();
    }
    echo join($output);
}
示例#3
0
<?php

session_start();
include_once 'config.php';
$con = new clscon();
$con->Save_Data();
echo 'data saved!';
?>

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
// put your code here
?>
    </body>
</html>
示例#4
0
 function find_rev()
 {
     $con = new clscon();
     $link = $con->db_connect();
     $qry = "call fndrev('{$this->revcod}')";
     $res = mysqli_query($link, $qry);
     if (mysqli_num_rows($res) > 0) {
         $r = mysqli_fetch_row($res);
         $this->revcod = $r[0];
         $this->revasgcod = $r[1];
         $this->revdat = $r[2];
         $this->revdsc = $r[3];
         $this->revscr = $r[4];
     }
     $con->db_close();
 }
示例#5
0
            }
            if (isset($newcart)) {
                $cart = $newcart;
            } else {
                $cart = "";
            }
        }
        break;
}
$_SESSION["cart"] = $cart;
//echo $_SESSION["cart"];
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
$con = new clscon();
$con->Disp_Data();
?>
    </body>
</html>