<html>
<head>
<title>Search</title>
<link rel="stylesheet" type="text/css" href="PrintMeThatLabel.css" />
<script src = "cookie.js" type="text/javascript"> </script>
<script src = "jquery-1.4.3.min.js" type="text/javascript"> </script>
<script src = "http://www.labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.3.0.js" type="text/javascript" charset="UTF-8"> </script>
<script src = "PrintMeThatLabel2.js" type="text/javascript" charset="UTF-8"> </script>
<style type=text/css>
.text {color: #000; font-family:Arial, Helvetica, sans-serif }
.head {color: #000; font-family:Arial, Helvetica, sans-serif }
.input {display:none;}
.tftable {font-size:12px;color:#333333;width:100%;border-width: 1px;border-color: #729ea5;border-collapse: collapse;}
.tftable th {font-size:12px;background-color:#acc8cc;border-width: 1px;padding: 8px;border-style: solid;border-color: #729ea5;text-align:left;}
.tftable tr {background-color:#d4e3e5;}
.tftable td {font-size:12px;border-width: 1px;padding: 8px;border-style: solid;border-color: #729ea5;}
.tftable tr:hover {background-color:#ffffff;}
</style>
</head>
<body>
<div class=text align="center">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" >
<span class=text>Enter Work Order #: </span>
<input type="text" name="Work_Order" length="30" value="">
<input type="submit" name="submit" value = "Search">
</form>
</div>
<div id="wrapper">
<div class='labelDesignArea'>
<label for="printersSelect">Printer:</label>
<select id="printersSelect"></select>
<button id="printButton">Print</button>
<div class='printerSettings'>
<a href='javascript:void(0)' style='visibility: hidden' id='printerSettingsButton'>Printer location (url)</a>
<div style='visibility: hidden'id='printerSettingsDiv'>
<label style='visibility: hidden' for='printerUriTextBox'></label>
<input style='visibility: hidden' type='text' id='printerUriTextBox'></input>
<button style='visibility: hidden' id='addPrinterUriButton'>Add</button>
<button style='visibility: hidden'id='clearPrinterUriButton'>Clear</button>
</div>
</div>
</div>
</div>
<?php
ini_set("display_errors",1);
error_reporting(E_ALL);
if(isset($_POST['submit']))
{
$UsrWorkOrder = $_POST['Work_Order'];
//db connect info
include 'conn.php';
//Where the query are stored
include 'Query.php';
$result_Vis = odbc_exec($conn_Vis,$sql_Vis); // Get Data From Result
while($row2 = odbc_fetch_array($result_Vis))
{
//Store the data in the new array
$result_cor1db01_2 = odbc_exec($conn_cor1db01_2,$sql_cor1db01_2); // Get Data From Result
$json = array();
echo "<div><table class='tftable'><tbody><tr>";
Echo "<tr><th>Work Order</th><th>Part Number</th><th>Description</th><th>Mfg Lot Number</th><th>Cable Length</th><th>Test Results A</th><th>Test Results B</th></tr>";
$num_rows = odbc_num_rows($result_cor1db01_2);
while($row3 = odbc_fetch_array($result_cor1db01_2))
{
//This stores the data
$Barcode = $row3["Work Order No"]."-". $row3["Serial No"];
$part = $row2["PART_X"];
$DESCR = $row2["DESCR_X"];
$MFG = $row3["Work Order No"]."-". $row3["Serial No"];
$Cable_Length = $row3["ValueInches"];
IF(number_format($row3["Value1"],2)[0] < "1"){
$Test_A = substr(number_format($row3["Value1"],2), 1);
}Else{
$Test_A = number_format($row3["Value1"],2);
}
IF(number_format($row3["Value2"],2)[0] < "1"){
$Test_A = substr(number_format($row3["Value2"],2), 1);
}Else{
$Test_A = number_format($row3["Value2"],2);
}
// put all the data in to a json array for batch printing labels.
$json []= array (
'Barcode' => $Barcode,
'part' => $part,
'DESCR' => $DESCR,
'MFG' => $MFG,
'Cable_Length' => $Cable_Length,
'Test_A' => $Test_A,
'Test_B' => $Test_B
);
// Echo "<br><br><img src=barcode.php?codetype=Code128B&size=80&text=".$row3["Work Order No"]."-". $row3["Serial No"] ." />";
Echo "<td>".$row3["Work Order No"]."-". $row3["Serial No"]."</td>";
Echo "<td>".$part."</td>";
Echo "<td>".$DESCR."</td>";
Echo "<td>" .$row3["Work Order No"]."-". $row3["Serial No"]."</td>";
Echo "<td>". $row3["ValueInches"]."</td>";
IF(number_format($row3["Value1"],2)[0] < "1"){
Echo "<td>".substr($row3["SS1"], -1)." " .substr(number_format($row3["Value1"],2), 1)."</td>";
}Else{
Echo "<td>".substr($row3["SS1"], -1)." " .number_format($row3["Value1"],2)."</td>";
}
IF(number_format($row3["Value2"],2)[0] < "1"){
Echo "<td>".substr($row3["SS2"], -1)." " .substr(number_format($row3["Value2"],2), 1)."</td> ";
}Else{
Echo "<td>".substr($row3["SS2"], -1)." " .number_format($row3["Value2"],2)."</td>";
}
echo "<td > <input type='button' id='bt_".$row3["Serial No"]."' type='submit' value='Print ME'></td></tr>";
//Echo "Test Results: ".substr($row3["SS1"], -1)." " .number_format($row3["Value1"],2)."<br>";
//Echo "Test Results: ".substr($row3["SS2"], -1)." " .number_format($row3["Value2"],2)."<br>";
}
echo "<br>".$num_rows ." Rows<br><br>";
Echo "</tbody></table></div>";
}
?>
<script type="text/javascript">
$("input").click(function() {
alert(this.id);
});
</script>
<?php
odbc_close($conn_cor1db01_2);
odbc_close($conn_Vis);
}
?>
<!-- This is storing the Json data then this gets pulled in to the PrintMeThatLabel.js -->
<input type='hidden' value='<?php echo json_encode($json); ?>' name='mike' id='mike'></input>
</body>
</html>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.