Esempio n. 1
0
<?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);
}
?>

Esempio n. 2
0
<?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 
}
Esempio n. 3
0
<?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>
                                   
                                   
Esempio n. 4
0
<?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>
Esempio n. 5
0
<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>
Esempio n. 6
0
    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
        }
    }
Esempio n. 7
0
<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");
Esempio n. 8
0
<?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">
										
										
										
Esempio n. 9
0
  <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>
Esempio n. 10
0
<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 
Esempio n. 11
0

<?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>
Esempio n. 12
0
<?php

include "../../class/b.class.php";
$m = new B();
$ma = $_POST["masanpham"];
$l = $m->select("select * from sanpham where Masanpham='{$ma}' ");
Esempio n. 13
0
<?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>
Esempio n. 14
0
<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"/>
Esempio n. 15
0
<?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>
Esempio n. 16
0
    public function show()
    {
        ?>
<form action="index.php?mod=thanhtoan" method="post"><?php 
        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>Giá mua</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["Masanpham"];
                    ?>
<input type="hidden" name="masanpham" value="<?php 
                    echo $r["Masanpham"];
                    ?>
" />
				 	<p><?php 
                    echo $r["Tensanpham"];
                    ?>
</p>
                    <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;
                    ?>
<input type="hidden" name="soluong" value="<?php 
                    echo $sl;
                    ?>
" /></td>
					<td><?php 
                    echo number_format($r['Dongia'], 3) . " đồng";
                    ?>
<input type="hidden" name="dongia" value="<?php 
                    echo $r["Dongia"];
                    ?>
" /></td>
                    <td><?php 
                    if ($r['GiaKhuyenMai'] != 0) {
                        echo number_format($r['Dongia'] - $r['GiaKhuyenMai'], 3) . " đồng";
                    } else {
                        echo "0 đồ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
        }
        ?>
<td><h2>Tổng thành tiền: <?php 
        echo number_format($tongtien, 3);
        ?>
 đồng</h2><input type="hidden" name="thanhtien" value="<?php 
        echo $tongtien;
        ?>
" />
<input type="submit" name="sm" value="Thanh toán" /></td>
</form>
<table width="100%" border="5">
  <tr>
    <td><a class="a" href="<?php 
        echo BASE_URL;
        ?>
/index.php">Tiếp tục mua hàng</a></td>
    <td><a class="a" href="<?php 
        echo BASE_URL;
        ?>
/index.php?mod=giohang&ac=delAll">Xóa toàn bộ giỏ hàng</a></td>
  </tr>
</table>

<?php 
    }
Esempio n. 17
0
<?php

$id = $_GET["idten"];
$b = new B();
$t = $b->select("select * from danhmucsanpham where idTen = '{$id}'");
foreach ($t as $a) {
    ?>
<form action="index.php?mod=danhmucsanpham&ac=sua" method="post">
id danh mục:<?php 
    echo $id;
    ?>
<input type="hidden"   name="iddanhmuc"  value="<?php 
    echo $id;
    ?>
" /><br />
tên danh mục<input type="text" name="tendanhmuc" value="<?php 
    echo $a["TenDanhMuc"];
    ?>
 "/>
<input type="submit" value="sua"/>
</form>
<?php 
}
?>


Esempio n. 18
0
<?php

include "../class/b.class.php";
$t = new B();
session_start();
if (isset($_SESSION["admin"])) {
}
$user = $_POST["Username"];
$pass = md5($_POST["Password"]);
$sql = "select User, TenHienThi from admin where User='******' and Password='******'";
//echo $sql;
$arr = array();
//'$user','$pass');
$a = $t->select($sql);
//print_r($a);exit;
//if(isset($_SESSION["admin"]))
//{
if ($t->getNum() == 0) {
    ?>
<script>
		 alert('Mat khau hoac pass khong dung');
		 window.location="dangnhap.php";  
		 </script><?php 
    exit;
} else {
    $_SESSION["admin"] = $a[0];
    echo "dang nhap thanh cong";
    ?>
		<script>window.location="index.php";</script>
		<?php 
}
Esempio n. 19
0
<?php

$b = new B();
$sqldem = "select Count(*) as dem from sanpham ";
$kq = $b->select($sqldem);
//print_r($kq);
$n = $kq[0]["dem"];
// echo "ban dang co $n tin ";
$pageSize = 20;
$sotrang = ceil($n / $pageSize);
$page = isset($_GET["page"]) ? $_GET["page"] : 1;
$vt = ($page - 1) * $pageSize;
$kq = $b->select("select * from sanpham 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>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>
Esempio n. 20
0
			
		</div></div> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<noscript> <!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
					Download From <a href="http://www.exet.tk">exet.tk</a></div>
				</div>
			</noscript>
			
			<!-- Page Head -->
			<h2>Welcome <?php 
$a = $b->select("select TenHienThi from admin");
foreach ($a as $r) {
    echo $r["TenHienThi"];
}
?>
			</h2>
			
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				<?php 
include "mod.php";
?>
			</div> <!-- End .content-box -->
			
Esempio n. 21
0
<?php

$ma = $_GET["mncc"];
$b = new B();
$t = $b->select("select * from nhacungcap where MaNCC='{$ma}'");
foreach ($t as $r) {
    ?>
<form action="index.php?mod=danhmucsanpham&ac=xleditncc" method="post">
	Mã Nhà Cung Cấp: <?php 
    echo $ma;
    ?>
<input type="hidden" name="mancc" value="<?php 
    echo $r["MaNCC"];
    ?>
" /><br>
    Tên Nhà CUng Cấp:  <input type="text" name="tenncc" value="<?php 
    echo $r["TenNCC"];
    ?>
" /><br>
    Liên Hệ:  <input type="text" name="lienhe" value="<?php 
    echo $r["LienHe"];
    ?>
" /><br>
	<input type="submit" value="Sửa" />

</form>
<?php 
}