|
|
|
สอบถามปัญหา Doctype กับการใช้ jquery javascript ajax php ครับ |
|
|
|
|
|
|
|
Code หบบบละ หรือจะให้เดาตอบ
|
|
|
|
|
Date :
2012-09-29 15:33:03 |
By :
aa |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include("phpSQLServerConnect.php");
header('Content-type: text/html; charset=tis-620');
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>Admin Panel - Security Operation | Bangkok Bank</title>
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<link rel="Stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.7.1.custom.css" />
<link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" />
<link rel="stylesheet" type="text/css" href="markitup/sets/default/style.css" />
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen">
<!-- JavaScript -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/clear.js"></script>
<script type="text/javascript" src="js/excanvas.pack.js"></script>
<script type="text/javascript" src="markitup/jquery.markitup.pack.js"></script>
<script type="text/javascript" src="markitup/sets/default/set.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
<? /* Start javascript about work */ ?>
<script type="text/javascript" src="js/ajaxframework.js"></script>
<script type="text/javascript" src="js/previewweb.js"></script>
<script type="text/javascript" src="js/edit_del.js"></script>
</head>
<body>
<div class="container" id="container">
<div id="header">
<div id="profile_info">
<img src="img/avatar.jpg" id="avatar" alt="avatar" />
<p>Welcome <strong>root</strong>. <a href="#">Log out.</a></p>
<p>System messages: 3. <a href="#">Read</a></p>
<p class="last_login">Last login: 21:03 9/08/2012</p>
</div>
<div id="logo"><h1><a href="index.php">AdmintTheme</a></h1></div>
</div>
<!-- end header -->
<div id="content" >
<div id="top_menu" class="clearfix">
<a id="visit" class="right" href="index.php">Refresh</a>
</div>
<div id="content_main" class="clearfix">
<div class="hidepanel">
<p class="heading" style="background:url(img/ico_search.jpg) no-repeat 5px center #f1f1f1; padding-left:40px;margin-bottom:10px;padding-top:10px;">
Search Phonebook & IP-Ports/Server [Show/Hide]
</p>
<div class="searchpanel">
<table>
<tr><td><form>
<h4 class= "ico_contacts">Phonebook
<input type = "text" name="users" onkeyup="searchphonebook(this.value)">
</input></td></form>
<form><td>
<h4 class= "ico_ipport">IP-Ports/Server
<input type = "text" name="users" onkeyup="searchipport(this.value)">
</input></td></form>
</table>
<br />
<div id="txtHint"><b>Search Ajax beta 1 Welcome!!</b></div>
</div>
<span id="mySpan"></span>
<span id="myForm" style="display='none';">
<table id="tablesearch" style="text-align::center;" width="100%">
<tr>
<th width = "7%" align="center">Services</th>
<th width = "7%" align="center">Admin</th>
<th width = "7%" align="center">Nickname</th>
<th width = "7%" align="center">Tel</th>
<th width = "7%" align="center">Mobile</th>
<th width = "7%" align="center">Email</th>
</tr>
<tr>
<td><select name="selServices">
<?
$strSQL = "SELECT DISTINCT Services FROM phonebook ORDER BY Services ASC";
$objQuery = mssql_query($strSQL);
while($objResuut = mssql_fetch_array($objQuery))
{
?>
<option value="<?=$objResuut["Services"];?>"><?=$objResuut["Services"];?></option>
<?
}
?>
</select></td>
<td><input type="text" name="txtAdmin" id="txtAdmin" size="10"></td>
<td><input type="text" name="txtNickname" id="txtNickname" size="10"></td>
<td><div align="center"><input type="text" name="txtTel" id="txtTel" size="20"></div></td>
<td align="right"><input type="text" name="txtMobile" id="txtMobile" size="20"></td>
<td align="right"><input type="text" name="txtEmail" id="txtEmail" size="30"></td>
</tr>
</table>
<input type="button" name="btnUpdate" id="btnUpdate" value="Update" OnClick="JavaScript:doCallAjax('UPDATE');">
<br><br></span>
<span id="mySpan"></span>
</div>
</div><!-- end #sidebar -->
</div><!-- end #content_main -->
<!-- end #seach -->
<div id="footer" class="clearfix">
<p class="left">Admin Panel Version 1.0</p>
<p class="right">Security Operation | Bangkok Bank</p>
</div><!-- end #footer -->
</div><!-- end container -->
</body>
</html>
--------------------------------------------------------------------------------
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include("phpSQLServerConnect.php");
header('Content-type: text/html; charset=tis-620');
$strMode = $_POST["tMode"];
$strID = $_POST["tPhonebook_id"];
//-------------**SEARCH**-------------//
$phonebook =$_GET["phonebook"] ;
$ipport =$_GET["ipport"];
if( $phonebook != "" || $ipport != "")
{
if($phonebook != "")
{
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>Search Phonebook & IP-Ports/Server - Security Operation | Bangkok Bank</title>
<link rel="stylesheet" type = "text/css" href = "css/style.css">
<script type="text/javascript" src="js/edit_del.js"></script>
</head>
<body>
<table align="right">
<tr>
<td align="right"><a href="add_phonebook.php" target="blank"><img src="img/add16x16.png" align ="right"></a></td>
<td align="right"><a href="add_phonebook.php">
<img src="img/remove16x16.png" align ="right"></a></td>
<td align="right"><a href="add_phonebook.php" target="blank"><img src="img/edit16x16.png" align ="right"></a></td>
</tr></table>
<?php
$strSQL="SELECT * FROM phonebook WHERE (phonebook.Services LIKE '%$phonebook%'
or phonebook.Admin LIKE '%$phonebook%'
or phonebook.Nickname LIKE '%$phonebook%')";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<br>
<table id="tablesearch" style="text-align::center;" width="100%">
<tr>
<th width = "7%" align="center">Services </th>
<th width = "7%" align="center">Admin </th>
<th width = "7%" align="center">Nickname </th>
<th width = "7%" align="center">Tel </th>
<th width = "7%" align="center">Mobile </th>
<th width = "7%" align="center">Email </th>
<th width = "1%" align="center"> </th>
<th width = "1%" align="center"> </th>
</tr>
<?php
while($objResult = mssql_fetch_array($objQuery))
{
?>
<tr>
<td align="center"><?=$objResult['Services']; ?></td>
<td align="center"><?=$objResult['Admin']; ?></td>
<td align="center"><?=$objResult['Nickname']; ?></td>
<td align="center"><?=$objResult['Tel'] ;?></td>
<td align="center"><?=$objResult['Mobile'] ;?></td>
<td align="center"><?=$objResult['Email'] ;?></td>
<td align="center"><a href="JavaScript:ShowEdit('<?=$objResult["Services"];?>',
'<?=$objResult["Admin"];?>',
'<?=$objResult["Nickname"];?>',
'<?=$objResult["Tel"];?>',
'<?=$objResult["Mobile"];?>',
'<?=$objResult["Email"];?>')">Edit</a></td>
<td align="center"><a href="JavaScript:doCallAjax('DELETE','<?=$objResult["Phonebook_id"];?>');">Del</a></td>
</tr>
<?php
}
?>
</table>
<?php
}else
{
$strSQL="SELECT * FROM ipport WHERE (ipport.Services LIKE '%$ipport%'
or ipport.Hostname LIKE '%$ipport%'
or ipport.IPAddress LIKE '%$ipport%'
or ipport.PortInband1 LIKE '%$ipport%'
or ipport.PortInband2 LIKE '%$ipport%'
or ipport.PortOutband LIKE '%$ipport%')";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table id="tablesearch" style="text-align::center;" width="100%">
<tr>
<th width = "7%" align="center">Services </th>
<th width = "7%" align="center">Hostname </th>
<th width = "7%" align="center">IPAddress </th>
<th width = "7%" align="center">Zone </th>
<th width = "7%" align="center">PortInband1 </th>
<th width = "7%" align="center">PortInband2 </th>
<th width = "7%" align="center">PortOutband </th>
<th width = "7%" align="center">Rack </th>
<th width = "7%" align="center">Remark </th>
<th width = "7%" align="center">Description </th>
</tr>
<?php
while($objResult = mssql_fetch_array($objQuery))
{
?>
<tr>
<td align="center"><?=$objResult['Services']; ?></td>
<td align="center"><?=$objResult['Hostname']; ?></td>
<td align="center"><?=$objResult['IPAddress']; ?></td>
<td align="center"><?=$objResult['Zone'] ;?></td>
<td align="center"><?=$objResult['PortInband1'] ;?></td>
<td align="center"><?=$objResult['PortInband2'] ;?></td>
<td align="center"><?=$objResult['PortOutband'] ;?></td>
<td align="center"><?=$objResult['Rack'] ;?></td>
<td align="center"><?=$objResult['Remark'] ;?></td>
<td align="center"><?=$objResult['Description'] ;?></td>
</tr>
<?php
}
?>
</table>
<?php
}
}
//-------------**UPDATE**-------------//
if($strMode == "UPDATE")
{
$strSQL = "UPDATE phonebook SET ";
$strSQL .="Services = '".$_POST["tServices"]."' ";
$strSQL .=",Admin = '".$_POST["tAdmin"]."' ";
$strSQL .=",Nickname = '".$_POST["tNickname"]."' ";
$strSQL .=",Tel = '".$_POST["tTel"]."' ";
$strSQL .=",Mobile = '".$_POST["tMobile"]."' ";
$strSQL .=",Email = '".$_POST["tEmail"]."' ";
$strSQL .="WHERE Phonebook_id = '".$_POST["tPhonebook_id"]."' ";
$objQuery = mssql_query($strSQL);
}
//-------------**DELETE**-------------//
if($strMode == "DELETE")
{
$strSQL = "DELETE FROM phonebook ";
$strSQL .="WHERE Phonebook_id = '".$strID."' ";
$objQuery = mssql_query($strSQL);
}
?>
</table>
</body>
ขอโทดค้าบบบ รบกวนตอบด้วยนะครับบ ขอบคุนคับบบ
|
|
|
|
|
Date :
2012-09-29 16:20:20 |
By :
Chinjang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองตัดบรรทัดที่ 18 ออก มันหายไม๊ครับ ไอ้บรรทัด <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> เนี้ยอ่ะ
|
|
|
|
|
Date :
2012-09-29 20:43:38 |
By :
deawx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deawx ผมทำตามที่พี่แนะนำแล้วนะครับ แต่ว่ามันก็ยังไม่ได้เลยอะครับ หน้านี้ที่จริงมันมาเป็น template ของ wordpress อะครับ ผมเอา theme มันมาใช้งานนะครับ อย่างที่ผมลองไว้ข้างต้นนะครับ ตัด Doctype แล้วมันใช้ได้อะครับ แต่ template เลื่อไม่สวยงานอะครับ แนะนำหน่อยก็ได้ครับ ว่าจะทำอย่างไรดีครับ
ขอบคุณครับ ^ ^ ผมมือใหม่นะครับ รบกวนขอละเอียดหน่อยนะครับ ขอบคุณอีกทีครับ
|
|
|
|
|
Date :
2012-09-30 12:54:50 |
By :
Chinjang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|