Jump to content

elentz

Members
  • Posts

    228
  • Joined

  • Last visited

Everything posted by elentz

  1. I actually have a form that pretty much does what I want except that I can only scan one barcode at a time and then I need to reset the form. That is tedious, I am looking for a way to mimic what the Access form does. It is a form within a form that will continously add new records as long as I continue to scan codes and do a CR at the end. I definitely want to get away from Access Thanks
  2. I need a form that has only three fields that will enter data into a Mysql table. The three fields are a Date, a numeric field that will be a link number used to link the table fields to a customer name. The third will be an entry from a scanner (barcode). What I want to do is initially enter the date, then a customer number (would be nice if I could use a dropdown to get this number). I will typically need to scan several items at a time that I want to enter as single records, each with the date, customer number and then the barcode. I am doing this with a MSAccess DB and I want to get away from it and use PHP and Mysql. Can someone suggest how I can do this? Thanks alot
  3. I have a text file that will always have the same format. It is like this: Station Message Detailed Recording 20:56:29 02-21-2008 TYP EXT# TRUNK DIALED DIGITS START ELAPSED COST ACCOUNT CODE IN 1011 94002 14:44 00:00:26 $00.00 NET 1001 P6011 1101 14:47 00:00:07 $00.00 NET 1001 P6011 1105 14:47 00:01:00 $00.00 IN 1000 94001 14:48 00:00:31 $00.00 The first two lines I need to manipulate. I need to get the date (end of first line)in a variable and then strip the rest of the first two lines out. Then I need to insert each line into different fields into a MySql table. I know enough that I know I need to open the file and read it. But how do I do the manipulating? Thanks for any suggestions.
  4. That ',' was exactly the issue! Thank you very much you made my day! I love this forum!
  5. I have some code that updates a table in a Mysql DB. The table fields are decimal 8,2. If I interrupt the update to the table and echo the variable $formatnet_total I get 2,395.23. If I let it update the table I get 2 in the field. What is happening here? $sql = 'SELECT SUM((vtiger_inventoryproductrel.quantity) * (vtiger_inventoryproductrel.listprice))' . ' from vtiger_inventoryproductrel' . ' where vtiger_inventoryproductrel.id = '.$id.''; $result = mysql_query($sql,$conn); $mytotal = mysql_fetch_row($result); $formatnet_total=number_format($mytotal[0],2,'.',','); $sql4 ="Update vtiger_invoicecf SET cf_602 = '$mitax', cf_610 = '$formatnet_total' where invoicei = '$id'"; $result = mysql_query($sql4) or die(mysql_error() . "<p>With Query<br>$sql4"); Thanks for looking!
  6. in other words a NOOBIE issue thanks alot guys that got me working.
  7. You guys are quick!!!! I haven't tried it yet, but what was the "Catch"?
  8. I have the code below. It won't do the update, all I get is a blank page and no update to my table. I know mu variables $mitax and $formatnet_total is correct since I can echo them to the page. Where have I mucked this up? $sql4 ="Update vtiger_invoicecf SET 'cf_602' = '$mitax', 'cf_604' = '$formatnet_total' where vtiger_invoicecf.invoice = '$id'"; $result = mysql_query($sql4) or die("Error in Query result"); Thanks
  9. I'm just brain storming now about this. What if I had hylafax setup on the server, and told php to use it as a printer. I just read that gfax will let you use Hylafax as a printer. Thanks
  10. I have a script that creates a PDF , I have also figured out how to use PHPMailer to email that PDF as an attachment. Now I want to install a Fax modem in to my Ubuntu machine and Fax that PDF whenever I want. Can this be done? If so How? Thanks alot
  11. DOH! I guess I need bigger font or better glasses! Thanks for seeing that!
  12. I must not be explaining what I need to do correctly. In the code I provided I have a IF/else : if($usebilltoemail == 1) {$sendemailto = $mainemail} else {$sendemailto = $emailto;} What I needed the above to do was give me a way to change the sendemailto to different addresses. When I tried to use the above code everything failed, do I have some syntax error? Thanks
  13. First of all the code I am going to paste here is just for show. I got phpmailer working mostly the way I want it, I just need help with if / else statements. I have a if /else statement that will determine if I want to email the pdf or download it and this is working fine. What I can't figure out is how to change the variables within the if statement to send the email. Such as IF $sendtobilltoemail ==1 ($variable1 = $variable 2) else $variable1 = $variable3 I have a couple of these types of things I need to do within the statement to send the pdf as an email //*********if / Else statement to send email to the Bill TO email address or a user input email address ******** //if($usebilltoemail == 1) {$sendemailto = $mainemail} //else {$sendemailto = $emailto;} //******if /Else to determine whether to send the pdf in a email or not ******** if($emailpdf == 1){ //****************Code to create the PDF as a string variale so it can be emailed *********** $pdf->Output("","S"); $doc = $pdf->Output("","S"); //*******************Setup and send the PDF as an attachment*************** require("/var/customstuff/PHPMailer/class.phpmailer.php"); //$mail->PluginDir = "/var//PHPMailer"; $mail = new PHPMailer(); $mail->From = "sales@comm.biz"; $mail->FromName = (" Sales Dept."); $mail->AddAddress("$emailto"); $mail->AddReplyTo("sales@comm.biz" ); $mail->Subject = ("Here is the proposal you requested."); $mail->Body = "Hello, $contact_name Please read over the enclosed proposal. I have also included a brochure about our company. If you have any questions Please contact me. Thank you very much for this opportunity! Sincerely, $salesman ; $mail->AddStringAttachment($doc,"Proposal # $quote_id.pdf","base64","MIME"); $mail->AddAttachment("/var/www/include/Quote_attachments/CQI_Brochure.pdf","CQI Brochure.pdf"); //Adds a file to the email automatically if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "The Proposal has been sent, use your back button to return to the last page."; } else { // ****************** Code to create the pdf to be downloaded ******************************* $pdf->Output('Proposal # '.$quote_id.' For '.$account_name.'.pdf','D'); } ?> Can someone show me an example of how to do this? Thanks alot
  14. sorry for the double post. noone else has had this huh?
  15. I am new to PHPmailer and I have run into a problem. I have tried all I know and I keep getting this error: Mailer Error: Language string failed to load: instantiate Here's my code: -- $sql = "SELECT Vtiger_quotescf.quoteid, Vtiger_quotescf.cf_530, vtiger_quotescf.cf_554, vtiger_quotescf.cf_556, vtiger_quotescf.cf_558, vtiger_quotescf.cf_560 FROM vtiger_quotescf Inner Join vtiger_quotes ON vtiger_quotes.quoteid = vtiger_quotescf.quoteid WHERE vtiger_quotes.quoteid = '$quote_id'"; $result=mysql_query($sql); $row=mysql_fetch_assoc($result); //$quote_id = $row['$quote_id']; $specialinstructions=$row['cf_530']; $emailpdf=$row['cf_554']; $emailto=$row['cf_556']; $emailfrom=$row['cf_558']; $salesperson=$row['cf_560']; //****************Code to create the PDF as a string variale so it can be emailed *********** $pdf->Output("","S"); $doc = $pdf->Output("","S"); //*******************Setup and send the PDF as an attachment*************** require("/var/www/cqicrm5/customstuff/PHPMailer/class.phpmailer.php"); $mail->PluginDir = "/var/www/cqi/PHPMailer"; $mail = new PHPMailer(); $mail->From = $emailfrom; $mail->FromName = ("CommuniQuest Sales Dept."); $mail->AddAddress($emailto); $mail->AddReplyTo("sales@comm.biz","Sales Dept." ); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->Subject = ("Here is the proposal you requested."); $mail->Body = ("The proposal you requested is inclosed. Please contact us with any questions you may have. Thank you for considering us."); $mail->AddStringAttachment($doc,"Proposal # $quote_id","base64","MIME"); if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "The Proposal has been sent"; I have the language file in a languages folder in the PHPMailer folder. If I manually enter the To , From and the Reply the email is sent perfectly. Can someone take a look at this and tell me what I have wrong? Thank you very much Ed
  16. Thank you I'll give it a shot Ed
  17. am new to PHPmailer and I have run into a problem. I have tried all I know and I keep getting this error: Mailer Error: Language string failed to load: instantiate I am getting the To From and Reply to email addys from a MySQL DB table Here's my code: -- $sql = "SELECT Vtiger_quotescf.quoteid, Vtiger_quotescf.cf_530, vtiger_quotescf.cf_554, vtiger_quotescf.cf_556, vtiger_quotescf.cf_558, vtiger_quotescf.cf_560 FROM vtiger_quotescf Inner Join vtiger_quotes ON vtiger_quotes.quoteid = vtiger_quotescf.quoteid WHERE vtiger_quotes.quoteid = '$quote_id'"; $result=mysql_query($sql); $row=mysql_fetch_assoc($result); //$quote_id = $row['$quote_id']; $specialinstructions=$row['cf_530']; $emailpdf=$row['cf_554']; $emailto=$row['cf_556']; $emailfrom=$row['cf_558']; $salesperson=$row['cf_560']; //****************Code to create the PDF as a string variale so it can be emailed *********** $pdf->Output("","S"); $doc = $pdf->Output("","S"); //*******************Setup and send the PDF as an attachment*************** require("/var/www/cqicrm5/customstuff/PHPMailer/class.phpmailer.php"); $mail->PluginDir = "/var/www/cqi/PHPMailer"; $mail = new PHPMailer(); $mail->From = $emailfrom; $mail->FromName = ("CommuniQuest Sales Dept."); $mail->AddAddress($emailto); $mail->AddReplyTo("sales@comm.biz","Sales Dept." ); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->Subject = ("Here is the proposal you requested."); $mail->Body = ("The proposal you requested is inclosed. Please contact us with any questions you may have. Thank you for considering us."); $mail->AddStringAttachment($doc,"Proposal # $quote_id","base64","MIME"); if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "The Proposal has been sent"; I have the language file in a languages folder in the PHPMailer folder. If I manually enter the To , From and the Reply the email is sent perfectly. Can someone take a look at this and tell me what I have wrong? Thank you very much Ed
  18. I have a script that was done by someone else that I want to add to. By itself it only produces a PDF that is offered as a download. What I want is to add some code at the end of the script that will do something like offer two buttons that will "route" the script to either one section of the script or the other and then end the script. All it needs to be is very simple. Can someone show me an example on how to do this? Thanks
  19. DOH! Musta been too tired. Thanks for the help!
  20. I keep getting this instead of a result of the following code: $sql3 = "SELECT vtiger_invoicecf.cf_546, vtiger_invoice.invoiceid FROM vtiger_invoice Inner Join vtiger_invoicecf ON vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid WHERE vtiger_invoice.invoiceid = '$myvar'"; $refno=mysql_query($sql3); // ************* Begin Top-Right Header *************** // title $titleBlock=array("147","7"); $pdf->title( "Invoice","", $titleBlock ); //$soBubble=array("168","17","12"); //$pdf->addBubbleBlock($so_name, "Albar�n", $soBubble); //$poBubble=array("130","17","12"); //$pdf->addBubbleBlock($po_name, " Cust. P.O.", $poBubble); $wobubble=array("130","17","12"); $pdf->addBubbleBlock($refno,"Work/Quote #",$wobubble); I should get a number for the $refno variable an I keep getting a "Resource id #335" instead. Can someone give me a clue? Thanks alot
  21. Sorry, The problem is: I can't get the variable from the first page to the end of the query in the second page. The code I have for the first page is <title>Pricebook / Pricing Worksheet</title> <style type="text/css"> <!-- .head1 {background: #CC9933; height:32px; color: #FFFFFF; font-size: 10pt; font-weight: 500=medium; text-align: center} .sub1 {background: #C8B588; height:22px; color: #FFFFFF; font-size: 9pt; font-weight: 500=medium; text-align: center} .data1 {background: #ffffCC} .data2 {background: #ffffCC} /* End of style section. Generated by AceHTML at 16/08/03 10:14:34 */ --> </style> </head> <BODY> <H4>Trouble Ticket Print page </h4> <H4>Enter the Trouble Ticket number that you want to print.</h4> <H4>Press the Enter Key after you make the entry.</h4> <h4></h4> <form action=/customstuff/tickets/tutorial/ticket.php method=post> Ticket #:<input type=text name="ticketid"> </form> <?PHP //****************************************************** // Connection to the Database //****************************************************** $conn = mysql_connect("localhost", "admin", "9axmy425"); mysql_select_db ('vtigercrm50',$conn); //****************************************************** include ('baaGrid.php'); $querystring=$sql = 'SELECT' . ' vtiger_troubletickets.ticketid,' . ' vtiger_account.accountname,' . ' vtiger_accountshipads.ship_city,' . ' vtiger_ticketcf.cf_544' . ' FROM' . ' vtiger_account' . ' Inner Join vtiger_troubletickets ON vtiger_troubletickets.parent_id = vtiger_account.accountid' . ' Inner Join vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid' . ' Inner Join vtiger_accountshipads ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid' . ' WHERE' . ' \'\' = \'\'' . ' ORDER BY' . ' vtiger_troubletickets.ticketid DESC' . ' LIMIT 20' . ' '; $grid = new baaGrid ($querystring); $grid->showErrors(); // just in case $grid->setHeadings("Ticket #,Customer,City,Type of call"); $grid->display(); ?> </BODY> </html> The second page I need the $_POST to be inserted into the where clause of the query so it picks the right record out of the tables. Here is most of the second page $sql = 'SELECT' . ' vtiger_account.accountname,' . ' vtiger_troubletickets.ticketid,' . ' vtiger_troubletickets.priority,' . ' vtiger_troubletickets.severity,' . ' vtiger_troubletickets.description,' . ' vtiger_accountscf.cf_472,' . ' vtiger_accountscf.cf_476,' . ' vtiger_ticketcf.cf_534,' . ' vtiger_ticketcf.cf_536,' . ' vtiger_ticketcf.cf_538,' . ' vtiger_ticketcf.cf_540,' . ' vtiger_accountscf.cf_464,' . ' vtiger_accountscf.cf_478,' . ' vtiger_accountscf.cf_468,' . ' vtiger_accountscf.cf_484,' . ' vtiger_accountscf.cf_486,' . ' vtiger_account.phone,' . ' vtiger_accountshipads.ship_street,' . ' vtiger_accountshipads.ship_city,' . ' vtiger_accountshipads.ship_code,' . ' vtiger_accountshipads.ship_state' . ' FROM' . ' vtiger_account' . ' Inner Join vtiger_accountscf ON vtiger_account.accountid = vtiger_accountscf.accountid' . ' Inner Join vtiger_troubletickets ON vtiger_accountscf.accountid = vtiger_troubletickets.parent_id' . ' Inner Join vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid' . ' Inner Join vtiger_accountshipads ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid' . ' WHERE' . ' vtiger_troubletickets.ticketid = '\"$_POST["ticketid"]"\''; [color=red][font=Verdana]//' vtiger_troubletickets.ticketid = \'17273\''[/font][/color] The line in red is a line I used to test the rest of my code for the second page. It produces a PDF. Thanks I hope I have explained my problem.
  22. Thanks for the link I got the first page to pass the variable, I tested it to a test page just like the tutorial. But, I can't get the post to go to the variable I need for my query. h4></h4> <form action=/customstuff/tickets/tutorial/ticket.php method=post> Ticket #:<input type=text name="ticketid"> </form> Then here is part of the query I need the post to go to . ' Inner Join vtiger_accountshipads ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid' . ' WHERE' . ' vtiger_troubletickets.ticketid = '\"$_POST["ticketid"]"\''; I am sure it is a simple syntax problem but I just don't understand some of the intricies here. Can some one help me?
  23. I have a simple 1 field page that I want to take the input from that field and pass it to a variable on another page. Can someone point me to a tutorial or show me some code to get this done? Thanks Alot!
  24. Thank you all very much your suggestions got me over my hump!! Have a great weekend!
  25. Thanks wildteen for the speedy reply. That got the whole array, now how do I selectively show the fields I want? Lets say I want to show cf_476 and ticketid. What I need is to be able to put those individual results into a cell in the pdf. Thanks
×
×
  • 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.