Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2011, 10:14 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Function OnEnter Key

Good day!

I encountered problem in pressing enter key. After I insert data in lot/batch# and I pressed Enter Key, instead of going to time in textbox it was go to save button which is wrong.

Here is my code:
PHP Code:
<?php                      
                     
if($rexist == 0
                        { 
                        
$query "SELECT t.operation_name, t.input_unit, t.output_unit FROM trace_operations t WHERE t.plt_typeno = '" $_POST["plt_typeno"] . "'  AND t.operation_name IN ('01 Oper' , '02 Oper') ORDER BY t.operation_name"
                        
$result mysql_query($query); 
                        if(
$result
                            if(
$row mysql_fetch_array($result)) 
                                { 
                                     
                                echo 
"<p><center><b>OPERATOR AND MACHINE TRACEABILITY</center></b></p>"
                                echo 
"<table>"
                                echo 
"<tr> 
                                <th class='myclass'>OPERATIONS</th> 
                                <th class='myclass'>Time IN</th> 
                                <th class='myclass'>Time OUT</th> 
                                <th class='myclass'>INPUT <br/> QTY</th> 
                                <th class='myclass'>UNIT</th> 
                                <th class='myclass'>OUTPUT QTY</th> 
                                <th class='myclass'>UNIT</th> 
                                <th class='myclass'>ID #</th> 
                                <th class='myclass'>MC #</th> 
                                <th class='myclass'>VARIANCE Qty</th> 
                                <th class='myclass'>VARIANCE PLT #</th> 
                                <th class='myclass'>DATE</th> 
                                <th class='myclass'>SHIFT</th></tr>"

                                echo 
"\n\t<tr>"
                                echo 
"\n\t\t<td width='800'>"
                                if (
$last_operation_name != $row["operation_name"]) echo $row["operation_name"]; 
                                
$last_operation_name $row["operation_name"]; 
                                echo 
"<input type='hidden' width='400' name='opname[]' value='" $row["operation_name"] . "' /></td>";    
                                echo 
"\n\t\t<td><input size='6' type='text' name='timein[]' id='timein" $ctr "' onkeypress='return handleEnter(event,\"timeout" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='timeout[]' id='timeout" $ctr "' onkeypress='return handleEnter(event,\"inqty" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='inqty[]' id='inqty" $ctr "' onkeypress='return handleEnter(event,\"outqty" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td>" $row["input_unit"]; 
                                echo 
"<input type='hidden' name='iun[]' value='" $row["input_unit"] . "' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='outqty[]' id='outqty" $ctr "' onkeypress='return handleEnter(event,\"idno" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td>" $row["output_unit"]; 
                                echo 
"<input type='hidden' name='oun[]' value='" $row["output_unit"] . "'></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='idno[]' id='idno" $ctr "' onkeypress='return handleEnter(event,\"mcno" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='mcno[]' id='mcno" $ctr "' onkeypress='return handleEnter(event,\"varqty" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='varqty[]' id='varqty" $ctr "' onkeypress='return handleEnter(event,\"varplt" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='varplt[]' id='varplt" $ctr "' onkeypress='return handleEnter(event,\"dateshift" $ctr "\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='dateshift[]' id='dateshift" $ctr "' onkeypress='return handleEnter(event,\"shift\");' /></td>"
                                echo 
"\n\t\t<td><input size='6' type='text' name='shift[]' id='shift" $ctr "' onkeypress='return handleEnter(event,\"saveform\");' /></td>"
                                echo 
"\n\t</tr>"
                                     } 
                                echo 
"</table>"
            } 
                echo 
"<p><input type='submit' value='Save' id='saveform' /></p>"
                echo 
"<input type='hidden' name='plt_typeno' value='" $_POST["plt_typeno"] . "' />"
        } 
        } 
        } 
        
?> 
</form> 
<form name="enumplt" action="yield_station1.php" method="post"> 
<input type="hidden" name="enum_plt" value="1" /> 
<input type="hidden" name="plt_typeno" /> 
</form> 
</body> 
</html>
Reply With Quote
  #2 (permalink)  
Old March 1st, 2011, 10:16 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is my whole code:
PHP Code:
<?php
include("config.php");
$rexist 0;
if(
$_POST["plt_no"] && $_POST["plt_typeno"] && !$_POST["retrieve_only"])
    {
    
$bom $_POST["bom"];
    
$chem $_POST["chem"];
    
$qty $_POST["qty"];
    
$part $_POST["part"];
    
$lot $_POST["lot"];
    
$plt_date $_POST["plt_date"];
    
    
$query "INSERT INTO plt_transact (plt_no, b1, sc2, plt_typeno, transact_date, plt_date) VALUES ('" $_POST["plt_no"] . "', '" $_POST["b1"] . "', '" $_POST["sc2"] . "', '" $_POST["plt_typeno"] . "', now(), '" $plt_date "')";
    
$result mysql_query($query);
    
$plt_transact_id mysql_insert_id();

    if(
$plt_transact_id != 0)
        {
    
        
$totalarr count($bom);
        for(
$ctr=0$ctr $totalarr$ctr++)
            {
            
$query "INSERT INTO plt_data (bom, plt_chemicals, qty, part_no, lot_no, plt_transact_id) VALUES ('" $bom[$ctr] . "', '" $chem[$ctr] . "', '" $qty[$ctr] . "', '" $part[$ctr] . "', '" $lot[$ctr] . "', '" $plt_transact_id "')";
            
$result mysql_query($query);
            }
        
        
$opname $_POST["opname"];
        
$timein $_POST["timein"];
        
$timeout $_POST["timeout"];
        
$inqty $_POST["inqty"];
        
$iun $_POST["iun"];
        
$outqty $_POST["outqty"];
        
$oun $_POST["oun"];
        
$idno $_POST["idno"];
        
$mcno $_POST["mcno"];
        
$varqty $_POST["varqty"];
        
$varplt $_POST["varplt"];
        
$dateshift $_POST["dateshift"];
        
$shift $_POST["shift"];
        
        
$totalarr count($opname);
        for(
$ctr=0$ctr $totalarr$ctr++)
            {
            
$inqty[$ctr] = (float) $inqty[$ctr];
            
$varqty[$ctr] = (float) $varqty[$ctr];
            
$outqty[$ctr] = (float) $outqty[$ctr];
            
$query "INSERT INTO traceability (operation_name, time_in, time_out, input_qty, input_unit, output_qty, output_unit, id_no, mc_no, variance_qty, variance_plt, date, shift, plt_transact_id) VALUES ('" $opname[$ctr] . "', '" $timein[$ctr] . "', '" $timeout[$ctr] . "', '" $inqty[$ctr] . "' , '" $iun[$ctr] . "' ,'" $outqty[$ctr] . "', '" $oun[$ctr] . "' , '" $idno[$ctr] . "', '" $mcno[$ctr] . "', '" $varqty[$ctr] . "', '" $varplt[$ctr] . "', '" $dateshift[$ctr] . "', '" $shift[$ctr] . "', '" $plt_transact_id "')";
            
$result mysql_query($query);
            }   
        }
         else
        {
        
$sysmessage "Transaction was not saved.";
        
        }   
       unset(
$_POST); 
        
    }
   
$rexist 0;
?>
<html>
<head>
    <title>Dunlop - PLT</title>
    <style type="text/css">
    .myclass {
     font-size: 10pt; font-family:Arial, Helvetica, sans-serif;
    }
    </style>
    <script language="javascript">
    function getplt(plt_typeno)
        {
        var myform = document.enumplt;
        myform.plt_typeno.value = plt_typeno;
        myform.submit();
        }
        
    function handleEnter(e, nextfield)
        {
        var characterCode = (e && e.which)? e.which: e.keyCode;
        if(characterCode == 13)
            {
            document.getElementById(nextfield).focus();
            return false;
            } 
        else
            {
            return true;
            }
        }
    </script>
</head>
<?php
if($_POST["enum_plt"] && $_POST["plt_typeno"])
    {
?>
<body onLoad="document.plttype.plt_no.focus();">
<?php
    
}
else
    {
    echo 
"<body>";
    }
 include(
"main1.php");
 echo 
"<p>$sysmessage</p>";
?>

<!--<p><a href="plt_definition.php">PLT Types</a>&nbsp;&nbsp;&nbsp;<a href="plt_query.php">Query</a></p>-->
Type:&nbsp;&nbsp;
<select name="plt_type" onChange="getplt(this.options[this.selectedIndex].value);">
    <?php
    $plt_typeno 
"";
    if(
$_POST["enum_plt"] || $_POST["plt_typeno"]) $plt_typeno $_POST["plt_typeno"];
    
$query "SELECT DISTINCT plt_typeno FROM plt_type GROUP BY plt_typeno ORDER BY plt_typeno";
    
$result mysql_query($query);
    echo 
"<option value=''></option>";
    if(!
$plt_typeno)
        {
        while(
$row mysql_fetch_array($result))
            echo 
"<option value='" $row["plt_typeno"] . "'>" $row["plt_typeno"] . "</option>";
        }
    else
        {
        while(
$row mysql_fetch_array($result))
            {
            echo 
"<option value='" $row["plt_typeno"] . "'";
            if(
$plt_typeno == $row["plt_typeno"]) echo " selected";
            echo 
">" $row["plt_typeno"] . "</option>";
            }
        }
    
?>
</select>

<form action="yield_station1.php" method="post" name="plttype">
<?php
//Show form


if($_POST["enum_plt"] && $_POST["plt_typeno"])
    {
    
$query "SELECT * FROM plt_type WHERE plt_typeno = '" $_POST["plt_typeno"] . "'";
    
$result mysql_query($query);
    if(
$result)
        {
            
        
?>
         <input type="hidden" name="retrieve" value="1" />
        <?php
        
echo "<p>PLT No:&nbsp;&nbsp;<input type='text' name='plt_no' onkeypress='return handleEnter(event,\"plt_date\");' /></br />";
        echo 
"<input type='hidden' name='plt_typeno' value='" $_POST["plt_typeno"] . "' />";
        echo 
"<input type='hidden' name='retrieve_only' value='1' />";
        echo 
"<p><input type='submit' value='Retrieve' id='retrievedata' /></p>";
        echo 
"<p>&nbsp;</p>";
        }
    }
        
?>
<?php
        
////View retrieve data   

if($_POST["plt_no"])
        {
            
$query "SELECT * FROM plt_transact WHERE plt_no = '" $_POST["plt_no"] . "' AND plt_typeno = '"$_POST["plt_typeno"]."' ";
        
$result_no mysql_query($query);
        if(
$result_no)
            {
            if(
mysql_num_rows($result_no) > 0)
                {
                
$query "SELECT * FROM plt_transact WHERE plt_no = '" $_POST["plt_no"] . "' ";
                
$result_no mysql_query($query);
                if(
$result_no)
                {
                    if(
mysql_num_rows($result_no) > 0)
                        {
                 
$plt_no $_POST["plt_no"];
                 
                echo 
"<p>PLT No:&nbsp;&nbsp;<input type='text' name='plt_no' value='$plt_no'; onkeypress='return handleEnter(event,\"plt_date\");' /></br />";
                 echo 
"PLT Date:&nbsp;&nbsp;" mysql_result($result_no0"plt_date") . "</p>";
                
$query "SELECT d.operation_name, d.time_in, d.time_out, d.input_qty, d.input_unit, d.output_qty, d.output_unit, d.id_no, d.mc_no, d.variance_qty, d.variance_plt, d.date, d.shift FROM traceability d, plt_transact t WHERE t.plt_no = '" $_POST["plt_no"] . "' AND d.plt_transact_id = t.plt_transact_id AND d.operation_name IN ('01 Oper', '02 Oper') ORDER BY d.operation_name";
                
$result mysql_query($query);
                if(
$result)
                    {
                    
                    echo 
"<p><center><b>OPERATOR AND MACHINE TRACEABILITY</center></b></p>";
                    echo 
"<table cellspacing='3'>";            
                    echo 
"<tr><th class='myclass'>OPERATION NAME</th><th class='myclass'>&nbsp;</th><th class='myclass'>TIME IN</th><th class='myclass'>&nbsp;</th><th class='myclass'>TIME OUT</th><th class='myclass'>&nbsp;</th><th class='myclass'>INPUT QTY</th><th class='myclass'>UNIT</th><th class='myclass'>&nbsp;</th><th class='myclass'>OUTPUT QTY</th><th class='myclass'>UNIT</th><th></th><th class='myclass'>ID #</th><th class='myclass'>&nbsp;</th><th class='myclass'>MC #</th><th class='myclass'>&nbsp;</th><th class='myclass'>VARIANCE QTY</th><th class='myclass'>VARIANCE PLT</th><th class='myclass'>&nbsp;</th><th class='myclass'>DATE</th>&nbsp;&nbsp;<th class='myclass'>SHIFT</th></tr>";
                    
$last_operation_name "";
                    while(
$row mysql_fetch_array($result))
                        {
                        echo 
"\n\t<tr>";
                        
                        echo 
"\n\t\t<td width='800'>";
                        if(
$last_operation_name != $row["operation_name"]) echo $row["operation_name"];
                        echo 
"</td>";
                        
$last_operation_name $row["operation_name"];
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["time_in"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["time_out"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td align='right'>" $row["input_qty"] . "</td>";
                        echo 
"\n\t\t<td>" $row["input_unit"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td align='right'>" $row["output_qty"] . "</td>";
                        echo 
"\n\t\t<td>" $row["output_unit"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["id_no"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["mc_no"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["variance_qty"] . "</td>";
                        echo 
"\n\t\t<td>" $row["variance_plt"] . "</td>";
                        echo 
"\n\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
                        echo 
"\n\t\t<td>" $row["date"] . "</td>";
                        echo 
"\n\t\t<td>" $row["shift"] . "</td>";
                        echo 
"\n\t</tr>";
                        }
                    echo 
"</table>";
                    }
                }
                }
              }
 else{

///If PLT No did not exist in the database the form will appear
     
        
echo "&nbsp;PLT No.:&nbsp;&nbsp;" $_POST["plt_no"] . " not found.<br />";
         echo 
"PLT No:<input type='text' name='plt_no' value='" $_POST["plt_no"] . "' />";
          echo 
"PLT Date:&nbsp;&nbsp;<input type='text' name='plt_date' onkeypress='return handleEnter(event,\"bom0\");' /></p>";
        
$query ="SELECT plt_chemicals, plt_typeno FROM plt_type WHERE plt_typeno = '" $_POST["plt_typeno"] . "'";
        
$result mysql_query($query);
        echo 
"<table>";
        echo 
"<tr><th class='myclass'>BOM</th><th class='myclass'>Chemicals</th><th class='myclass'>Qty</th><th class='myclass'>Part #</th><th class='myclass'>Lot #</th></tr>";
        
$totalrows mysql_num_rows($result);
        
$trows $totalrows 1;
        for(
$ctr 0$ctr $trows$ctr++)
            {
            
$tctr $ctr 1;
            
$row mysql_fetch_array($result);
            echo 
"\n\t<tr>";
            echo 
"\n\t\t<td><input type='text' name='bom[]' id='bom" $ctr "' onkeypress='return handleEnter(event,\"qty" $ctr "\");' /></td>";
            echo 
"\n\t\t<td>" $row["plt_chemicals"];
            echo 
"<input type='hidden' name='chem[]' value='" $row["plt_chemicals"] . "' /></td>";
            echo 
"\n\t\t<td><input type='text' name='qty[]' id='qty" $ctr "' onkeypress='return handleEnter(event,\"part" $ctr "\");' /></td>";
            echo 
"\n\t\t<td><input type='text' name='part[]' id='part" $ctr "' onkeypress='return handleEnter(event,\"lot" $ctr "\");' /></td>";
            echo 
"\n\t\t<td><input type='text' name='lot[]' id='lot" $ctr "' onkeypress='return handleEnter(event,\"bom" $tctr "\");' /></td>";
            echo 
"\n\t</tr>";
            }
        if(
$totalrows 1)
            {
            
$row mysql_fetch_array($result);
            echo 
"\n\t<tr>";
            echo 
"\n\t\t<td><input type='text' name='bom[]' id='bom" $ctr "' onkeypress='return handleEnter(event,\"qty" $ctr "\");' /></td>";
            echo 
"\n\t\t<td>" $row["plt_chemicals"];
            echo 
"<input type='hidden' name='chem[]' value='" $row["plt_chemicals"] . "' /></td>";
            echo 
"\n\t\t<td><input type='text' name='qty[]' id='qty" $ctr "' onkeypress='return handleEnter(event,\"part" $ctr "\");' /></td>";
            echo 
"\n\t\t<td><input type='text' name='part[]' id='part" $ctr "' onkeypress='return handleEnter(event,\"lot" $ctr "\");' /></td>";
            echo 
"\n\t\t<td><input type='text' name='lot[]' id='lot" $ctr "' onkeypress='return handleEnter(event,\"b1\");' /></td>";
            echo 
"\n\t</tr>";
            }
        echo 
"</table>";
        

///Here is the table before the table for the operator and machine traceability where the timein belongs. As you can see at SC2 onkeypress  was on timein but it did not happen it goes to save button.
        
echo "<p>&nbsp;</p>";
        echo 
"<table>";
        echo 
"<tr><th class='myclass'>PARTS TRACEABILITY</th><th class='myclass'>LOT/BATCH #</th></tr>";
        echo 
"<tr><td>B1</td><td><input type='text' name='b1' id='b1' onkeypress='return handleEnter(event,\"sc2\");' /></td></tr>";
        echo 
"<tr><td>SC2</td><td><input type='text' name='sc2' id='sc2' onkeypress='return handleEnter(event,\"timein\");' /></td></tr>";
        echo 
"</table>";
        echo 
"<p>&nbsp;</p>";
 
 
$query "SELECT t.operation_name, t.input_unit, t.output_unit FROM traceability t, plt_transact c WHERE t.plt_transact_id = c.plt_transact_id AND c.plt_no = '" $_POST["plt_no"] . "' AND c.plt_typeno = '" $_POST["plt_typeno"] . "'  AND t.operation_name IN ('01 Oper', '02 Oper') ORDER BY t.operation_name";

                
$last_operation_name "";
                
$result mysql_query($query);
                if(
$result)
                    {  
                    
$totalrows mysql_num_rows($result);
                    if(
$totalrows 0)
                        {
                        
$rexist 1;
                        
$query "SELECT d.operation_name, d.time_in, d.time_out, d.input_qty, d.input_unit, d.output_qty, d.output_unit, d.id_no, d.mc_no, d.variance_qty, d.variance_plt, d.date, d.shift FROM traceability d, plt_transact t WHERE t.plt_no = '" $_POST["plt_no"] . "' AND d.plt_transact_id = t.plt_transact_id AND d.operation_name IN ('01 Oper', '02 Oper') ORDER BY d.operation_name";
                        
$result mysql_query($query);
                        if(
$result)
                            {
                            
$last_operation_name "";
                            while(
$row mysql_fetch_array($result))
                                {
                                    
                                echo 
"<p><center><b>OPERATOR AND MACHINE TRACEABILITY</center></b></p>";
                                echo 
"<table>";
                                echo 
"<tr>
                                <th class='myclass'>OPERATIONS</th>
                                <th class='myclass'>Time IN</th>
                                <th class='myclass'>Time OUT</th>
                                <th class='myclass'>INPUT <br/> QTY</th>
                                <th class='myclass'>UNIT</th>
                                <th class='myclass'>OUTPUT QTY</th>
                                <th class='myclass'>UNIT</th>
                                <th class='myclass'>ID #</th>
                                <th class='myclass'>MC #</th>
                                <th class='myclass'>VARIANCE Qty</th>
                                <th class='myclass'>VARIANCE PLT #</th>
                                <th class='myclass'>DATE</th>
                                <th class='myclass'>SHIFT</th></tr>"
;
                                echo 
"<tr>";
                                echo 
"<td width='150'>";
                                if(
$last_operation_name != $row["operation_name"]) echo $row["operation_name"];
                                echo 
"</td>";
                                
$last_operation_name $row["operation_name"];
                                echo 
"<td size = '6'>" $row["time_in"] . "</td>";
                                echo 
"\n\t\t<td size = '6'>" $row["time_out"] . "</td>";
                                echo 
"\n\t\t<td size = '6' align = 'left'>&nbsp;&nbsp;" $row["input_qty"] . "</td>";
                                echo 
"\n\t\t<td size = '15' align='left'>" $row["input_unit"] . "</td>";
                                echo 
"\n\t\t<td size = '6' align = 'left'>&nbsp;&nbsp;" $row["output_qty"] . "</td>";
                                echo 
"\n\t\t<td size = '6'>" $row["output_unit"] . "</td>";
                                echo 
"\n\t\t<td size = '6'>" $row["id_no"] . "</td>";
                                echo 
"\n\t\t<td size = '6'>&nbsp;&nbsp;&nbsp;" $row["mc_no"] . "</td>";
                                echo 
"\n\t\t<td size = '6'>" $row["variance_qty"] . "</td>";
                                echo 
"\n\t\t\t\t\t<td size = '6'>" $row["variance_plt"] . "</td>";
                                echo 
"\n\t\t\t\t<td size = '6'>" $row["date"] . "</td>";
                                echo 
"\n\t\t<td size = '6'> &nbsp" $row["shift"] . "</td>";
                                echo 
"\n\t</tr>";
                                echo 
"</table>";
                                }
                            }
                        }
                     
                     if(
$rexist == 0)
                        {
                        
$query "SELECT t.operation_name, t.input_unit, t.output_unit FROM trace_operations t WHERE t.plt_typeno = '" $_POST["plt_typeno"] . "'  AND t.operation_name IN ('01 Oper' , '02 Oper') ORDER BY t.operation_name";
                        
$result mysql_query($query);
                        if(
$result)
                            if(
$row mysql_fetch_array($result))
                                {
                                    
                                echo 
"<p><center><b>OPERATOR AND MACHINE TRACEABILITY</center></b></p>";
                                echo 
"<table>";
                                echo 
"<tr>
                                <th class='myclass'>OPERATIONS</th>
                                <th class='myclass'>Time IN</th>
                                <th class='myclass'>Time OUT</th>
                                <th class='myclass'>INPUT <br/> QTY</th>
                                <th class='myclass'>UNIT</th>
                                <th class='myclass'>OUTPUT QTY</th>
                                <th class='myclass'>UNIT</th>
                                <th class='myclass'>ID #</th>
                                <th class='myclass'>MC #</th>
                                <th class='myclass'>VARIANCE Qty</th>
                                <th class='myclass'>VARIANCE PLT #</th>
                                <th class='myclass'>DATE</th>
                                <th class='myclass'>SHIFT</th></tr>"
;
                                echo 
"\n\t<tr>";
                                echo 
"\n\t\t<td width='800'>";
                                if (
$last_operation_name != $row["operation_name"]) echo $row["operation_name"];
                                
$last_operation_name $row["operation_name"];
                                echo 
"<input type='hidden' width='400' name='opname[]' value='" $row["operation_name"] . "' /></td>";   
                                echo 
"\n\t\t<td><input size='6' type='text' name='timein[]' id='timein" $ctr "' onkeypress='return handleEnter(event,\"timeout" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='timeout[]' id='timeout" $ctr "' onkeypress='return handleEnter(event,\"inqty" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='inqty[]' id='inqty" $ctr "' onkeypress='return handleEnter(event,\"outqty" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td>" $row["input_unit"];
                                echo 
"<input type='hidden' name='iun[]' value='" $row["input_unit"] . "' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='outqty[]' id='outqty" $ctr "' onkeypress='return handleEnter(event,\"idno" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td>" $row["output_unit"];
                                echo 
"<input type='hidden' name='oun[]' value='" $row["output_unit"] . "'></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='idno[]' id='idno" $ctr "' onkeypress='return handleEnter(event,\"mcno" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='mcno[]' id='mcno" $ctr "' onkeypress='return handleEnter(event,\"varqty" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='varqty[]' id='varqty" $ctr "' onkeypress='return handleEnter(event,\"varplt" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='varplt[]' id='varplt" $ctr "' onkeypress='return handleEnter(event,\"dateshift" $ctr "\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='dateshift[]' id='dateshift" $ctr "' onkeypress='return handleEnter(event,\"shift\");' /></td>";
                                echo 
"\n\t\t<td><input size='6' type='text' name='shift[]' id='shift" $ctr "' onkeypress='return handleEnter(event,\"saveform\");' /></td>";
                                echo 
"\n\t</tr>";
                                     }
                                echo 
"</table>";
            }
                echo 
"<p><input type='submit' value='Save' id='saveform' /></p>";
                echo 
"<input type='hidden' name='plt_typeno' value='" $_POST["plt_typeno"] . "' />";
        }
        }
        }
        
?>
</form>
<form name="enumplt" action="yield_station1.php" method="post">
<input type="hidden" name="enum_plt" value="1" />
<input type="hidden" name="plt_typeno" />
</form>
</body>
</html>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in Duplication of data and onenter key newphpcoder PHP Databases 1 February 14th, 2011 05:13 AM
key code for function key F2 swathi reddy ASP.NET 2.0 Basics 1 May 17th, 2010 04:58 AM
Help with key function migake XSLT 1 April 24th, 2006 07:30 AM
function key F1 rajanikrishna Javascript 1 January 27th, 2004 05:21 AM
Key function shamsad Oracle 0 October 4th, 2003 06:40 AM



All times are GMT -4. The time now is 02:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.