Jump to content

kat35601

Members
  • Posts

    182
  • Joined

  • Last visited

Everything posted by kat35601

  1. Yes the mail is sent to the person I get a "1" both in the email and the echo of $text But on the page I get the full echo of the included page. The output on the page Below( the 1 with Message successfully sent! is what is in the txt or email just a 1) Message successfully sent! 1 Status Orders Total Customer ◃ 3 ▹ 20 Minimal ◃ 11 ▹ 4 Product ◃ 504 ▹ 424 Released ◃ 282 ▹ 511
  2. I want to send an email that includes the results from another page. But it does not work for me. The hello works but the include does not go with the email but it does display on the page that tells me the email was sent. I may also have some code not needed to send the email but this is my first time to use pear mail so I went with there example. <?php require_once "Mail.php"; require_once "Mail/mime.php"; $from = "removed.com"; $to = "removed@txt.att.net"; $subject = "Status\r\n\r\n"; #$text="hello"; $text = include("kf_open_order_status.php"); $html = ""; $crlf = "\n"; $mime = new Mail_mime($crlf); $mime->setTXTBody($text); $mime->setHTMLBody($html); $host = "smtp.gmail.com"; $username = "removed.com"; $password = "removed"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $body = $mime->get(); $headers = $mime->headers($headers); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo(" " . $mail->getMessage() . " "); } else { echo(" Message successfully sent! "); } ?>
  3. echo "<tr><td><a href='kf_orders_entered_detail.php?id=WHAT GOES HERE'>" . $row['ompCreatedBy'] ."</td>"; I can not getting ompCreatedBy to pass from this statement please help me with (WHAT GOES HERE)
  4. Thanks-----The total is not correct. What would be my problem. Produced Today 10-22-2015 Grand Total: 6371.88 Line Item Qty Price UL2 ◃ 110-03 ▹ 4 520.00 UL2 ◃ 115-02 ▹ 194 9,310.06 UL2 ◃ 115-04 ▹ 101 6,361.99 UL2 ◃ 115-05 ▹ 101 7,371.99 UL2 ◃ 115-12 ▹ 8 824.00 UL2 ◃ 171-05 ▹ 3 254.97 UL2 ◃ 175-02 ▹ 1 54.99 UL2 ◃ 175-05 ▹ 2 169.98 UL2 ◃ 175-12 ▹ 48 4,560.00 UL2 ◃ 190-03 ▹ 9 1,170.00 UL2 ◃ 190-12 ▹ 6 618.00 UL2 ◃ 193-02 ▹ 59 2,831.41 UL2 ◃ 193-04 ▹ 37 1,849.63 UL2 ◃ 197-04 ▹ 150 7,498.50 UL2 ◃ 197-05 ▹ 136 8,158.64 UL2 ◃ 269-05 ▹ 4 419.96 UL2 ◃ 269-73 ▹ 1 95.00 UL2 ◃ 275-02 ▹ 59 3,539.41 UL2 ◃ 275-05 ▹ 101 10,098.99 UL2 ◃ 275-12 ▹ 86 9,890.00 UL2 ◃ 405-02 ▹ 2 139.98 UL2 ◃ 485-12 ▹ 2 280.00 UL3 ◃ 175-33 ▹ 33 1,155.00 UL3 ◃ 175-53 ▹ 35 1,225.00 UL3 ◃ 230-53 ▹ 1 42.00 UL3 ◃ 269-76 ▹ 17 935.00 UL3 ◃ 405-50 ▹ 2 90.00 UL3 ◃ 405-60 ▹ 14 770.00 UL3 ◃ 405-FP ▹ 3 90.00 UL3 ◃ 485-01 ▹ 96 4,800.00 UL3 ◃ 485-50 ▹ 81 3,645.00 UL3 ◃ 485-51 ▹ 43 1,720.00 UL3 ◃ 485-52 ▹ 74 1,850.00 UL3 ◃ 485-60 ▹ 18 990.00 <html> <head> <title>Production</title> </head> <body> <style> table { border: 1px solid #B0CBEF; border-width: 1px 0px 0px 1px; font-size: 14pt; font-family: Calibri; font-weight: 100; border-spacing: 0px; border-collapse: collapse; } TH { background-image: url(excel-2007-header-bg.gif); background-repeat: repeat-x; font-weight: normal; font-size: 17px; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; height: 17px; } TD { border: 0px; padding: 0px 4px 0px 2px; border: 1px solid #D0D7E5; border-width: 0px 1px 1px 0px; } TD B { border: 0px; background-color: white; font-weight: bold; } TD.heading { background-color: #E4ECF7; text-align: center; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; } </style> <h1>Kith Furniture </h1> <?php $grandTotal = 0; $connect =odbc_connect("Removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql=" SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) AS DATE ,ISNULL(trans, 'NON') AS trans ,ISNULL(Transactions.item, Snumbers.item) AS item ,count(serial) AS qty ,tuser ,convert(varchar,cast(sum(M1_KF.dbo.PartUnitSalePrices.imhUnitSalePrice) as money),1) as TotalPrice FROM Orbedata.dbo.SNumbers LEFT OUTER JOIN OrbeData.dbo.Transactions ON snum = serial INNER JOIN M1_KF.dbo.PartUnitSalePrices ON Orbedata.dbo.transactions.item = M1_KF.dbo.PartUnitSalePrices.imhPartID WHERE CONVERT(DATE, tdate) = CONVERT(DATE, Getdate()) AND trans = 'fpr' GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) ,ISNULL(trans, 'NON') ,ISNULL(Transactions.item, Snumbers.item) ,tuser ,Orbedata.dbo.transactions.qty order by tuser,item "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo "Produced Today ". date("m-d-Y") ; echo "<table><tr>"; echo "<th>Line</th>"; echo "<th> </th>"; echo "<th>Item</th>"; echo "<th> </th>"; echo "<th>Qty</th>"; echo "<th>Price</th></tr>"; while (odbc_fetch_row($result)) { $scanner=odbc_result($result,"tuser"); $Item=odbc_result($result,"item"); $Qty=odbc_result($result,"qty"); $Price=odbc_result($result,"TotalPrice"); $grandTotal += $Price; echo "<tr><td>$scanner</td>"; echo "<td> ◃ </td>"; echo "<td>$Item</td>"; echo "<td> ▹ </td>"; echo "<td>$Qty</td>"; echo "<td align='right'>$Price</td></tr>"; } echo "Grand Total: $grandTotal"; odbc_close($connect); ?> </body> </html>
  5. I want to get a grand total for the results of price. I do not want to do this in sql I would like to know how to do it in PHP Please. <html> <head> <title>Production</title> </head> <body> <style> table { border: 1px solid #B0CBEF; border-width: 1px 0px 0px 1px; font-size: 14pt; font-family: Calibri; font-weight: 100; border-spacing: 0px; border-collapse: collapse; } TH { background-image: url(excel-2007-header-bg.gif); background-repeat: repeat-x; font-weight: normal; font-size: 17px; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; height: 17px; } TD { border: 0px; padding: 0px 4px 0px 2px; border: 1px solid #D0D7E5; border-width: 0px 1px 1px 0px; } TD B { border: 0px; background-color: white; font-weight: bold; } TD.heading { background-color: #E4ECF7; text-align: center; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; } </style> <h1>Kith Furniture </h1> <?php $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql=" SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) AS DATE ,ISNULL(trans, 'NON') AS trans ,ISNULL(Transactions.item, Snumbers.item) AS item ,count(serial) AS qty ,tuser ,convert(varchar,cast(sum(M1_KF.dbo.PartUnitSalePrices.imhUnitSalePrice) as money),1) as TotalPrice FROM Orbedata.dbo.SNumbers LEFT OUTER JOIN OrbeData.dbo.Transactions ON snum = serial INNER JOIN M1_KF.dbo.PartUnitSalePrices ON Orbedata.dbo.transactions.item = M1_KF.dbo.PartUnitSalePrices.imhPartID WHERE CONVERT(DATE, tdate) = CONVERT(DATE, Getdate()) AND trans = 'fpr' GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) ,ISNULL(trans, 'NON') ,ISNULL(Transactions.item, Snumbers.item) ,tuser ,Orbedata.dbo.transactions.qty order by tuser,item "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo "Produced Today ". date("m-d-Y") ; echo "<table><tr>"; echo "<th>Line</th>"; echo "<th> </th>"; echo "<th>Item</th>"; echo "<th> </th>"; echo "<th>Qty</th>"; echo "<th>Price</th></tr>"; while (odbc_fetch_row($result)) { $scanner=odbc_result($result,"tuser"); $Item=odbc_result($result,"item"); $Qty=odbc_result($result,"qty"); $Price=odbc_result($result,"TotalPrice"); echo "<tr><td>$scanner</td>"; echo "<td> ◃ </td>"; echo "<td>$Item</td>"; echo "<td> ▹ </td>"; echo "<td>$Qty</td>"; echo "<td align='right'>$Price</td></tr>"; } odbc_close($connect); ?> </body> </html>
  6. I want to add Javascript called encode() and show below my results of my page. the barcode should be of $Serial The page works but I do not get a barcode....I don't get any error. This is my first time to try to add a javascript to php <html> <head> <title>Status Screen</title> </head> <body> <?php include 'db.php'; $serial='14417504017'; ?> <link rel="StyleSheet" href="barcode.css" type="text/css" /> <script src="barcode.js"></script> <script type="text/javascript"> function encode() { var strValue = document.getElementById("$serial").value; var strBarcodeHTML = code128(strValue); document.getElementById("barcode").innerHTML = strBarcodeHTML; } </script> </head> <?php //=$_GET["id"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql = $sql_redtag_select; $sql .= $sql_case1; $sql .= $sql_truck; $sql .= " FROM WIP_master left join m1_DC.dbo.SalesOrders on m1_DC.dbo.SalesOrders.ompSalesOrderID=OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID left join m1_DC.dbo.UTRUCK ON m1_DC.dbo.UTRUCK.UTRTRUCKNUMBER=m1_DC.dbo.SalesOrders.UOMPTRUCKNUMBER where OrbeData_KithKitchens.dbo.WIP_master.serial='$serial' and (OrbeData_KithKitchens.dbo.WIP_master.status not in ('1','25','50')) and( redtag='Y' and redtagclosed !='Y' or (redtag='N' and m1_DC.dbo.SalesOrders.uompschedulenumber like 'S%' and m1_DC.dbo.SalesOrders.ompclosed <> -1 ) ) order by OrbeData_KithKitchens.dbo.WIP_master.uompschedulenumber,uomlSorP,upsdescription,jmaPartID "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } ?> <div class="barcode" id="barcode"></div> <?php include ("redtag_serial_results.php"); odbc_close($connect); echo "<script type='text/javascript'>" ,"encode();" , "</script>" ?> </body> </html>
  7. I don't disagree that's why I came here is to get guidance. I am sorry if by asking question I have done something wrong.
  8. or should I use try to use odbc_fetch_row????? What would that look like???
  9. <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $serial=$_POST["serial"]; $connect =odbc_connect("Removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $query= " Select serial from WIP_Master where serial ='$serial' "; $sql=" Update WIP_Master set Status= '2' where serial ='$serial' "; $result =odbc_exec($connect,$query); if (odbc_num_rows($query));{ $result =odbc_exec($connect,$sql); } if(!$result){ trigger_error("Error in SQL".odbc_errormsg()); } odbc_close($connect); sleep(5); $url = 'http://theintranet/kk_update_redtag_lk.php'; header('Location: ' . $url); ?> </body> </html> So this is working but I do want to report "serial not found" if the select statement does not find it or return any rows and return to the url mentioned, is there any other error catching or correcting that I need to do???
  10. So I can't go from my update page to the entry page...I don't want to pass anything I just want to start over.
  11. on this page they will enter the serial number of a repaired item and it will change the status to repaired and let it continue into our system it should then go back to the page to enter the serial number.
  12. <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $serial=$_POST["serial"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $query= " Select serial from WIP_Master where seiral ='$serial' "; $sql=" Update WIP_Master set Status= 5 where seiral ='$serial' and Status='2'"; $result =odbc_exec($connect,$query); if (odbc_num_rows($query)){ $result =odbc_exec($connect,$sql);} else {echo 'Serial Notfound'}; if(!$result){ trigger_error("Error in SQL".odbc_errormsg()); } {echo 'Updated'} odbc_close($connect); sleep(5); $url = 'http://theintranet/kk_update_redtag_lk.php'; header('Location: ' . $url); ?> </body> </html> ok so this might be runnable you think? I added a redirect of sorts to the end.
  13. <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $serial=$_POST["serial"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $query= " Select serial from WIP_Master where seiral ='$serial' "; $sql=" Update WIP_Master set Status= 5 where seiral ='$serial' and Status='2'"; $result =odbc_exec($connect,$query); if (odbc_num_rows($query)){ $result =odbc_exec($connect,$sql);} else {echo 'Serial Notfound'}; if(!$result){ trigger_error("Error in SQL",odbc_errormsg()); } {echo 'Updated'}; odbc_close($connect); sleep(5); ?> </body> </html> Like this???
  14. <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $serial=$_POST["serial"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $query= " Select serial from WIP_Master where seiral ='$serial' "; $sql=" Update WIP_Master set Status= 5 where seiral ='$serial' and Status='2'"; $result =odbc_exec($connect,$query) if (odbc_num_rows($query)){ $result =odbc_exec($connect,$sql);} else {echo 'Serial Notfound'} $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } <h1> Updated</h1> odbc_close($connect); sleep(5); ?> </body> </html> Because I have no clue what I am doing. But I am trying.
  15. <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $serial=$_POST["serial"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $query= " Select serial from WIP_Master where seiral ='$serial' "; $sql=" Update WIP_Master set Status= 5 where seiral ='$serial' and Status='2'"; $result =odbc_exec($connect,$query) if (!mssql_num_rows($query)){ $result =odbc_exec($connect,$sql);} else {echo 'Serial Notfound'} $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } <h1> Updated</h1> odbc_close($connect); sleep(5); ?> </body> </html> Hello I need to check to see if a select statement returns a row if so I then want to run and up date statement. This is as far as I have gotten would you please point me in the right direction. I just can't figure it out.
  16. I need to add to the output of this code a button that will then export the data to a csv file. <html> <head> <title>Status Screen</title> </head> <body> <p> Created RedTags </p> <?php $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql="SELECT uompschedulenumber, uompscheduleColor,jmaPartID,ompSalesOrderID, uomlSorP,serial,rail,panel,stile,upsdescription,itemtype,jmaPartShortDescription , uomlStyleGroup,status , Case when status=10 then 'Created' when status=3 then 'PreSanding' when status=4 then 'PrePaint' else '' end as Status1 FROM WIP_master where redtag='Y' and redtagclosed !='Y' and status=10 order by uompschedulenumber,uomlSorP,upsdescription,jmaPartID "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo "<table cellspacing='10' border='1'><tr>"; echo "<th>PartID</th>"; echo "<th>OrderID</th>"; echo "<th>SorP</th>"; echo "<th>Serial</th>"; echo "<th>Description</th>"; echo "<th>ItemType</th>"; echo "<th>ItemDesc</th>"; echo "<th>StatusDesc</th>"; echo "<th>Schedule</th>"; while (odbc_fetch_row($result)) { $bgcolor= odbc_result($result, "uompscheduleColor"); $jmaPartID= odbc_result($result, "jmaPartID"); $ompSalesOrderID= odbc_result($result, "ompSalesOrderID"); $uomlSorP= odbc_result($result, "uomlSorP"); $serial= odbc_result($result, "serial"); $upsdescription= odbc_result($result, "upsdescription"); $itemtype = odbc_result($result, "itemtype"); $jmaPartShortDescription = odbc_result($result, "jmaPartShortDescription"); $status1 = odbc_result($result, "status1"); $uompschedulenumber=odbc_result($result, "uompschedulenumber"); echo "<tr><td bgcolor=$bgcolor >$jmaPartID</td>"; echo "<td style='text-align:center'>$ompSalesOrderID</td>"; echo "<td style='text-align:center'>$uomlSorP</td>"; echo "<td style='text-align:center'>$serial</td>"; echo "<td style='text-align:center'>$upsdescription</td>"; echo "<td style='text-align:center'> $itemtype</td>"; echo "<td style='text-align:center'>$jmaPartShortDescription</td>"; echo "<td style='text-align:center'>$status1</td>"; echo "<td style='text-align:center'> $uompschedulenumber</td>"; } odbc_close($connect); ?> </body> </html>
  17. I am sorry the first code has been updated to included the field Create_Date which is now a time stamp in our sql database.What I need is how to make a row flash what would be the code for that my output is on an 80"screen and we want to flash rows that are older than 20 hours
  18. Create_Date is a date and time field I want to flash a row if the create_date is 20 hours old <html> <head> <title>Status Screen</title> </head> <body> <p> Open RedTags </p> <?php $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql="SELECT uompschedulenumber, uompscheduleColor,jmaPartID,ompSalesOrderID, uomlSorP,serial,rail,panel,stile,upsdescription,itemtype , uomlStyleGroup,status , Case when status=10 then 'Created' when status=3 then 'PreSanding' when status=4 then 'PrePaint' else '' end as Status1 ,getdate() as Created_Date FROM WIP_master where redtag='Y' and redtagclosed !='Y' order by uompschedulenumber,uomlSorP,upsdescription,jmaPartID "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo "<table cellspacing='10' border='1'><tr>"; echo "<th>PartID</th>"; echo "<th>OrderID</th>"; echo "<th>SorP</th>"; echo "<th>Serial</th>"; echo "<th>Rail</th>"; echo "<th>Panel</th>"; echo "<th>Description</th>"; echo "<th>ItemType</th>"; echo "<th>Stile</th>"; echo "<th>Created</th>"; echo "<th>Status</th>"; echo "<th>StatusDesc</th>"; while (odbc_fetch_row($result)) { $bgcolor= odbc_result($result, "uompscheduleColor"); $jmaPartID= odbc_result($result, "jmaPartID"); $ompSalesOrderID= odbc_result($result, "ompSalesOrderID"); $uomlSorP= odbc_result($result, "uomlSorP"); $serial= odbc_result($result, "serial"); $rail= odbc_result($result, "rail"); $panel= odbc_result($result, "panel"); $stile= odbc_result($result, "stile"); $upsdescription= odbc_result($result, "upsdescription"); $itemtype = odbc_result($result, "itemtype"); $uomlStyleGroup = odbc_result($result, "uomlStyleGroup"); $Created = odbc_result($result, "Created_Date"); $status = odbc_result($result, "status"); $status1 = odbc_result($result, "status1"); echo "<tr><td bgcolor=$bgcolor >$jmaPartID</td>"; echo "<td style='text-align:center'>$ompSalesOrderID</td>"; echo "<td style='text-align:center'>$uomlSorP</td>"; echo "<td style='text-align:center'>$serial</td>"; echo "<td style='text-align:center'> $panel</td>"; echo "<td style='text-align:center'> $stile</td>"; echo "<td style='text-align:center'> $upsdescription</td>"; echo "<td style='text-align:center'> $itemtype</td>"; echo "<td style='text-align:center'>$uomlStyleGroup</td>"; echo "<td style='text-align:center'>$Created</td>"; echo "<td style='text-align:center'>$status</td>"; echo "<td style='text-align:center'>$status1</td>"; } odbc_close($connect); ?> </body> </html>
  19. echo "<td style='text-align:center'><a href='kk_schedule_subreport.php?sn=$uompScheduleNumber&itm=DR'>$PRT_FR</a></td>"; I this code itm=DR what would be the correct syntax for that I tried " and ''' but it did not work.
  20. echo "<td style='text-align:center'><a href='kk_schedule_subreport.php?sn=$uompScheduleNumber&itm=DR'>$PRT_FR</a></td>"; what if I wanted to add a constant like in the example itm='DR' but what would be the correct syntax for that????
  21. on the subreport page would th post look like this???? $uompScheduleNumber=$_POST["$uompScheduleNumber"];
  22. echo "<td style='text-align:center'><a href='subreport1.php?sn=$uompScheduleNumber'>$PRT_FR</a></td>"; That works great how would I add a second parameter $dr_fr??????
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.