Jump to content

newphpcoder

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by newphpcoder

  1. Hi, I have this code for setFilterGrid and it works fine: <form name="material_form" action="<?php echo $PHP_SELF; ?>" method="post" autocomplete="off"><div id="WH_list"><table id="mat_list"><thead><tr><th>DATE ENTRY</th><th>PO NUMBER</th><th>KIND</th><th>ITEM CODE</th><th>DESCRIPTION</th><th>UoM</th><th>SUPPLIER</th><th>QTY</th><th>WH #</th><th>ROW #</th><th>RACK #</th><th>LEVEL</th><th>RECEIVED BY</th></tr></thead><?php$sql = "SELECT m.date_entry, m.po_number, m.kind, r.item_code, r.sup_code, u.uom, s.supplier_name, ";$sql .= "m.qty, w.whse, w.row, w.rack, w.level, o.employee ";$sql .= "FROM material_data_in AS m LEFT JOIN raw_material AS r ON (m.mat_id = r.item_code) ";$sql .= "LEFT JOIN uom_list AS u ON (u.uom_id = m.uom_id) ";$sql .= "LEFT JOIN supplier AS s ON (s.supplier_id = m.supplier_id) ";$sql .= "LEFT JOIN warehouse AS w ON (w.id = warehouse_id) ";$sql .= "LEFT JOIN rm_receiver AS o ON (o.emp_id = m.received_by)";$res = mysql_query($sql);while($row_mat_list = mysql_fetch_assoc($res)){$date_entry = $row_mat_list['date_entry'];$po_number = $row_mat_list['po_number'];//$unique_id = $row_mat_list['unique_id'];$kind = $row_mat_list['kind'];$item_code = $row_mat_list['item_code'];$description = $row_mat_list['sup_code']; $uom = $row_mat_list['uom'];$supplier = $row_mat_list['supplier_name'];$qty = $row_mat_list['qty'];$qty = number_format($qty, 2);$whse = $row_mat_list['whse'];$row = $row_mat_list['row'];$rack = $row_mat_list['rack'];$level = $row_mat_list['level'];$received_by = utf8_encode($row_mat_list['employee']);echo "<tr>";echo "<td>$date_entry</td>";echo "<td>$po_number</td>";echo "<td>$kind</td>";echo "<td>$item_code</td>";echo "<td>$description</td>";echo "<td>$uom</td>";echo "<td>$supplier</td>";echo "<td>$qty</td>";echo "<td>$whse</td>";echo "<td>$row</td>";echo "<td>$rack</td>";echo "<td>$level</td>";echo "<td>$received_by</td>";echo "</tr>";} echo "<tr>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td id='totalHERE' style='color:red;border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "<td style='border:none;'></td>";echo "</tr>";?></table><table id=''></form><script language="javascript" type="text/javascript">var totalRowDex = tf_Tag(tf_Id('mat_list'), "tr").length;var inventProp = { rows_counter: true, loader: true, loader_text: "FilterING DaTa....", col_operation: { id: ["totalHERE"], col: [7], operation: ["sum"], write_method: ["innerHTML"], exclude_row: [totalRowDex], decimal_precision: [2] }, rows_always_visible: [totalRowDex]};setFilterGrid("mat_list", inventProp);</script></form> now my problem is, how can I make the total qty has a comma every 3 digits. Because the Total = 80000000.00 how can I make it 80,000,000.00 I hope somebody can help me. Thank you so much.
  2. Hi,I used IIS as my web server. I have 5 websites already setup in IIS. Now I add one more website, but when I run the url instead of displaying the forms it display the codes.I have no idea how can I fixed this problem. When I tried to remove all the php codes it display the form.I hope somebody can help me to fixed this error.Thank you.
  3. Hi, I have form that displaying report per week. First thing to do is choose what week then automatically display the date/shift that week ranges. here is my weekly_report.php <?php error_reporting(0); session_start(); ob_start(); date_default_timezone_set("Asia/Singapore"); include('connection.php'); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><title>Weekly Report</title><head><link rel="stylesheet" type="text/css" href="op_report.css" /><script type="text/javascript" src="jquery.js"></script><script type='text/javascript' src='jquery.autocomplete.js'></script><link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" /><script type="text/javascript">//----auto complete week--//$().ready(function() { $("#week_selected").autocomplete("get_week_list.php", { width: 115, matchContains: true, mustMatch: true, selectFirst: false }); $("#week_selected").result(function(event, data, formatted) { $("#week_number").val(data[1]); }); }); /*AJAX*/function AJAX(){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari return xmlHttp; } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer return xmlHttp; } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); return xmlHttp; } catch (e){ alert("Your browser does not support AJAX!"); return false; } } } } //-----get weekdata from week---//function getweekdata() { // if (window.event.keyCode==13 || window.event.keyCode==10) { divid = "week_data"; var url = "get_weekly_data.php"; var str = "id=" + document.getElementById("week_number").value; var xmlHttp = AJAX(); xmlHttp.onreadystatechange = function(){ if(xmlHttp.readyState > 0 && xmlHttp.readyState < 4){ // document.getElementById(divid).innerHTML=loadingmessage; } if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { var jsonart = xmlHttp.responseText; document.getElementById(divid).innerHTML = jsonart; } } } xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", str.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(str); // } } </script></head><body onload=document.getElementById("week_selected").focus();><form name="weekly_report" action="" method="post"><div id="ddcolortabs"><ul><li> <a href="index.php" title="Operator's Shift Report"><span>Operator's Shift Report</span></a></li><li id="current"> <a href="weekly_report.php" title="Reports"><span>Reports</span></a></li></ul></div><br/><div><table><tr><td style="border: none;">Type Week:</td><td><input type="text" name="week_selected" id="week_selected" value="" size="15" onkeyup="getweekdata();"></td></tr></table></div><input type="hidden" name="week_number" id="week_number"><div id='week_data'></div></form></body></html> //get_week_list.php <?phpob_start();include "connection.php";$q = strtolower($_GET["q"]);if ($q == '') { header("HTTP/1.0 404 Not Found", true, 404); }//else (!$q) return;else{$sql = "select week_id, week_number from week_list where week_number LIKE '$q%'";$rsd = mysql_query($sql);$cnt = mysql_num_rows($rsd); if($cnt > 0) { while($rs = mysql_fetch_array($rsd)) { $pid = $rs['week_id']; $pname = $rs['week_number']; echo "$pname|$pidn"; } } else { header("HTTP/1.0 404 Not Found", true, 404); }}?> and here is my get_weekly_data.php // which display the data for that week. <?phpob_start();include "connection.php";if($_POST["id"]){ $sql = "select r.report_date, s.shift_type FROM op_reports AS r, shift_list AS s WHERE WEEK(report_date) + 1 = '" . ($_POST["id"]) . "' GROUP BY shift_type ORDER BY shift_id ASC"; $res = mysql_query($sql); echo "<table>"; echo "<tr>"; echo "<th>Comp</th>"; while($row = mysql_fetch_assoc($res)) { $report_date = $row['report_date']; $report_shift = $row['shift_type']; echo "<th>$report_date/$report_shift</th>"; } echo "</tr>"; $sql_r = "select r.report_date, s.shift_type FROM op_reports AS r, shift_list AS s WHERE WEEK(report_date) + 1 = '" . ($_POST["id"]) . "' GROUP BY shift_type ORDER BY shift_type DESC"; $res_r = mysql_query($sql_r); echo "<tr>"; echo "<th></th>"; while($r = mysql_fetch_assoc($res_r)){ echo "<th>Output</th>"; } echo "</tr>"; $sql_comp = "SELECT DISTINCT p.process_name , r.process_id, r.report_shift FROM op_reports AS r JOIN process_list AS p ON (p.process_id = r.process_id) WHERE WEEK(report_date) + 1 = '" . ($_POST["id"]) . "' GROUP BY process_name ORDER BY p.process_name ASC"; $res_comp = mysql_query($sql_comp); echo "<tr>"; while($row_comp = mysql_fetch_assoc($res_comp)) { $process = $row_comp['process_name']; $process_id = $row_comp['process_id']; echo "<td>$process</td>"; $comp = "SELECT DISTINCT o.compound_type, o.process_id, o.shift_date FROM op_output AS o WHERE process_id = '$process_id' GROUP BY o.shift_id, compound_type ORDER BY compound_type ASC"; $c = mysql_query($comp); echo "<tr>"; while($co = mysql_fetch_assoc($c)) { $compound_type = $co['compound_type']; $process_i = $co['process_id']; $shift_date = $co['shift_date']; echo "<td>$compound_type</td>"; $sql_output = "SELECT DISTINCT o.compound_type, SUM(o.compound_output) AS compound_output, o.process_id, o.shift_id, o.shift_date FROM op_output AS o WHERE process_id = '$process_id' AND o.compound_type = '$compound_type' GROUP BY o.shift_id, o.shift_date, compound_type ORDER BY o.shift_id ASC"; $res_output = mysql_query($sql_output); while($row_output = mysql_fetch_assoc($res_output)) { $compound_output = $row_output['compound_output']; $shift = $row_output['shift_id']; $compound = $row_output['compound_type']; $date = $row_output['shift_date']; if($shift == 1 && $date == $shift_date) { echo"<td>$compound_output</td>"; } else { echo "<td></td>"; } if($shift == 2 && $date == $shift_date) { echo"<td>$compound_output</td>"; } else { echo "<td></td>"; } if($shift == 3 && $date == $shift_date) { echo"<td>$compound_output</td>"; } else { echo "<td></td>"; } if($shift == 4 && $date == $shift_date) { echo"<td>$compound_output</td>"; } else { echo "<td></td>"; } if($shift == 5 && $date == $shift_date) { echo"<td>$compound_output</td>"; } else { echo "<td></td>"; } } echo "</tr>"; } } echo "</tr>"; echo "</table>"; }?> My problem now is on displaying of output per date/shift. It's been todays that I tried to fixed this. I hope somebody can help me. Thank you so much
  4. Hi,I have webpage that consist of table where I display the list of employee, the problem is there's a lot of employee list so I need to add scrollbar to my table but the header is fixed, when I tried to add code autoflow:auto; in my css for <div> operator_list it did not work.here is my css code:#operator_list{ position: absolute; margin-left: 350px; overflow: auto; }table { margin: 12px; margin-left: 3px; border: 1px solid #DDD; }th { background: #694; color: #FFF; padding: 2px 6px; border-collapse: separate; border: 1px solid #000;}td { border: 1px solid #DDD; text-align: left;}and here is the code of my webpage <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><title>Operators List</title><head><link rel="stylesheet" type="text/css" href="op_report.css" /><script type="text/javascript" src="jquery.js"></script><script type='text/javascript' src='jquery.autocomplete.js'></script><link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" /> <link rel="stylesheet" type="text/css" href="filtergrid.css" /><script language="javascript" type="text/javascript" src="tablefilter.js"></script> <script language="javascript" type="text/javascript" src="tablefilter_all.js"></script><script language="javascript" type="text/javascript" src="tablefilter_all_min.js"></script> <link rel="stylesheet" type="text/css" href="prompt.css"><link rel="stylesheet" type="text/css" href="notify.css"> <script type="text/javascript" src="prompt.js"> </script><script type="text/javascript" src="notification.js"> </script><script type="text/javascript"> //----auto complete process name---//$().ready(function() { $("#process").autocomplete("get_process_list.php", { width: 145, matchContains: true, mustMatch: true, selectFirst: false }); $("#process").result(function(event, data, formatted) { $("#process_id").val(data[1]); }); }); //------auto complete employee id----//$().ready(function() { $("#emp_id").autocomplete("get_op_data.php", { width: 145, matchContains: true, mustMatch: true, selectFirst: false }); $("#emp_id").result(function(event, data, formatted) { $("#employee_id").val(data[0]); }); $("#emp_id").result(function(event, data, formatted) { $("#lastname").val(data[1]); }); $("#emp_id").result(function(event, data, formatted) { $("#firstname").val(data[2]); }); $("#emp_id").result(function(event, data, formatted) { $("#middlename").val(data[3]); }); $("#emp_id").result(function(event, data, formatted) { $("#process").val(data[4]); }); }); /*AJAX*/function AJAX(){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari return xmlHttp; } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer return xmlHttp; } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); return xmlHttp; } catch (e){ alert("Your browser does not support AJAX!"); return false; } } } } </script></head><body onload=document.getElementById("employee_id").focus();><form name="operator_list" action="" method="post" autocomplete="off"> <!--Tab List --><div id="ddcolortabs"><ul><li id="current"> <a href="operator.php" title="Operator's List"><span>Production Operators</span></a></li><li> <a href="supervisor.php" title="Supervisor's List"><span>Production Supervisors</span></a></li></ul></div><br/><br/><div></div> <div><table><tr><td>Employee ID Search :</td><td><input type="text" name="emp_id" id="emp_id" value=""></td></tr></table></div><!-- Fieldset for Operators Information--><div id="operators_fieldset"><fieldset><legend>Input Operators Information</legend><table><tr><td>Employee ID: </td><td><input type="text" name="employee_id" id="employee_id" value=""></td><tr> <tr><td>Lastname: </td><td><input type="text" name="lastname" id="lastname" value=""></td></tr> <tr><td>Firstname: </td><td><input type="text" name="firstname" id="firstname" value=""></td></tr> <tr><td>Middlename: </td><td><input type="text" name="middlename" id="middlename" value=""></td></tr> <tr><td>Process: </td><td><input type="text" name="process" id="process" value=""></td></tr></table> <input type="hidden" name="process_id" id="process_id" value="" /> <center><input type="submit" name="save" id="save" value="Save"><input type="button" name="update" id="update" value="Update"><input type="button" name="delete" id="delete" value="Delete"></center></fieldset></div><div id="operator_list"><table id="op_list"><thead><tr><th>EMPLOYEE ID</th><th>LASTNAME</th><th>FIRSTNAME</th><th>MIDDLENAME</th><th>PROCESS</th></tr></thead> <tr><td>f</td><td>fv</td><td>f</td><td>f</td><td>HS/BD</td></tr><tr><td>gh</td><td>d</td><td>v</td><td>d</td><td>Deflashing</td></tr><tr><td>fvs</td><td>d</td><td>xcc</td><td>csdd</td><td>Deflashing</td></tr><tr><td>fv</td><td>c</td><td>c</td><td>d</td><td>Final Mix</td></tr><tr><td>b</td><td>vc</td><td>x</td><td>c</td><td>HS/BD</td></tr><tr><td>c</td><td>x</td><td>s</td><td>s</td><td>HS/BD</td></tr><tr><td>ds</td><td>s</td><td>s</td><td>d</td><td>Core Molding</td></tr><tr><td>sd</td><td>d</td><td>d</td><td>d</td><td>Deflashing</td></tr><tr><td>sf</td><td>df</td><td>dc</td><td>dqd</td><td>Deflashing</td></tr><tr><td>d</td><td>df</td><td>dff</td><td>df</td><td>Compound Mixing</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td><td>Compound Mixing</td></tr><tr><td>DC-00003</td><td>Chin</td><td>Un</td><td>Lee</td><td>Deflashing</td></tr><tr><td>DC-00002</td><td>de Jesus</td><td>Jay</td><td>Dy</td><td>Deflashing</td></tr><tr><td>DC-00001</td><td>Dela Cruz</td><td>Juan</td><td>Uy</td><td>Compound Mixing</td></tr></table><table id=''></form><script language="javascript" type="text/javascript">/*var totalRowDex = tf_Tag(tf_Id('op_list'), "tr").length;var inventProp = { rows_counter: true, loader: true, loader_text: "FilterING DaTa....", rows_always_visible: [totalRowDex]};setFilterGrid("op_list", inventProp);*/setFilterGrid("op_list");</script></body></html>I tried to search on google but when I tried it did not work so I decided to post my problem in forum.I hope somebody can help me.Thank you so muchThank you
  5. Hi Good day!I have 2 tables for my dtr database.first the employees where all the data of employee was save.employees fields:EmployeeIDLastnameFirstnameSubDepartmentattendance_logEMP_IDLOG_TIME (datetime)INDICATORI tried lots of query to get the EmployeeID where no attendance on the date I want to check who are the absentee.I just want to select the EmployeeId where no LOG_TIME with the date 2013-05-02attendance_log table is the table where the time in and out was save.I hope somebody can help me to get only the EmployeeId with no attendance where Sub = 'REG' and Department IN ('QA', 'Engineering', 'Assembly').Thank you
  6. Hi Good day! I got encountered problem in displaying my page in IE8, especially in my background image. It was not displayed fully on the page. It also repeated. I want to happen is the background is displayed fully. here is my css code: html {background: url(images/background.png) no-repeat fixed;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover; } Any help is highly appreciated. Thank you so mcuh.
  7. Hi..I found code that has a sum below from this link :http://tablefilter.free.fr/ex.php#tbl9Sample Table 7: <script language="javascript" type="text/javascript">//<![CDATA[var totRowIndex = tf_Tag(tf_Id('table7'),"tr").length; var table7_Props = { rows_counter: true, loader: true, loader_text: "Filtering data...", col_operation: { id: ["table8Tot1","table8Tot2"], col: [2,4], operation: ["sum","sum"], write_method: ["innerHTML","setValue"], exclude_row: [totRowIndex], decimal_precision: [1,0] }, rows_always_visible: [totRowIndex] };var tf7 = setFilterGrid( "table7",table7_Props );//*** Note ***//You can also write operation results in elements outside the table. //]]></script> Honestly, I cannot understand the whole code because it has no html code or sample code of table.So it's to hard for me to adopt that code in my present code: <html><title>Raw Materials Inventory</title><head><link rel="stylesheet" type="text/css" href="css/kanban.css" /><script language="javascript" type="text/javascript" src="tablefilter.js"></script> <style>table { font: 14px/28px Verdana, Arial, Helvetica, sans-serif; border-collapse: collapse; } th { padding: 0 0.6em; text-align: left; } tr.yellow th { border-top: 1px solid #FB7A31; border-bottom: 1px solid #FB7A31; background: #FFC; } td { border-bottom: 1px solid #CCC; padding: 0 0.6em; } td+td { border-left: 1px solid #CCC; text-align: center; }</style></head><body><form><!--<div id="ddcolortabs"><ul><li> <a href="SalesOrder.php" title="Sales Order"><span>Order Management</span></a></li> <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li><li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li><li><a href="fsn.php" title="Finished Stock Note"><span>WMS FG</span></a></li><li id="current"><a href="ReceivingMaterials.php" title="WMS RM"><span>WMS RM</span></a></li><li><a href="StockRequisition1.php" title="Stock Requisition"><span>Stock Requisition</span></a></li> <li><a href="calendar_days.php" title="Calendar Days"><span>Calendar Days</span></a></li></ul></div>--><div id="ddcolortabs1"><ul><li><a href="ReceivingMaterials.php" title="Raw Materials"><span>Raw Materials</span></a></li><li><a href="Shelving.php" title="Shelving"><span>Shelving</span></a></li><li><a href="Picking.php" title="Picking"><span>Picking</span></a></li><li><a href="Issuance.php" title="Issuance"><span>Issuance</span></a></li><li id="current"><a href="wmsinventory.php" title="Inventory"><span>Inventory</span></a></li</ul></div><div style='clear: both;'> </div><div style='clear: both;'> </div><table id='inventory'><tr class='yellow'><th>Component</th><th>Item Code</th><th>Description</th><th>WH Location</th><th>UoM</th><th>Quantity</th></tr><tr><td>Chemicals</td><td>MAT-CHE-0010</td><td>Barium Sulfate, 25kg./bag</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0075 </td><td>Kaolin Clay</td><td>WAREHOUSE 1</td><td>kg</td><td>200</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>325</td></tr><tr><td>Chemicals</td><td>MAT-CHE-0080</td><td>Light Magnesium Carbonate</td><td>WAREHOUSE 2</td><td>kg</td><td>250</td></tr><tr><td>Ringpull</td><td>PAC-EZO-0050</td><td>Ringpull, SONOCO 300dia; EOE part # 115-0356-56</td><td>WAREHOUSE 2</td><td>pc</td><td>151800</td></tr><tr><td>Sticker</td><td>PAC-STK-0080A</td><td>Blank Label Sticker, 3"X4",sheet form (additional carton label for SHIREBROOK order)</td><td>WAREHOUSE 3</td><td>pc</td><td>464</td></tr><tr><td>Tin Can/PET/P-bag</td><td>PAC-PET-0000</td><td>PET 3B-DSPI</td><td>WAREHOUSE 1</td><td>pc</td><td>94500</td></tr></table><table id=''></form><script language="javascript" type="text/javascript"> var fnsFilters = { sort_select: true, loader: true, col_5: "none", col_4: "none", col_3: "select", col_2: "none", col_1: "select", col_0: "select", on_change: true, display_all_text: "Filter", rows_counter: false, btn_reset: false, alternate_rows: false, btn_reset_text: "Display Existing Item Code", col_width: ["auto","auto","auto", "auto", "auto", "auto"] } setFilterGrid("inventory",fnsFilters);</script></body> </html> I hope somebody can help me. To merge the two javascript. So that after I filter the Item Code below the Quantiy will display the SUM.Thank you so much
  8. Hi,I resolved my first problem which is 0 become -. I just exchange the value of 0 and -.Now my problem is how can I put the lot_number value from my database to barcode value which handled by $text. I mean no need to declare to : $bc->build('LO130319001'); manually.I just get the lotnumber value to:$_SESSION["rm_id"] = mysql_insert_id(); $sql = "SELECT r.lot_number, m.mat_code, m.description FROM wms_receiving AS r LEFT JOIN bom_material AS m ON r.uid_mat = m.uid_mat WHERE r.rm_id = " . $_SESSION["rm_id"]; $res = mysql_query($sql); $row = mysql_fetch_assoc($res);$lot_number = $row['lot_number'];Thank you so much
  9. Hi... I saw this thread I tried this code: <?php $bc = new barCode();$bc->build('LO130319001'); class barCode{ public $bcHeight, $bcThinWidth, $bcThickWidth, $bcFontSize, $mode; function __construct($mode='gif', $height=25, $thin=1, $thick=2, $fSize=1) { $this->bcHeight = $height; $this->bcThinWidth = $thin; $this->bcThickWidth = $this->bcThinWidth * $thick; $this->fontSize = $fSize; $this->mode = $mode; $this->outMode = array('gif'=>'gif', 'png'=>'png', 'jpeg'=>'jpeg', 'wbmp'=>'vnd.wap.wbmp'); $this->codeMap = array( '0'=>'000110100', '1'=>'100100001', '2'=>'001100001', '3'=>'101100000', '4'=>'000110001', '5'=>'100110000', '6'=>'001110000', '7'=>'000100101', '8'=>'100100100', '9'=>'001100100', 'A'=>'100001001', 'B'=>'001001001', 'C'=>'101001000', 'D'=>'000011001', 'E'=>'100011000', 'F'=>'001011000', 'G'=>'000001101', 'H'=>'100001100', 'I'=>'001001100', 'J'=>'000011100', 'K'=>'100000011', 'L'=>'001000011', 'M'=>'101000010', 'N'=>'000010011', 'O'=>'100010010', 'P'=>'001010010', 'Q'=>'000000111', 'R'=>'100000110', 'S'=>'001000110', 'T'=>'000010110', 'U'=>'110000001', 'V'=>'011000001', 'W'=>'111000000', 'X'=>'010010001', 'Y'=>'110010000', 'Z'=>'011010000', ' '=>'011000100', '$'=>'010101000', '%'=>'000101010', '*'=>'010010100', '+'=>'010001010', '-'=>'010000101', '.'=>'110000100', '/'=>'010100010' ); } public function build($text='', $showText=false, $fileName=null) { if (trim($text) <= ' ') throw new exception('barCode::build - must be passed text to operate'); if (!$fileType = $this->outMode[$this->mode]) throw new exception("barCode::build - unrecognized output format ({$this->mode})"); if (!function_exists("image{$this->mode}")) throw new exception("barCode::build - unsupported output format ({$this->mode} - check phpinfo)"); $text = strtoupper($text); $dispText = "* $text *"; $text = "*$text*"; // adds start and stop chars $textLen = strlen($text); $barcodeWidth = $textLen * (7 * $this->bcThinWidth + 3 * $this->bcThickWidth) - $this->bcThinWidth; $im = imagecreate($barcodeWidth, $this->bcHeight); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); imagefill($im, 0, 0, $white); $xpos = 0; for ($idx=0; $idx<$textLen; $idx++) { if (!$char = $text[$idx]) $char = '-'; for ($ptr=0; $ptr<=8; $ptr++) { $elementWidth = ($this->codeMap[$char][$ptr]) ? $this->bcThickWidth : $this->bcThinWidth; if (($ptr + 1) % 2) imagefilledrectangle($im, $xpos, 0, $xpos + $elementWidth-1, $this->bcHeight, $black); $xpos += $elementWidth; } $xpos += $this->bcThinWidth; } if ($showText) { $pxWid = imagefontwidth($this->fontSize) * strlen($dispText) + 10; $pxHt = imagefontheight($this->fontSize) + 2; $bigCenter = $barcodeWidth / 2; $textCenter = $pxWid / 2; imagefilledrectangle($im, $bigCenter - $textCenter, $this->bcHeight - $pxHt, $bigCenter + $textCenter, $this->bcHeight, $white); imagestring($im, $this->fontSize, ($bigCenter - $textCenter) + 5, ($this->bcHeight - $pxHt) + 1, $dispText, $black); } if (!$fileName) header("Content-type: image/{$fileType}"); switch($this->mode) { case 'gif': imagegif($im, $fileName); case 'png': imagepng($im, $fileName); case 'jpeg': imagejpeg($im, $fileName); case 'wbmp': imagewbmp($im, $fileName); } imagedestroy($im); }} ?> as you can see $bc->build('LO130319001'); but when I tried to scan the barcode the output become LO13-319—1 the 0 become – before this is my code: $sql = "SELECT r.lot_number, m.mat_code, m.description FROM wms_receiving AS r LEFT JOIN bom_material AS m ON r.uid_mat = m.uid_mat WHERE r.rm_id = " . $_SESSION["rm_id"]; $res = mysql_query($sql); $row = mysql_fetch_assoc($res); $labelprint = "<table>"; $labelprint .= "<tr><td><strong> Lot # : </strong></td><td> $row[lot_number] </td></tr>"; // $labelprint .= "<tr><td><strong> Stock Item : </strong></td><td> $row[mat_code] </td></tr><tr><td><strong> Stock Desc. : </strong></td><td> $row[description] </td></tr>"; $description_to_print =htmlspecialchars($row[description], ENT_QUOTES); $labelprint .= "<tr><td><strong> Stock Item : </strong></td><td> $row[mat_code] </td></tr><tr><td><strong> Stock Desc. : </strong></td><td> $description_to_print</td></tr>"; $labelprint .= "</table>"; unset($_POST); Now I need to put the Lot number into barcode. How can I used the above code in generating barcode. Thank you so much
  10. Hi,Good day!I found a sample code in generating barcode.here's the link:http://www.brandonchecketts.com/archives/quick-php-script-to-generate-a-barcodeand this is the code: <?php$number = isset($_GET['number']) ? $_GET['number'] : '';$barcode_font = dirname(__FILE__).'/fonts/FREE3OF9.TTF';$plain_font = dirname(__FILE__).'/fonts/plain.pfb';$width = 200;$height = 80;$img = imagecreate($width, $height);// First call to imagecolorallocate is the background color$white = imagecolorallocate($img, 255, 255, 255);$black = imagecolorallocate($img, 0, 0, 0);// Reference for the imagettftext() function// imagettftext($img, $fontsize, $angle, $xpos, $ypos, $color, $fontfile, $text);imagettftext($img, 36, 0, 10, 50, $black, $barcode_font, $number);imagettftext($img, 14, 0, 40, 70, $black, $plain_font, $number);header('Content-type: image/png');imagepng($img);imagedestroy($img);?> fisrt i got an error at because I don't have plain.pfb, i don't know where i can download that font. and when I tried to change it to pala.tff and I run the code the error was gone bt the output is blank.I need to create a barcode. It's my first time to create a barcode using php.Any help is highly appreciated.Thank you so much.
  11. HiGood day!I just want to know if what syntax/code should I use to put - in my data variable.for example I have this data.$lot_number_indi_scan = 'LO130315002LO130318001';I want to create a new variable and the output has added - between the lot_number_indi_scan like this:$newlot = 'LO130315002-LO130318001';I want to happen is first I will check the length of $lot_number_indi_scan if length is greater than 10 every lot_number_indi_scan has -like this: $newlot = 'LO130315002-LO130318001';Any help is highly appreciated.Thank you so much.
  12. Hi...Good day!I already had codes on setFilterGrid on my table, now I need to add the total qty at the row which is i don't have any idea if it is possible using javascript and how. I want to happen is every time I filter the item code the Quantity will SUM and display on the last row.here is my code: <?php include('connection.php'); ?><html><title>Raw Materials Inventory</title><head><link rel="stylesheet" type="text/css" href="css/kanban.css" /><script language="javascript" type="text/javascript" src="tablefilter.js"></script> <style>table { font: 14px/28px Verdana, Arial, Helvetica, sans-serif; border-collapse: collapse; }th { padding: 0 0.6em; text-align: left; }tr.yellow th { border-top: 1px solid #FB7A31; border-bottom: 1px solid #FB7A31; background: #FFC; }td { border-bottom: 1px solid #CCC; padding: 0 0.6em; }td+td { border-left: 1px solid #CCC; text-align: center; }</style></head><body><form><?php$current = "in";include("menu.php");echo "<div style='clear: both;'> </div><div style='clear: both;'> </div>";$result = mysql_query("SELECT s.bin_location, s.shelved_qty, s.issued_qty, r.wh_code, m.component, m.mat_code, m.description, m.uom FROM wms_shelving AS s LEFT JOIN wms_receiving AS r ON s.rm_id = r.rm_id LEFT JOIN bom_material AS m ON r.uid_mat = m.uid_mat WHERE s.shelved_qty > s.issued_qty OR ISNULL(s.issued_qty) ORDER BY m.component, m.mat_code");echo "<table id='inventory'>";echo "<tr class='yellow'><th>Component</th><th>Item Code</th><th>Description</th><th>WH Location</th><th>UoM</th><th>Quantity</th></tr>";while($row = mysql_fetch_array($result)) { $component = $row['component']; $itemcode = $row['mat_code']; $description = $row['description']; $wh_location = $row['bin_location']; $uom = $row['uom']; $remaining_qty = $row["shelved_qty"] - $row["issued_qty"];echo "<tr>";echo "<td>$component</td>";echo "<td>$itemcode</td>";echo "<td>$description</td>";echo "<td>$wh_location</td>";echo "<td>$uom</td>";echo "<td>$remaining_qty</td>";echo "</tr>" ; }echo "</table>";?></form><script language="javascript" type="text/javascript"> var fnsFilters = { sort_select: true, loader: true, col_5: "none", col_4: "none", col_3: "select", col_2: "none", col_1: "select", col_0: "select", on_change: true, display_all_text: "Filter", rows_counter: false, btn_reset: false, alternate_rows: false, btn_reset_text: "Display Existing Item Code", col_width: ["auto","auto","auto", "auto", "auto", "auto"] } setFilterGrid("inventory",fnsFilters);</script></body></html> Any help is highly appreciated.Thank you so much.
  13. Hi, Good day!I encountered difficulties in checking of the data is like on the data from my table.I have tablewms_pickingand I have lot_number field and value = 'LO130318001-LO130318002' and item_code = 'MAT-CHE-0010'then I have variable:$lot_number = 'LO130318001LO130318002';$mat_code = 'MAT-CHE-0010';I created query:select s.sr_id, p.item_code, p.lot_number from sr_chemicals AS s JOIN wms_picking AS p ON (s.sr_id = p.sr_id) WHERE p.item_code = '$mat_code' and p.lot_number LIKE '%$lot_number%';select s.sr_id, p.item_code, p.lot_number from sr_chemicals AS s JOIN wms_picking AS p ON (s.sr_id = p.sr_id) WHERE p.item_code = 'MAT-CHE-0010' and p.lot_number LIKE '%LO130318001LO130318002%';and I got no result, but I just want to get the result of lot_number field field and value = 'LO130318001-LO130318002' and item_code = 'MAT-CHE-0010'.Any help is highly appreciated.Thank you so much.
  14. HiGood day!I have form created that I used setFilterGrid in my table, so that I can easily filter the data.Now Every time I filter the item code I need to sum all the quantity , same with if I filter the item code and wh location it also sum the quantiy. Is it possible in javascript?Here is my code: <?php include('connection.php'); ?><html><title>Raw Materials Inventory</title><head><link rel="stylesheet" type="text/css" href="css/kanban.css" /><script language="javascript" type="text/javascript" src="tablefilter.js"></script> <style>table { font: 14px/28px Verdana, Arial, Helvetica, sans-serif; border-collapse: collapse; }th { padding: 0 0.6em; text-align: left; }tr.yellow th { border-top: 1px solid #FB7A31; border-bottom: 1px solid #FB7A31; background: #FFC; }td { border-bottom: 1px solid #CCC; padding: 0 0.6em; }td+td { border-left: 1px solid #CCC; text-align: center; }</style></head><body><form><?php$current = "in";include("menu.php");echo "<div style='clear: both;'> </div><div style='clear: both;'> </div>";$result = mysql_query("SELECT s.bin_location, s.shelved_qty, s.issued_qty, r.wh_code, m.component, m.mat_code, m.description, m.uom FROM wms_shelving AS s LEFT JOIN wms_receiving AS r ON s.rm_id = r.rm_id LEFT JOIN bom_material AS m ON r.uid_mat = m.uid_mat WHERE s.shelved_qty > s.issued_qty OR ISNULL(s.issued_qty) ORDER BY m.component, m.mat_code");echo "<table id='inventory'>";echo "<tr class='yellow'><th>Component</th><th>Item Code</th><th>Description</th><th>WH Location</th><th>UoM</th><th>Quantity</th></tr>";while($row = mysql_fetch_array($result)) { $component = $row['component']; $itemcode = $row['mat_code']; $description = $row['description']; $wh_location = $row['bin_location']; $uom = $row['uom']; $remaining_qty = $row["shelved_qty"] - $row["issued_qty"];echo "<tr>";echo "<td>$component</td>";echo "<td>$itemcode</td>";echo "<td>$description</td>";echo "<td>$wh_location</td>";echo "<td>$uom</td>";echo "<td>$remaining_qty</td>";echo "</tr>" ; }echo "</table>";?></form><script language="javascript" type="text/javascript"> var fnsFilters = { sort_select: true, loader: true, col_5: "none", col_4: "none", col_3: "select", col_2: "none", col_1: "select", col_0: "select", on_change: true, display_all_text: "Filter", rows_counter: false, btn_reset: false, alternate_rows: false, btn_reset_text: "Display Existing Item Code", col_width: ["auto","auto","auto", "auto", "auto", "auto"] } setFilterGrid("inventory",fnsFilters);</script></body></html> Thank you so much
  15. Hi,Good day!I have problem in checking if the two values of variables is match or like.sample 1:in this sample 1 my condition works fine. lot_number = LO130227003lot_number_scan = LO130227003if(lot_number === lot_number_scan){alert('correct');}else{alert('wrong');} sample 2:in this sample 2 my condition did not work. lot_number = LO130227003-LO130228001lot_number_scan = LO130227003 if(lot_number === lot_number_scan){alert('correct');}else{alert('wrong');} I tried to find the solution in this problem but I can't find the same problem.I want to happen is: if(LO130227003-LO130228001 LIKE OR Match LO130227003){alert('correct');}elseif(LO130227003-LO130228001 LIKE OR Match LO130227003LO130228001){alert('correct');}else{alert('wrong');} I don't know what syntax should I used.here is my code: function sequence(varid){ var a= varid.indexOf("/") var b= varid.slice(0,a); b = parseInt( c= (b+1)var f = varid.slice(a); if (window.event.keyCode==13 || window.event.keyCode==10) { var lot_number = document.getElementsByName("lot_number")[b].value; var lot_number_scan = document.getElementsByName("lot_number_scan")[b].value;var counting = document.getElementsByName("lot_number_scan");counting = counting.length; var newid = c + f if(c == counting) { document.getElementById("issued_by").focus(); } else { //----In this part I need to check if lot_number like lot_number_scan if(lot_number === lot_number_scan) { document.getElementById(newid).focus(); } else{ document.getElementsByName("lot_number_scan")[b].value = ''; document.getElementsByName("lot_number_scan")[b].focus(); } } }} I hope someday can help me to fix this problem.Thank you so much.
  16. Hi...It's my first time to use ajax and I used it to get the bin_loc per lot_number where I choose in select option per ItemCode.And now I get the bin_loc but the problem is I only get the bin_loc of the first select option the rest was not.Here is my code of PickingForm.php <?php session_start(); error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);$Date_Shelve =date('Y-m-d H:i:s');?><html><title>Picking</title><head><link href="kanban.css" rel="stylesheet" type="text/css"><script type="text/javascript">var xmlhttp; // Give the function a unique name, this is what your HTML will call to run the AJAXfunction select_code() { // This is all just setting up the variable, ignore it if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { //alert(xmlhttp.responseText); // alert(xmlhttp.readyState+" "+xmlhttp.status); // alert(xmlhttp.readyState+" "+xmlhttp.status); document.getElementById("bin_loc").innerHTML = xmlhttp.responseText; //var mydata=xmlhttp.responseText; } }; var val = document.getElementById("lot_number"); var lot_number = val.options[val.selectedIndex].text; //alert(lot_number); var parameters = "lot_number=" + lot_number; xmlhttp.open("POST", "PickingFormTest.php", true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.send(parameters);//var mydata=xmlhttp.responseText; }</script> </head><body> <div id="SR_date"><label>Date :</label><input type="text" name="date_pick" value="<?php echo $Date_Shelve; ?>" size="16" readonly="readonly" style="border: none;"> </div> <div id="Picking"><?php $sr_num_ = $_POST['sr_num_'];//$sql = "SELECT sr_number " $sql = "SELECT sr_number, Items, DemandedQty, uomFROM sr_main WHERE sr_number = '$sr_num_'";$res_sr_main = mysql_query($sql, $con); $row_num = mysql_num_rows($res_sr_main);if($row_num > 0){while($row_sr_main = mysql_fetch_assoc($res_sr_main)){$sr_number_ = $row_sr_main['sr_number'];$items = $row_sr_main['Items'];$demandedqty = $row_sr_main['DemandedQty'];$uom = $row_sr_main['uom']; echo "<label> SR # :</label>";echo "<input type='text' readonly='readonly' style='border:none;' id='sr_number_' name='sr_number_' value='$sr_number_'>";echo "<table>";echo "<th>Items</th> <th> Item Code </th> <th> Demanded Qty </th> <th> UoM </th> <th> Description </th> <th> Lot Number </th> <th> Bin Location </th> <th> Picked By </th> <th> Approved</th>";echo "<tr> <td>$items</td> <td></td> <td style='text-align:right;'>$demandedqty</td> <td>$uom</td> </tr>"; $sql_sub = "SELECT s.sr_number, s.Items, s.ItemCode, s.SubQty, s.UoM, s.DescriptionFROM sr_submain s WHERE s.sr_number = '$sr_num_' and s.Items = '$items' AND NOT EXISTS(SELECT w.stock_item FROM wms w WHERE s.ItemCode = w.stock_item AND w.sr_number = s.sr_number AND (w.qty_withdraw !='0.00' OR w.qty_withdraw = 'NULL'))";$res_sub = mysql_query($sql_sub, $con);while($row_sub = mysql_fetch_assoc($res_sub)){ echo "<form name='picking_lotnum' action='PickingForm.php?sr_num_=".$sr_num_."' method='POST' enctype='multipart/form-data' target='_self'>"; $sr_num = $row_sub['sr_number']; $Items = $row_sub['Items']; $ItemCode = $row_sub['ItemCode']; $SubQty = $row_sub['SubQty']; $UoM = $row_sub['UoM']; $Description = $row_sub['Description'];$query = "SELECT lot_number from wms WHERE (date_shelve IS NOT NULL) AND stock_item = '$ItemCode' AND (qty = orig_qty OR qty != '0.00') AND qty >= '$SubQty' ORDER BY qty"; $rows = mysql_query($query, $con); echo "<tr> <td></td> <td><input type='text' name='ItemCode' id='ItemCode' value='$ItemCode' readonly='readonly' style='border:none;font-family: Arial, Helvetica, sans-serif; font-size: .9em;'></td> <td><input type='text' name='SubQty' id='SubQty' value='$SubQty' readonly = 'readonly' style='border:none; text-align:right;font-family: Arial, Helvetica, sans-serif; font-size: .9em;'></td> <td>$UoM</td> <td>$Description</td>"; echo "<td><select name = 'lot_number' id='lot_number' onChange='select_code();'>"; echo "<option></option>"; while ($record = mysql_fetch_array($rows)) { echo "<option value = '{$record['lot_number']}'"; if ($lot_number == $record['lot_number']) echo "selected = 'selected'"; echo ">{$record['lot_number']}</option>"; } echo "</select>"; echo "</td>"; echo "<td id='bin_loc'></td>"; echo "<td> <input type='text' name='picked_by' id='picked_by' size='20' value=''> </td>"; echo "<td><input type='submit' name='priority' value='Approved' id='priority'></td>"; echo "</tr>"; echo "<input type='hidden' name='date_pick' value='$Date_Shelve' size='16' style='border: none;'>"; echo "<input type='hidden' readonly='readonly' style='border:none;' id='sr_num_' name='sr_num_' value='$sr_number_'>"; echo "</form>";} }} echo "</table>"; echo "</div>"; ?></body></html> and here is the PickingFormTest.php <?php session_start(); error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);$lot_number = $_POST['lot_number'];//echo $lot_number; // $q=$_GET["lot_number"]; $sql_bin = "SELECT bin_loc FROM wms WHERE lot_number = '$lot_number'"; $res_bin = mysql_query($sql_bin, $con); while($row_bin = mysql_fetch_assoc($res_bin)){ $bin_loc = $row_bin['bin_loc']; echo "<input type='text' value='$bin_loc' id='bin_loc'>"; } ?> Thank you so much
  17. Hi...I just want to know how can I compute the Total Maximum Dozen while I'm input number in the textboxes from Maximum Lot.Now, in my code:When I input in textbox from Maximum lot it computes the Maximum Dozen and Total Maximum Lot, and the Total Maximum Dozen was only compute or change when I press the key on the textbox from Maximum Dozen.I want to happen is:when I input in Maximum Lot textboxes the total Maximum Lot, Maximum Dozen, and Total Maximum Dozen will compute.Here is my code: <html><head><title>Half Shell</title><link rel="stylesheet" type="text/css" href="kanban.css" /> <script type="text/javascript">//auto compute Total Maxfunction autocalearn(oText){ var P28_max_lot = document.getElementById("P28_max_lot").value; var P28_bch_wt = document.getElementById("P28_bch_wt").value; var P28_plug_wt = document.getElementById("P28_plug_wt").value; var P28_max_convert = (parseFloat(P28_max_lot) * ((parseFloat(P28_bch_wt))* parseFloat(1000)) / parseFloat(P28_plug_wt) / parseFloat(12)); if( !isNaN(P28_max_convert) ){ var P28_max_doz = document.getElementById("P28_max_doz").value = P28_max_convert.toFixed(2); } var P30_max_lot = document.getElementById("P30_max_lot").value; var P30_bch_wt = document.getElementById("P30_bch_wt").value; var P30_plug_wt = document.getElementById("P30_plug_wt").value; var P30_max_convert = (parseFloat(P30_max_lot) * ((parseFloat(P30_bch_wt))* parseFloat(1000)) / parseFloat(P30_plug_wt) / parseFloat(12)); if( !isNaN(P30_max_convert) ){ var P30_max_doz = document.getElementById("P30_max_doz").value = P30_max_convert.toFixed(2); } var P32_max_lot = document.getElementById("P32_max_lot").value; var P32_bch_wt = document.getElementById("P32_bch_wt").value; var P32_plug_wt = document.getElementById("P32_plug_wt").value; var P32_max_convert = (parseFloat(P32_max_lot) * ((parseFloat(P32_bch_wt))* parseFloat(1000)) / parseFloat(P32_plug_wt) / parseFloat(12)); if( !isNaN(P32_max_convert) ){ var P32_max_doz = document.getElementById("P32_max_doz").value = P32_max_convert.toFixed(2); } var P33_max_lot = document.getElementById("P33_max_lot").value; var P33_bch_wt = document.getElementById("P33_bch_wt").value; var P33_plug_wt = document.getElementById("P33_plug_wt").value; var P33_max_convert = (parseFloat(P33_max_lot) * ((parseFloat(P33_bch_wt))* parseFloat(1000)) / parseFloat(P33_plug_wt) / parseFloat(12)); if( !isNaN(P33_max_convert) ){ var P33_max_doz = document.getElementById("P33_max_doz").value = P33_max_convert.toFixed(2); } var P35_max_lot = document.getElementById("P35_max_lot").value; var P35_bch_wt = document.getElementById("P35_bch_wt").value; var P35_plug_wt = document.getElementById("P35_plug_wt").value; var P35_max_convert = (parseFloat(P35_max_lot) * ((parseFloat(P35_bch_wt))* parseFloat(1000)) / parseFloat(P35_plug_wt) / parseFloat(12)); if( !isNaN(P35_max_convert) ){ var P35_max_doz = document.getElementById("P35_max_doz").value = P35_max_convert.toFixed(2); } var P35M_max_lot = document.getElementById("P35M_max_lot").value; var P35M_bch_wt = document.getElementById("P35M_bch_wt").value; var P35M_plug_wt = document.getElementById("P35M_plug_wt").value; var P35M_max_convert = (parseFloat(P35M_max_lot) * ((parseFloat(P35M_bch_wt))* parseFloat(1000)) / parseFloat(P35M_plug_wt) / parseFloat(12)); if( !isNaN(P35M_max_convert) ){ var P35M_max_doz = document.getElementById("P35M_max_doz").value = P35M_max_convert.toFixed(2); } var P35W_max_lot = document.getElementById("P35W_max_lot").value; var P35W_bch_wt = document.getElementById("P35W_bch_wt").value; var P35W_plug_wt = document.getElementById("P35W_plug_wt").value; var P35W_max_convert = (parseFloat(P35W_max_lot) * ((parseFloat(P35W_bch_wt))* parseFloat(1000)) / parseFloat(P35W_plug_wt) / parseFloat(12)); if( !isNaN(P35W_max_convert) ){ var P35W_max_doz = document.getElementById("P35W_max_doz").value = P35W_max_convert.toFixed(2); } var P38_max_lot = document.getElementById("P38_max_lot").value; var P38_bch_wt = document.getElementById("P38_bch_wt").value; var P38_plug_wt = document.getElementById("P38_plug_wt").value; var P38_max_convert = (parseFloat(P38_max_lot) * ((parseFloat(P38_bch_wt))* parseFloat(1000)) / parseFloat(P38_plug_wt) / parseFloat(12)); if( !isNaN(P38_max_convert) ){ var P38_max_doz = document.getElementById("P38_max_doz").value = P38_max_convert.toFixed(2); } if (isNaN(oText.value)){alert('Numbers only!');oText.value = '';}var field, val, oForm = oText.form, Total_max_lot = a = 0;for (a; a < arguments.length; ++a) //loop through text elements{field = arguments[a];val = parseFloat(field.value);if (!isNaN(val)) //number?{Total_max_lot += val;}} oForm.Total_max_lot.value = Total_max_lot.toFixed(2); } </script><script type="text/javascript">//Auto convert to Doz and auto compute total max dozfunction doz(oText){ if (isNaN(oText.value)){oText.value = '';}var field, val, oForm = oText.form, Total_max_doz = a = 0;for (a; a < arguments.length; ++a) //loop through text elements{field = arguments[a];val = parseFloat(field.value); if (!isNaN(val)) //number?{Total_max_doz += val;}}oForm.Total_max_doz.value = Total_max_doz.toFixed(2);}</script></head> <?php date_default_timezone_set("Asia/Singapore");$con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);?><body><form name="loading_kanban" action="" method="post" onSubmit="return false"><div id="fieldset_PS"><table><th>Compounds</th><th>Max</th><th>UoM</th><th>Max</th><th>UoM</th><tr><td><input type="text" name="P28" id="P28" value="P28" ></td><td><input type="text" name="P28_max_lot" id="P28_max_lot" value="<?php echo $P28_max_lot; ?>" onkeyup="return autocalearn(this, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P28_max_lot_uom" id="P28_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P28_max_doz" id="P28_max_doz" value="<?php echo $P28_max_doz;?>" onkeyup="return doz(P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)" ></b></td><td><input type="text" name="P28_max_doz_uom" id="P28_max_doz_uom" value="Doz" ></td></tr><tr><td><input type="text" name="P30" id="P30" value="P30" ></td><td><input type="text" name="P30_max_lot" id="P30_max_lot" value="<?php echo $P30_max_lot;?>" onkeyup="return autocalearn(this, P28_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P30_max_lot_uom" id="P30_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P30_max_doz" id="P30_max_doz" value="<?php echo $P30_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P30_max_doz_uom" id="P30_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P32" id="P32" value="P32" ></td><td><input type="text" name="P32_max_lot" id="P32_max_lot" value="<?php echo $P32_max_lot ;?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P32_max_lot_uom" id="P32_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P32_max_doz" id="P32_max_doz" value="<?php echo $P32_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P32_max_doz_uom" id="P32_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P33" id="P33" value="P33" ></td><td><input type="text" name="P33_max_lot" id="P33_max_lot" value="<?php echo $P33_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P33_max_lot_uom" id="P33_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P33_max_doz" id="P33_max_doz" value="<?php echo $P33_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P33_max_doz_uom" id="P33_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35" id="P35" value="P35"></td><td><input type="text" name="P35_max_lot" id="P35_max_lot" value="<?php echo $P35_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35_max_lot_uom" id="P35_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35_max_doz" id="P35_max_doz" value="<?php echo $P35_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35_max_doz_uom" id="P35_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35M" id="P35M" value="P35M"></td><td><input type="text" name="P35M_max_lot" id="P35M_max_lot" value="<?php echo $P35M_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35M_max_lot_uom" id="P35M_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35M_max_doz" id="P35M_max_doz" value="<?php echo $P35M_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35M_max_doz_uom" id="P35M_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35W" id="P35W" value="P35W"></td><td><input type="text" name="P35W_max_lot" id="P35W_max_lot" value="<?php echo $P35W_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35W_max_lot_uom" id="P35W_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35W_max_doz" id="P35W_max_doz" value="<?php echo $P35W_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35W_max_doz_uom" id="P35W_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P38" id="P38" value="P38" ></td><td><input type="text" name="P38_max_lot" id="P38_max_lot" value="<?php echo $P38_max_lot; ?>" size="8" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P38_max_lot_uom" id="P38_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P38_max_doz" id="P38_max_doz" value="<?php echo $P38_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P35W_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P38_max_doz_uom" id="P38_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="Total" id="Total" value="Total" ></td><td><input type="text" name="Total_max_lot" id="Total_max_lot" value="<?php echo $Total_max_lot; ?>" ></td><td><input type="text" name="Total_max_lot_uom" id="Total_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="Total_max_doz" id="Total_max_doz" value="<?php echo $Total_max_doz; ?>"></b></td><td><input type="text" name="Total_max_doz_uom" id="Total_max_doz_uom" value="Doz" ></td></tr> </table></div></form></body></html> Can you do me additional favor?If you have time kindly visit this site:http://www.topmovietrailers2012.blogspot.com/Thank you so much
  18. Hi...I just want to know how can I compute the Total Maximum Dozen while I'm input number in the textboxes from Maximum Lot.Now, in my code:When I input in textbox from Maximum lot it computes the Maximum Dozen and Total Maximum Lot, and the Total Maximum Dozen was only compute or change when I press the key on the textbox from Maximum Dozen.I want to happen is:when I input in Maximum Lot textboxes the total Maximum Lot, Maximum Dozen, and Total Maximum Dozen will compute.Here is my code: <html><head><title>Half Shell</title><link rel="stylesheet" type="text/css" href="kanban.css" /> <script type="text/javascript">//auto compute Total Maxfunction autocalearn(oText){ var P28_max_lot = document.getElementById("P28_max_lot").value; var P28_bch_wt = document.getElementById("P28_bch_wt").value; var P28_plug_wt = document.getElementById("P28_plug_wt").value; var P28_max_convert = (parseFloat(P28_max_lot) * ((parseFloat(P28_bch_wt))* parseFloat(1000)) / parseFloat(P28_plug_wt) / parseFloat(12)); if( !isNaN(P28_max_convert) ){ var P28_max_doz = document.getElementById("P28_max_doz").value = P28_max_convert.toFixed(2); } var P30_max_lot = document.getElementById("P30_max_lot").value; var P30_bch_wt = document.getElementById("P30_bch_wt").value; var P30_plug_wt = document.getElementById("P30_plug_wt").value; var P30_max_convert = (parseFloat(P30_max_lot) * ((parseFloat(P30_bch_wt))* parseFloat(1000)) / parseFloat(P30_plug_wt) / parseFloat(12)); if( !isNaN(P30_max_convert) ){ var P30_max_doz = document.getElementById("P30_max_doz").value = P30_max_convert.toFixed(2); } var P32_max_lot = document.getElementById("P32_max_lot").value; var P32_bch_wt = document.getElementById("P32_bch_wt").value; var P32_plug_wt = document.getElementById("P32_plug_wt").value; var P32_max_convert = (parseFloat(P32_max_lot) * ((parseFloat(P32_bch_wt))* parseFloat(1000)) / parseFloat(P32_plug_wt) / parseFloat(12)); if( !isNaN(P32_max_convert) ){ var P32_max_doz = document.getElementById("P32_max_doz").value = P32_max_convert.toFixed(2); } var P33_max_lot = document.getElementById("P33_max_lot").value; var P33_bch_wt = document.getElementById("P33_bch_wt").value; var P33_plug_wt = document.getElementById("P33_plug_wt").value; var P33_max_convert = (parseFloat(P33_max_lot) * ((parseFloat(P33_bch_wt))* parseFloat(1000)) / parseFloat(P33_plug_wt) / parseFloat(12)); if( !isNaN(P33_max_convert) ){ var P33_max_doz = document.getElementById("P33_max_doz").value = P33_max_convert.toFixed(2); } var P35_max_lot = document.getElementById("P35_max_lot").value; var P35_bch_wt = document.getElementById("P35_bch_wt").value; var P35_plug_wt = document.getElementById("P35_plug_wt").value; var P35_max_convert = (parseFloat(P35_max_lot) * ((parseFloat(P35_bch_wt))* parseFloat(1000)) / parseFloat(P35_plug_wt) / parseFloat(12)); if( !isNaN(P35_max_convert) ){ var P35_max_doz = document.getElementById("P35_max_doz").value = P35_max_convert.toFixed(2); } var P35M_max_lot = document.getElementById("P35M_max_lot").value; var P35M_bch_wt = document.getElementById("P35M_bch_wt").value; var P35M_plug_wt = document.getElementById("P35M_plug_wt").value; var P35M_max_convert = (parseFloat(P35M_max_lot) * ((parseFloat(P35M_bch_wt))* parseFloat(1000)) / parseFloat(P35M_plug_wt) / parseFloat(12)); if( !isNaN(P35M_max_convert) ){ var P35M_max_doz = document.getElementById("P35M_max_doz").value = P35M_max_convert.toFixed(2); } var P35W_max_lot = document.getElementById("P35W_max_lot").value; var P35W_bch_wt = document.getElementById("P35W_bch_wt").value; var P35W_plug_wt = document.getElementById("P35W_plug_wt").value; var P35W_max_convert = (parseFloat(P35W_max_lot) * ((parseFloat(P35W_bch_wt))* parseFloat(1000)) / parseFloat(P35W_plug_wt) / parseFloat(12)); if( !isNaN(P35W_max_convert) ){ var P35W_max_doz = document.getElementById("P35W_max_doz").value = P35W_max_convert.toFixed(2); } var P38_max_lot = document.getElementById("P38_max_lot").value; var P38_bch_wt = document.getElementById("P38_bch_wt").value; var P38_plug_wt = document.getElementById("P38_plug_wt").value; var P38_max_convert = (parseFloat(P38_max_lot) * ((parseFloat(P38_bch_wt))* parseFloat(1000)) / parseFloat(P38_plug_wt) / parseFloat(12)); if( !isNaN(P38_max_convert) ){ var P38_max_doz = document.getElementById("P38_max_doz").value = P38_max_convert.toFixed(2); } if (isNaN(oText.value)){alert('Numbers only!');oText.value = '';}var field, val, oForm = oText.form, Total_max_lot = a = 0;for (a; a < arguments.length; ++a) //loop through text elements{field = arguments[a];val = parseFloat(field.value);if (!isNaN(val)) //number?{Total_max_lot += val;}} oForm.Total_max_lot.value = Total_max_lot.toFixed(2); } </script><script type="text/javascript">//Auto convert to Doz and auto compute total max dozfunction doz(oText){ if (isNaN(oText.value)){oText.value = '';}var field, val, oForm = oText.form, Total_max_doz = a = 0;for (a; a < arguments.length; ++a) //loop through text elements{field = arguments[a];val = parseFloat(field.value); if (!isNaN(val)) //number?{Total_max_doz += val;}}oForm.Total_max_doz.value = Total_max_doz.toFixed(2);}</script></head> <?php date_default_timezone_set("Asia/Singapore");$con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);?><body><form name="loading_kanban" action="" method="post" onSubmit="return false"><div id="fieldset_PS"><table><th>Compounds</th><th>Max</th><th>UoM</th><th>Max</th><th>UoM</th><tr><td><input type="text" name="P28" id="P28" value="P28" ></td><td><input type="text" name="P28_max_lot" id="P28_max_lot" value="<?php echo $P28_max_lot; ?>" onkeyup="return autocalearn(this, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P28_max_lot_uom" id="P28_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P28_max_doz" id="P28_max_doz" value="<?php echo $P28_max_doz;?>" onkeyup="return doz(P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)" ></b></td><td><input type="text" name="P28_max_doz_uom" id="P28_max_doz_uom" value="Doz" ></td></tr><tr><td><input type="text" name="P30" id="P30" value="P30" ></td><td><input type="text" name="P30_max_lot" id="P30_max_lot" value="<?php echo $P30_max_lot;?>" onkeyup="return autocalearn(this, P28_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P30_max_lot_uom" id="P30_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P30_max_doz" id="P30_max_doz" value="<?php echo $P30_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P32_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P30_max_doz_uom" id="P30_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P32" id="P32" value="P32" ></td><td><input type="text" name="P32_max_lot" id="P32_max_lot" value="<?php echo $P32_max_lot ;?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P32_max_lot_uom" id="P32_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P32_max_doz" id="P32_max_doz" value="<?php echo $P32_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P33_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P32_max_doz_uom" id="P32_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P33" id="P33" value="P33" ></td><td><input type="text" name="P33_max_lot" id="P33_max_lot" value="<?php echo $P33_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P33_max_lot_uom" id="P33_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P33_max_doz" id="P33_max_doz" value="<?php echo $P33_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P35_max_doz, P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P33_max_doz_uom" id="P33_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35" id="P35" value="P35"></td><td><input type="text" name="P35_max_lot" id="P35_max_lot" value="<?php echo $P35_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35M_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35_max_lot_uom" id="P35_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35_max_doz" id="P35_max_doz" value="<?php echo $P35_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35M_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35_max_doz_uom" id="P35_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35M" id="P35M" value="P35M"></td><td><input type="text" name="P35M_max_lot" id="P35M_max_lot" value="<?php echo $P35M_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35W_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35M_max_lot_uom" id="P35M_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35M_max_doz" id="P35M_max_doz" value="<?php echo $P35M_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35W_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35M_max_doz_uom" id="P35M_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P35W" id="P35W" value="P35W"></td><td><input type="text" name="P35W_max_lot" id="P35W_max_lot" value="<?php echo $P35W_max_lot; ?>" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P38_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P35W_max_lot_uom" id="P35W_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P35W_max_doz" id="P35W_max_doz" value="<?php echo $P35W_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P38_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P35W_max_doz_uom" id="P35W_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="P38" id="P38" value="P38" ></td><td><input type="text" name="P38_max_lot" id="P38_max_lot" value="<?php echo $P38_max_lot; ?>" size="8" onkeyup="return autocalearn(this, P28_max_lot, P30_max_lot, P32_max_lot, P33_max_lot, P35_max_lot, P35M_max_lot, P35W_max_lot, P40_max_lot, P41_max_lot, P42_max_lot, P43_max_lot, P46_max_lot, P47_max_lot)" ></td><td><input type="text" name="P38_max_lot_uom" id="P38_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="P38_max_doz" id="P38_max_doz" value="<?php echo $P38_max_doz; ?>" onkeyup="return doz(this, P28_max_doz, P30_max_doz, P32_max_doz, P33_max_doz,P35_max_doz, P35M_max_doz, P35W_max_doz, P40_max_doz, P41_max_doz, P42_max_doz, P43_max_doz, P46_max_doz, P47_max_doz)"></b></td><td><input type="text" name="P38_max_doz_uom" id="P38_max_doz_uom" value="Doz" ></td></tr> <tr><td><input type="text" name="Total" id="Total" value="Total" ></td><td><input type="text" name="Total_max_lot" id="Total_max_lot" value="<?php echo $Total_max_lot; ?>" ></td><td><input type="text" name="Total_max_lot_uom" id="Total_max_lot_uom" value="Lot" ></td><td><b><input type="text" name="Total_max_doz" id="Total_max_doz" value="<?php echo $Total_max_doz; ?>"></b></td><td><input type="text" name="Total_max_doz_uom" id="Total_max_doz_uom" value="Doz" ></td></tr> </table></div></form></body></html> Can you do me additional favor?If you have time kindly visit this site:http://www.topmovietrailers2012.blogspot.com/Thank you so much
  19. Hi..I create mysql syntax for query testing before i input to my php codehere is my mysql code: set @t = 0;set @rqty=31968;SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN @t+OUTPUT_QTY > @rqtyTHEN @rqty [email="-@t"]-@t[/email] ELSE OUTPUT_QTYEND as qty,@t := @t + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = 'P28' AND (@t < @rqty); and i attach the sample output of the above query.Now that query test is work i will input that code to my php codes. $sql = "SELECT SKUCode, Materials, Comp, Qty FROM bom WHERE SKUCode = '$SKUCode'"; $res = mysql_query($sql, $con); ($row = mysql_fetch_assoc($res)); $Materials = $row['Materials']; $Qty = $row['Qty']; $Comp = $row['Comp']; //P28//-----Compute Req Qty and Save to table---// $ReqQty = $Qty * $POReq; // 31968 $sql = "UPDATE bom SET ReqQty = '$ReqQty' WHERE SKUCode = '$SKUCode' AND Materials = '$Materials'";$resReqQty = mysql_query($sql, $con);$t = 0;$sql = "SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN $t+OUTPUT_QTY > $ReqQtyTHEN $ReqQty -$t ELSE OUTPUT_QTYEND as qty,$t := $t + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = '$Comp' AND ($t < $ReqQty)"; when I echo the query:I got this: SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN 0+OUTPUT_QTY > 31968 THEN 31968 -0 ELSE OUTPUT_QTY END as qty, 0 := 0 + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = 'P28' AND (0 < 31968)then I run it to the sqland I got an error:Error Code : 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= 0 + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = '' at line 1(0 ms taken)Any help is highly appreciatedThank you so much
  20. Hi...I have atable: bomfields:Comp = P28ReqQty = 31968and I have tabletable: dippingfields needed to get dataLOT_CODEOUTPUT_QTYDATE_ENTRYnow I only want to get LOT_CODE and OUTPUT_QTY where can suffix the ReqQty ORDER BY DATE_ENTRYI tried this query: SELECT SUBSTR(LOT_CODE, 9,4) AS Comp, LOT_CODE, OUTPUT_QTY, DATE_ENTRY FROM dipping WHERE SUBSTR(LOT_CODE, 9,4) = 'P28' ORDER BY DATE_ENTRY ASC; I attach the result of this query.I want only query or get is the LOT_CODE where the OUTPUT can suffix the ReqQty.Simple Example:ReqQty = 100Comp = P28LOT_CODE--OUTPUT_QTY---DATE_ENTRY00001P28--- 50------------2012-05-1500002P28----25------------2012-05-1600003P28----50------------2012-05-1700004P28----25-----------2012-05-18in query I need to get only the00001P28--- 50------------2012-05-1500002P28----25------------2012-05-1600003P28----50------------2012-05-17because it suffix my ReqQty as you can see in this LOT_CODE00003P28----50------------2012-05-17 i only need is 25 to suffix my ReqQty so I need to display only:00001P28--- 50------------2012-05-1500002P28----25------------2012-05-1600003P28----25------------2012-05-17Feel free to ask me if theirs any question for better understanding of my problemThank you dipping.zip
  21. Hi.I created forms with condition to only view Items which is = Min Lot, now my problem is if no items that = Min Lot the select option below was displayed and the save button. I want to display them only also if the if condition is true. I mean if the condition was not satisfied no display, now in my code it happened is the Issued BY, Received By, Approved BY, Requested By and save button was still display.. How can I also display only them if the condition was satisfied?Thank youhere is my code: <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con); ?><html><title>Stock Requisition</title><head><link rel="stylesheet" type="text/css" href="kanban.css"> <script type="text/javascript">function save_sr(){ var sr_date = document.getElementById("sr_date").value; var sr_number = document.getElementById("sr_number").value; var Items_ = document.getElementById("Items_").value; var SubItems = document.getElementById("SubItems").value; var ItemCode = document.getElementById("ItemCode").value; var DemandedQty = document.getElementById("DemandedQty").value; var UoM = document.getElementById("UoM").value; var Class = document.getElementById("Class").value; var Description = document.getElementById("Description").value; var BINLocation = document.getElementById("BINLocation").value; var RequestedBy = document.getElementById("RequestedBy").value; var ApprovedBy = document.getElementById("ApprovedBy").value; var ReceivedBy = document.getElementById("ReceivedBy").value; var IssuedBy = document.getElementById("IssuedBy").value; var Items1 = document.getElementById("Items1").value; var SubQty_ = document.getElementsByTagName('input'); var SubQty = SubQty_[9].getAttribute("value"); var sr_number_hide = document.getElementById("sr_number_hide").value; document.frmMain.action="StockRequisitionSave1.php?sr_date="+sr_date+"&sr_number="+sr_number+"&Items_="+Items_+ "&SubItems="+SubItems+"&ItemCode="+ItemCode+"&DemandedQty="+DemandedQty+"&UoM="+UoM+"&Class="+Class+"&Description="+ Description+"&BINLocation="+BINLocation+"&RequestedBy="+RequestedBy+"&ApprovedBy="+ApprovedBy+"&ReceivedBy="+ReceivedBy+ "&IssuedBy="+IssuedBy+"&Items1="+Items1+"&sr_number_hide="+sr_number_hide+"&SubQty="+SubQty; document.frmMain.submit(); alert("Stock Requisition data save."); //window.location = "StockRequisition1.php"; window.location = "StockRequisitionDisplay1.php";}</script><script type="text/javascript">function test_(cmpd, mult) { var len_ = (document.frmMain.elements.length) - 1; for (i=0; i <= len_; i++ ) { var cmp = "_" + cmpd; var strPos_ = document.frmMain.elements[i].id.indexOf(cmp) if (strPos_ != -1) { var strPos = document.frmMain.elements[i].id.indexOf("_"); var strId = document.frmMain.elements[i].id.slice(strPos + 1) + "_" + document.frmMain.elements[i].id.slice(0,strPos); document.frmMain.elements[i].value = (document.getElementById(strId).value * mult).toFixed(2); } } } </script></head><body><form name="frmMain" method="post"> <div><table><thead><th>Items</th><th>Sub Items</th><th>Item Code</th><th>Demanded Qty</th><th>UoM</th><th>Class</th><th>Description</th><th>BIN Location</th></thead><?php$DemandedQty = $_POST['DemandedQty'];$sql = "SELECT DISTINCT Items FROM bom_subitems ORDER BY Items";$res_bom = mysql_query($sql, $con);$totalDistinct = mysql_num_rows($res_bom);if ($totalDistinct > 0) { while ($row = mysql_fetch_assoc($res_bom)) { $Comp[] = substr($row['Items'], 12, 3); // $Comp = substr($cmpdArray, 12, 3); }} foreach ($Comp as $Comp) { $sql = "SELECT COUNT(WIP_1) AS WIP_1 FROM KANBAN_REPORT_OPEN WHERE SUBSTRING(LOT_CODE, 9) = '$Comp' AND WIP_1 > 0"; $resultWip = mysql_query($sql, $con); $wip_1 = mysql_result($resultWip, 0 , "WIP_1"); $wip1Accum = $wip1Accum + $wip_1; $sql = "SELECT COUNT(WIP_2) AS WIP_2 FROM KANBAN_REPORT_OPEN WHERE SUBSTRING(LOT_CODE, 9) = '$Comp' AND WIP_2 > 0"; $resultWip = mysql_query($sql, $con); $wip_2 = mysql_result($resultWip, 0 , "WIP_2"); $wip2Accum = $wip2Accum + $wip_2; $sql = "SELECT COUNT(WIP_3) AS WIP_3 FROM KANBAN_REPORT_OPEN WHERE SUBSTRING(LOT_CODE, 9) = '$Comp' AND WIP_3 > 0"; $resultWip = mysql_query($sql, $con); $wip_3 = mysql_result($resultWip, 0 , "WIP_3"); $wip3Accum = $wip3Accum + $wip_3; $sql = "SELECT COUNT(WIP_4) AS WIP_4 FROM KANBAN_REPORT_OPEN WHERE SUBSTRING(LOT_CODE, 9) = '$Comp' AND WIP_4 > 0"; $resultWip = mysql_query($sql, $con); $wip_4 = mysql_result($resultWip, 0 , "WIP_4"); $wip4Accum = $wip4Accum + $wip_4; $sql = "SELECT COUNT(WIP_5) AS WIP_5 FROM KANBAN_REPORT_OPEN WHERE SUBSTRING(LOT_CODE, 9) = '$Comp' AND WIP_5 > 0"; $resultWip = mysql_query($sql, $con); $wip_5 = mysql_result($resultWip, 0 , "WIP_5"); $wip5Accum = $wip5Accum + $wip_5; $total = $wip_1 + $wip_2 + $wip_3 + $wip_4 + $wip_5; $sql = "SELECT Compounds, Min_Lot FROM param_settings WHERE Compounds = '$Comp'";$res_param = mysql_query($sql);$row_param = mysql_fetch_assoc($res_param);$Compounds = $row_param['Compounds'];$Min_Lot = $row_param['Min_Lot']; if($Comp = $Compounds && $total == $Min_Lot){ $sql = "SELECT DISTINCT Items FROM bom_subitems WHERE SUBSTR(Items,13,3) = '$Compounds' ORDER BY Items";$res_bom = mysql_query($sql, $con);while($row = mysql_fetch_assoc($res_bom)){ $Items = $row['Items']; $Items_ = substr($Items, 12, 3); echo "<tr> <td style='border: none;font-weight: bold;'> <input type='name' value='$Items_' name='Items_[]' id='Items_' readonly = 'readonly' style = 'border:none;width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td> <td style='border:none;'> </td> <td style='border:none;'> </td> <td style='border: none;'><center><input type='text' style='text-align: right;' name='DemandedQty[]' id='DemandedQty' size='12' onkeyup='test_(\"$Items_\", this.value)' value=''></center></td> </tr>"; $sql = "SELECT Items, SubItems, ItemCode, UoM, Class, Description, BINLocation, Quantity FROM bom_subitems WHERE Items = '$Items' ORDER BY Items"or die(mysql_error());$res_sub = mysql_query($sql, $con); $counter = 0; while($row_sub = mysql_fetch_assoc($res_sub)){ $joinId = $counter . "_" . $Items_; $Items = $row_sub['Items']; $Items1 = substr($Items, 12, 3); $SubItems = $row_sub['SubItems']; $ItemCode = $row_sub['ItemCode']; $UoM = $row_sub['UoM']; $Class = $row_sub['Class']; $Description = $row_sub['Description']; $BINLocation = $row_sub['BINLocation']; $Quantity = $row_sub['Quantity']; $joinId2 = $Items_ . "_" . $counter; echo "<tr> <td style='border: none;'> <input type='hidden' value='$Items1' name='Items1[]' id='Items1'></td> <td style='border: none;'> <input type='text' name='SubItems[]' id='SubItems' value='$SubItems' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td> <td style='border: none;'> <input type='text' name='ItemCode[]' id='ItemCode' value='$ItemCode' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td> <td><input class='txt' type='text' name='SubQty[]' id='$joinId' readonly = 'readonly' size='12' style= 'border:none;text-align:right'/><input type='hidden' id='$joinId2' value='$Quantity' /></td> <td style='border: none;' size='3'> <input type='text' name='UoM[]' id='UoM' value='$UoM' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;' size='3'></td> <td style='border: none;'> <input type='text' name='Class[]' value='$Class' name='Class' id='Class' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td> <td style='border: none;'> <input type='text' name='Description[]' value='$Description' id='Description' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;' size= '30'></td> <td style='border: none;'> <input type='text' name='BINLocation[]' value='$BINLocation' id='BINLocation' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td> </tr>"; $counter = $counter + 1;}}}} ?></table></div><?php $RequestedBy = array('AAA', 'BBB', 'CCC', 'DDD'); $ApprovedBy = array('EEE', 'FFF', 'GGG', 'HHH'); $ReceivedBy = array('III', 'JJJ', 'KKK', 'LLL'); $IssuedBy = array('MMM', 'NNN', 'OOO', 'PPP');?> <div id='Requested_By'><label>Requested By:</label> <select name="RequestedBy"> <option value="Select">Select</option> <option value="AAA" <?php if($_POST['RequestedBy'] == 'AAA') echo "selected='selected'"; ?>>AAA</option> <option value="BBB" <?php if($_POST['RequestedBy'] == 'BBB') echo "selected='selected'"; ?>>BBB</option> <option value="CCC" <?php if($_POST['RequestedBy'] == 'CCC') echo "selected='selected'"; ?>>CCC</option> <option value="DDD" <?php if($_POST['RequestedBy'] == 'DDD') echo "selected='selected'"; ?>>DDD</option> </select></div><div id='Approved_By'><label>Approved By:</label><select name="ApprovedBy"><option name='Select'>Select</option><option value="EEE" <?php if($_POST['ApprovedBy'] == 'EEE') echo "selected='selected'"; ?>>EEE</option> <option value="FFF" <?php if($_POST['ApprovedBy'] == 'FFF') echo "selected='selected'"; ?>>FFF</option> <option value="GGG" <?php if($_POST['ApprovedBy'] == 'GGG') echo "selected='selected'"; ?>>GGG</option> <option value="HHH" <?php if($_POST['ApprovedBy'] == 'HHH') echo "selected='selected'"; ?>>HHH</option></select></div><div id='Received_By'><label>Issued By:</label><select name="IssuedBy"><option name='Select'>Select</option><option value="III" <?php if($_POST['ReceivedBy'] == 'III') echo "selected='selected'"; ?>>III</option> <option value="JJJ" <?php if($_POST['ReceivedBy'] == 'JJJ') echo "selected='selected'"; ?>>JJJ</option> <option value="KKK" <?php if($_POST['ReceivedBy'] == 'KKK') echo "selected='selected'"; ?>>KKK</option> <option value="LLL" <?php if($_POST['ReceivedBy'] == 'LLL') echo "selected='selected'"; ?>>LLL</option></select></div><div id='Issued_By'><label>Received By:</label><select name="ReceivedBy"><option name='Select'>Select</option><option value="MMM" <?php if($_POST['IssuedBy'] == 'MMM') echo "selected='selected'"; ?>>MMM</option> <option value="NNN" <?php if($_POST['IssuedBy'] == 'NNN') echo "selected='selected'"; ?>>NNN</option> <option value="OOO" <?php if($_POST['IssuedBy'] == 'OOO') echo "selected='selected'"; ?>>OOO</option> <option value="PPP" <?php if($_POST['IssuedBy'] == 'PPP') echo "selected='selected'"; ?>>PPP</option></select></div><div id="save_btn"><input type="button" name="button" value="save" onClick="save_sr()" style="width: 5em;"></div></form></body></html> I will attach my sample form output
  22. Hi..I encountered problem in my configuration of my php because not all data was uploaded to database eventhougn my files is not large it was only KB.my server is apache.I already edit this:•max_input_time•memory_limit•max_execution_time•post_max_sizebut still not all data was save to my database..I tried everything and yet, nothing was change. still not all was save to my database :(Thank you
  23. Hi..I have code for auto increment of JO Number, now it display:120504001by using this code: <?php $sql = "SELECT jo_number FROM job_order ORDER BY jo_date DESC LIMIT 1"; $result = mysql_query($sql, $con); if (!$result) { echo 'failed'; die(); } $total = mysql_num_rows($result); if ($total <= 0) { $currentSRNum = 1; $currentYear = (int)(date('y')); $currentMonth = (int)(date('m')); $currentDay = (int)(date('d')); $currentSRYMD = substr($row['jo_number'], 0, 6); $currentYMD = date("ymd"); if ($currentYMD > $currentSRYMD) { $currentSRNum = 1; } else { $currentSRNum += 1; } } else {//------------------------------------------------------------------------------------------------------------------ // Stock Number iteration.... $row = mysql_fetch_assoc($result); $currentSRNum = (int)(substr($row['jo_number'],0,3)); $currentSRYear = (int)(substr($row['jo_number'],2,2)); $currentSRMonth = (int)(substr($row['jo_number'],0,2)); $currentSRNum = (int)(substr($row['jo_number'],6,4)); $currentYear = (int)(date('y')); $currentMonth = (int)(date('m')); $currentDay = (int)(date('d')); $currentSRYMD = substr($row['jo_number'], 0, 6); $currentYMD = date("ymd"); if ($currentYMD > $currentSRYMD) { $currentSRNum = 1; } else { $currentSRNum += 1; } }//------------------------------------------------------------------------------------------------------------------ $yearMonth = date('ymd'); $currentSR = $currentYMD . sprintf("%03d", $currentSRNum);?> now I want it to be:JO120504001JO120504002JO120504003JO120504004JO120505001JO120504002JO120504003Any help is highly appreciated.Thank you so much
  24. Hi....I have form which I put save function on the last textbox:here is my code: <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><script type="text/javascript" > var input_size = 1;function checkTextBox(bc){ var barcode_ = bc.tabIndex; if ( bc.value.length > input_size ) { for(i=0; i<document.barcode.elements.length; i++) { if( document.barcode.elements[i].tabIndex == (barcode_+1) ) { document.barcode.elements[i].focus(); break; } } } }function postSet() { if (window.event.keyCode==13 || window.event.keyCode==10) { document.getElementById('code_read_box6').disabled = true; save(); alert('code_read_box6'); }} </script><script type="text/javascript">var ajaxTimeOut = null;var ajaxTimeOutOperator = null;var responsePHP; // = "no_reply"var responsePHPOperator;var changeFocus; //= false;var transactionWasSaved;function remoteRequestObject() { var ajaxRequest = false; try { ajaxRequest = new XMLHttpRequest(); } catch(err) { try{ ajaxRequest = new ActiveXObject("MSxml2.XMLHTTP"); } catch(err) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch(err){ // --> change to DOM alert("Not Supported Browser") + err.description; notify('Not Supported Browser.'); return false; } } } return ajaxRequest;}var ajaxRequest; // = remoteRequestObject();var ajaxRequestOperator;</script><script type="text/javascript">function save() { ajaxRequest.onreadystatechange = function () { if (ajaxRequest.readyState==4 && ajaxRequest.status==200) { var result = ajaxRequest.responseText; alert (result); if (result == "failed") { document.getElementById('code_read_box6').disabled = false; document.getElementById('code_read_box6').value = ""; document.getElementById('code_read_box6').focus(); notify("Please scan again."); } if (result == "saved") { alert(result); notify("Transaction has been saved."); reset(); } } } var url = "save_barcode.php"; ajaxRequest.open("POST", url, true);ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");ajaxRequest.setRequestHeader("Content-length", parameters.length);ajaxRequest.setRequestHeader("Connection", "close");ajaxRequest.send(parameters);} </script> </head><body onLoad="document.barcode.code_read_box1.focus();"><form name="barcode" ><input type="text" tabindex="1" id="code_read_box1" value="" onkeyup="checkTextBox(this);"/><br/><input type="text" tabindex="2" id="code_read_box2" value="" onkeyup="checkTextBox(this);"/><br/><input type="text" tabindex="3" id="code_read_box3" value="" onkeyup="checkTextBox(this);"/><br/><input type="text" tabindex="4" id="code_read_box4" value="" onkeyup="checkTextBox(this);"/><br/><input type="text" tabindex="5" id="code_read_box5" value="" onkeyup="checkTextBox(this);"/><br/><input type="text" tabindex="6" id="code_read_box6" value="" onkeyup="checkTextBox(this);" onkeypress="postSet()"/><br/></form></body> </html> I got an error:'ajaxRequest' is null or not an object on line 72It display the error when I press enter on the last textbox.Sorry, I'm not familiar in ajax..I hope somebody can help meThank you
  25. Hi..I need to input data in my textbox by scanning barcode then the data will input to textbox then the cursor focus move to next textbox until it goes to last textbox then save data.How is it possible? here is my sample code: <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone$con = mysql_connect('localhost', 'root','');if (!$con) { echo 'failed'; die();}mysql_select_db("mes", $con);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><script type="text/javascript" > // this variable says how many characters you allow// to input in each textboxvar input_size = 3; function checkTextBox( ct ){ var tab = ct.tabIndex; if ( ct.value.length == input_size ) { for(i=0; i<document.barcode.elements.length; i++) { if( document.barcode.elements[i].tabIndex == (tab+1) ) { document.barcode.elements[i].focus(); break; } } } }; </script> </head><body onLoad="document.barcode.code_read_box1.focus();"><form name="barcode" ><input type="text" tabindex="1" id="code_read_box1" value="" onKeyPress="checkTextBox(this);"/><br/><input type="text" tabindex="2" id="code_read_box2" value="" onKeyPress="checkTextBox(this);"/><br/><input type="text" tabindex="3" id="code_read_box3" value="" onKeyPress="checkTextBox(this);"/><br/><input type="text" tabindex="4" id="code_read_box4" value="" onKeyPress="checkTextBox(this);"/><br/><input type="text" tabindex="5" id="code_read_box5" value="" onKeyPress="checkTextBox(this);"/><br/><input type="text" tabindex="6" id="code_read_box6" value="" onKeyPress="checkTextBox(this);"/><br/></form></body> </html> In that code I use javascript, but the problem in my code is it move to another textbox after i input 3 characters but it did not what I want because i need to use barcode instead of keyboard.I hope somebody can help me.Thank you so much
×
×
  • Create New...