rsammy Posted January 22, 2007 Share Posted January 22, 2007 i am working on an email module in a patient application. i have some info on the email body (which is displayed as a message blob) apart from 'To' 'From' and 'Subject'. I also have reply and forward buttons. i need to send the logic to the same page, compose.php when either reply or forward is clicked. haviing said that, i need to display the original message (distinguish it with some mark or something -just as in outlook or hotmail) which cannot be edited while leaving some space for the new message!how is this possible?this is my code...[code] <form name="viewMessages" method="post" action="view.php"> <p><br> </p> <table width="681" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16"><img src="images/clear.gif" width="10" height="15"></td> <td width="601" bgcolor="#0099CC"> <div align="right"> <input type="hidden" name="mess_id" value="<?PHP print($rowdisplay["ID"]); ?>"> <input type="hidden" name="m1" value="<?PHP print("$m1"); ?>"> <input type="hidden" name="d1" value="<?PHP print("$d1"); ?>"> <input type="hidden" name="y1" value="<?PHP print("$y1"); ?>"> <input type="hidden" name="m2" value="<?PHP print("$m2"); ?>"> <input type="hidden" name="d2" value="<?PHP print("$d2"); ?>"> <input type="hidden" name="y2" value="<?PHP print("$y2"); ?>"> <input type="hidden" name="messagevariable" value="<?PHP print("$messagevariable"); ?>"> <input class="sbttnW" type="submit" name="forward" value="Forward"> <input class="sbttnW" type="submit" name="reply" value="Reply"> </div> </td> <td width="64"><img src="images/clear.gif" width="25" height="15"></td> </tr> <td width="16"> </td> <td> <table width="601" border="1" cellspacing="0" cellpadding="0" bordercolor="#0099CC"> <tr> <td width="597"> <table width="597" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"> </td> <td width="85"> </td> <td width="270"> </td> <td width="212"> </td> <td width="37"><img src="images/clear.gif" width="10" height="15"></td> </tr> <tr> <td width="15"> </td> <td width="85"> <div align="left"><b>From:</b></div></td> <!--<td colspan="2"> <?PHP print($rowdisplay["from_p"]); ?> </td>--> <td colspan="2"> <?PHP $queryfrom = "SELECT user_fname, user_lname, user_email FROM user_mgr WHERE user_email='$from_p' "; //echo "$query"; $resultfrom = mysql_query($queryfrom); $rowfrom = mysql_fetch_array($resultfrom); //print($queryfrom); $fname= $rowfrom["user_fname"]; $lname=$rowfrom["user_lname"]; //$uname = $user_fname ." ". $user_lname; $uname = $fname ." ". $lname; print ($uname); ?> </td> <td width="37"> </td> </tr> <tr> <td> </td> <td><b>To:</b></td> <!--<td colspan="2"><? print($rowdisplay["to_email"]); ?></td>--> <td colspan="2"> <?PHP $queryto = "SELECT user_fname, user_lname, user_email FROM user_mgr WHERE user_email='$to_email'"; $resultto = mysql_query($queryto); $rowto = mysql_fetch_array($resultto); $tofname= $rowto["user_fname"]; $tolname=$rowto["user_lname"]; $toname = $tofname ." ". $tolname; print ($toname); ?> </td> <td> </td> </tr> <tr> <td width="15"> </td> <td width="85"> <div align="left"><b>Received:</b></div></td> <!--<td colspan="2"> <?PHP print($rowdisplay["date"]); ?> </td>--> <td colspan="2"> <?PHP print($rowdisplay["date"]." ".$rowdisplay["time_sent"] . " ET"); ?> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> <div align="left"><b>Subject:</b></div></td> <td colspan="2"> <?PHP print($rowdisplay["subject"]); ?> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> <div align="left"><b></b></div></td> <td width="270"> </td> <td width="212"> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> <div align="left"><b>Message:</b></div></td> <td colspan="2" rowspan="4" align="left" valign="top"> <?PHP print($rowdisplay["message"]); ?> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> </td> <td width="37"> </td> </tr> <tr> <td width="15"> </td> <td width="85"> </td> <td width="37"> </td> </tr> </table> </td> </tr> </table> </td> <td width="64"><img src="images/clear.gif" width="10" height="15"></td> </tr> </table> </form> </td> </tr> <tr> <td colspan="2"><div align="center"> <? if ($visit_type == ICN) { if ($dcn_posted_for_billing =="No") { if ($dcn_approved_for_billing =="No") { $requestforApproval='Yes'; print(" <br> <input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='main.php?mess_id=$mess_id&m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2&requestforApproval=$requestforApproval&mesgtran_ID=$mesgtran_ID'\"> "); } } } ?> </div></td> </tr> <tr> <td colspan="3" height="2"><div align="center"><br><br> <!--<input class="sbttn" type="submit" name="print" value="Print Friendly">--> <? print(" <br> <input class='sbttn' type='submit' name='action' value='Print Friendly' onClick=\"location.href='printMCtemplate.php?mess_id=$mess_id&m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2'\"> "); ?> </div></td> <td width="67"> </td> </tr></table>[/code] Quote Link to comment Share on other sites More sharing options...
rsammy Posted January 22, 2007 Author Share Posted January 22, 2007 forgot to show this:here is how the email body is: From: Barbara Ueckert To: Office Manager Received: 01/16/2007 3:58 PM ET Subject: Jack Jones - ICN Message: PATIENT NAME: Jack JonesVISIT DATE: 1/16/07PATIENT #: 123456789DOB: 03/18/1945SEX: MalePREF PROVIDER: Barbara UeckertREF #: STATUS: FollowVISIT TIME: 12:55 PMATTENDING PROVIDER: Barbara UeckertLOCATION: City Gen. Emgcy FacilityDIAGNOSIS: 10-19% Bdy Brn/10-19% 3d - 948.11PROCEDURE: 1 stage mohs, up to 5 spec - 17304;Ablate heart dysrhythm focus - 93651TRANSACTION ID: 5967886 Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 22, 2007 Share Posted January 22, 2007 I didn't fully undertand your question, rephrase it. Quote Link to comment Share on other sites More sharing options...
rsammy Posted January 22, 2007 Author Share Posted January 22, 2007 this is my email screen on view.php:From: Barbara Ueckert To: Office Manager Received: 01/16/2007 3:58 PM ET Subject: Jack Jones - ICN Message: PATIENT NAME: Jack JonesVISIT DATE: 1/16/07PATIENT #: 123456789DOB: 03/18/1945SEX: MalePREF PROVIDER: Barbara UeckertREF #: STATUS: FollowVISIT TIME: 12:55 PMATTENDING PROVIDER: Barbara UeckertLOCATION: City Gen. Emgcy FacilityDIAGNOSIS: 10-19% Bdy Brn/10-19% 3d - 948.11PROCEDURE: 1 stage mohs, up to 5 spec - 17304;Ablate heart dysrhythm focus - 93651TRANSACTION ID: 5967886 now, i have a forward button on the screen too, along with a reply button! when i hit them, i shud go to the next screen(compose.php) and i shud be abel to choose the recipient of this forwarded email. at the same time, i will still need to retain the original email and them be able to add some more text to it. the way this page works now is, i am not carrying over the message text(email body) to the next page(compose.php). the message is stored in the database in a blob! how do i carry the message over to the next page and then enable additional lines of text being added to the text on the next page?currently, i am able to display the recipient(drop down field with actual recipient selected by default), senders name, date and time messge was received and Subject. but, the message blob is not displayed. i need t odisplay this blob as well as be able to alter/add more lines of text to it. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Put the message in a session variable and use it on the next page. Quote Link to comment Share on other sites More sharing options...
rsammy Posted January 22, 2007 Author Share Posted January 22, 2007 can u explain in detail please? im not too good in php! do u mean post/get? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 No, I mean SESSION. Quote Link to comment Share on other sites More sharing options...
rsammy Posted January 22, 2007 Author Share Posted January 22, 2007 say something like - $_SESSION['message']=$message;????and then call this in the next screen by using a post? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Yes. You need to have session_start() at the top of every page. Quote Link to comment Share on other sites More sharing options...
rsammy Posted January 22, 2007 Author Share Posted January 22, 2007 tried it. it doesnt work! here is wat im doing...i am executing this query to get the messagevariable:*************$querydisplay = "SELECT messages.message, messages.user_id, messages.status, messages.from_p, messages.subject, DATE_FORMAT(messages.received, '%m/%d/%Y') as date, messages.ID, messages.to_email, messages.time_sent, messages.grp_id, messages.tran_ID FROM messages WHERE messages.ID='$mess_id' AND messages.request !='settodelete'"; $resultdisplay = mysql_query($querydisplay); $num_rows = mysql_num_rows($resultdisplay); $rowdisplay = mysql_fetch_array($resultdisplay); $from_p = $rowdisplay["from_p"]; $to_email = $rowdisplay["to_email"]; $mesgtran_ID = $rowdisplay["tran_ID"]; $messagevariable = $rowdisplay["message"];***************[code] <tr> <td width="16"><img src="images/clear.gif" width="10" height="15"></td> <td width="601" bgcolor="#0099CC"> <div align="right"> <input type="hidden" name="mess_id" value="<?PHP print($rowdisplay["ID"]); ?>"> <input type="hidden" name="m1" value="<?PHP print("$m1"); ?>"> <input type="hidden" name="d1" value="<?PHP print("$d1"); ?>"> <input type="hidden" name="y1" value="<?PHP print("$y1"); ?>"> <input type="hidden" name="m2" value="<?PHP print("$m2"); ?>"> <input type="hidden" name="d2" value="<?PHP print("$d2"); ?>"> <input type="hidden" name="y2" value="<?PHP print("$y2"); ?>"> <input type="hidden" name="messagevariable" value="<?PHP print("$messagevariable"); ?>"> <? $_SESSION['messagevariable']=$messagevariable; ?> <input class="sbttnW" type="submit" name="forward" value="Forward"> <input class="sbttnW" type="submit" name="reply" value="Reply"> </div> </td> <td width="64"><img src="images/clear.gif" width="25" height="15"></td></tr>[/code]i am using the following code to send it to compose.php from current page(view.php):[code]if (isset($_POST["reply"])){ header("Location: compose.php?mess_id=".$_POST["mess_id"]. "&reply=".$_POST["reply"]. "&m1=".$_POST["m1"]."&d1=".$_POST["d1"]."&y1=".$_POST["y1"]."&m2=".$_POST["m2"]."&d2=".$_POST["d2"]."&y2=".$_POST["y2"]."&inboxcounter=".$_POST["inboxcounter"]."&sentcounter=".$_POST["sentcounter"]); exit;}//forward the messageif (isset($_POST["forward"])){ header("Location: compose.php?mess_id=".$_POST["mess_id"]. "&reply=".$_POST["reply"]. "&m1=".$_POST["m1"]."&d1=".$_POST["d1"]."&y1=".$_POST["y1"]."&m2=".$_POST["m2"]."&d2=".$_POST["d2"]."&y2=".$_POST["y2"]."&inboxcounter=".$_POST["inboxcounter"]."&sentcounter=".$_POST["sentcounter"]); exit;}[/code]and on the next page(compose.php) this is wat im doing:$messagevariable=$_POST["messagevariable"];to retrieve the variable and trying to display it here! Quote Link to comment Share on other sites More sharing options...
rsammy Posted March 13, 2007 Author Share Posted March 13, 2007 figured it out, thanx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.