 |
|
น่าจะคล้าย ๆ กัน ดัดแปลงเอาน่ะครับ
Code (PHP)
<?php
<FORM name="key" METHOD=POST ACTION="" ONSUBMIT="return validate(this);" enctype="multipart/form-data">
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="left">
<font size="+3" face="Arial, Helvetica, sans-serif">SP-CTS-001 Online</font>
</td>
</tr>
<tr>
<td colspan="3" align="left"> </td>
</tr>
<tr>
<td class=DetailHead align="left">
<? #---------------------------------------- เลือกลูกค้าและบทที่ ที่ต้องการ ----------------------------------------------->
$sql = "SELECT * FROM dcc_master_sub WHERE (docno='SP-CTS-001')";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while(odbc_fetch_row($table))
{
$docno = odbc_result($table,"docno");
$custcode = odbc_result($table,"custcode");
$chapter = odbc_result($table,"chapter");
}
#---------------------------------------- เก็บชื่อลูกค้าที่ต้องการ ----------------------------------------------->
$sql = "SELECT * FROM dcc_customer";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while (odbc_fetch_row($table))
{
$NameCustomer = odbc_result($table,"description");
}
#<!---------------------------------------- เก็บชื่อบทที่ต้องการ ----------------------------------------------->
$sql = "SELECT * FROM dcc_master_chapter WHERE (docno='SP-CTS-001')";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while (odbc_fetch_row($table))
{
$NameChapter = odbc_result($table,"description");
}
?>
Customer : <input class="style4" name="custcode" size="20" value="<?=$_POST["custcode"];?>">
Chapter : <input class="style4" name="chapter" size="10" value="<?=$_POST["chapter"];?>">
<input name="check" type="submit" class="style4" value="Check">
</td>
</tr>
<TR>
<TD> </TD>
</TR>
<TR>
<TD>
คลิกเลือกลูกค้าและบทที่ต้องการอัพโหลดไฟล์ขึ้นระบบออนไลน์ <br />
แล้วกดปุ่ม Check เพื่อตรวจสอบควาามถูกต้อง<br />
แล้วเลือกไฟล์ PDF ที่ต้องการ ก่อนกด Save<br />
</TD>
</TR>
</TABLE>
</FORM>
<FORM METHOD=POST ACTION="insertSPCTS001.php" ONSUBMIT="return validate(this);" enctype="multipart/form-data">
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<?
if(($s_custcode=$_POST["custcode"]) && ($s_chapter=$_POST["chapter"]))
{
$sql = "SELECT * FROM dcc_master_sub WHERE (docno='SP-CTS-001' and custcode='$s_custcode' and chapter='$s_chapter')";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while(odbc_fetch_row($table))
{
$docno = odbc_result($table,"docno");
$chapter = odbc_result($table,"chapter");
$custcode = odbc_result($table,"custcode");
$revision = odbc_result($table,"revision");
$dteuse = odbc_result($table,"dteuse");
$dd=substr($dteuse,8,2);
$mm=substr($dteuse,5,2);
$yy=substr($dteuse,0,4);
$dateuse="$dd/$mm/$yy";
}
$sql = "SELECT * FROM dcc_customer WHERE codeno='$s_custcode'";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while (odbc_fetch_row($table))
{
$codeno = odbc_result($table,"codeno");
$CustomerName = odbc_result($table,"description");
}
$sql = "SELECT * FROM dcc_master_chapter WHERE (chapter='$s_chapter' and docno='SP-CTS-001')";
$table = odbc_exec($connect,$sql) or die ("No Connect Database");
while (odbc_fetch_row($table))
{
$chapter = odbc_result($table,"chapter");
$ChapterName = odbc_result($table,"description");
}
?>
<TR>
<td>Doc No.</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#990000"><B /><?=$docno;?></FONT></td>
</TR>
<TR>
<td>Custcode</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#003300"><?=$custcode;?></FONT></td>
</TR>
<TR>
<td>CustomerName</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#003300"><B /><?=$CustomerName;?></FONT></td>
</TR>
<TR>
<td>Chapter</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#003300"><?=$chapter;?></FONT></td>
</TR>
<TR>
<td>ChapterName</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#003300"><?=$ChapterName;?></FONT></td>
</TR>
<TR>
<td>Revision</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#660066"><?=$revision;?></FONT></td>
</TR>
<TR>
<td>Date Use</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#660066"><?=$dateuse;?></FONT></td>
</TR>
<TR>
<td>Department</td>
<td colspan="3" align="left"><FONT SIZE="" COLOR="#660099"><?=$Department;?></FONT></td>
</TR>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Upload PDF</td>
<td><input name="upfile" type="file" class="style4" size="50"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" align="center">
<input name="save" type="submit" class="style4" value="Save">
<BR>
</td>
</tr>
<? }?>
</table>
</FORM>
?>
|
 |
 |
 |
 |
Date :
2009-04-29 17:36:54 |
By :
didoman |
|
 |
 |
 |
 |
|
|
 |