Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > มีปัญหาเรื่อง Array type="text" มัน count($test); ไม่ถูกครับ



 

มีปัญหาเรื่อง Array type="text" มัน count($test); ไม่ถูกครับ

 



Topic : 090338



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์




หาจากกระทู้เก่าแล้วยังทำไม่ได้ ช่วยดูโค๊ดให้หน่อยครับ พอ sutmit ค่าของ count คูณ 3 ถ้า tyep เป็น checkbox พอเราคลิก แล้ว sutmit ค่าถูกต้อง แต่ถ้ากำหนด type เป็น text ค่ากลับ คูณ 3 ครับ

Code (PHP)
<form action="insert_usermany.php" method="post" enctype="multipart/form-data">
<?
$intRows = 0;

//connect_db("mcintranet");
	$strSQL = "SELECT *  from schedule_user where id_scheduleward='$id_scheduleward'";
$objQuery1 = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while ($objResult = mysql_fetch_array($objQuery1)){
		$intRows ++;
?>
<tr>

   <th bgcolor="#4682b4"><div align="center" ><font face = "MS Sans Serif" color="#FFFFFF" size="1"><?=$intRows;?></font></div></th>
<th width=""bgcolor="#4682b4" align=""><font face = "MS Sans Serif" color="#FFFFFF" size="1">
<div align=""><?$Card_idEmp=$objResult["Card_idEmp"];
$result2=select_name($Card_idEmp);
$rowname=mysql_fetch_array($result2,MYSQL_ASSOC);?>

<?echo $rowname["Fname_Emp"] ;?>&nbsp;&nbsp;
<?echo $rowname["Lname_Emp"] ;
$Card_idEmp=$rowname["Card_idEmp"] ;
?>
</div>
<input type="text" name="test[]" class="checkbox" id="name" value="<?=$objResult["Card_idEmp"];?>"/></td>

<?
}
?>
</th>




Tag : PHP









ประวัติการแก้ไข
2013-02-05 10:38:56
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-02-05 10:37:27 By : pinto2004 View : 709 Reply : 4
 

 

No. 1



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

สถานะออฟไลน์


ใส่ tag insert code ด้วยครับ และผมก็งงครับคำถาม ??
Code (PHP)
<form action="insert_usermany.php" method="post" enctype="multipart/form-data">
<?
$intRows = 0;

//connect_db("mcintranet");
$strSQL = "SELECT * from schedule_user where id_scheduleward='$id_scheduleward'";
$objQuery1 = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while ($objResult = mysql_fetch_array($objQuery1)){
$intRows ++;
?>
<tr>

<th bgcolor="#4682b4"><div align="center" ><font face = "MS Sans Serif" color="#FFFFFF" size="1"><?=$intRows;?></font></div></th>
<th width=""bgcolor="#4682b4" align=""><font face = "MS Sans Serif" color="#FFFFFF" size="1">
<div align=""><?$Card_idEmp=$objResult["Card_idEmp"];
$result2=select_name($Card_idEmp);
$rowname=mysql_fetch_array($result2,MYSQL_ASSOC);?>

<?echo $rowname["Fname_Emp"] ;?>&nbsp;&nbsp;
<?echo $rowname["Lname_Emp"] ;
$Card_idEmp=$rowname["Card_idEmp"] ;
?>
</div>
<input type="text" name="test[]" class="checkbox" id="name" value="<?=$objResult["Card_idEmp"];?>"/></td>

<?
}
?>










ประวัติการแก้ไข
2013-02-05 10:44:01
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-05 10:42:33 By : Ex-[S]i[L]e[N]t
 


 

No. 2



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์


ต้องขอโทษ ตอนนี้ผมรู้ปัญหาหลังจากที่ใช้เวลามาสองวัน ผมใช้คำสั่งตรึงแนว แล้วมีคำสัง
<script type="text/javascript">
if(typeof tableScroll == 'function'){tableScroll('mainTable');}
</script>

ต่อท้ายเลยทำให้ คำสัง echo count($test); อีกหน้าตอน sutmit คูณ3 ครับ

Code:
scheduletatle.php

<?php

require_once("./include/check_data.php");
require_once("./include/connect_db.php");
require_once("./include/function.php");
?>
<html>
<head>


<title>จัดตารางเวร</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">
*{
font-family:tahoma, "MS Sans serif", Verdana;
font-size:14px;
}
</style>
<style type="text/css">
.browse_page{
clear:both;
margin-left:12px;
height:35px;
margin-top:5px;
display:block;
}
.browse_page a,.browse_page a:hover{
display:block;
height:18px;
width:18px;
font-size:10px;
float:left;
margin-right:2px;
border:1px solid #CCCCCC;
background-color:#F4F4F4;
color:#333333;
text-align:center;
line-height:18px;
font-weight:bold;
text-decoration:none;
}
.browse_page a:hover{
border:1px solid #0A85CB;
background-color:#0A85CB;
color:#FFFFFF;
}
.browse_page a.selectPage{
display:block;
height:18px;
width:18px;
font-size:10px;
float:left;
margin-right:2px;
border:1px solid #0A85CB;
background-color:#0A85CB;
color:#FFFFFF;
text-align:center;
line-height:18px;
font-weight:bold;
}
.browse_page a.SpaceC{
display:block;
height:18px;
width:18px;
font-size:10px;
float:left;
margin-right:2px;
border:0px dotted #0A85CB;
font-size:11px;
background-color:#FFFFFF;
color:#333333;
text-align:center;
line-height:18px;
font-weight:bold;
}
.browse_page a.naviPN{
width:50px;
font-size:12px;
display:block;
height:18px;
float:left;
border:1px solid #0A85CB;
background-color:#0A85CB;
color:#FFFFFF;
text-align:center;
line-height:18px;
font-weight:bold;
}
</style>
<style type="text/css">

.tableBoxOuter {
width:100%;height:90%; // adjust size of table
background: #FFFFFF;
}

.scrolltable td, th {
font-size: 12px;
margin:0em;
padding-top: 4px;
padding-bottom: 4px;
padding-right: 4px;
padding-left: 4px;
table-layout: automatic;
white-space: nowrap;
}

</style>

<script type="text/javascript">
/* Copyright Richard Cornford 2004 */
var finalizeMe = (function(){
var global = this,base,safe = false,svType = (global.addEventListener && 2)||(global.attachEvent && 3)|| 0;
function addFnc(next, f){function t(ev){if(next)next(ev);f(ev);};t.addItem = function(d){if(f != d.getFunc()){if(next){next.addItem(d);}else{next = d;}}return this;};t.remove = function(d){if(f == d){f = null;return next;}else if(next){next = next.remove(d);}return this;};t.getFunc = function(){return f;};t.finalize = function(){if(next)next = next.finalize();return (f = null);};return t;};
function addFunction(f){if(base){base = base.addItem(addFnc(null, f));}else{base = addFnc(null, f);}};
function ulQue(f){addFunction(f);if(!safe){switch(svType){case 2:global.addEventListener("unload", base, false);safe = true;break;case 3:global.attachEvent("onunload", base);safe = true;break;default:if(global.onunload != base){if(global.onunload)addFunction(global.onunload);global.onunload = base;}break;}}};
ulQue.remove = function(f){if(base)base.remove(f);};
function finalize(){if(base){base.finalize();switch(svType){case 3:global.detachEvent("onunload", base);break;case 2:global.removeEventListener("unload", base, false);break;default:global.onunload = null;break;}base = null;}safe = false;};
ulQue(finalize);return ulQue;
})();


var InitializeMe = (function(){
var global = this,base = null,safe = false;
var listenerType = (global.addEventListener && 2)||(global.attachEvent && 3)|| 0;
function getStackFunc(next, funcRef, arg1,arg2,arg3,arg4){function l(ev){funcRef((ev?ev:global.event), arg1,arg2,arg3,arg4);if(next)next = next(ev);return (funcRef = null);};l.addItem = function(d){if(next){next.addItem(d);}else{next = d;}};return l;};
return (function(funcRef, arg1,arg2,arg3,arg4){if(base){base.addItem(getStackFunc(null, funcRef, arg1,arg2,arg3,arg4));}else{base = getStackFunc(null, funcRef, arg1,arg2,arg3,arg4);}if(!safe){switch(listenerType){case 2:global.addEventListener("load", base, false);safe = true;break;case 3:global.attachEvent("onload", base);safe = true;break;default:if(global.onload != base){if(global.onload){base.addItem(getStackFunc(null, global.onload));}global.onload = base;}break;}}});
})();
var queryStrings = (function(out){
if(typeof location != 'undefined'){
var temp = location.search||location.href||'';
var nvp, ofSet;
if((ofSet = temp.indexOf('?')) > -1){
temp = temp.split("#")[0];
temp = temp.substring((ofSet+1), temp.length);
var workAr = temp.split('&');
for(var c = workAr.length;c--;){
nvp = workAr[c].split('=');
if(nvp.length > 1){out[nvp[0]] = nvp[1];}
}
}
}
return out;
})({});

var TimedQue = (function(){
var base, timer;
var interval = 60;
var newFncs = null;
function addFnc(next, f){function t(){next = next&&next();if(f()){return t;}else{f = null;return next;}}t.addItem = function(d){if(next){next.addItem(d);}else{next = d;}return this;};t.finalize = function(){return ((next)&&(next = next.finalize())||(f = null));};return t;}
function tmQue(fc){if(newFncs){newFncs = newFncs.addItem(addFnc(null, fc));}else{newFncs = addFnc(null, fc);}if(!timer){timer = setTimeout(tmQue.act, interval);}}
tmQue.act = function(){var fn = newFncs, strt = new Date().getTime();if(fn){newFncs = null;if(base){base.addItem(fn);}else{base = fn;}}base = base&&base();if(base||newFncs){var t = interval - (new Date().getTime() - strt);timer = setTimeout(tmQue.act, ((t > 0)?t:1));}else{timer = null;}};
tmQue.act.toString = function(){return 'TimedQue.act()';};
tmQue.finalize = function(){timer = timer&&clearTimeout(timer);base = base&&base.finalize();newFncs = null;};
return tmQue;
})();

var getElementWithId = (function(){if(document.getElementById){return (function(id){return document.getElementById(id);});}else if(document.all){return (function(id){return document.all[id];});}return (function(id){return null;});})();

function getSimpleExtPxIn(el){
var temp, temp2, tick = 0, getBorders = retFalse, doCompStyle = retFalse,defaultView,objList = [];
function retFalse(){return false;}
retFalse.elTest = retFalse;
retFalse.iY = retFalse.iX = retFalse.y = retFalse.x = retFalse.w = retFalse.h = retFalse.bb = retFalse.bt = retFalse.bl = retFalse.br = 0;
function retThis(){return retThis;}
function gCompStyleBorders(p, el){doCompStyle(p, defaultView.getComputedStyle(el, '' ));}
function doComputedStyleFloat(p, cs){p.bt = (cs.getPropertyCSSValue('border-top-width').getFloatValue(5));p.bl = (cs.getPropertyCSSValue('border-left-width').getFloatValue(5));p.br = (cs.getPropertyCSSValue('border-right-width').getFloatValue(5));p.bb = (cs.getPropertyCSSValue('border-bottom-width').getFloatValue(5));}
function doComputedStyleValue(p, cs){p.bt = Math.ceil(parseFloat(s.getPropertyValue('border-top-width')))|0;p.bl = Math.ceil(parseFloat(s.getPropertyValue('border-left-width')))|0;p.br = Math.ceil(parseFloat(s.getPropertyValue('border-right-width')))|0;p.bb = Math.ceil(parseFloat(s.getPropertyValue('border-bottom-width')))|0;}
function gClientBorders(p, el){if(el.clientWidth||el.clientHeight){p.bb = (el.offsetHeight - (el.clientHeight + (p.bt = el.clientTop|0)))|0;p.br = (el.offsetWidth - (el.clientWidth + (p.bl = el.clientLeft|0)))|0;}}
function getInterfaceObj(el){var lastTick = NaN;var offsetParent = getSimpleExtPxInFn(el.offsetParent)||retFalse;function p(doTick){if(doTick){tick = (1+tick)%0xEFFFFFFF;}if(tick != lastTick){lastTick = tick;offsetParent();getBorders(p, el);p.iY = (p.y = (offsetParent.iY + (el.offsetTop|0))) + p.bt;p.iX = (p.x = (offsetParent.iX + (el.offsetLeft|0))) + p.bl;p.w = el.offsetWidth|0;p.h = el.offsetHeight|0;}return p;}p.elTest = function(elmnt){return (elmnt == el);};p.iY = p.iX = p.w = p.h = p.y = p.x = p.bb = p.bt = p.bl = p.br = 0;return (objList[objList.length] = p);}
function getSimpleExtPxInFn(el){if((!el)||(el == document)){return retFalse;}for(var c = objList.length;c--;){if(objList[c].elTest(el)){return objList[c];}}return getInterfaceObj(el);}
function setSpecialObj(el){var lastTick = NaN;function p(doTick){if(doTick){tick = (1+tick)%0xEFFFFFFF;}return p;}p.elTest = function(elmnt){return (elmnt == el);};p.iY = p.iX = p.w = p.h = p.y = p.x = p.bb = p.bt = p.bl = p.br = 0;objList[objList.length] = p;}
if((typeof el.offsetParent != 'undefined')&&(typeof el.offsetTop == 'number')&&(typeof el.offsetWidth == 'number')){if((typeof el.clientTop == 'number')&&(typeof el.clientWidth == 'number')){getBorders = gClientBorders;}else if((defaultView = document.defaultView)&&defaultView.getComputedStyle &&(temp = defaultView.getComputedStyle(el, '' ))&&(((temp.getPropertyCSSValue)&&(temp2 = temp.getPropertyCSSValue('border-top-width'))&&(temp2.getFloatValue)&&(doCompStyle = doComputedStyleFloat))||((temp.getPropertyValue)&&(doCompStyle = doComputedStyleValue)))){getBorders = gCompStyleBorders;temp2 = temp = null;}if(document.documentElement){setSpecialObj(document.documentElement);}if(document.body){setSpecialObj(document.body);}return (getSimpleExtPxIn = getSimpleExtPxInFn)(el);}else{retThis.elTest = retFalse;retThis.iY = retThis.iX = retThis.y = retThis.x = retThis.w = retThis.h = retThis.bb = retThis.bt = retThis.bl = retThis.br = NaN;return (getSimpleExtPxIn = retThis);}
}

function getNewFILCFncStac(fnc){function getNewFnc(f){var next = null;function t(a){next = next&&next(a);return (f(a))?t:next;}t.finalize = function(){next = next&&next.finalize();return (f = null);};t.addItem = function(d){if(f != d){if(next){next.addItem(d);}else{next = getNewFnc(d);}}return this;};return t;}var base = getNewFnc(fnc);fnc = function(a){base = base&&base(a);};fnc.addItem = function(d){if(base){base.addItem(d)}else{base = getNewFnc(d);}};fnc.finalize = function(){return (base = base&&base.finalize());};return fnc;}

function GlobalEventMonitor(eventName, functinRef){
var finalize, global = this;
var monitors = {};
var onName = ['on',''];
function mainMonitor(eventName, functinRef){
var monitor = monitors[eventName];
if(monitor){
monitor(functinRef);
}else{
setEventMonitor(eventName, functinRef);
}
}
function setListener(eventName, longName, fncStack){
global.addEventListener(eventName, fncStack, false);
return true;
}
function setListener_aE(eventName, longName, fncStack){
global.attachEvent(longName, fncStack);
return true;
}
function oldHandler(f){return (function(e){f(e);return true;});}
function retFalse(){return false;}
function setEventMonitor(eventName, functinRef){
var fncStack, longName;
onName[1] = eventName;
longName = onName.join('');
function main(funcRef){
if(funcRef){
fncStack.addItem(funcRef);
globalCheck();
}
}
function globalCheck(){
if(global[longName] != fncStack){
if(global[longName]){
fncStack.addItem(oldHandler(global[longName]));
}
global[longName] = fncStack;
}
}
fncStack = getNewFILCFncStac(functinRef);
if(setListener(eventName, longName, fncStack)){
globalCheck = retFalse;
}else{
globalCheck();
}
finalize.addItem(fncStack.finalize);
monitors[eventName] = main;
functinRef = null;
}
if(!global.addEventListener){
if(global.attachEvent){
setListener = setListener_aE;
}else{
setListener = retFalse;
}
}
finalizeMe((finalize = getNewFILCFncStac(
function(){
finalize = monitors = null;
})
));
(GlobalEventMonitor = mainMonitor)(eventName, functinRef);
functinRef = null;
}

var tableScroll = (function(){
var global = this, finalise, tableList = {};
var notOnScroll = true, notAbort = true;
var overrideStyles = {
margin:[{keys:['margin','marginBottom','marginLeft','marginRight','marginTop'],value:'0px'}],
padding:[{keys:['padding','paddingBottom','paddingLeft','paddingRight','paddingTop'],value:'0px'}],
border:[
{keys:['border','borderBottom','borderLeft','borderRight','borderTop'],value:'0px none #FFFFFF'},
{keys:['borderWidth','borderLeftWidth','borderRightWidth','borderBottomWidth','borderTopWidth'],value:'0px'},
{keys:['borderStyle','borderRightStyle','borderLeftStyle','borderBottomStyle','borderTopStyle'],value:'none'}
],
overflow:[{keys:['overflow'],value:'hidden'}],
positionRel:[{keys:['position'],value:'relative'}],
positionAbs:[{keys:['position'],value:'absolute'}],
top:[{keys:['top'],value:'0px'}],
left:[{keys:['left'],value:'0px'}],
zIndex:[{keys:['zIndex'],value:2}]
};
function setStyleProps(styleObj){
var data, dArray;
for(var c = 1;c < arguments.length;c++){
if((data = overrideStyles[arguments[c]])){
for(var d = data.length;d--;){
dArray = data[d].keys;
for(var e = dArray.length;e--;){
styleObj[dArray[e]] = data[d].value;
}
}
}
}
return true;
}
function setClass(el,val){
if(el.setAttribute){el.setAttribute('class',val);}
return (el.className = val);
}
function retFalse(){return false;}
function TableScroll(id){
var midAbsDiv, parent, vHeaderAbsStyle, vHeaderRelStyle, hHeaderAbsStyle, hHeaderRelStyle;
var midAbsDivStyle, midAbsinerDivStyle, inRelDivStyle, outRelDivDim;
var lastScrollTop = NaN, lastScrollLeft = NaN, lastWidth = NaN, lastHeight = NaN, tableDim, table = getElementWithId(id);
var midRelinerDivStyle, midRelinerDiv, testCellDim;
function position(){
var nh,nw,size,th,tw,cellWidth,celHeight,st = midAbsDiv.scrollTop, sl = midAbsDiv.scrollLeft, h = outRelDivDim(true).h, w = outRelDivDim.w;
if((size = ((w != lastWidth)||(h != lastHeight)))||(st != lastScrollTop)||(sl != lastScrollLeft)){
hHeaderRelStyle.left = (((cellWidth = (testCellDim().x - tableDim().iX)) + (lastScrollLeft = sl)) * -1)+'px';//position
vHeaderRelStyle.top = (((celHeight = (testCellDim.y - tableDim.iY)) + (lastScrollTop = st)) * -1)+'px';
if(size){
vHeaderRelStyle.width = vHeaderAbsStyle.width = midAbsDivStyle.left = hHeaderAbsStyle.left = (cellWidth+'px');
hHeaderRelStyle.height = hHeaderAbsStyle.height = midAbsDivStyle.top = vHeaderAbsStyle.top = (celHeight+'px');
inRelDivStyle.left = (cellWidth * -1)+'px';
inRelDivStyle.top = (celHeight * -1)+'px';
midRelinerDivStyle.width = midAbsinerDivStyle.width = ((tw = tableDim.w) - cellWidth)+'px';
midRelinerDivStyle.height = midAbsinerDivStyle.height = ((th = tableDim.h) - celHeight)+'px';
midAbsDivStyle.height = vHeaderAbsStyle.height = (((nh = ((lastHeight = h) - celHeight)) > celHeight)?nh:celHeight)+'px';
midAbsDivStyle.width = hHeaderAbsStyle.width = (((nw = ((lastWidth = w) - cellWidth)) > cellWidth)?nw:cellWidth)+'px';
hHeaderRelStyle.width = inRelDivStyle.width = tw + 'px';
vHeaderRelStyle.height = inRelDivStyle.height = th + 'px';
}
}
return notOnScroll;
}
function onScroll(){
notOnScroll = false;
position();
}
function onSize(){
position();
return true;
}
finalise.addItem(function(){
testCellDim = midRelinerDivStyle = midRelinerDiv =
midAbsinerDivStyle = tableDim = vHeaderAbsStyle = vHeaderRelStyle = hHeaderAbsStyle = hHeaderRelStyle = inRelDivStyle = outRelDivDim = midAbsDiv = parent = table = null;
})
if(
table&&
(typeof table.scrollTop == 'number')&&
(typeof table.offsetHeight == 'number')&&
table.tagName&&
table.appendChild&&
table.cloneNode&&
table.getAttribute&&
table.getElementsByTagName&&
(parent = table.parentNode)&&
parent.insertBefore
){
InitializeMe(function(){
var newTable, testCell;
var vHeaderAbs, vHeaderRel, hHeaderAbs, hHeaderRel,outRelDiv, midAbsinerDiv, inRelDiv;
if(
(notAbort)&&
(testCell = table.getElementsByTagName('td')[0])&&
(newTable = table.cloneNode(true))&&
(outRelDiv = document.createElement('DIV'))&&
(setClass(outRelDiv, 'tableBoxOuter'))&&
(midAbsDiv = document.createElement('DIV'))&&
(midRelinerDiv = document.createElement('DIV'))&&
(midAbsinerDiv = document.createElement('DIV'))&&
(inRelDiv = document.createElement('DIV'))&&
(vHeaderAbs = document.createElement('DIV'))&&
(vHeaderRel = document.createElement('DIV'))&&
(hHeaderAbs = document.createElement('DIV'))&&
(hHeaderRel = document.createElement('DIV'))&&
(setStyleProps(outRelDiv.style, 'positionRel', 'padding'))&&
(midAbsDivStyle = midAbsDiv.style)&&
(setStyleProps(midAbsDivStyle, 'positionAbs', 'padding', 'margin', 'border', 'zIndex'))&&
(midRelinerDivStyle = midRelinerDiv.style)&&
(setStyleProps(midRelinerDivStyle, 'positionRel', 'padding', 'margin', 'border', 'top', 'left'))&&
(midAbsinerDivStyle = midAbsinerDiv.style)&&
(setStyleProps(midAbsinerDivStyle, 'positionAbs', 'overflow', 'padding', 'margin', 'border', 'top', 'left'))&&
(inRelDivStyle = inRelDiv.style)&&
(setStyleProps(inRelDivStyle, 'positionRel', 'padding', 'margin', 'border', 'top', 'left'))&&
(vHeaderAbsStyle = vHeaderAbs.style)&&
(setStyleProps(vHeaderAbsStyle, 'positionAbs', 'overflow', 'padding', 'margin', 'border', 'top', 'left', 'zIndex'))&&
(vHeaderRelStyle = vHeaderRel.style)&&
(setStyleProps(vHeaderRelStyle, 'positionRel', 'padding', 'margin', 'border', 'top', 'left'))&&
(hHeaderAbsStyle = hHeaderAbs.style)&&
(setStyleProps(hHeaderAbsStyle, 'positionAbs', 'overflow', 'padding', 'margin', 'border', 'top', 'left', 'zIndex'))&&
(hHeaderRelStyle = hHeaderRel.style)&&
(setStyleProps(hHeaderRelStyle, 'positionRel', 'padding', 'margin', 'border', 'top', 'left'))&&
(setStyleProps(table.style, 'margin'))&&
(midAbsDiv.appendChild(midRelinerDiv))&&
(midRelinerDiv.appendChild(midAbsinerDiv))&&
(midAbsinerDiv.appendChild(inRelDiv))&&
(outRelDiv.appendChild(midAbsDiv))&&
(vHeaderAbs.appendChild(vHeaderRel))&&
(hHeaderAbs.appendChild(hHeaderRel))&&
(outRelDiv.appendChild(vHeaderAbs))&&
(outRelDiv.appendChild(hHeaderAbs))&&
(parent.insertBefore(outRelDiv, table))&&
(!isNaN((outRelDivDim = getSimpleExtPxIn(outRelDiv)).w))&&
(inRelDiv.appendChild(table))&&
(!isNaN((testCellDim = getSimpleExtPxIn(testCell)).w))&&
(!isNaN((tableDim = getSimpleExtPxIn(table)).w))&&
(hHeaderRel.appendChild(newTable))&&
(newTable = table.cloneNode(true))&&
(vHeaderRel.appendChild(newTable))
){
midAbsDivStyle.overflow = 'scroll';
if(midAbsDiv.addEventListener){
midAbsDiv.addEventListener('scroll', onScroll, false);
}else if(midAbsDiv.attachEvent){
midAbsDiv.attachEvent('onscroll', onScroll);
}else{
midAbsDiv.onscroll = onScroll;
}
GlobalEventMonitor('resize', onSize);
position();
TimedQue(position);
}else{
notAbort = false;
}
});
}else{
notAbort = false;
}
return true;
}
function main(){
var id;
for(var c = 0;c < arguments.length;c++){
id = arguments[c];
if(notAbort&&!tableList[id]){
tableList[id] = TableScroll(id);
}
}
}
if(
(!global.queryStrings||!queryStrings['noTableScroll'])&&
global.setTimeout&&
global.document&&
document.createElement
){
finalizeMe((finalise = getNewFILCFncStac(function(){
finalise = tableList = null;
})));
return main;
}else{
return retFalse;
}
})();
</script>

</head>
<body>
<?
$result=schedule_ward($id_scheduleward);
$row = mysql_fetch_array($result,MYSQL_ASSOC);

$id_month=$row["id_month"];
$result2=schedule_month($id_month);
$row2 = mysql_fetch_array($result2,MYSQL_ASSOC);
$code_dpt=$row["code_dpt"];
$result3=select_dpt($code_dpt);
$row3= mysql_fetch_array($result3,MYSQL_ASSOC);
?>
<table width="100%">
<tr valign="top" height="" align="center">
<td colspan="5" height="25" align="center" bgcolor="#3399CC"><font face = "MS Sans Serif" color="#FFFFFF" size="2"><div align="center"><b> ตารางเวร แผนก <?=$row3["name_dpt"];?>&nbsp;&nbsp;เดือน&nbsp;<?=$row2["month"];?> <?=$row2["year"];?></b>
</div></font></td>
</tr>

</table>

<!------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------>


<?
connect_db("mcintranet");
?>


</th>
</th>
</tr>

<?
connect_db("mcintranet");
?>
<form action="insert_usermany.php" method="post" enctype="multipart/form-data">
<table class=scrolltable id=mainTable width="100%" border="0" align="" >
<thead><tr>
<th width=""bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#FFFFFF" size="1"> <div align="center">ลำดับ</div></th>
<th width="250"bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#FFFFFF" size="1"> <div align="center">รายชื่อ</div></th>
<?
$end_month =$row2["end_month"];
$d="1";
while($d<="$end_month"){
?>
<th width="20"bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#FFFFFF" size="1"> <div align="center"><?=$d;?></div></th>
<?
$d++ ;
}
?>
<th width=""bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#FFFFFF" size="1"> <div align="center">รวม</div></th>

