 |
jquery include มาแล้วตัว jquery ใน page ไม่ทำงานครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>::Admin-Active::</title>
<!-- <meta http-equiv="refresh" content="10"/>refresh every 10 second -->
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="layout.css" />
<link rel="stylesheet" type="text/css" href="../jQuery/datepicker/css/ui.all.css" />
<script language="javascript" type="text/javascript" src="../jQuery/jQuery-1.7.2.js"></script>
<script language="javascript" type="text/javascript" src="../jQuery/datepicker/ui/jQuery.ui.core.js"></script>
<script language="javascript" type="text/javascript" src="../jQuery/datepicker/ui/jQuery.ui.widget.js"></script>
<script language="javascript" type="text/javascript" src="../jQuery/datepicker/ui/jQuery.ui.datepicker.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
$('#ShowHideTable1').hide();
$('table.show1').click(function()
{
$('#ShowHideTable1').toggle(500);
$('.advance').attr('src','images/delete_blue_icon.jpg');
/*$('.advance').toggle(
function () {
$(this).attr("src","images/delete_blue_icon.jpg");
},
function () {
$(this).attr("src","images/add_blue_icon.png");
}
);*/
});
});
</script>
<script type="text/javascript">
function time_alert()
{
var x = setTimeout("window_open()",1000);
}
function window_open()
{
window.open('window_open.php' , '','menubar=no,toolbar=no,location=no,scrollbars=no, status=no,resizable=yes,width=900,height=800,top=220,left=650 ' );
}
</script>
<style type="text/css">
<!--.style1 {color: #FF0000}-->
</style>
</head>
<body id="page1" >
<div class="tail-top-right"></div>
<div id="main">
<!-- header -->
<div id="header">
<ul class="site-nav">
<li><a href="index.php" style="text-decoration:none">Home</a></li>
<li class="last"><a href="admin_active.php" class="act" style="text-decoration:none">Admin-Active</a></li>
</ul>
</div>
<!-- content -->
<div id="content">
<div class="inner_copy">
<a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a>
</div><!-- don't delete this ice-->
<div class="wrapper">
<div class="col-1">
<div class="box">
<div class="border-top">
<div class="border-right">
<div class="border-bot">
<div class="border-left">
<div class="inner">
<?php include 'menu_left2.php'; ?><!-- include menu left -->
</div>
</div><!-- close border-left -->
</div><!-- close border-bot -->
</div><!-- close border-right -->
</div><!-- close border-top -->
</div><!-- close box -->
<div class="banner">
<a href="http://192.168.1.12/internal/index.php" target="_blank"><img src="images/banner.gif" alt="" /></a>
</div>
</div><!-- close col-1 -->
<div class="col-2">
<div class="">
</div>
<div class="box">
<div class="border-top">
<div class="border-right">
<div class="border-bot">
<div class="border-left">
<div class="inner">
<ul class="list1">
<!-- <li><h3>รายชื่อรายละเอียดการแก้ไขใบงาน</h3></li> -->
<li>
<?php
require_once "../../config.inc.php";
require_once "../../functions/public_global_function.php";
$result = mssql_query("select max(pro_new) from pro_sv_mstr ");
$new = mssql_result($result,0,$pro_new);
echo "<h4><font color=red>รายชื่อรายละเอียดการแก้ไขใบงาน</font></h4>";
if($new==1)
{
mssql_query("UPDATE pro_sv_mstr Set pro_new=0");
$new=0;
echo "<script> time_alert()</script>";
}
else
{
echo "สถานะปัจจุบัน: ไม่มีงานใหม่";
}
?>
<table border="0" width="520" class="show1">
<tr>
<td width="15">
<img src="images/add_blue_icon.png" class="advance" width="15" height="16" border="0" style="cursor:pointer"/>
</td>
<td align="left" width="505">
<font color="blue" style="cursor:pointer"><u>advanced</u></font>
<font size="1" color="red">หมายเหตุ : ก่อนการใช้งานส่วน advanced จะต้องปิด Auto refresh ก่อนทุกครั้ง !</font>
</td>
</tr>
</table>
<div id="ShowHideTable1">
<form name="form1" method="post" action="http://192.168.1.110/service/admin~s/connect_it/Back_Systems/admin_active.php">
<table border="1" width="250" style="color:gray;">
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td colspan="2" align="center"><b>ระบุวันที่ค้นหา</b> <input type="text" id="datepicker" name="date_fix" style="width:100px;"/></td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td width="15"><input type="checkbox" name="non_fix" value="check1"/></td>
<td align="left" width="235"> แสดงงานที่ยังไม่ได้รับเรื่อง</td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td width="15"><input type="checkbox" name="con_fix" value="check2"/></td>
<td align="left" width="235"> แสดงงานที่กำลังดำเนินการ</td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td width="15"><input type="checkbox" name="end_fix" value="check3"/></td>
<td align="left" width="235"> แสดงงานที่แก้ไขเสร็จสิ้น</td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td width="15"><input type="checkbox" name="cancle_fix" value="check4"/></td>
<td align="left" width="235"> แสดงงานที่ยกเลิกปัญหา</td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td width="15"><input type="checkbox" name="all_fix" value="check5"/></td>
<td align="left" width="235"> แสดงงานทั้งหมด</td>
</tr>
<tr onMouseMove=this.bgColor="red";this.style.color="white" onMouseOut=this.bgColor="transparent";this.style.color="gray">
<td colspan="2" align="center"><input type="submit" value="ค้นหา" style="font-size:13px;width:50px;cursor:pointer"></td>
</tr>
</table>
</form>
</div>
<?
echo '<table border="1" width="750" style="table-layout:fixed;">';
echo '<tr bgcolor="#CCCCCC">';
echo '<th width="100">No.การแจ้ง</th>';
echo '<th width="300">ชื่อปัญหา</th>';
echo '<th width="150">วัน-เวลาที่แจ้ง</th>';
echo '<th width="150">เปลี่ยนสถานะ</th>';
echo '<th width="50">ลบ</th>';
echo "</tr>";
$today_date = date("d/m/Y");
$date_fix = $_POST["date_fix"];//ระบุวันที่ค้นหา
$non_fix = $_POST["non_fix"];//แสดงงานที่ยังไม่ได้แก้ปัญหา
$con_fix = $_POST["con_fix"];//แสดงงานที่กำลังดำเนินการ
$end_fix = $_POST["end_fix"];//แสดงงานที่แก้ไขเสร็จสิ้น
$cancle_fix = $_POST["cancle_fix"];//แสดงงานที่ยกเลิกปัญหา
$all_fix = $_POST["all_fix"];//แสดงงานทั้งหมด
$select = "(pro_id<>'55052100' and pro_date='".$today_date."')or pro_status = 1";
if($date_fix <> "")
{
$select = "pro_date='".$date_fix."'";
}
if($date_fix <> "" && $non_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 1";
}
if($date_fix <> "" && $con_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 2";
}
if($date_fix <> "" && $end_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 3";
}
if($date_fix <> "" && $cancle_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 4";
}
if($date_fix <> "" && $con_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 2";
}
if($date_fix <> "" && $end_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 3";
}
if($date_fix <> "" && $cancle_fix <> "")
{
$select = "pro_date='".$date_fix."' and pro_status = 4";
}
if($date_fix == "" &&$non_fix <> "")
{
$select = "pro_status = 1";
}
if($date_fix == "" && $con_fix <> "")
{
$select = "pro_status = 2";
}
if($date_fix == "" && $end_fix <> "")
{
$select = "pro_status = 3";
}
if($date_fix == "" && $cancle_fix <> "")
{
$select = "pro_status = 4";
}
if($date_fix == "" && $all_fix <> "")
{
$select = "pro_id<>'55052100'";
}
$sql_mstr = "SELECT * FROM pro_sv_mstr WHERE ".$select;
$result_mstr = mssql_query($sql_mstr);
while($data = mssql_fetch_array($result_mstr))
{
$sql_pbm = mssql_query("SELECT * FROM pro_sv_pbm WHERE pbm_id='".$data[pbm_id]."'");
$result_pbm = mssql_fetch_array($sql_pbm);
if($data[pro_status]==1)
{
$status = '<a href="resolve.php?pro_id='.$data[pro_id].'&status='.$data[pro_status].'"><font color="orange">รับเรื่อง</font></a>';
}
if($data[pro_status]==2)
{
$status = '<a href="resolve.php?pro_id='.$data[pro_id].'&status='.$data[pro_status].'"><font color="blue">กำลังดำเนินการ</font></a>';
}
if($data[pro_status]==3)
{
$status = '<font color="green">ดำเนินการเสร็จสิ้น</font>';
}
if($data[pro_status]==4)
{
$status = '<font color="gray">ยกเลิกการแก้ไข</font>';
}
echo '<tr align="center">';
echo '<td><a href="detail.php?action=resolve&pro_id='.$data[pro_id].'"><font color="blue">'.$data[pro_id].'</font></a></td>';
echo '<td align="left"> '.$result_pbm[pbm_desc].'</td>';
echo '<td>'.$data[pro_date].'<font color="blue">|</font>'.$data[pro_time].'</td>';
echo '<td>'.$status.'</a></td>';
?>
<td><a href="pro_del.php?pro_id=<?=$data['pro_id'];?>" onclick="return confirm('ยืนยันการลบ?')"><font color="red">ลบ</font></a></td>
<?
echo '</tr>';
}
echo '</table>';
?>
</li>
<li>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="title"><img src="images/banner_saijo.jpg" alt="" width="850" height="100" align="center"/></div>
</div>
</div>
<!-- footer -->
<div id="footer">
<div class="indent"></div>
</div>
</div>
</body>
</html>
**บรรทัดที่ 77 ผม include menu ที่เป็น jquery มาครับ
ผลลัพธ์ออกมาเป็น jquery ตัวเมนูทำงาน แต่ตัวที่มีอยู่แล้วไม่ทำงานครับผม (ถ้าเอา jquery menu ออกก็ทำงานตามปกติครับ)
ลองใช้ firefox หา bug มันฟ้องว่า บรรทัดที่ 17 ไม่ใช่ function ผมต้องเขียนยังไงถึงจะถูกรูปแบบครับ
ขอบคุณล่วงหน้าน่ะครับ
Tag : HTML/CSS, JavaScript, jQuery
|
|
 |
 |
 |
 |
Date :
2012-05-31 11:34:37 |
By :
hayenaiceman |
View :
1946 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="Script/ddaccordion.js">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "headerbar", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it is collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["", "", ""], //Additional HTML added to the header when it is collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
</script>
<style type="text/css">
.urbangreymenu{
width: 190px; /*width of menu*/
}
.urbangreymenu .headerbar{
font: bold 13px Verdana;
color: white;
background: #606060 url(arrowstop.gif) no-repeat 8px 6px; /*last 2 values are the x and y coordinates of bullet image*/
margin-bottom: 0; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 7px 0 7px 31px; /*31px is left indentation of header text*/
}
.urbangreymenu .headerbar a{
text-decoration: none;
color: white;
display: block;
}
.urbangreymenu ul{
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 0; /*bottom spacing between each UL and rest of content*/
}
.urbangreymenu ul li{
padding-bottom: 2px; /*bottom spacing between menu items*/
}
.urbangreymenu ul li a{
font: normal 12px Arial;
color: black;
background: #E9E9E9;
display: block;
padding: 5px 0;
line-height: 17px;
padding-left: 8px; /*link text is indented 8px*/
text-decoration: none;
}
.urbangreymenu ul li a:visited{
color: black;
}
.urbangreymenu ul li a:hover{ /*hover state CSS*/
color: white;
background: black;
}
</style>
<body>
<div class="urbangreymenu">
<h3 class="headerbar">Service</h3>
<ul class="submenu">
<li><a href="pbm.php?data=1">ต้องการพิมพ์ใบยืมอะไหล่ใหม่</a></li>
<li><a href="pbm.php?data=2">ต้องการพิมพ์ใบแจ้งซ่อมใหม่</a></li>
<li><a href="pbm.php?data=3">ต้องการยกเลิกใบงาน</a></li>
<li><a href="pbm.php?data=4">ต้องการเปลี่ยนแปลงอะไหล่ใบงาน</a></li>
<li><a href="pbm.php?data=5">ต้องการเพิ่มอะไหล่ในใบงาน</a></li>
<li><a href="pbm.php?data=6">ต้องการลบอะไหล่ออกจากใบงาน</a></li>
<li><a href="pbm.php?data=7">ต้องการเปลี่ยนสถานะอะไหล่จากขายเป็นเคลม</a></li>
<li><span><a href="pbm.php?data=8">การ login เข้าใช้ระบบ</a></span></li>
<li><span><a href="pbm.php?data=10">กรอกข้อมูลเคลม Comp ไม่ได้</a></span></li>
<li><span><a href="pbm.php?data=11">ต้องการเพิ่มไอเท็มใน StoreX</a></span></li>
<li><span><a href="pbm.php?data=12">คีย์ข้อมูลลูกค้าไม่ได้</a></span></li>
<li><span><a href="pbm.php?data=13">ต้องการแยกใบงาน(dis)</a></span></li>
<li><span><a href="pbm.php?data=14">ไม่มี Serial แอร์ที่ลูกค้าแจ้งซ่อม</a></span></li>
<li><span><a href="pbm.php?data=15">ต้องการดึง Stock จาก MFG/PRO เข้า Service</a></span></li>
<li><span><a href="pbm.php?data=16">ต้องการเพิ่ม User ใหม่</a></span></li>
<li><span><a href="pbm.php?data=37">ต้องการเพิ่มอะไหล่ใหม่ใน Service</a></span></li>
<li><span><a href="pbm.php?data=37">ต้องการเพิ่มอะไหล่ใหม่+ราคาใน "Part Online"<<</a></span></li>
</ul>
<h3 class="headerbar">Store</h3>
<ul class="submenu">
<li><span><a href="pbm.php?data=17">ไม่สามารถจ่ายอะไหล่ให้ช่างได้</a></span></li>
<li><span><a href="pbm.php?data=18">ต้องการเปลี่ยนแปลงอะไหล่ในใบงาน</a></span></li>
<li><span><a href="pbm.php?data=19">ต้องการเพิ่มอะไหล่ในใบงาน</a></span></li>
<li><span><a href="pbm.php?data=20">ต้องการลบอะไหล่ออกจากใบงาน</a></span></li>
<li><span><a href="pbm.php?data=21">ต้องการรับของจากช่างใหม่</a></span></li>
<li><span><a href="pbm.php?data=22">รับของคืนจากช่างไม่ขึ้นใบงาน</a></span></li>
<li><span><a href="pbm.php?data=23">ปิดใบงานแล้ว ต้องการย้อนสถานะ</a></span></li>
<li><span><a href="pbm.php?data=24">ต้องการเบิกอะไหล่ใหม่</a></span></li>
<li><span><a href="pbm.php?data=8">การ login เข้าใช้ระบบ</a></span></li>
<li><span><a href="pbm.php?data=16">ต้องการเพิ่ม User ใหม่</a></span></li>
<li><span><a href="pbm.php?data=28">ต้องการแก้ไขหมายเลข SI</a></span></li>
</ul>
<h3 class="headerbar">Claim</h3>
<ul class="submenu">
<li><span><a href="pbm.php?data=29">ต้องการพิมพ์ใบเคลมใหม่</a></span></li>
<li><span><a href="pbm.php?data=30">ต้องการพิมพ์ใบสั่งอะไหล่ใหม่</a></span></li>
<li><span><a href="pbm.php?data=31">ต้องการพิมพ์ใบรับคืนอะไหล่ใหม่</a></span></li>
<li><span><a href="pbm.php?data=32">ต้องการให้รับเคลมได้ (กรณีหมดประกัน)</a></span></li>
<li><span><a href="pbm.php?data=33">ต้องการแก้ไขปิดงานยืมเคลมใหม่</a></span></li>
<li><span><a href="pbm.php?data=25">ต้องการพิมพ์ใบ D/R ใหม่</a></span></li>
<li><span><a href="pbm.php?data=8">การ login เข้าใช้ระบบ</a></span></li>
<li><span><a href="pbm.php?data=16">ต้องการเพิ่ม User ใหม่</a></span></li>
<li class="last"><span><a href="pbm.php?data=38">Store key ข้อมูลรับอะไหล่ไม่ได้</a></span></li>
</ul>
</div>
</body>
</html>';
?>
** อันนี้ตัว jquery ที่ถูกเรียกไปใช้งานครับ ******************
|
 |
 |
 |
 |
Date :
2012-05-31 11:36:12 |
By :
hayenaiceman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code เยอะขนาดนี้จะให้ดูอะไรครับ
|
 |
 |
 |
 |
Date :
2012-05-31 12:59:02 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
****ขอโทษทีครับผม *****
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="Script/ddaccordion.js"></script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "headerbar", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it is collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["", "", ""], //Additional HTML added to the header when it is collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
</script>
<style type="text/css">
*********ผมคิดว่าผมเรียกใช้ผิดครับ ตรงส่วนนี้ผมต้อง include ไปซึ่งมันก็ทำงานได้ แต่ว่ามันทำให้ jquery ตัวอื่นๆในหน้าไม่ทำงานครับผม*****
|
 |
 |
 |
 |
Date :
2012-05-31 13:09:52 |
By :
hayenaiceman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ
ขอบคุณคับ
(หนีไปใช้ javascript เอา ^_^)
|
 |
 |
 |
 |
Date :
2012-05-31 13:34:41 |
By :
hayenaiceman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|