|
 |
|
คือหนูอยากทำแบบให้เลือกประเภทสินค้าแล้วนำมาเก็บไว้ชั่วคราวก่อนแล้วถ้าตกลงค่อยบันทึกลงฐานข้อมูลค่ะ |
|
 |
|
|
 |
 |
|
รบกวนดูให้หน่อยต้องเพิ่มตรงไหนค่ะ
Code (PHP)
<?php
ob_start();
///////////////////////////////////////////////////////////////////////////
session_start();
include "connect.php";
mysql_select_db($dbname,$dbconnect)or die("ไม่สามารถเลือกฐานข้อมูลได้").mysql_error();
mysql_query("SET NAMES UTF8");
?>
<?
// ถ้ามีการเลือกประเภทของงานให้เก็บลง Session
if(trim($_GET["id_catalogue_store"]) != "")
{
//$_SESSION["strP"]=$_SESSION["strP"]+1;
$_SESSION["id_catalogue_store"]=$_GET["id_catalogue_store"];
//$_SESSION["strQuanlity"][$_SESSION[strP]]=1;
session_write_close();
header("location:$_SERVER[PHP_SELF]");
}
?>
<tr>
<td bgcolor="#66CCFF" colspan="2" align="center"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><input name="BtnContinute" type="button" class="button" id="BtnContinute2" value="เลือกประเภทงาน" onClick="window.location='add_buy_type.php';">กรุณาเลือกประเภทแบบให้ครบก่อน</font></td>
</tr>
อีกไฟล์
Code (PHP)
<?php
ob_start();
////////////////////////////////////////////////////////////////////////
session_start();
include "connect.php";
mysql_select_db($dbname,$dbconnect)or die("ไม่สามารถเลือกฐานข้อมูลได้").mysql_error();
mysql_query("SET NAMES UTF8");
?>
<table width="95%" align="center" bgcolor="#FFFFFF">
<tr>
<td colspan="2">
<? ?>
</td>
</tr>
<tr valign="top">
<td width="30%">
<? require_once("menu_admin.php"); ?>
</td>
<td >
<p align="right"><font color="#000000" size="5" face="Arial, Helvetica, sans-serif">
<?
$sqlsearch="SELECT*FROM tbllogin WHERE id_login='$valid_user'";
$resultsearch=mysql_query($sqlsearch,$dbconnect)or die("ไม่สามารถเชื่อมต่อฐานข้อมูลได้!!").mysql_error();
$showsearch=mysql_fetch_array($resultsearch);
echo "$showsearch[title_login]"; ?><? echo "$showsearch[id_login]"; ?> <? echo "$showsearch[lastname_login]"; ?></font></p>
<table width="95%" align="center">
<form action="catalogue_store.php?id_catalogue_store=<?=$_GET["id_type_work"];?>" name="frmEdit" method="post">
<tr>
<td bgcolor="#่33FFFF" width="100" colspan="2" align="center"><font color="#000000" size="5" face="Arial, Helvetica, sans-serif">การเพิ่มประเภทสินค้าเข้ารายการ</font>
</td>
</tr>
<tr>
<td bgcolor="#66CCFF" align="right"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">
กรุณาเลือกประเภทหลัก:</font></td>
<td bgcolor="#66CCFF" >
<select id="se_type_work" name="se_type_work" onChange = "location.href='add_buy_type.php?id_type_work='+this.value+'&id_sharetype_work=<?=$id_sharetype_work?>'">
<option selected value="">กรุณาเลือกประเภทหลัก</option>
<?
$strSQL = "SELECT * FROM tbltype_work ORDER BY id_type_work ASC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult["id_type_work"];?>"
<? if($id_type_work==$objResult["id_type_work"]){
echo "selected"; } ?>
><?=$objResult["name_type_work"];?></option>
<?
}
?>
</select></font></td></tr>
<tr>
<td bgcolor="#66CCFF" align="right"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">
กรุณาเลือกประเภทย่อย : </font></td>
<td bgcolor="#66CCFF" >
<select id="se_share_type_work" name="se_share_type_work" style="width:300px" onChange = "location.href='add_buy_type.php?id_type_work=<?=$id_type_work?>&id_sharetype_work='+this.value">
<option selected value="" selected="selected">กรุณาเลือกประเภทย่อย</option>
<?
if($id_type_work<>""){
$strSQL = "SELECT * FROM tblsharetype_work where id_type_work = '$_GET[id_type_work]'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{ ?>
<option value="<?=$objResult['id_sharetype_work']?>"
<? if($id_sharetype_work==$objResult["id_sharetype_work"]){
echo "selected"; } ?>
><?=$objResult['name_sharetype_work']?></option>
<? }
}
?>
</select></font></td></tr>
<tr>
<td colspan = "2" align ="center" bgcolor="#66CCFF"><input type="submit" name="submit" value="ตกลง"><input name = "submit" type = "submit" value = "ยกเลิก"></td>
</tr>
</table>
<?
//ตรวจสอบว่ามีการกรอกข้อมูลครบถ้วนหรือไม่
mysql_close($dbconnect);
?>
</table>
</form>
</td></tr></table>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-05-14 09:19:08 |
By :
deedee2338 |
View :
865 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้หลักการเดียวกับระบบตะกร้าสินค้าเลยครับ ลองเอามาประยุกต์ใช้ได้เลยครับ ในเว็บนี้มีแจกครับ
|
 |
 |
 |
 |
Date :
2011-05-14 09:29:23 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หนูก็ดูจากตรงไหนค่ะแต่เวลาแปลงมาเป็นของเราก็เป็นอย่างที่เห็น
|
 |
 |
 |
 |
Date :
2011-05-14 10:22:39 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เงียบจัง
|
 |
 |
 |
 |
Date :
2011-05-18 12:53:46 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|