</tr></thead>
<form action="insert_usermany.php" method="post" enctype="multipart/form-data">
<?
$intRows = 0;

//connect_db("mcintranet");
$strSQL = "SELECT * from schedule_user where id_scheduleward='$id_scheduleward'";
$objQuery1 = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while ($objResult = mysql_fetch_array($objQuery1)){
$intRows ++;
?>
<tr>

<th bgcolor="#4682b4"><div align="center" ><font face = "MS Sans Serif" color="#FFFFFF" size="1"><?=$intRows;?></font></div></th>
<th width=""bgcolor="#4682b4" align=""><font face = "MS Sans Serif" color="#FFFFFF" size="1">
<div align=""><?$Card_idEmp=$objResult["Card_idEmp"];
$result2=select_name($Card_idEmp);
$rowname=mysql_fetch_array($result2,MYSQL_ASSOC);?>

<?echo $rowname["Fname_Emp"] ;?>&nbsp;&nbsp;
<?echo $rowname["Lname_Emp"] ;
$Card_idEmp=$rowname["Card_idEmp"] ;
?>
</div>
<input type="text" name="test[]" class="checkbox" id="test" value="<?=$objResult["Card_idEmp"];?>"/></td>

<??>
</th>
<?

$j=1;
while ($j<="$end_month"){
$id_month=$row2["id_month"];
$year=$row2["year"];
$date_schedule=$year."-".$id_month."-".$j;
$strSQL3 = "select * from schedule_emp where Card_idEmp='$Card_idEmp' and date_schedule=$date_schedule";
$objQuery3 = mysql_query($strSQL3) or die ("Error Query [".$strSQL3."]");
$objResult3 = mysql_fetch_array($objQuery3,MYSQL_ASSOC);


?>
<td width=""bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#CC0000" size="1"><b>
<input type="hidden" name="date_scheduleuser" value="<?=$year."-".$id_month."-".$j;?>">

<select size="1" name="id_pro" id="id_pro" onchange="searchUser1(this.value,<?=$Card_idEmp;?>);"><option value="" selected><?=$list_pro?></option>
<?
$sql2="select * from wage order by id_wage asc";
$result2 = mysql_query($sql2);

while($row = mysql_fetch_array($result2,MYSQL_ASSOC))

{
?>
<option value="<?=$row["code_wage"]?>"><?=$row["code_wage"]?> </option>
<?
}
?>
</select>
</b>


</font></td>
<?
$j++ ;

}
$strSQL4 = "select *,sum(h) AS 'totalh',sum(m) AS 'totalm' from job where Card_idEmp='$Card_idEmp' and (month(date_job)='$m') and code_joblist='$code_joblist' GROUP BY code_joblist ORDER BY totalh DESC ";
$objQuery4 = mysql_query($strSQL4) or die ("Error Query [".$strSQL4."]");
$objmtotal = mysql_fetch_array($objQuery4,MYSQL_ASSOC);
$sum_m=$objmtotal["totalm"];
//$sum_m="0";
$sum_h=$objmtotal["totalh"];
//$sum_h="0";
$job_mtotal=($sum_h*60)+$sum_m;
?>
<td width=""bgcolor="#4682b4" align="center"><font face = "MS Sans Serif" color="#CC0000" size="1"><b> <div align="center"><?=$job_mtotal;?></b></font></td>

<?
}
?>
</tr>

