 |
|
Code (PHP)
<?
session_start();
include"Connect.php";
//if($_SESSION["u_id"] == NULL)
//echo "<meta http-equiv='Refresh' content='0; URL=../index.php'>";
$user_id=$_SESSION["u_id"] ;
$today = date("Y")+543;
$ms = trim(date("Y-m-d"));
//echo $ms = trim(date("m-d"));
$mm=date("m");
$jobsearch=$_GET["jobsearch"];
$sql = "select * from user where user_id ='$user_id' "; //เช็คค่าข้อมูลที่ส่งมาจากฟอร์ม
$dbquery = mysql_db_query($dbname, $sql);
if($row = mysql_fetch_array($dbquery)){
$user_type=$row[user_type ];
}
?>
<script language="javascript">
function chack(){
if(form1.co_number.value==""){
if(form1.invoice_number.value==""){
alert("Fill Invoice No OR Co No !!")
return false;
}
}
if(form1.billing_status.value==""){
alert("Fill Billing Status !!")
return false;
}
if(form1.billing_status.value=='Billing'){
if(form1.date.value==""){
alert("Fill Billing Date !!")
return false;
}
}
if(form1.billing_status.value=='Complete'){
if(form1.complete_date.value==""){
alert("Fill Complete Date !!")
return false;
}
}
if(form1.invoice_number.value!=""){
if(form1.invoice_date.value==""){
alert("Fill Invoice Date !!")
return false;
}
}
var allCheckBox = $("[id^='jobcheck']")
var count_checked = allCheckBox.filter(":checked").length;
if (count_checked == 0) {
alert("Please Check At Least One Of The Checkboxes");
return false;
}
//else if(count_checked != allCheckBox.length) {
// alert("some of the check boxs are not checked");
//}
if (confirm('ต้องการที่จะยืนยันข้อมูล')==true)
{
}
else
{
alert('You selected to cancel.');
return false;
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" type="image/x-icon" href="images/JOBV02-01.png" />
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/check.js"></script>
<title>JobOrder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/web.css"/>
<style type="text/css">
<!--
tr.tover:hover{
cursor:pointer;
background-color:#33FF33;
}
-->
</style>
</head>
<body onLoad="MM_preloadImages('images/home(1).png','images/job(1).png','images/billstatus(1).png','images/payment(1).png','images/logout(1).png','images/star(1).png','images/report(1).png')">
<table width="1280" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="77" colspan="5" align="center" >
<p><img src="images/LOGO.png" width="1280" height="250" /></p>
</td>
</tr>
<tr valign="top">
<td height="49">
<? include "menu.php"; ?>
</td>
<tr valign="top">
<td width="627"><form action="#" method="post" name="form" id="form">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="125"> </td>
<td class="menu"> </td>
<td width="1010"> </td>
</tr>
<tr>
<td width="125"> </td>
<td class="menu">Job Order No.</td>
<td></td>
</tr>
<tr>
<td width="125"> </td>
<td width="145" class="menu"><label for="jobsearch"></label><input type="text" name="jobsearch" id="jobsearch" value="<?=$_GET["jobsearch"];?>" /></td>
<td><input type="image" name="button" id="button" value="Submit" src="images/SEARCH_31X31_v02.png" formaction="<?=$_SERVER['SCRIPT_NAME'];?>" formmethod="get" /></td>
</tr>
</table>
</form><br /><br />
<form action="savepayment.php" method="post" name="form1" id="form1" onsubmit="return chack()" >
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr class="thai">
<td > </td>
<td > </td>
<td width="152" > </td>
<td width="698" >วางบิลลูกค้า</td>
</tr>
<tr class="table" >
<td scope="col"> </td>
<td scope="col"> </td>
<td colspan="2" scope="col"> </td>
</tr>
<tr bgcolor="#414042" class="menu_white" >
<td width="32" align="left" scope="col"> </td>
<td width="390" align="left" scope="col">Job No.</td>
<td colspan="2" align="left" scope="col">Job Check.</td>
</tr>
<tr class="table" >
<td scope="col"> </td>
<td scope="col"> </td>
<td colspan="2" scope="col"> </td>
</tr>
<?
if($jobsearch != ""){
$sql="SELECT * FROM job WHERE job_no like '%$jobsearch%' order by job_no desc ";
$query=mysql_query($sql);
while($data=mysql_fetch_array($query)){
$i++;
if($i%2==0)
{
$bg = "#DDDDDD";
}
else
{
$bg = "#b4b4b4";
}
$sql1="SELECT job_no FROM stock WHERE job_no = '".$data['job_no']."' ";
$query1=mysql_query($sql1);
if(mysql_num_rows($query1)>=1){
$sql2="SELECT * FROM payment ";
$sql2.="WHERE job_no = '%".$data['job_no']."%' ";
$query2=mysql_query($sql2);
if(mysql_num_rows($query2)==0){
/*$sql3="SELECT st_name FROM stock ";
$sql3.="WHERE st_name NOT IN (
SELECT SUBSTRING_INDEX(`job_no`,'_',-1)
AS part2 FROM payment
WHERE `job_no` LIKE '%".$data['job_no']."%'
AND SUBSTRING_INDEX(`job_no`,'_',1) != SUBSTRING_INDEX(`job_no`,'_',-1)
)
AND `job_no` LIKE '%".$data['job_no']."%' ";*/
$sql3="SELECT st_name FROM stock ";
$sql3.="WHERE st_name NOT IN (
SELECT job_item FROM payment
WHERE job_no LIKE '%".$data['job_no']."%'
)
AND job_no LIKE '%".$data['job_no']."%' ";
$query3=mysql_query($sql3);
if(mysql_num_rows($query3)>=1){?>
<tr bgcolor="<?=$bg;?>" class="tover" >
<td align="left" class="item_black" scope="col"> </td>
<td align="left" class="item_black" scope="col"> <? echo $data['job_no'];?>
<input type="hidden" name="user" value="<? echo $user_id ; ?>">
</td>
<td colspan="2" align="left" scope="col">
<input name="jobcheck[]" type="checkbox" id="jobcheck<?=$data['job_no']?>" value="<? echo $data['job_no'] ; ?>" /></td>
</tr>
<? }
}
}else{
$sql2="SELECT * FROM payment ";
$sql2.="WHERE job_no = '".$data['job_no']."' ";
$query2=mysql_query($sql2);
if(mysql_num_rows($query2)==0){?>
<tr bgcolor="<?=$bg;?>" class="tover">
<td align="left" class="item_black" scope="col"> </td>
<td align="left" class="item_black" scope="col"> <? echo $data['job_no'];?>
<input type="hidden" name="user" value="<? echo $user_id ; ?>">
</td>
<td colspan="2" align="left" scope="col">
<input name="jobcheck[]" type="checkbox" id="jobcheck<?=$data['job_no']?>" value="<? echo $data['job_no']; ?>" /></td>
</tr>
<? }
}
}?>
<tr >
<td align="left" scope="col"> </td>
<td align="left" scope="col"> </td>
<td colspan="2" align="left" scope="col"> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#F0f0f0" >
<td width="3%" class="item_black"> </td>
<td width="31%" class="item_black"> Item Name</td>
<td width="66%"><!--<input name="item_name" type="text" id="item_name" size="15" />-->
<select name="item_name" id="item_name" style="width:185px;height:20px;" >
</select>
</td>
</tr>
<tr bgcolor="#F0f0f0" >
<td width="3%" class="item_black"> </td>
<td width="31%" class="item_black"> CO. No</td>
<td width="66%"> <input name="co_number" type="text" id="co_number" size="15" /></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> PO. No</td>
<td> <input name="po_number" type="text" id="po_number" size="15" /></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> PO.Upload</td>
<td> <input type="button" value="Upload" id="btntest"/></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> Billing Amount</td>
<td> <input name="billing_amount" type="text" id="billing_amount" size="15" onkeypress="check_number()" /></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> Billing Date</td>
<td> <table width="30%" align="left" bordercolor="<? $bg ;?>">
<tr>
<td align="left"><input name="date" id="date" style="cursor: text" onClick="ds_sh(this);" value="" size="15" readonly />
</td>
</tr>
</table>
<table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;">
<tr><td id="ds_calclass">
</td></tr>
</table></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> Billing Status</td>
<td> <select name="billing_status" id="billing_status" style="width:122px" >
<option value="">เลือก</option>
<option value="Billing">Billing</option>
<option value="Complete">Complete</option>
</select></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> INVOICE. No</td>
<td> <input name="invoice_number" type="text" id="invoice_number" size="15" /></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> INVOICE. Date</td>
<td><table width="30%" align="left">
<tr>
<td align="left"><input name="invoice_date" id="invoice_date" style="cursor: text" onClick="ds_sh(this);" value="" size="15" readonly />
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#F0f0f0">
<td class="item_black"> </td>
<td class="item_black"> Complete Date</td>
<td> <table width="30%" align="left">
<tr>
<td align="left"><input name="complete_date" id="complete_date" style="cursor: text" onClick="ds_sh(this);" value="" size="15" readonly />
</td>
</tr>
</table>
<table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;">
<tr><td id="ds_calclass">
</td></tr>
</table></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" align="center"><input type="image" name="button2" id="button2" value="Submit" src="images/Submit_botton.png" /></td>
</tr><? } ?>
</table>
<div></div>
<script type="text/javascript">
// <!-- <![CDATA[
// Project: Dynamic Date Selector (DtTvB) - 2006-03-16
// Script featured on JavaScript Kit- http://www.javascriptkit.com
// Code begin...
// Set the initial date.
var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth() + 1;
ds_c_year = ds_i_date.getFullYear();
// Get Element By Id
function ds_getel(id) {
return document.getElementById(id);
}
// Get the left and the top of the element.
function ds_getleft(el) {
var tmp = el.offsetLeft;
el = el.offsetParent
while(el) {
tmp += el.offsetLeft;
el = el.offsetParent;
}
return tmp;
}
function ds_gettop(el) {
var tmp = el.offsetTop;
el = el.offsetParent
while(el) {
tmp += el.offsetTop;
el = el.offsetParent;
}
return tmp;
}
// Output Element
var ds_oe = ds_getel('ds_calclass');
// Container
var ds_ce = ds_getel('ds_conclass');
// Output Buffering
var ds_ob = '';
function ds_ob_clean() {
ds_ob = '';
}
function ds_ob_flush() {
ds_oe.innerHTML = ds_ob;
ds_ob_clean();
}
function ds_echo(t) {
ds_ob += t;
}
var ds_element; // Text Element...
var ds_monthnames = [
'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม','มิถุนายน', 'กรกฏาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน' ,'ธันวาคม',
]; // You can translate it for your language.
var ds_daynames = [
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
]; // You can translate it for your language.
// Calendar template
function ds_template_main_above(t) {
return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'
+ '<tr>'
+ '<td class="ds_head" style="cursor: pointer" onclick="ds_py();"><<</td>'
+ '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();"><</td>'
+ '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Close]</td>'
+ '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">></td>'
+ '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">>></td>'
+ '</tr>'
+ '<tr>'
+ '<td colspan="7" class="ds_head">' + t + '</td>'
+ '</tr>'
+ '<tr>';
}
function ds_template_day_row(t) {
return '<td class="ds_subhead">' + t + '</td>';
// Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.
}
function ds_template_new_week() {
return '</tr><tr>';
}
function ds_template_blank_cell(colspan) {
return '<td colspan="' + colspan + '"></td>'
}
function ds_template_day(d, m, y) {
return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';
// Define width the day row.
}
function ds_template_main_below() {
return '</tr>'
+ '</table>';
}
// This one draws calendar...
function ds_draw_calendar(m, y) {
// First clean the output buffer.
ds_ob_clean();
// Here we go, do the header
ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));
for (i = 0; i < 7; i ++) {
ds_echo (ds_template_day_row(ds_daynames[i]));
}
// Make a date object.
var ds_dc_date = new Date();
ds_dc_date.setMonth(m - 1);
ds_dc_date.setFullYear(y);
ds_dc_date.setDate(1);
if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
days = 31;
} else if (m == 4 || m == 6 || m == 9 || m == 11) {
days = 30;
} else {
days = (y % 4 == 0) ? 29 : 28;
}
var first_day = ds_dc_date.getDay();
var first_loop = 1;
// Start the first week
ds_echo (ds_template_new_week());
// If sunday is not the first day of the month, make a blank cell...
if (first_day != 0) {
ds_echo (ds_template_blank_cell(first_day));
}
var j = first_day;
for (i = 0; i < days; i ++) {
// Today is sunday, make a new week.
// If this sunday is the first day of the month,
// we've made a new row for you already.
if (j == 0 && !first_loop) {
// New week!!
ds_echo (ds_template_new_week());
}
// Make a row of that day!
ds_echo (ds_template_day(i + 1, m, y));
// This is not first loop anymore...
first_loop = 0;
// What is the next day?
j ++;
j %= 7;
}
// Do the footer
ds_echo (ds_template_main_below());
// And let's display..
ds_ob_flush();
// Scroll it into view.
ds_ce.scrollIntoView();
}
// A function to show the calendar.
// When user click on the date, it will set the content of t.
function ds_sh(t) {
// Set the element to set...
ds_element = t;
// Make a new date, and set the current month and year.
var ds_sh_date = new Date();
ds_c_month = ds_sh_date.getMonth() + 1;
ds_c_year = ds_sh_date.getFullYear();
// Draw the calendar
ds_draw_calendar(ds_c_month, ds_c_year);
// To change the position properly, we must show it first.
ds_ce.style.display = '';
// Move the calendar container!
the_left = ds_getleft(t);
the_top = ds_gettop(t) + t.offsetHeight;
ds_ce.style.left = the_left + 'px';
ds_ce.style.top = the_top + 'px';
// Scroll it into view.
ds_ce.scrollIntoView();
}
// Hide the calendar.
function ds_hi() {
ds_ce.style.display = 'none';
}
// Moves to the next month...
function ds_nm() {
// Increase the current month.
ds_c_month ++;
// We have passed December, let's go to the next year.
// Increase the current year, and set the current month to January.
if (ds_c_month > 12) {
ds_c_month = 1;
ds_c_year++;
}
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
}
// Moves to the previous month...
function ds_pm() {
ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.
// We have passed January, let's go back to the previous year.
// Decrease the current year, and set the current month to December.
if (ds_c_month < 1) {
ds_c_month = 12;
ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
}
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
}
// Moves to the next year...
function ds_ny() {
// Increase the current year.
ds_c_year++;
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
}
// Moves to the previous year...
function ds_py() {
// Decrease the current year.
ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
}
// Format the date to output.
function ds_format_date(d, m, y) {
// 2 digits month.
m2 = '00' + m;
m2 = m2.substr(m2.length - 2);
// 2 digits day.
d2 = '00' + d;
d2 = d2.substr(d2.length - 2);
// YYYY-MM-DD
return y + '-' + m2 + '-' + d2;
}
// When the user clicks the day.
function ds_onclick(d, m, y) {
// Hide the calendar.
ds_hi();
// Set the value of it, if we can.
if (typeof(ds_element.value) != 'undefined') {
ds_element.value = ds_format_date(d, m, y);
// Maybe we want to set the HTML in it.
} else if (typeof(ds_element.innerHTML) != 'undefined') {
ds_element.innerHTML = ds_format_date(d, m, y);
// I don't know how should we display it, just alert it to user.
} else {
alert (ds_format_date(d, m, y));
}
}
// And here is the end.
// ]]> -->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title></title>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_timelineStop(tmLnName) { //v1.2
//Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
if (tmLnName == null) //stop all
for (var i=0; i<document.MM_Time.length; i++) document.MM_Time[i].ID = null;
else document.MM_Time[tmLnName].ID = null; //stop one
}
function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
//Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (numGotos != null)
if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
jmpFwd = (fNew > tmLn.curFrame);
for (i = 0; i < tmLn.length; i++) {
sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
if (sprite.charAt(0) == "s") {
numKeyFr = sprite.keyFrames.length;
firstKeyFr = sprite.keyFrames[0];
lastKeyFr = sprite.keyFrames[numKeyFr - 1];
if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
if (sprite.obj != null) {
if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
else sprite.obj[props.prop2][props.prop] = props[propNum];
} }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
}
tmLn.curFrame = fNew;
if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}
function MM_timelinePlay(tmLnName, myID) { //v1.2
//Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
if (myID == tmLn.ID) { //if Im newest
setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn[i];
if (sprite.charAt(0) == 's') {
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } } }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
if (fNew > tmLn.lastFrame) tmLn.ID = 0;
} }
}
//-->
</script>
<script language="javascript">
$(document).ready(function(){
$('#item_name').html('<option value=>-- Select --</option>');
$('#item_name').css( "background-color","#F5F5F5" );
$('#item_name').attr('disabled','disabled');
var countChecked = function() {
var n = $( "input:checked" ).length;
// var job = $( "jobcheck" ).value;
//alert(job);
if(n==1){
$('#item_name').removeAttr('disabled');
$('#item_name').css( "background-color","" );
$.post('fare_frm2.php',{job_nox:$("input:checked").val()},function(data){
if(data=="No"){
$('#item_name').html('<option value=>-- No Item --</option>');
$('#item_name').attr('disabled','disabled');
}else{
$('#item_name').html(data);
;
}
});
}else{
$('#item_name').attr('disabled','disabled');
$('#item_name').css( "background-color","#F5F5F5" );
}
};
//countChecked();
$( "input[type=checkbox]" ).on( "click", countChecked );
});
</script>
<script type="text/javascript"><!--
// Returns an array with values of the selected (checked) checkboxes in "frm"
function getSelectedChbox(frm) {
// JavaScript & jQuery Course - http://coursesweb.net/javascript/
var selchbox = []; // array that will store the value of selected checkboxes
// gets all the input tags in frm, and their number
var inpfields = frm.getElementsByTagName('input');
var nr_inpfields = inpfields.length;
// traverse the inpfields elements, and adds the value of selected (checked) checkbox in selchbox
for(var i=0; i<nr_inpfields; i++) {
if(inpfields[i].type == 'checkbox' && inpfields[i].checked == true) selchbox.push(inpfields[i].value);
}
return selchbox;
}
/* Test this function */
// When click on #btntest, alert the selected values
document.getElementById('btntest').onclick = function(){
var selchb = getSelectedChbox(this.form); // gets the array returned by getSelectedChbox()
// alert(selchb);
// url: "upload_photo_in.php?P=" + document.getElementById('job').value,
var myWindow = window.open("upload_po.php?job_no="+selchb, "_blank", "width=600, height=600");
}
//-->
</script>
</form>
</td>
<tr valign="top">
<td align="center"><img src="images/buttom.jpg" width="442" height="76" /></td>
</table>
</td>
</tr>
</table>
</body>
</html>
คือตอนนี้เฉพาะ code หน้านี้ของ ผมถ้า data มีหลายๆ record พบว่ามีการ query ข้อมูลนานมากเลย ประมาน 10-15 วิ /1000 record
พอจะมีวิธีแก้ไขหรือตรวจสอบสาเหตุได้มั้ยครับว่ามันเกิดจากอะไร
Tag : PHP, MySQL, HTML/CSS, JavaScript, Ajax, jQuery
|
|
 |
 |
 |
 |
Date :
2015-08-28 22:48:55 |
By :
wahahaboy |
View :
1411 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |