 |
|
เหมือน ว่าใช้ tablesorter ที่พี่ให้ แล้วครับ พอโหลด ข้อมูลออกมาจากฐานข้อมูล แล้ว ข้อมูลออกมาหมดแล้ว
กดที่หัวตารางให้ sort ได้ แต่ว่า มันไม่ sort ให้อะครับ วานช่วยดูให้หน่อย ได้มะครับ
ใส่สคริป และ css ไว้หมดแล้ว ครับ แต่ที่หัวตารางแล้วไม่ได้ แต่พอเขียน ข้อมูลออกมาเองไม่ต้องโหลดมาจาก DB มัน sort ให้ได้ครับ
Code (PHP)
<link href="css/jq.css" rel="stylesheet" type="text/css" media="print, projection, screen"/>
<link href="css/blue/style.css" rel="stylesheet" type="text/css" media="print, projection, screen"/>
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery.tablesorter.js" type="text/javascript"></script>
<script src="lib/chili/chili-1.8b.js" type="text/javascript"></script>
<script src="lib/docs.js" type="text/javascript"></script>
Code (PHP)
<table width="100%" border="0" cellspacing="1" class="tablesorter">
<thead>
<tr>
<th>Contract Partner</th>
<th>Contract Type</th>
<th>Contract Subject</th>
<th>Contract Expire</th>
<th>Remaining time</th>
</tr>
</thead>
<?php
// MySQL Function - Include Connection File (Create by Dreamweaver)
$hostname_contract_manager = "localhost";
$database_contract_manager = "xxxxxxx";
$username_contract_manager = "xxxxxxxx";
$password_contract_manager = "";
$contract_manager = mysql_pconnect($hostname_contract_manager, $username_contract_manager, $password_contract_manager) or
trigger_error(mysql_error(), E_USER_ERROR);
// PHP & MySQL Function - Query records from MySQL (Contract)
// Sort and Order Functions
mysql_select_db($database_contract_manager, $contract_manager) or die("Can Not Connect to Database Server");
$query_ContractManage =
"SELECT
Contract_Partner,
Contract_Type,
Contract_Subject,
Contract_Expire,
(to_days(`contract_details`.`Contract_Expire`) - to_days(curdate())) as countdate
FROM
contract_details, contract_user
where (to_days(`contract_details`.`Contract_Expire`) - to_days(curdate())) <= 30";
$ContractManage = mysql_query($query_ContractManage, $contract_manager) or die(mysql_error());
// MySQL Function - Record Verification
$totalRows_ContractManage = mysql_num_rows($ContractManage);
if ($totalRows_ContractManage <> 0)
{
//send mail all data that mySql have
$ContractManage = mysql_query($query_ContractManage);
while ($row_ContractManage = mysql_fetch_assoc($ContractManage))
{
$Contract_ID = $row_ContractManage[Contract_ID];
$Contract_Partner = $row_ContractManage[Contract_Partner];
$Contract_Type = $row_ContractManage[Contract_Type];
$Contract_Subject = $row_ContractManage[Contract_Subject];
$Contract_Expire = $row_ContractManage[Contract_Expire];
$countExpireDate = $row_ContractManage[countdate];
$Admin_Notification = $row_ContractManage[Admin_Notification];
?>
<tbody>
<tr valign='top'>
<td align='left'><?= $Contract_Partner?></td>
<td align='center'><?= $Contract_Type?></td>
<td align='center'><?= $Contract_Subject?></td>
<td align='center'><?= $Contract_Expire?></td>
<td align='center'><?= $countExpireDate?></td>
</tr>
</tbody>
<?php
$Row_No++;
}mysql_close();}
?>
</table>
|
 |
 |
 |
 |
Date :
2010-01-11 18:22:01 |
By :
aiMai46 |
|
 |
 |
 |
 |
|
|
 |