...

View Full Version : reset button not working



coolumanga
06-09-2011, 10:51 AM
hi this is my code and reset butoon not working


<form action="plan_chart_sc_wk_save.php" method="post" onmousemove="Calulate()" >
<table id="t1" width="1175" border="1" cellspacing="0" cellpadding="2" >


<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day1totqty" id="day1totqty" type="text" size="4"/>
</div></td>

<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day1tothr" id="day1tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day2totqty" id="day2totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day2tothr" id="day2tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day3totqty" id="day3totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day3tothr" id="day3tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day4totqty" id="day4totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day4tothr" id="day4tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day5totqty" id="day5totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day5tothr" id="day5tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day6totqty" id="day6totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day6tothr" id="day6tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day7totqty" id="day7totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day7tothr" id="day7tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day8totqty" id="day8totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day8tothr" id="day8tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day9totqty" id="day9totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day9tothr" id="day9tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day10totqty" id="day10totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day10tothr" id="day10tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day11totqty" id="day11totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day11tothr" id="day11tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day12totqty" id="day12totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day12tothr" id="day12tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day13totqty" id="day13totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day13tothr" id="day13tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day14totqty" id="day14totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day14tothr" id="day14tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day15totqty" id="day15totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day15tothr" id="day15tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day16totqty" id="day16totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day16tothr" id="day16tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day17totqty" id="day17totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day17tothr" id="day17tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day18totqty" id="day18totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day18tothr" id="day18tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day19totqty" id="day19totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day19tothr" id="day19tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day20totqty" id="day20totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day20tothr" id="day20tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day21totqty" id="day21totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day21tothr" id="day21tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day22totqty" id="day22totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day22tothr" id="day22tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day23totqty" id="day23totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day23tothr" id="day23tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day24totqty" id="day24totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day24tothr" id="day24tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day25totqty" id="day25totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day25tothr" id="day25tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day26totqty" id="day26totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day26tothr" id="day26tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day27totqty" id="day27totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day27tothr" id="day27tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day28totqty" id="day28totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day28tothr" id="day28tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day29totqty" id="day29totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day29tothr" id="day29tothr" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day30totqty" id="day30totqty" type="text" size="4" />
</div></td>
<td ><div align="center">
<input readonly="true" style="background-color:<?php echo getcolor($headday1) ?>" name="day30tothr" id="day30tothr" type="text" size="4" />
</div></td>

<td >&nbsp;</td>
</tr>
</thead><tbody>

<?php




$where='1=1';

if ($_POST["chkdate1"]=="checkbox")
$where="NewDlvy>='".$day1."' AND NewDlvy<='".$day30."'";


$sqlstr="SELECT * FROM plan_chart WHERE $where ORDER BY NewDlvy, Sc_No, Seq_No";
// echo $sqlstr;

$result = mysql_query($sqlstr);

$count=0;

while($record = mysql_fetch_array( $result )) {

$rowresult= mysql_query("SELECT sum(shp_qty) As QTY FROM Invoice_item WHERE Sc_no='".$record['Sc_No']."' AND Seq_No='".$record['Seq_No']."' ")or die(mysql_error());
$row = mysql_fetch_array( $rowresult );
$Quantity=$row['QTY'];

$balance=$record['Quantity']- $Quantity;

$rowresultwip= mysql_query("select `testsuj_WIP`.`Sc_No` AS `Sc_No`,sum(`testsuj_WIP`.`WIPQTY`) AS `SUM(testsuj_WIP.WIPQTY)` from `testsuj_WIP` where `testsuj_WIP`.`Sc_No`=_latin1'".$record['Sc_No']."' AND Seq_No='".$record['Seq_No']."' AND (`testsuj_WIP`.`Department` =_latin1'Final Packing') group by `testsuj_WIP`.`Sc_No`")or die(mysql_error());
$rowwip = mysql_fetch_array( $rowresultwip );
$totQuantitywip=$rowwip['SUM(testsuj_WIP.WIPQTY)'];
$phybal= $totQuantitywip - $Quantity;
$qtytoprd=$record['Quantity']- $totQuantitywip;

//rowresult= mysql_query("SELECT * FROM Category WHERE CategoryId='".$record['CategoryId']."'")or die(mysql_error());
//$row = mysql_fetch_array( $rowresult );
$count++;

if ($balance !== 0){


?>
<? // ######################################################################### ?>
<tr bgcolor="#FFCCCC"> <td class="td1">
<input name="Sc_No<?php echo $count ?>" id="Sc_No<?php echo $count ?>" type="text" size="3"

value="<?php print $record['Sc_No']; ?>" readonly='true'/></td>

<td nowrap>
<input name="Seq_No<?php echo $count ?>" id="Seq_No<?php echo $count ?>" type="text" size="2"

value="<?php print substr('000'.$record['Seq_No'],-3,3) ; ?>" readonly='true'/></td>

<td nowrap> <div align="center">
<?php print $record['NickName']; ?>
</div></td>
<td nowrap> <?php print $record['Model_Name']; ?></td>
<td nowrap> <?php print $record['Size']; ?></td>
<td nowrap> <?php print $record['Frame_Size']; ?></td>
<td nowrap> <div align="center">
<?php print $record['Perday']; ?>
</div></td>
<td nowrap> <div align="center">
<?php print $record['Quantity']; ?>
</div></td>

<?php

$rowresult= mysql_query("SELECT
Sum(Sc_Plan_Chat.Quantity) AS Quantity
FROM
Sc_Plan_Chat
WHERE
Sc_Plan_Chat.Sc_No = '".$record['Sc_No']."' AND
Sc_Plan_Chat.Seq_No = '".$record['Seq_No']."' AND
Sc_Plan_Chat.PDate < '$day1' ")or die(mysql_error());

$row = mysql_fetch_array( $rowresult );
if($row['Quantity']==0)
$color="#FFFFFF";
else
$color="#FF0000";
?>
<td nowrap> <div align="center" ><?php print number_format($phybal,0); ?></div></td>
<td nowrap> <div align="center" ><?php print number_format($qtytoprd,0); ?></div></td>

<td nowrap bgcolor="#FFCCCC">&nbsp; </td>

<td nowrap> <div align="center">

<?php
$sqlstr11="SELECT * FROM plan_chart WHERE NewDlvy= '$day1' AND Sc_No='". $record['Sc_No']."' AND Seq_No='". $record['Seq_No']."' ORDER BY Sc_No,Seq_No";
//$sqlstr11="select `plan_chart`.`Sc_No` AS `Sc_No`,`plan_chart`.`Seq_No` AS `Seq_No`,`plan_chart`.`Perhour` AS `Perhour`,`plan_chart`.`Quantity` AS `Quantity`,sum(`Invoice_item`.`shp_qty`) AS `Sum(Invoice_item.shp_qty)`,`plan_chart`.`NewDlvy` AS `NewDlvy` from (`plan_chart` join `Invoice_item` on(((`plan_chart`.`Sc_No` = `Invoice_item`.`Sc_no`) and (`plan_chart`.`Seq_No` = `Invoice_item`.`seq_no`)))) where NewDlvy='$day1' AND Sc_No='". $record['Sc_No']."' AND Seq_No='". $record['Seq_No']."' group by Sc_No,Seq_No order by Sc_No,Seq_No";
$result11 = mysql_query($sqlstr11);

$row1=mysql_fetch_array($result11);

$sql2="select `Invoice_item`.`Sc_no` AS `Sc_no`,`Invoice_item`.`seq_no` AS `seq_no`,sum(`Invoice_item`.`shp_qty`) AS `Sum(Invoice_item.shp_qty)` from `Invoice_item` where Sc_no='". $record['Sc_No']."' AND seq_no='". $record['Seq_No']."' group by `Invoice_item`.`Sc_no`,`Invoice_item`.`seq_no` ";

$result2=mysql_query($sql2);

$row22=mysql_fetch_array($result2);

$balance5=$row1['Quantity']-$row22['Sum(Invoice_item.shp_qty)'];

if ( $row1['Quantity'] > '0' && $row1['Perhour'] > '0' )
{
$QTYY=$row1['Quantity'];
$perhour1=$row1['Perhour'];

$perhour=$QTYY/$perhour1;}

// $rowresult11= mysql_query("SELECT sum(shp_qty) As QTY FROM Invoice_item WHERE Sc_no='".$record['Sc_No']."' AND Seq_No='".$record['Seq_No']."' ")or die(mysql_error());
// $row111 = mysql_fetch_array( $rowresult11 );
// $Quantity3=$row111['QTY'];



// $balance=$row1['Quantity']- $Quantity3;

// if ( $row1['Quantity'] > '0' && $row1['Perhour'] > '0' )
// {
// $perhour1=$row1['Quantity']/$row1['Perhour']; }

//$perhour1=$balance/$row1['PerHour'];}
$rowresult= mysql_query("SELECT * FROM `Sc_Plan_Chat` WHERE
Sc_No='". $record['Sc_No']."' AND
Seq_No='". $record['Seq_No']."' AND
PDate='$day1' " );
$row = mysql_fetch_array( $rowresult );

?>
<input style="background-color:#FFCCCC" name="newday1qty<?php echo $count ?>" id="newday1qty<?php echo $count ?>" type="text" size="4" value="<?php if( $balance5 > '0')echo $balance5 ?>" readonly="readonly" />
</div></td>




</table>
</form>

plesase help me for the working reset button????

plzz help me

BulletTimeBill
06-09-2011, 01:29 PM
...dear god :eek: What/where is the 'reset' button in this divine code you've written? I had to use the browsers find function to search for 'reset' but had no luck.
Some notes though:
Post more specific pieces of code.
Look up php's foreach loop.
Look up table less design.
You can use php to out put css in the head instead of writing echo getcolor($headday1) 30something times.

Most importantly though is to show the smallest amount of code necessary to solve the problem.

Fou-Lu
06-09-2011, 05:24 PM
As mentioned there is no reset nor submit button in here.
In any case, 'reset' is a client technology, not a server one. Reset does not send itself as a successful field, and therefore this is an HTML/CSS issue and not a PHP one. All I can say for sure is that without either a reset button or submit button you won't get very far with the form :/
Moving from PHP to HTML/CSS. Modify your post and wrap that code in
or
in order to make it readable.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum