|
|
|
รบกวนถามครับ texbox และ เช็คข้อมูลที่เหมือนใน table และ Hide/Show table onclick button รายละเอียดด้านใน ขอบคุณครับ |
|
|
|
|
|
|
|
1. เมื่อกด search ก็คือการ submit ก็ให้ ดึงค่า $_POST หรือ $_GET หรือ $_REQUEST
2.SELECT SUM(Qty) AS Sumtotal FROM ..... WHERE workorder LIKE '....' GROUP BY workorder
3.เช็คจากค่า ที่เรากดปุ่ม search เอา ถ้าว่าง (ยังไม่กดก็ไม่โชว์)
|
|
|
|
|
Date :
2016-03-29 11:53:15 |
By :
Shadow Copy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองมาศึกษา liveseach ดูก็ได้ครับ
|
|
|
|
|
Date :
2016-03-29 12:00:26 |
By :
Shadow Copy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอ code ที่ได้เขียนไว้ของคุณ เอามาดูก่อนน่ะ
|
|
|
|
|
Date :
2016-03-29 14:21:02 |
By :
Shadow Copy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตอบความคิดเห็นที่ : 4 เขียนโดย : Shadow Copy เมื่อวันที่ 2016-03-29 14:21:02
รายละเอียดของการตอบ ::
คับผม
Code (PHP)
<?
include_once("lib/Database.php");
ini_set('display_errors',1);
error_reporting(~0);
$project_id = $_GET["project_id"];
//echo "<pre>".print_r($_POST,true)."</pre>";
//echo $project_id;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OQA Online Monitoring</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="shortcut icon" href="images/sulotion.gif" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="lib/js/jquery-ui-1.10.3.css">
<link rel="stylesheet" type="text/css" href="lib/js/jquery-ui-timepicker-addon.css">
<link href="css/theme.default.css" rel="stylesheet">
<link href="docs/css/jq.css" rel="stylesheet">
<script src="docs/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="lib/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="lib/js/jquery-ui-1.10.3.js"></script>
<script type="text/javascript" src="lib/js/jquery.layout-latest_1.3.0.js"></script>
<script type="text/javascript" src="lib/js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="lib/js/__jquery.tablesorter.min.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>
<script src="js/jquery.tablesorter.widgets.min.js"></script>
<div align="center"><img src="images/headdddd.png" width="70%" height="100"></div>
<body>
<table width="70%" height="20" border="0" align="center" bgcolor="#DCDFE2">
<tr bgcolor="#FFFFFF" class="label-success">
<td width="591"> </td>
<td width="229" height="20"><span class="style54 style16">|| <a href="" class="style12">Home</a> || <a href="" class="style12">Help</a> || <<User>> Logout || </span></td>
</tr>
</table>
<p align="center">
<input type="hidden" name="project_id" id="project_id" value="<?=$project_id?>">
</p>
<div width="100%" class="container">
<form method="post" name=form1 action="#">
<h1 align="center"><span class="style11"><span class="style13">OQA</span> <span class="style8">Search Record</span> </span></h1>
<p align="center"> </p>
<table width="246" border="0" align="center">
<tr>
<td width="78"><div align="center"><span class="style6">W/O </span></div></td>
<td width="158"><input class="form-control input-sm" name="WORK_ORDER_NAME"></td>
</tr>
<tr>
<td><div align="center"><span class="style6">Lot Number </span></div></td>
<td><input class="form-control input-sm" name="LOT_NUMBER"></td>
</tr>
</table>
<p align="center"> </p>
<p align="center" class="style8">[:: Read me Please !! ::]<br>
[ select your variable for search data. Exam workorder 0* or 0XXXX* or 00201F08 ]<br>
[ lot number Exam V* or VM* VMXXXXXX* or VMIA150224011 ]</p>
<p> </p>
<p align="center"><button name="submit" id="submit" type="submit" class="btn btn-success"> Search </button>
<button name="reset" id="reset" type="reset" class="btn btn-danger"> Reset </button></p>
<p align="center"> </p>
</form>
</div>
<table width="941" height="255" border="0" align="center" bgcolor="#DCDFE2">
<tr>
<td width="1017"><div width="100%" class="container">
<p>
<?
if(isset($_GET["project_id"])){
$strproject_id = $_GET["project_id"];
$strSql = "";
$strSql = " SELECT ID, LastProcess, LastStatus, LastMessage FROM XXOQA_FITS_TO_ORA_IFACE_Configuration ";
$strSql .= " Where ID = ".$strproject_id;
$result = mssql_query($strSql, $link) or die('MSSQL error: ' . mssql_get_last_message());
$total = mssql_num_rows($result);
if($total > 0)
{
$row1 = mssql_fetch_array($result);
}
}
?>
</p>
<table width="60%" height="42" border="0" class="table table-inverse">
<tr>
<td width="12%"><strong>Last Process : </strong></td>
<td width="36%"><?=$row1["LastProcess"]?></td>
<td width="15%"><strong>Last Message : </strong></td>
<td width="37%" rowspan="2"><span class="style3"><?=$row1["LastMessage"]?></td>
</tr>
<tr>
<td><strong>Last Status : </strong></td>
<td><?
if ($row1["LastStatus"] == 1){
echo "Pass";
}elseif ($row1["LastStatus"]){
echo "Fail";
}
?> </td>
<td> </td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td>
<div class="container">
<?
ini_set('display_errors',1);
error_reporting(~0);
$strWORK_ORDER_NAME = isset($_REQUEST["WORK_ORDER_NAME"])?$_REQUEST["WORK_ORDER_NAME"]:"";
$strPROJECT = isset($_REQUEST["PROJECT"])?$_REQUEST["PROJECT"]:"";
if(isset($_REQUEST["WORK_ORDER_NAME"]) || isset($_REQUEST["LOT_NUMBER"]))
{
$strWORK_ORDER_NAME = isset($_REQUEST["WORK_ORDER_NAME"])?$_REQUEST["WORK_ORDER_NAME"]:"";
$strLOT_NUMBER = isset($_REQUEST["LOT_NUMBER"])?$_REQUEST["LOT_NUMBER"]:"";
$strSql = "";
$strSql .= " SELECT Distinct WORK_ORDER_NAME, ITEM_NUMBER, QUANTITY_ACCEPT, LOT_NUMBER, Convert(varchar,FITS_DATE,120) as FITS_DATE, Convert(varchar,PG_DATE,120) as PG_DATE, PROJECT FROM dbo.XXOQA_FITS_TO_ORA_IFACE ";
$strSql .= " Where 1=1 ";
if ($strWORK_ORDER_NAME != "")
$strSql .= " AND WORK_ORDER_NAME like '".str_replace("*","%",$strWORK_ORDER_NAME)."' ";
if ($strLOT_NUMBER != "")
$strSql .= " AND LOT_NUMBER like '".str_replace("*","%",$strLOT_NUMBER)."' ";
//echo $strSql ;
$result = mssql_query($strSql, $link) or die('MSSQL error: ' . mssql_get_last_message());
$total = mssql_num_rows($result);
$Per_Page = 20; // Per Page
$Page = isset($_GET["Page"])?$_GET["Page"]:1;
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($total<=$Per_Page)
{
$Num_Pages =1;
}
else if(($total % $Per_Page)==0)
{
$Num_Pages =($total/$Per_Page) ;
}
else
{
$Num_Pages =($total/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$Page_End = $Per_Page * $Page;
IF ($Page_End > $total)
{
$Page_End = $total;
}
if ($total >0)
{
$row = mssql_fetch_array($result);
}
//echo $total;
//echo "<pre>".print_r($result,true)."</pre>";
}
?>
<?
if ($total>0)
{
?>
<p align="center" class="style8"><strong>Project : <?=$row["PROJECT"]?></strong></p>
<p><strong><span class="style8"><br>W/O :</span> <?echo $strWORK_ORDER_NAME;?></strong></p>
<table width="100%" height="71" class="tablesorter" id="tablesort1">
<tr class="danger">
<thead>
<tr><th><div align="center">No.</div></th>
<th><div align="center">w/o</div></th>
<th><div align="center">Item Number</div></th>
<th><div align="center">Qty</div></th>
<th><div align="center">Total</div></th>
<th><div align="center">Lot Number</div></th>
<th><div align="center">Oracle Date</div></th>
<th><div align="center">FITS Date</div></th>
<th><div align="center">PG Date</div></th>
</tr>
</thead>
<tbody>
<?
for($i=$Page_Start;$i<$Page_End;$i++){
//echo "<pre>".print_r($row,true)."</pre>";
//$i=$i+1;
?>
<tr class="success">
<td><div align="center">
<?=$i?>
.</div></td>
<td><?=mssql_result($result,$i,"WORK_ORDER_NAME")?></td>
<td><?=mssql_result($result,$i,"ITEM_NUMBER")?></td>
<td><?=mssql_result($result,$i,"QUANTITY_ACCEPT")?></td>
<td> </td>
<td><?=mssql_result($result,$i,"LOT_NUMBER")?></td>
<td><?=mssql_result($result,$i,"FITS_DATE")?></td>
<td><?=mssql_result($result,$i,"FITS_DATE")?></td>
<td><?=mssql_result($result,$i,"PG_DATE")?></td>
</tr>
<?
}
?>
</tbody>
</table>
<div align="center">
<p> </p>
<p>Total
<?=$total?>
Record :
<?=$Num_Pages?>
Page :
<?
$param = "WORK_ORDER_NAME=".$strWORK_ORDER_NAME;
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?$param&Page=$Prev_Page&project_id=$project_id'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?$param&Page=$i&project_id=$project_id'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?$param&Page=$Next_Page&project_id=$project_id'>Next>></a> ";
}
}else{
?>
<?
}
?>
</p>
</div>
</div> </td>
</tr>
</table>
</body>
</html>
|
ประวัติการแก้ไข 2016-03-29 15:03:19 2016-03-29 15:04:51 2016-03-29 15:28:01
|
|
|
|
Date :
2016-03-29 14:58:24 |
By :
kriszy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาค่า $_POST['submit']; ไปดัก if
|
|
|
|
|
Date :
2016-03-29 15:02:25 |
By :
Shadow Copy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ตรงบรรทัดที่ 196 รึเปล่าครับ
|
|
|
|
|
Date :
2016-03-29 15:07:15 |
By :
kriszy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ ขอบคุณครับ
|
|
|
|
|
Date :
2016-03-29 16:46:10 |
By :
kriszy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|