Jump to content

stvs

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stvs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to make a sales sheet print out listing the sales person and the amount they have sold, then at the bottom give me the overall total of sales that were done. Right now all I have been able to do is pull the sales person name and display each one of there sale amounts for any given week of the year. What I cannot figure out is how do I go about adding up the sales and displaying a total amount at the bottom. I have pasted the below code which currently selects the date range from the sales records and sorts them by the sales person. What I would like to know how to do is add up the total amount of sales and display it at the bottom. Can anyone give me a hand as in what is the right direction to go with this? $date1 = "$month1$day1$year1"; $date2 = "$month2$day2$year2"; $query = "SELECT * FROM payment_info WHERE chargeon1 between '$date1' and '$date2' order by sales_person"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); echo " <b>$num_rows</b> results found for all sales between <b>'$date1'</b> and <b>'$date2'</b><br><br>"; while ($row = mysql_fetch_array($result)) { $sales_person = $row["sales_person"]; $total_amount = $row["total_amount"]; echo " <table> <tr> <td width=150> $sales_person </td> <td width=150> <td width=150> $total_amount </td> <td width=150> <td width=150> $chargeon1 </td> </tr> </table> ";} ?>
  2. I see what my problem is, what I have been trying is very close to what you posted Frost and it does work. However it is not displaying the html in Outlook, but now that I check it on my webmail it shows up just fine. Now I need to see what outlook needs to be displayed the right way. Thank you Frost.
  3. Yes Frost that will send in html, however you do not have any variables to assign in the email from a form. I know how to store data into a mysql database and display results, however I was hoping to not have to create a database just for this form because there will be 5 other forms just asking different questions so the database will be quite large.
  4. Here is the form page, generic for now so I can try and figure this out. I fill out the form and hit submit. It then uses the code I listed above to generate and send out the email. It works, but the email is in plain text. I wish to have it send an email in html so I can format it with a table and 2 colums for the data to line up and look nicer. Generic form at the moment [code] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title></title> <meta name="description" content=""> </head> <body> <form method="post" action="send.php"> <table border=0 summary=""> <tr> <td width="300">First Name:</td> <td><input type="text" name="firstname" size="25" maxlength="40"> </td> </tr> <tr> <td width="300">Last Name:</td> <td><input type="text" name="lasttname" size="25" maxlength="40"> </td> </tr> <tr> <td width="300">Phone:</td> <td><input type="text" name="phone" size="15" maxlength="15"> </td> </tr> </table> <br><br> <table border=0 summary=""> <tr> <td><b>Work Settings</b></td> <td> </td> </tr> <tr> <td width="300">General Acute Care</td> <td><select name="GeneralAcuteCare"> <option value=""></option> <option value="Theory, no practice"> Theory, no practice</option> <option value="Intermittent experience"> Intermittent experience</option> <option value="Experienced"> Experienced</option> <option value="Supervise and Teach"> Supervise and Teach</option> </select> </td> </tr> <tr> <td width="300">Home Health</td> <td><select name="HomeHealth"> <option value=""></option> <option value="Theory, no practice"> Theory, no practice</option> <option value="Intermittent experience"> Intermittent experience</option> <option value="Experienced"> Experienced</option> <option value="Supervise and Teach"> Supervise and Teach</option> </select> </td> </tr> <tr> <td width="300">Skilled Nursing Facility</td> <td><select name="SkilledNursingFacility"> <option value=""></option> <option value="Theory, no practice"> Theory, no practice</option> <option value="Intermittent experience"> Intermittent experience</option> <option value="Experienced"> Experienced</option> <option value="Supervise and Teach"> Supervise and Teach</option> </select> </td> </tr> <tr> <td width="300">Out patient Clinic</td> <td><select name="OutpatientClinic"> <option value=""></option> <option value="Theory, no practice"> Theory, no practice</option> <option value="Intermittent experience"> Intermittent experience</option> <option value="Experienced"> Experienced</option> <option value="Supervise and Teach"> Supervise and Teach</option> </select> </td> </tr> </table> <table> <tr> <td><b>Comments:</b></td> </tr> <tr> <td><textarea name="comments" cols="80" rows="10"> </textarea> </td> </tr> </table> <div align="right"> <input type="submit" value="Submit"> </div> </form> </body> </html> [/code]
  5. Ok this has been a little trickier then I had expected, currently I have a form that when submitted it just sends a regular email in plain text with all the information. However I would like to be able to format the email so it is more organized with a table that contains the submitted information. However all the tutorials I have gone over does not show how to pull information from the form fields and put them in the html message itself. They just show how to send an email in html format without any form data. My current code below is what I have been experimenting with and just sends plain text. Can anyone give me some assistance as to how to have the form data submit in html? <? $firstname = $_POST["firstname"]; $lastname = $_POST["lastname"]; $phone = $_POST["phone"]; $GeneralAcuteCare = $_POST["GeneralAcuteCare"]; $HomeHealth = $_POST["HomeHealth"]; $SkilledNursingFacility = $_POST["SkilledNursingFacility"]; $OutpatientClinic = $_POST["OutpatientClinic"]; $comments = $_POST["comments"]; $to = "steve@domain.com"; $from = "test@domain.com"; $subject = "Skills Checklist"; $message ="Name: $firstname \n"; $message .="Phone: $phone \n\n"; $message .="General Acute Care: $GeneralAcuteCare \n"; $message .="Home Health: $HomeHealth \n"; $message .="Skilled Nursing Facility: $SkilledNursingFacility \n"; $message .="Out patient Clinic: $OutpatientClinic \n\n"; $message .="Comments: $comments \n"; if($comments != "") { //send mail - $subject & $contents come from surfer input mail($to, $from, $subject, $message); // redirect back to url visitor came from header("Location: http://www.website.com/success.php"); } else { print(" error "); } ?> I have tried adding the content type and mime version to the headers. As per some examples I tried to insert the $firstname into the html code for the message and it does not pull the data. I then tried to echo the data and that did not work either.
×
×
  • 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.