</table>


<table width="100%">

<tr>
<td align="center">

<input type="hidden" name="id_group" value="<?=$id;?>">
<input type="submit" name="select" id="select" value="เลือก" /> </td>
</tr>
</form>


</table>
<script type="text/javascript">
if(typeof tableScroll == 'function'){tableScroll('mainTable');}
</script>

</body>
</html>


ประวัติการแก้ไข
2013-02-05 11:06:52
2013-02-05 11:07:56
2013-02-05 11:13:57
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-05 11:04:21 By : pinto2004
 

 

No. 3



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์


insert_usermany.php

<?
echo count($test);

?>





ดูแล้วอาจจะงง นะครับ เพราะไปเชื่อมหลายตัว สรุปก็คือ พอลบ code ใน file scheduletable.php

<script type="text/javascript">
if(typeof tableScroll == 'function'){tableScroll('mainTable');}
</script>

ออก ก็ count ตามปกติ อย่างนี้เราจะแ้ก้ยังไงดีครับ


ประวัติการแก้ไข
2013-02-05 11:12:37
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-05 11:06:19 By : pinto2004
 


 

No. 4



โพสกระทู้ ( 8 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วครับ ขอบคุณทุกท่านมาก มันคูณให้เรา ก็เลยทำการ หารกลับคืนเสียเลย


ประวัติการแก้ไข
2013-02-05 15:24:23
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-05 15:23:41 By : pinto2004
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : มีปัญหาเรื่อง Array type="text" มัน count($test); ไม่ถูกครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่