Jump to content

newphpcoder

Members
  • Content Count

    186
  • Joined

  • Last visited

Community Reputation

9 Neutral

About newphpcoder

  • Rank
    Member
  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.
×
×
  • Create New...