|
|
|
ขอโค้ด massage box เพื่อแจ้งให้สมัครสมาชิก หรือทำการ เข้าสู่ระบบ ก่อนจะสั่งซือสินค้าได้ |
|
|
|
|
|
|
|
Code (JS)
$(function(){
$("#ok").live("click", function(){
get_form();
});
});
function get_form(){
var v1 = $("#s1 option:selected").val();
var v2 = $("#s2 option:selected").val();
var v3 = $("#s3 option:selected").val();
var v4 = $("#page option:selected").val();
var v5 = $("#l_coat option:selected").val();
var v6 = $("#color option:selected").val();
var v7 = $("#s6").val();
//alert($v1);
//alert($v2);
//alert($v3);
//alert($v4);
//alert($v5);
//alert($v6);
//alert($v7);
$.ajax({
type: "POST",
url: "show_order.php",
data: "s1="+v1+"&s2="+v2+"&s3="+v3+"&page="+v4+"&l_coat="+v5+"&color="+v6+"&s6="+v7,
success: function(data){//alert(data);
$("#show_order").html(data);
}
});
}
function show_size(t){
var v1 = $("#s1 option:selected").val();
//alert(v1);
$.ajax({
type: "POST",
url: "size.php",
data: "s1="+v1,
success: function(data){//alert(data);
$("#size_show").html(data);
}
});
}
function show_paper(t){
var v2 = $("#size_id").val();
//alert(v2);
$.ajax({
type: "POST",
url: "paper.php",
data: "size_id="+v2,
success: function(data){//alert(data);
$("#show_paper").html(data);
}
});
}
|
|
|
|
|
Date :
2011-08-17 16:54:41 |
By :
chadjan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<? @include ("config.php")?>
<?
$product = $_REQUEST['s1'];
$size = $_REQUEST['s2'];
$paper = $_REQUEST['s3'];
$page = $_REQUEST['page'];
$l_coat = $_REQUEST['l_coat'];
$color = $_REQUEST['color'];
$qty = $_REQUEST['s6'];
$total = $qty * $rw['price'];
$sql = " SELECT stoc.pro_name, size.size_name, product.page, product.color, paper.paper_name, product.pvc, product.price";
$sql .= " FROM stoc LEFT JOIN product ON stoc.pro_id = product.pro_id";
$sql .= " LEFT JOIN size ON stoc.pro_id = size.pro_id";
$sql .= " LEFT JOIN paper ON stoc.pro_id = paper.pro_id";
$sql .= " WHERE stoc.pro_id = '$product' ";
$obj = mysql_query($sql);
$rw = mysql_fetch_array($obj);
$total = $qty * $rw['price'];
echo
'<script language="javascript">'.
'function fncSubmit()'.
'{'.
'alert("ป้อนข้อมูลไม่ถูกต้อง");'.
'return true;'.
'}'.
'</script>'.
'<div align="center">'.
'<form name="form1" action="samak.php" method="post" onSubmit="JavaScript:return fncSubmit();">'.
'<table width="600" border="0" cellspacing="0" cellpadding="1">'.
'<tr bgcolor="#FFF1B9">'.
'<td width="40%"> ประเภทงาน</td>'.
'<td align="right">'.$rw['pro_name'].'</td>'.
'<input type="hidden" name="product" id="product" value="'.$rw['pro_name'].'" />'.
'</tr>'.
'<tr bgcolor="#FBD079">'.
'<td> ขนาด</td>'.
'<td align="right">'.$rw['size_name'].'</td>'.
'<input type="hidden" name="size" id="size" value="'.$rw['size_name'].'" />'.
'</tr>'.
'<tr bgcolor="#FFF1B9">'.
'<td> สี</td>'.
'<td align="right">'.$rw['color'].'</td>'.
'<input type="hidden" name="color" id="color" value="'.$rw['color'].'" />'.
'</tr>'.
'<tr bgcolor="#FBD079">'.
'<td> กระดาษ</td>'.
'<td align="right">'.$rw['paper_name'].'</td>'.
'<input type="hidden" name="paper" id="paper" value="'.$rw['paper_name'].'" />'.
'</tr>'.
'<tr bgcolor="#FFF1B9">'.
'<td> เคลือบผิว</td>'.
'<td align="right">'.$rw['pvc'].'</td>'.
'<input type="hidden" name="pvc" id="pvc" value="'.$rw['pvc'].'" />'.
'</tr>'.
'<tr bgcolor="#FBD079">'.
'<td> พิมพ์</td>'.
'<td align="right">'.$rw['page'].'</td>'.
'<input type="hidden" name="page" id="page" value="'.$rw['page'].'" />'.
'</tr>'.
'<tr bgcolor="#FFF1B9">'.
'<td> จำนวน</td>'.
'<td align="right">'.$qty.'</td>'.
'<input type="hidden" name="qty" id="qty" value="'.$qty.'" />'.
'</tr>'.
'<tr bgcolor="#FBD079">'.
'<td> ราคาต่อหน่วย</td>'.
'<td align="right">'.$rw['price'].'</td>'.
'<input type="hidden" name="price" id="price" value="'.$rw['price'].'" />'.
'</tr>'.
'<tr bgcolor="#FFF1B9">'.
'<td> ราคารวม</td>'.
'<td align="right">'.$total.'</td>'.
'<input type="hidden" name="total" id="total" value="'.$total.'" />'.
'</tr>'.
'<tr bgcolor="#FBD079">'.
'<td> </td>'.
'<td align="right">'.
'<input type="submit" name="btn_ok" id="btn_ok" value="สั่งซื้อ" /><td>'.
'<input type="hidden" name="pro_id" id="pro_id" value="'.$rw['pro_id'].'" />'.
'</tr>'.
'</table>'.
'</form>'.
'</div>';
?>
|
ประวัติการแก้ไข 2011-08-17 17:12:49 2011-08-17 17:20:58
|
|
|
|
Date :
2011-08-17 17:04:00 |
By :
puchong1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$("#ok").live("click", function(){
get_form();
});
});
function get_form(){
var v1 = $("#s1 option:selected").val();
var v2 = $("#s2 option:selected").val();
var v3 = $("#s3 option:selected").val();
var v4 = $("#page option:selected").val();
var v5 = $("#l_coat option:selected").val();
var v6 = $("#color option:selected").val();
var v7 = $("#s6").val();
$.ajax({
type: "POST",
url: "show_order.php",
data: "s1="+v1+"&s2="+v2+"&s3="+v3+"&page="+v4+"&l_coat="+v5+"&color="+v6+"&s6="+v7,
success: function(data){//alert(data);
$("#show_order").html(data);
}
});
}
function show_size(t){
var v1 = $("#s1 option:selected").val();
//alert(v1);
$.ajax({
type: "POST",
url: "size.php",
data: "s1="+v1,
success: function(data){//alert(data);
$("#size_show").html(data);
}
});
}
function show_paper(t){
var v2 = $("#size_id").val();
//alert(v2);
$.ajax({
type: "POST",
url: "paper.php",
data: "size_id="+v2,
success: function(data){//alert(data);
$("#show_paper").html(data);
}
});
}
|
|
|
|
|
Date :
2011-08-17 17:32:20 |
By :
puchong1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|