本文整理汇总了PHP中B::select方法的典型用法代码示例。如果您正苦于以下问题:PHP B::select方法的具体用法?PHP B::select怎么用?PHP B::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类B
的用法示例。
在下文中一共展示了B::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: B
<?php
$masp = $_POST["masanpham"];
$dg = $_POST["dongia"];
$sl = $_POST["soluong"];
$tt = $_POST["thanhtien"];
$b = new B();
$sql = "insert into hoadon(MaHD,TenKhachHang,SoDienThoai,DiaChi,ThanhTien) values('','','','','{$tt}')";
$arr = array(" '', '', '', '', '{$tt}' ");
//print_r($arr);
$s = $b->insert($sql, $arr);
$ct = $b->select("select * from hoadon ");
foreach ($ct as $s) {
$mhd = $s["MaHD"];
$sql2 = "insert into chitiethoadon(MaChiTiet,MaSanPham,MaHD,DonGia,SoLuong) values('','{$masp}','{$mhd}','{$dg}','{$sl}') ";
$arr = array("'','{$masp}','{$mhd}','{$dg}','{$sl}'");
print_r($arr);
}
?>
示例2: B
<?php
$ml = $_GET["ml"];
$b = new B();
$t = $b->select("select * from loaisanpham where MaLoai = '{$ml}'");
foreach ($t as $a) {
?>
<form action="index.php?mod=danhmucsanpham&ac=xleditml" method="post">
Tên danh mục:<?php
echo $a["idTen"];
?>
<input type="hidden" name="tendanhmuc" value="<?php
echo $a["idTen"];
?>
" /><br />
Mã Loại:<?php
echo $ml;
?>
<input type="hidden" name="maloai" value="<?php
echo $ml;
?>
" /><br />
Tên Loại:<input type="text" name="tenloai" value="<?php
echo $a["TenLoai"];
?>
"/><br />
<input type="submit" value="sua"/>
</form>
<?php
}
示例3: B
<?php
$b = new B();
$sqldem = "select Count(*) as dem from tintuc ";
$kq = $b->select($sqldem);
//print_r($kq);
$n = $kq[0]["dem"];
// echo "ban dang co $n tin ";
$pageSize = 10;
$sotrang = ceil($n / $pageSize);
$page = isset($_GET["page"]) ? $_GET["page"] : 1;
$vt = ($page - 1) * $pageSize;
$kq = $b->select("select * from tintuc limit {$vt}, {$pageSize}");
//print_r($kq);
?>
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<table>
<thead>
<tr>
<th>ID Tin</th>
<th>Tiêu đề</th>
<th>Tóm Tắt Nội Dung</th>
示例4: B
<?php
$b = new B();
$arr = $b->select("select * from nhacungcap");
?>
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<table>
<thead>
<tr>
<th>Nhà Cung Cấp</th>
<th>Tên Nhà Cung Cấp</th>
<th>Liên Hệ</th>
<th>Thao Tác</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
<div class="clear"></div>
示例5: B
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<?php
$id = $_GET["idtin"];
$b = new B();
$t = $b->select("select * from tintuc, loaitin where tintuc.idLoaiTin=loaitin.idLoaiTin and idTin='{$id}'");
foreach ($t as $a) {
?>
<form action="index.php?mod=danhmucsanpham&ac=xledittin" method="post" enctype="multipart/form-data">
ID Tin: <?php
echo $id;
?>
<input type="hidden" name="idtin" /></br>
Loại Tin :<?php
echo $a["tenLoaiTin"];
?>
<input type="hidden" name="loaitin" /></br>
Hình ảnh: <input type="file" name="hinhanh" /></br>
Tiêu đề : <input type="text" name="tieude" value="<?php
echo $a["tieuDe"];
?>
" /></br>
Nội dung ngắn :<input type="text" name="noidungngan" value="<?php
echo $a["tomTatnd"];
?>
" /></br>
Nội dung chi tiết: <textarea rows="20" cols="70" name="noidung"><?php
echo $a["noiDungCT"];
?>
</textarea></br>
<script type="text/javascript">CKEDITOR.replace( 'noidung'); </script>
示例6: show
public function show()
{
if (Count($this->giohang) == 0) {
echo "Giỏ hàng rỗng";
return;
} else {
echo "<table style='width:100%' border=\"0\"><tr border=\\><td>Sản phẩm đã chọn</td><td>Số lượng</td><td>Đơn Giá</td><td>Giá Khuyến Mãi</td><td>Thành tiền</td></tr>";
$tongtien = 0;
//khởi tạo tổng tiền trong hàm hiển thị
foreach ($this->giohang as $msp => $sl) {
$a = new B();
$arr = $a->select("select * from sanpham where Masanpham='{$msp}'");
foreach ($arr as $r) {
$tongtien += $sl * $r['Dongia'] - $sl * $r['GiaKhuyenMai'];
?>
<?php
echo "<tr>";
?>
<td><div style="float:right; width:50%;">
<?php
echo $r["Tensanpham"];
?>
<p><?php
echo $r["MaNCC"];
?>
</p>
<p><a href="<?php
echo BASE_URL;
?>
/index.php?mod=giohang&ac=del&masanpham=<?php
echo $msp;
?>
"><img src="images/Trash-25.png"</a></p>
</div>
<div style="float:left; width:50%;"><img src="<?php
echo BASE_URL . "/" . $r['Hinhanh'];
?>
" width="100px" height="100px"/></div> </td>
<td> <?php
echo $sl;
?>
</td>
<td><?php
echo number_format($r['Dongia'], 3) . " đồng";
?>
</td>
<td><?php
echo number_format($r['GiaKhuyenMai'], 3) . " đồng";
?>
</td>
<td><?php
echo number_format($sl * $r['Dongia'] - $sl * $r['GiaKhuyenMai'], 3) . " đồng";
?>
</td>
<?php
echo "</tr>";
}
}
echo "</table>";
$this->tongtien = $tongtien;
//gán tổng tiền trong hàm cho biến tong tiền của class
}
}
示例7: B
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<?php
$a = new B();
?>
<form action="index.php?mod=themsp" method="post" enctype="multipart/form-data">
Mã sản phẩm: <input type="hidden" name="masanpham" /><br />
Tên sản phẩm: <input type="text" name="tensanpham"/><br />
Đơn giá: <input type="text" name="gia" /><br />
Giá khuyến mãi: <input type="text" name="giaKM" /><br />
Hình ảnh: <input type="file" name="hinh" /><br />
Tên Mã Loại: <select name="ml"/>
<?php
$arr = $a->select("select * from loaisanpham");
foreach ($arr as $r) {
?>
<option value="<?php
echo $r["MaLoai"];
?>
"> <?php
echo $r["TenLoai"];
?>
</option>
<?php
}
?>
</select><br />
Tên Nhà cung cấp: <select name="mncc"/>
<?php
$arr = $a->select("select * from nhacungcap");
示例8: B
<?php
$b = new B();
$arr = $b->select("select * from binhluan where duyet=0 ");
?>
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<table>
<thead>
<tr>
<th>ID Bình luận</th>
<th>Mã sản phẩm</th>
<th>Nội dụng comment</th>
<th>Trạng thái</th>
<th>Duyệt</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
示例9:
<div id="menu1">
<div id="menu">
<ul id="ul">
<li><a href="index.php?mod=trangchu">Trang Chủ</a></li>
<li><a href="index.php?mod=gioithieu">Giới Thiệu</a>
<ul>
<li><a href="index.php?mod=gioithieu&idgt=thongtin">Thông tin về SPACE </a></li>
<li><a href="index.php?mod=gioithieu&idgt=quatrinh">Quá Trình Phát Triển </a></li>
</ul>
</li>
<li><a href="index.php?mod=sanpham">Sản Phẩm</a>
<ul>
<?php
$arr = $b->select("select * from danhmucsanpham");
foreach ($arr as $r) {
?>
<li>
<a href="index.php?mod=sanpham&i=loaisanpham&iddm=<?php
echo $r["idTen"];
?>
"><?php
echo $r["TenDanhMuc"];
?>
</a>
</li><?php
}
?>
</ul>
</li>
示例10: B
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<?php
$msp = $_GET["msp"];
$b = new B();
$t = $b->select("select * from loaisanpham lsp inner join sanpham sp inner join nhacungcap ncc on sp.MaLoai=lsp.MaLoai and sp.MaNCC=ncc.MaNCC where Masanpham = '{$msp}'");
foreach ($t as $a) {
?>
<form action="index.php?mod=danhmucsanpham&ac=xleditsp" method="post" enctype="multipart/form-data">
Mã sản phẩm: <?php
echo $msp;
?>
<input type="hidden" name="masanpham" /></br>
Tên sản phẩm:<input type="text" name="tensanpham" value="<?php
echo $a["Tensanpham"];
?>
" /></br>
Đơn giá: <input type="text" name="gia" value="<?php
echo number_format($a["Dongia"], 3);
?>
" /></br>
Giá khuyến mãi: <input type="text" name="giaKM" value="<?php
echo number_format($a["GiaKhuyenMai"], 3);
?>
"/></br>
Hình ảnh: <input type="file" name="hinhanh" /></br>
Tên Loại:<?php
echo $a["TenLoai"];
?>
<input type="hidden" name="maloai" /></br>
Tên nhà cung cấp:<?php
示例11: B
<?php
$timkiem = $_POST["tk"];
$b = new B();
$sql = "select * from sanpham where Tensanpham like '%{$timkiem}%' ";
$arr = array($timkiem);
$kq = $b->select($sql, $arr);
//print_r($kq);
if (Count($kq) == 0) {
echo "sai";
} else {
echo "có " . Count($kq) . " sản phẩm tìm được";
?>
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<table>
<thead>
<tr>
<th>Mã Sản Phẩm</th>
<th>Tên Sản Phẩm</th>
<th>Đơn Giá</th>
<th>Giá Khuyến Mãi</th>
<th>Mã Loại</th>
示例12: B
<?php
include "../../class/b.class.php";
$m = new B();
$ma = $_POST["masanpham"];
$l = $m->select("select * from sanpham where Masanpham='{$ma}' ");
示例13: B
<?php
$b = new B();
$arr = $b->select("select * from loaisanpham");
?>
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<table>
<thead>
<tr>
<th>Mã Loại</th>
<th>Tên Loại</th>
<th>ID Tên Danh Mục</th>
<th>Thao Tác</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
<div class="clear"></div>
示例14: B
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<?php
$a = new B();
?>
<form action="index.php?mod=themtt" method="post" enctype="multipart/form-data">
ID Tin: <input type="hidden" name="idTin" /><br />
ID Loại Tin: <select name="idLT">
<?php
$arr = $a->select("select * from loaitin");
foreach ($arr as $r) {
?>
<option value="<?php
echo $r["idLoaiTin"];
?>
"><?php
echo $r["tenLoaiTin"];
?>
</option> <?php
}
?>
</select><br />
Ảnh Đại Diện:<input type="file" name="anhdaidien" /><br />
Tiêu đề: <input type="text" name="tieude" /><br />
Nội dung ngắn: <input type="text" name="ndngan" /><br />
Nội dung chi tiết:
<textarea rows="20" cols="70" name="noidung"></textarea>
<script type="text/javascript">CKEDITOR.replace( 'noidung'); </script>
<input type="submit" value="thêm"/>
示例15: B
<?php
$a = new B();
?>
<form action="index.php?mod=themloai" method="post">
Mã Loại: <input type="text" name="maloai" />
Tên Loại: <input type="text" name="tenloai"/>
Tên ID Tên Danh Mục: <select name="idTen"/>
<?php
$arr = $a->select("select * from danhmucsanpham");
foreach ($arr as $r) {
?>
<option value="<?php
echo $r["idTen"];
?>
"> <?php
echo $r["TenDanhMuc"];
?>
</option>
<?php
}
?>
</select>
<input type="submit" value="thêm"/>
</form>