Viewing file: AddQaReport.php (8.48 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
/** Define Validate Access */
define( '_VALID_ACCESS', 1 );
/** Check Session User Login */
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
echo "<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
echo "<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../includes/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
$Username = $valid_user;
/** Config Table for This Page */
$myTable = " qa_project_tb";
$myTable2 = " qa_qareport_tb";
$myTable3 ="qa_report_tb" ;
/** Query เพื่อหา Numrows ก่อน */
$query = " SELECT * FROM $myTable3 WHERE ReportId='$ReportId' ";
$result = $dbObj->execQuery($query);
$rs = $dbObj->fetchArray($result);
/** โฟลเดอร์ไฟล์เอกสาร */
$doc_path = $_Config_live_site."/Qa_pic";
} # else
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function browse()
{
pc.Filename.src = pc.Filename.value;
}
<!--
//-->
function chk(c){
if (c.checked){
document.all.Prob1.disabled=false;
document.all.Prob2.disabled=false;
document.all.Prob3.disabled=false;
document.all.Prob4.disabled=false;
}
else{
document.all.Problem.disabled=false;
}
}
</script>
<table width="606" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="606" height="249">
<fieldset>
<label>
<form action="InsertQaReport.php" method="post" enctype="multipart/form-data" name="pc" id="pc">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" style=" border:0px solid gray"size="12">
<tr bgcolor="#eeeeee">
<td colspan="3" bordercolor="#CCCCCC" bgcolor="#FFFFFF"><font color="#000000" face="Tahoma"> <?php echo htmlspecialchars_decode( $rs['Report_name'] ); ?>
</a></font></td>
</tr>
<tr bgcolor="#eeeeee">
<td height="29" colspan="3" align="left" bordercolor="#CCCCCC" bgcolor="#FFFFFF"> ข้อเอกสาร:
<input name="Stand_code" type="text" id="Stand_code" style="text-align:center" onkeypress="checkNumeric()" value="<?php echo $rs['Ind_code'];?>" size="10" /></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="3" align="left" bordercolor="#CCCCCC" bgcolor="#FFFFFF"><a> รายการเอกสาร</font></a> :</span></td>
</tr>
<tr bgcolor="#eeeeee">
<td width="24%" align="right" bordercolor="#CCCCCC" bgcolor="#FFFFFF"> </td>
<td width="2%" bordercolor="#FFFFCC" bgcolor="#FFFFFF"> </td>
<td width="74%" align="left" bordercolor="#FFFFCC" bgcolor="#FFFFFF">
<textarea name="Report_name" cols="60" id="Report_name"></textarea>
<script>QBPATH='../editor'; VISUAL=1; SECURE=0;</script>
<script src='../editor/quickB.js'></script>
<script src='../editor/tabedit.js'></script>
</td>
</tr>
<tr bordercolor="#99CCFF" bgcolor="#86ade2">
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr bordercolor="#99CCFF" bgcolor="#86ade2">
<td colspan="3" bgcolor="#FFFFFF"><table width="105%" border="0" cellpadding="0" cellspacing="1" class="style1">
<tr>
<td width="74%"><a>โหลดเอกสาร:</a>
<input name="Filename" type="file" id="Filename" onchange="browse()" size="25" />
</div></td>
<td width="26%"> </td>
</tr>
</table></td>
</tr>
<tr bgcolor="#BFD0E6">
<td height="16" colspan="3" align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#BFD0E6">
<td height="28" colspan="3" align="center" bgcolor="#FFFFFF">
<input type="submit" name="Submit" value="บันทึกข้อมูล" class="button" />
<input type="reset" name="Submit" value=" เริ่มใหม่ " class="button" />
<input type="button" name="Submit2" value="ปิดหน้าต่าง" onclick="javascript:parent.close();" class="CURSOR-HAND" id="Submit" />
<input name="ReportId" type="hidden" id="ReportId" value="<? echo $rs[ReportId]?>" />
</font><font color="#000000" face="Tahoma">
<input name="projectId" type="hidden" id="projectId" value="<? echo $rs[projectId]?>" />
</font></td>
</tr>
<tr bgcolor="#BFD0E6">
<td height="16" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#BFD0E6">
<td height="28" colspan="3" bgcolor="#FFFFFF"><table width="583" border="0" align="center">
<tr>
<th width="569" scope="col">
<table width="101%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#F0F0F0">
<td height="26" colspan="3" align="center" bordercolor="#999966" bgcolor="#FFFFFF" class="PADDING-LEFT-10">รายหลักฐานรายย่อย</td>
</tr>
<?php
$query = " SELECT * FROM $myTable2 WHERE projectId='$rs[projectId]' and ReportId = '$rs[ReportId]' ";
$result1 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
?>
<?php
$no = 1+($display-1)*$limit;
while( $rss = $dbObj->fetchArray($result1) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td height="20" align="left"></font></a><?php echo htmlspecialchars_decode( nl2br( $rss['Report_name'] ) ); ?></td>
<td width="11%" align="center" class="PADDING-LEFT-5">
<?php if( $rss['Filename'] != "" ) { ?>
<a href="javascript:;" onclick="NewWindow('<?=$doc_path;?>/<?=$rss["Filename"]?>','Detail','850','600','yes');"><img src="../images/icons/download.png" alt=" ดาวน์โหลดไฟล์ <?=$rss['Filename'];?> " width="16" height="16" border="0" /></a>
<?php } else { ?>
<img src="../images/icons/download_off.png" width="16" height="16" />
<?php } ?>
</span></td>
<td width="7%" align="center" class="PADDING-LEFT-5"><font size="2" face="Tahoma"><a href="DelReport.php?ReportqaId=<? echo $rss['ReportqaId']?>"><img src="../images/icons/cross.png" alt="ลบข้อมูล" <? echo $rss['ReportqaId']?> width="16" height="16" border="0" /></a></font></td>
</tr>
<?php
//$no++;
} # while
?>
<tr>
<td height="22" colspan="3" align="center" bgcolor="#F8F8F8">ทั้งหมด <span class="NOTE"><?php echo $numrows; ?></span> รายการ</a></td>
</tr>
</table></th>
</tr>
</table></td>
</tr>
<tr bgcolor="#BFD0E6">
<td height="28" colspan="3" align="right" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</form>
</label>
</fieldset>
</font></td>
</tr>
</table>
|