Jump to content

rsammy

Members
  • Posts

    212
  • Joined

  • Last visited

    Never

Everything posted by rsammy

  1. cant do. cos it can be anyting, Emergency or Room 421-A or something like that. anyways, i guess its not possible to convert it if such values appear. it shud be left as is. thanx for the reply and im closing this thread. sorry!
  2. i need to convert a string(room number) to numeric before sorting on room_no. how can i do this? this is my code/query: select pat_dgraphics.pat_first_name, pat_dgraphics.pat_mid_init, pat_dgraphics.pat_last_name, appt_schd.appt_pref_phyID, DATE_FORMAT(pat_dgraphics.pat_dob, '%m/%d/%Y') as dob, pat_dgraphics.pat_ssn, appt_schd.appt_loc as admit_visit_loc, appt_schd.appt_room_no as admit_room_no, appt_schd.appt_descr, appt_schd.appt_date FROM appt_schd, pat_dgraphics WHERE appt_schd.appt_pat_id=pat_dgraphics.pat_ID AND pat_last_name like '%%' AND pat_first_name like '%%' AND (Date_Format(pat_dob, '%m/%d/%Y') like '%%' OR Date_Format(pat_dob, '%c/%e/%Y') like '%%' ) AND appt_schd.appt_loc like '%%' AND pat_dgraphics.pat_client_id ='1' AND appt_schd.appt_pref_phyID like '%%' and appt_schd.appt_date ='2007-07-06' ORDER by admit_room_no ASC now, what this does is, sorts the room number field but, not in the correct order. if the room numbers are like 11, 24, 147, 23, 54 and so on... it sorts them as 11, 147, 23, 24, 54... since room_no is a string, it does this. how do i convert it to a numeric value before sorting it so it gives me an output in the correct order?
  3. the query, when i test it in MYSQLFront(a database interface) works fine - it results 11 results(one from appt_schd table for the day and 10 from admit_stat table). but, when i run this query in PHP, it returns just 2 records(from admit_stat table). any reason or idea why it behaves different here?
  4. i have this query... SELECT DISTINCT appt_pat_id, appt_loc as admit_visit_loc, '' as admit_room_no FROM appt_schd WHERE admit_visit_loc='Good Sam' AND appt_date ='2007-06-29' UNION SELECT admit_pat_id as appt_pat_id, admit_visit_loc, admit_room_no FROM admit_stat WHERE admit_visit_loc = 'Good Sam' whats wrong with this code? when i try executing this, it says 'unknown field admit_visit_loc in 'where clause'. this, it says for the first query. if i change that field name to appt_loc, it seems to be working but, it does not return all the records.
  5. i am using vb but, its at the receiving end its causing a problem(my guess). its looking at the & and probably thinking that its another variable. is there a way we can trap it here(when im receiving it in a PHP file?)
  6. here it is: If ReaddischargeRecord(DisRec) Then theMessage = theMessage & "&STATUS=" & DisRec.admit_status theMessage = theMessage & "&VISIT_DATE=" & DisRec.dateofvisit ' 10/9/06 Appended Time of the Visit as well to the VISIT_DATE theMessage = theMessage & "&VISIT_TIME= " & DisRec.timeofvisit theMessage = theMessage & "&ATTENDING_PROVIDER=" & DisRec.physician If Trim$(DisRec.location) <> "" Then theMessage = theMessage & "&LOCATION=" & DisRec.location End If If Trim$(DisRec.room_number) <> "" Then theMessage = theMessage & "&ROOM_#=" & DisRec.room_number End If If (Trim$(DisRec.diagnosis) <> "") And (Trim$(DisRec.diagnosis) <> "NONE") Then theMessage = theMessage & "&DIAGNOSIS=" & DisRec.diagnosis End If theMessage = theMessage & "&PROCEDURE=" & DisRec.procedures If (Trim$(DisRec.medications) <> "") And (Trim$(DisRec.medications) <> "NONE") Then theMessage = theMessage & "&MEDICATION=" & DisRec.medications End If If Trim$(DisRec.imaging) <> "" Then theMessage = theMessage & "&IMAGING=" & DisRec.imaging End If If Trim$(DisRec.follow) <> "" Then theMessage = theMessage & "&FOLLOW_UP_NOTES=" & DisRec.follow End If If Trim$(DisRec.con_name) <> "" Then theMessage = theMessage & "&SEE_CONSULTANT=" & DisRec.con_name & " in " & DisRec.con_days End If If Trim$(DisRec.doc_name) <> "" Then theMessage = theMessage & "&SEE_PROVIDER=" & DisRec.doc_name & " in " & DisRec.doc_days End If End If im guessing the '&' in the variable name is causing it to think its a new variable from there on?
  7. actually, this field comes from a mobile device. i receive it and then insert it into the database. it takes in all other special characters except for this '&' sign. for example, this is my code(where i receive the info from the device): <?PHP ob_start(); print ("InstiComm"); // set log file function writeLog($msg) { // set file to write $filename = "error.log"; // open file $fh = fopen($filename, "a") or die("Could not open log. ENDOFMESSAGE"); $size=ob_get_length(); // create the data string to be written $str = date("[Y-m-d h:i:s] ", mktime()) . $msg . $size. "\r\n"; // write to log fwrite($fh, $str) or die("Could not write to log. ENDOFMESSAGE"); // close file fclose($fh); } $phy_pin=$_POST["phy_pin"]; if (!isset($phy_pin)) { echo "Access Denied"; print ("ENDOFMESSAGE"); exit; } $tid=$_POST["TRAN_ID"]; if (!isset($tid)) { echo "No Data Received 112"; print ("ENDOFMESSAGE"); exit; } $pid=$_POST["PATIENT_#"]; if (!isset($pid)) { echo "No Data Received 111"; print ("ENDOFMESSAGE"); exit; } function FncShowHTTPVars ($array) { $varString =""; if (count($array)) { while (list($key, $val) = each($array)) { if (is_array($val)) { while (list($key2, $val2) = each($val)) $varString.= "$key [$key2] = $val2<br>"; } else $varString.= "$key = $val<br>"; } } return $varString; } //File for database information require_once ("../config.php"); //Open connection to Database mysql_connect ($database[hostname], $database[username], $database[password]) or die("Unable to connect to the database. ENDOFMESSAGE"); mysql_select_db ($database[dbname]) or die("Unable to open the database. ENDOFMESSAGE"); $my_vars = "Post vars: <br>"; $my_vars .= FncShowHTTPVars ($_POST); $my_vars .= "Get vars: <br>"; $my_vars .= FncShowHTTPVars ($_GET); if (isset ($my_vars)) { $message = ""; $pat_fname=$_POST["PATIENT_FNAME"]; $pat_lname=$_POST["PATIENT_LNAME"]; if ( isset( $pat_fname, $pat_lname )) $message .= "PATIENT NAME: " . $pat_fname . " " . $pat_lname. "\n"; $location=$_POST["LOCATION"]; if ( isset( $location )) $message .= "LOCATION: " . $location . "\n"; $room_no=$_POST["ROOM_#"]; if (isset( $room_no)) $message .= "ROOM NUMBER: " . $room_no . "\n"; $dia=$_POST["DIAGNOSIS"]; if ( isset( $dia )) $message .= "DIAGNOSIS: " .$dia . "\n"; $pro=$_POST["PROCEDURE"]; if ( isset( $pro )) $message .= "PROCEDURE: " . $pro . "\n"; $med=$_POST["MEDICATION"]; if ( isset( $med )) $message .= "MEDICATION: " . $med . "\n"; $img=$_POST["IMAGING"]; if ( isset( $img )) $message .= "IMAGING: " . $img . "\n"; $fol=$_POST["FOLLOW_UP_NOTES"]; if ( isset($fol )) $message .= "FOLLOW UP NOTES: " . $fol . "\n"; $refer=$_POST["SEE_CONSULTANT"]; and then, this is where i insert it into the table: $queryl= ("INSERT INTO dcn (dcn_phy_id, dcn_pref_prov, dcn_pat_id, dcn_dov, dcn_img, dcn_foll, dcn_cons, dcn_doc, dcn_palm_db_id, dcn_visit_id, dcn_date_created, dcn_mr_num, dcn_client_id, dcn_approved_for_billing, dcn_posted_for_billing, dcn_tran_ID) VALUES ('$phy_id', '$pref_prov', '$pat_id', '$dateofvisit', '$img', '$fol', '$refer','$see_doc', '$unqID', '$visit_id', '$visit_date_reformat', '$ref_no', '$client_id', 'No', 'No', '$unqID')"); $resultl=mysql_query($queryl); if(!$resultl) { $error="Error 342"; } the problem is with the follow-up notes($fol) and procedure ($pro) fields!
  8. if i receive an '&' sign in my string via a POST variable, i lose all of the remainder of the string after that symbol. is it a php thing. i send this in a free form text field and the string breaks when it encounters the '&' sign and stores the info preceding it. any workaround for this? any help/suggestions?
  9. not sure if this is where i shud be posting this one. is it possible to use visual source safe for php and mysql files? if yes, how do i install and setup vss on my server? what are the steps to do it. can anyone help me out on this one? i have used vss but never installed/setup one on a server before. ???
  10. i am working on a page where office staff enters info on scheduling a doctor for on-call duty. the page has info like date, shift, Doctors name(Provider) and Location fields and a Add button. staff selects the date from the calendar, selects a shift from the drop-down, selects a Provider and Location from the drop-down boxes. When page loads, shift drop-down box defaults to the first value(Shift 1) and Provider and Location fields are defaulted to blank. These fields are to be made mandatory. i am trying what i did on othre screens and it doesnt seem to work here. if i hit the Add button without choosing values for these two fields(just leaving them blank) all validations are skipped. i am attaching the code here: admit_stat <?PHP //File for database information //require_once ("phpInclude/config.php"); require_once ("../config.php"); //File to verify authenticated user include ("phpInclude/cookie.php"); $messages=$_GET["message"]; $month = date("M"); $month_number = date("n"); $year = date("Y"); $numberofdays = date("t"); $month_day = date("j"); $date = "$year-$month_number-$month_day"; $today="$month_number/$month_day/$year"; //echo "$today"; function option_select($month_year_day, $t) { if($month_year_day == $t) { print "<option value=$t selected>$t</option>"; } else { print "<option value=$t>$t</option>"; } } $message = ""; $goodMessage = ""; if(isset($_POST["action"])) { $Year = $_POST["year"]; $month = $_POST["Month"]; $day = $_POST["Day"]; $wDay=$_POST["wDay"]; $oncall_id=$_POST["oncall_id"]; $date = $Year."-".$month."-".$day; $date1 = $month."/".$day."/".$Year; //echo "$date"; $time = $_POST["shift"]; //echo "$time"; $phy_id = $_POST["phy_id"]; //echo "$phy_id"; $gr_loc = $_POST["gr_loc"]; //echo "$gr_loc"; //print("LOC IS...: " .$gr_loc); if ($gr_loc == "") { $gr_loc = 1; } $timedisplay = $_POST["shift"]; mysql_query("SET AUTOCOMMIT=0"); $query = "SELECT oncall_id FROM oncall WHERE oncall_id='$oncall_id' "; $result = mysql_query($query); $num_rows = mysql_num_rows($result); print(""); if($num_rows > 0) { $row = mysql_fetch_array($result); $oncall_id = $row["oncall_id"]; $queryupdate=(" UPDATE oncall SET oncall_phy_id = '$phy_id', oncall_org_id = '$gr_loc', oncall_time = '$time', oncall_date = '$date', oncall_day = '$wDay' WHERE oncall_id ='$oncall_id' "); $resultupdate=mysql_query($queryupdate); if (! $resultupdate){ $error= "Error 500"; echo "here"; } else{ $message = "On-Call Schedule has been changed.<br>Here is a list of the last 5 schedules added.<br><br>Click on Add On-Call to add another schedule or View-on-Call:Day or View-on-Call:Month to view existing On-Call schedules. "; } } else { $queryz="INSERT INTO oncall (oncall_phy_id, oncall_org_id, oncall_time, oncall_date, oncall_day) VALUES ('$phy_id','$gr_loc','$time','$date', '$wDay')"; //echo "$queryz"; $resultz = mysql_query($queryz); if (! $resultz){ $error= "Error 501"; } else{ $message= "<font class=goodTXT><b>On-Call Schedule has been added.</b></font><br>Here is a list of the last 5 schedules added.<br><br>Click on <b>Add On-Call to add another schedule<b> or <b>View-on-Call:Day or View-on-Call:Month<b> to view existing On-Call schedules. "; } //echo "Here1"; } if (isset($error)) { $message = "Please try again later - Database $error"; //echo "$error"; mysql_query("ROLLBACK"); mysql_close(); //exit; } else { mysql_query("COMMIT"); //print("Success"); } header("Location: oncall.php?"."message=".$message ); } $query="select oncall_id, oncall_phy_id, oncall_org_id, oncall_day, oncall_time, date_format(oncall_date, '%m/%d/%Y') as date from oncall where oncall_date='$date' "; if($phy_id != 0) { $query .= " AND oncall_phy_id='$phy_id' "; } $query_location="SELECT org_name from orgs where org_ID='$location'"; $resultz=mysql_query($query_location); $rowz=mysql_fetch_array($resultz); $org_namez=$rowz["org_name"]; $query .= " AND oncall_org_id='$location' "; $query .= " order by oncall_date ASC"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); $querylistdt="SELECT Date_Format(oncall_date, '%m/%d/%Y') as oncall_date, oncall_time, phy_fname, phy_lname,org_name from oncall oc, phy_det pd,orgs o where oc.oncall_phy_id = pd.phy_id and oc.oncall_org_id = o.org_id order by oncall_id desc limit 5 "; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>ABC</title> <link rel='stylesheet' type='text/css' href='css/styleSheet.css'> <SCRIPT language="JavaScript" src="js/tree.js"> </SCRIPT> <SCRIPT language="JavaScript" src="js/validateSSN.js"></SCRIPT> <SCRIPT language="JavaScript" src="date-picker.js"></SCRIPT> <SCRIPT language="JavaScript"> function validate() { var err_msg = new Array(); var i=0; var j=0; var bigstring = "Please correct the following errors:\n"; var loginID = ""; var pass = ""; var count = 0; var aMatch = false; var aBlank = false; var AppDate = document.oncall.datebox.value; var aDate = AppDate.split("/"); var aMonth = aDate[0]; var aDay = aDate[1]; var aYear = aDate[2]; var ADate = new Date(aYear, (aMonth - 1), aDay); var Today = new Date(); var TodayDay = Today.getDate(); var TodayMon = Today.getMonth()+1; var TodayYear = Today.getYear(); //alert(aMonth); var ADate = new Date(aYear, (aMonth - 1), aDay); var TodayDate = new Date(TodayYear, TodayMon-1, TodayDay); if (ADate < TodayDate) { err_msg[i] = "Entered date cannot be less than today's date."; i++; } if ((TodayMon == '1') || (TodayMon == '3') || (TodayMon == '5') || (TodayMon == '7') || (TodayMon == '8') || (TodayMon == '10') || (TodayMon == '12')) { if (TodayDay > 31) { err_msg[i] = TodayMon . " has only 31 days"; } } if (oncall.physician.value == "") { err_msg[i] = "Preferred Provider cannot be blank."; i++; } if (i>0) { for (j=0; j<err_msg.length; j++) { count = j + 1; bigstring = bigstring + "\n" + count +". " + err_msg[j]; } alert (bigstring); return false; } else { return true; } } </SCRIPT> </head> <BODY> <table width="900" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4" bgcolor="#FFFFFF"> <div align="left"><font color="#FFFFFF"><b> </b></font></div> <div align="right"><font color="#FFFFFF"><img src="images/title_barom.jpg" width="900" height="69"></font></div></td> </tr> <tr> <td align="left" valign="top" width="276"> <table width="276" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><div align="center"><font color="#006699"><img src="images/clear.gif" height="15" width="1"><b><?PHP print($group_name); ?><br> User: </b><?PHP print($USER_NAME); ?></font></div></td> </tr> <tr> <td align="left" valign="top"> <SCRIPT language="JavaScript"> tree.loadState() tree.display() </SCRIPT> </td> </tr> </table> <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><? print("<b>$copyright1</b>"); ?></p> </td> <td colspan="3" align="left" valign="top" width="624"> <div align="center"> <br> </div> <table width="614" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699" width="359" height="19"> <div align="left"><b><font color="#FFFFFF">Add On-Call Schedule</font></b></div></td> <td bgcolor="#006699" width="249" height="19" valign="top"> </td> </tr> <tr> <td colspan="2"> <table width="592" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"> </td> <td rowspan="3" align="left" valign="top"> <form name="oncall" method="post" action="checkoncall.php" onSubmit="return validate()" > <table width="450" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="196" height="22"> <div align="right"><font class="inputLbl">Date: </font></div></td> <td width="130"> <input type='text' name='datebox' readonly value="<? //if coming to the screen first time, print $today - which is the current date. else, print the date in the post variable - $date1 //print ("$today"); print ("$date1");print ("asdfas"); if($date1 == "") { print ("$today"); } else { print ("$date1"); } ?>" size=15 > </td> <td width="124"><div align="left"><a href="javascript:show_calendar('oncall.datebox');" onmouseover="window.status='Date Picker';return true;" onmouseout="window.status='';return true;"><img src="show-calendar.gif" width=24 height=22 border=0 align="absmiddle"></a></div></td> </tr><script language="JavaScript"> </script> <tr> <td width="196"> <div align="right"><font class="inputLbl">Schedule: </font></div></td> <td colspan="2"> <? //print($time); ?><select name="shift" > <!--if coming to the screen for the first time, print show Shift1 as default, else show last selected value as default--> <option value="Shift 1" <? if ($time == "Shift 1") print("selected"); ?>>Shift 1</option> <option value="Shift 2" <? if ($time == "Shift 2") print("selected"); ?>>Shift 2</option> <option value="Shift 3" <? if ($time == "Shift 3") print("selected"); ?>>Shift 3</option> <option value="Day" <? if ($time == "Day") print("selected"); ?>>Day</option> <option value="Night" <? if ($time == "Night") print("selected"); ?>>Night</option> <option value="24 Hours" <? if ($time == "24 Hours") print("selected"); ?>>24 Hours</option> <option value="Weekend" <? if ($time == "Weekend") print("selected"); ?>>Weekend</option> </select> </td> </tr> <tr> <td width="196"> <div align="right"><font class="inputLbl">Provider: </font></div></td> <td colspan="2"> <?PHP $queryphy="select phy_id, phy_fname, phy_lname from phy_det where phy_disabled = 'Enable' order by phy_lname, phy_fname"; $resultphy = mysql_query ($queryphy); if ($resultphy) { print ("<select name='physician'>\n"); print ("<option value=\"\"></option>\n"); while($rowphy = mysql_fetch_array($resultphy)) { if($pat_phy_id == $rowphy["phy_id"]) { print ('<option selected value="'.$rowphy["phy_id"].'">'.$rowphy["phy_lname"].', '.$rowphy["phy_fname"].'</option>'); } else { print ('<option value="'.$rowphy["phy_id"].'">'.$rowphy["phy_lname"].', '.$rowphy["phy_fname"].'</option>'); } } print ("</select>"); } ?> <font class="redTxt">*</font> </td> </tr> <tr> <td width="196"> <div align="right"><font class="inputLbl">Location: </font></div></td> <td colspan="2"> <?PHP $querys="SELECT org_ID, org_name FROM orgs where org_type !='Office' order by org_name ASC"; $results= mysql_query ($querys); if ($results) { print ("<select name='location'>\n"); print ("<option value=\"\"></option>\n"); //print ("<option value='0' selected>ANY</option>"); if ($row= mysql_fetch_array($results)) { do { print ("<option value=\""); print $row["org_ID"]; print ("\">"); print $row["org_name"]; print ("</option>"); } while ($row = mysql_fetch_array($results)); } } print ("</select>"); ?> <font class="redTxt">*</font> </td> </tr> <tr> <td width="196" align="left" valign="top"> </td> <td colspan="2" align="left" valign="top"> </td> </tr> <tr> <td width="196" align="left" valign="top"> <div align="right"><font class="inputLbl"> </font></div></td> <td colspan="2" align="left" valign="top"> </td> </tr> <tr> <td width="196" align="left" valign="top"> </td> <td colspan="2" align="left" valign="top"> <input class="sbttn" type="submit" name="action" value="Add"> </td> </tr> </table> </form></td> <td width="15"> </td> </tr> <tr> <td width="15" height="86"><img src="../images/clear.gif" width="15" height="8"></td> <td width="1" height="86"> </td> <!--<td width="104" height="146"><img src="../images/clear.gif" width="15" height="8"></td>--> </tr> </table><div align="center"> <img src="../images/clear.gif" width="15" height="1"> <table width="536" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="5" height="7"> <div align="center"><? print ("$messages"); ?> </div></td> </tr> <tr> <td width="15"> </td> <td width="15"> </td> </tr> <tr bgcolor="006699"> <td width="110"> <div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Date</font></b></div></td> <td width="36"> <div align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"> Time</font></b></div></td> <td width="170"> <div align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"> Provider Name</font></b></div></td> <td width="175"> <div align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"> Location</font></b></div></td> </tr> <tr bgcolor=\"#cccccc\"> <tr> <!--<td width="100"> <div align="center"><?PHP print ($list_date); ?></div></td> <td width="117"> <div align="center"><?PHP print ($list_time); ?></div></td> <td width="177"> <div align="center"><?PHP print ($list_phyfname); print (","); print ($list_phylname); ?> </div></td> <td width="176"> <div align="center"><?PHP print ($list_org); ?></div></td>--> <? $resultlistdt=mysql_db_query("$database[dbname]", $querylistdt); $num_rows=mysql_num_rows($resultlistdt); $num_results=mysql_num_rows($resultlistdt); $i=1; if(!isset($rowNum)) { $rowNum = 0; } $rowNumHold = $rowNum; if ($num_rows > 0) { for($q=0;$q<$num_rows;$q++) { if(mysql_data_seek($resultlistdt, $rowNum++)) { if ($i++%2) { print ("<tr bgcolor=\"#cccccc\">"); } else { print ("<tr>"); } $row = mysql_fetch_object($resultlistdt); print("<td height=\"14\"> <div align=\"center\">"); print($row->oncall_date); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row->oncall_time); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row->phy_fname); print(" "); print($row->phy_lname); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row->org_name); print("</div></td>"); print("</div></td>"); print("</tr>"); } } } ?> <tr> <tr> <td width="15"><img src="../../images/clear.gif" width="15" height="8"></td> <td width="15"><img src="../../images/clear.gif" width="15" height="1"></td> </tr> <tr> <tr> <td colspan="3"><img src="../../images/clear.gif" width="1" height="15"></td> </tr> </table></td> </tr> </table> <p> </p></td> </tr> <tr> <td align="left" valign="top" width="276"> </td> <td colspan="3" width="624"> </td> </tr> </table> </body> </html> <?PHP mysql_close(); ?> how do i make sure that these fields are chosen and not blanks before going over to the next screen - checkoncall.php where the user can click on Submit button to insert info into the database? help is badly needed on this one. i know its a small issue, but i am not able to get around it. thanx
  11. i am working with three different tables - scheduler, admitstatus and patient tables. scheduler table has info on when a patient is scheduled to see a doctor(date, location, patient_id) admitstatus table has info on patient's admission status(admit_id, patient_id, location, admit_date) patient table has patient's info(patient_id, full name, dob, sex, and so on) scenario: office staff registeres a patient(new patient - in patient table) and then schedules him for an appointment same day(say, today). this info is stored in scheduler table. doctor sees this patient and admits him. this info is now stored in admitstatus table. office staff runs a report on all the active patients for the day(all those in the scheduler and admitstatus tables). query returns all patients(records) stored in both tables(scheduler and admitstatus). that is - it returns one record from admitstatus table for the admitted patient, as also another record for the same patient from the scheduler table(he was scheduled to see a doctor for that day). here is the code for this: <?PHP <td width="644" colspan="3" align="left" valign="top"> <table width="540" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699" height="22" width="536"> <b><font color="#FFFFFF">ACTIVE PATIENTS LIST:</font></b> </td> </tr> <tr> <td height="392" width="536"> <table width="521" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4" height="21"> <div align="center"><font color="#000000"><img src="../images/clear.gif" width="1" height="15"><b><font class="inputLbl">Enter Patient Information and click on Search</font></b></font></div></td> </tr> <tr> <td width="15"> </td> <td rowspan="3" align="left" valign="top" width="498"> <form method="post" action="AdmitPatsearch.php" name="Form" onSubmit="return validate()"> <table width="497" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="14" width="232"> </td> <td height="14" width="265"> </td> </tr> <tr> <td height="14" width="232"> </td> <td height="14" width="265"> </td> </tr> <tr> <td height="22"> <div align="right"><font class="inputLbl">First Name: </font></div></td> <td height="22" width="265"> <input class="txtboxLarge" type="text" name="patfname" value="<? if (isset ($patfname)){ print ("$patfname"); } ?>" onBlur="javascript:changeCase(document.Form.patfname);" > </td> </tr> <tr> <td height="22"> <div align="right"><font class="inputLbl">Last Name: </font></div></td> <td height="22" width="265"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input class="txtboxLarge" type="text" name="patlname" value="<? if (isset($patlname)){ print ("$patlname"); } ?>" onBlur="javascript:changeCase(document.Form.patlname);" > </font></td> </tr> <tr> <td height="22"><div align="right"><font class="inputLbl">Location: </font></div></td> <td colspan="2" align="left" valign="top"><select name="location" id="location"> <?PHP if (isset($location)) { //print($location); print ("<option value='$location' selected>"); } $query_loc="select org_ID, org_name from orgs where org_id!=1 order by org_name"; $result_loc = mysql_query ($query_loc); if ($result_loc) { print ("<option value=\"\"></option>\n"); while($row_loc = mysql_fetch_array($result_loc)) { if($location == $row_loc["org_name"]) { print ('<option selected value="'.$row_loc["org_name"].'">'.$row_loc["org_name"].'</option>'); } else { print ('<option value="'.$row_loc["org_name"].'">'.$row_loc["org_name"].'</option>'); } } print ("</select>"); } ?> </td> </tr> <tr> <td height="22"><div align="right"><font class="inputLbl">DOB as (mm/dd/yyyy): </font></div></td> <td height="22"><input name="patdob" type="text" class="txtboxLarge" id="patdob" value="<? if (isset($patdob)) { print ("$patdob"); } ?>" ></td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl"> <input type="hidden" name="client_id" value="<? print ("1"); ?>"> </font></div></td> <td colspan="2"> </td> </tr> <tr> <td height="46" width="232"> </td> <td height="46" width="265"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input class="sbttn" type="submit" name="Submit" value="Search"> </font></td> </tr> </table> </form></td> <td width="1"> </td> <td width="104"> </td> </tr> <tr> <td width="15"> </td> <td width="1"> </td> <td width="104"> </td> </tr> <tr> <td width="15" height="146"><img src="../images/clear.gif" width="15" height="8"></td> <td width="1" height="146"> </td> <td width="104" height="146"><img src="../images/clear.gif" width="15" height="8"></td> </tr> </table><div align="center"> <img src="../images/clear.gif" width="15" height="1"> <table width="536" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="006699"> <td width="154"> <div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"> Patient Name </font></b></div></td> <td width="130"> <div align="center"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Patient #</font></strong></div></td> <td width="115"> <div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">DOB</font></b></div></td> <td width="279"> <div align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Location</font></b></div></td> <td width="130"> <div align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Pref Provider</font></b></div></td> </tr> <? if (isset($_POST["patlname"]) OR ($_GET["patlname"]) OR ($_POST["patfname"]) OR ($_GET["patfname"]) OR ($_POST[location]) OR ($_GET[location]) OR ($_POST["physician"]) OR ($_GET["physician"]) OR ($_POST[client_id]) OR ($_GET[client_id])){ $patlname=trim("$patlname"); $patfname=trim("$patfname"); $location=trim("$location"); $physician_name=trim("$physician_name"); $clientid=stripslashes("$clientid"); $today = date("Y-m-d"); $query1 = "SELECT DISTINCT appt_pat_id, appt_loc as admit_visit_loc, '' as admit_room_no FROM scheduler WHERE appt_date ='$today' UNION SELECT admit_pat_id as appt_pat_id, admit_visit_loc, admit_room_no FROM admitstat WHERE admit_visit_loc like '%$location%' ORDER BY appt_pat_id ASC "; $result=mysql_db_query("$database[dbname]", $query1); $num_rows = mysql_num_rows($result); $num_results=mysql_num_rows($result); $i=1; if(!isset($rowNum)) { $rowNum = 0; } $rowNumHold = $rowNum; $count = 1; $limit_results = 25; if ($num_rows > 0) { for($q=0;$q<$limit_results && $rowNum < $num_rows;$q++) { if(mysql_data_seek($result, $rowNum++)) { if ($i++%2) { print ("<tr bgcolor=\"#cccccc\">"); } else { print ("<tr>"); } if ($row = mysql_fetch_array($result)) { $admit_visit_loc=$row["admit_visit_loc"]; $admit_room_no=$row["admit_room_no"]; $admit_pat_id=$row["admit_pat_id"]; $appt_pat_id=$row["appt_pat_id"]; ?> <td width="124"> <div align="left"><font class="plnTxtBl"> <? $patnamequery="SELECT pat_ID, pat_first_name, pat_mid_init, pat_last_name, pat_ssn, DATE_FORMAT(pat_dob, '%m/%d/%Y') as dob, pat_phy_id, pat_client_id from patient where pat_ID='$appt_pat_id' AND pat_last_name like '$patlname%' AND pat_first_name like '$patfname%' AND pat_client_id $clientid"; $patnameresult = mysql_query($patnamequery); $rowpatname=mysql_fetch_array($patnameresult); $pat_first_name=$rowpatname["pat_first_name"]; $pat_last_name=$rowpatname["pat_last_name"]; $pat_dob=$rowpatname["dob"]; $pat_ssn=$rowpatname["pat_ssn"]; $phy_id=$rowpatname["pat_phy_id"]; $client_id=$rowpatname["pat_client_id"]; print ("$pat_last_name"); print (", "); print("$pat_first_name"); ?> </font> </div></td> <? print ("<td width=\"120\"> <div align=\"center\"><font class=\"plnTxtBl\"> "); print ("$pat_ssn"); ?></font></div></td> <td width="97"> <div align="center"><font class="plnTxtBl"> <? print ("$dob"); ?></font></div></td> <td width="129"><div align="left"><font class="plnTxtBl"> <? print ("$admit_visit_loc"); //print "<br>"; print (" "); print"Room #: "; print ("$admit_room_no"); ?> </font> </div></td> <td width="110"> <div align="left"><font class="plnTxtBl"> <? if ($phy_id != 0) { $phyidquery="SELECT phy_fname, phy_lname FROM phy_det WHERE phy_id='$phy_id'"; $resultphyidquery=mysql_db_query("$database[dbname]", $phyidquery); $rowphy_id=mysql_fetch_array($resultphyidquery); $phy_fname=$rowphy_id["phy_fname"]; $phy_lname=$rowphy_id["phy_lname"]; } else { $phy_fname=" "; $phy_lname=" "; } print ("$phy_fname"); print " "; print("$phy_lname"); ?></font></div></td> </tr> <? } while($row = mysql_fetch_array($result)); } } ?> requirement: office staff runs the same report but, does not want to see two records for the same patient coming in from the two tables. the record from scheduler table shud not be included in this list as the doctor has already seen this patient and he has been admitted. the patient shud info shud not be deleted from scheduler table for historical purposes. can anyone help?
  12. i have an application where i need to send an email within the system. i should not display the email address anywhere in the email. as of now, the way it shows up(on the recipients computer) when i send the email is... From: ABC Message Center [DoNotReply@abc.com] To: abc@abc.com Cc: Subject: New Mail from: <Senders Name> <--------- message body here--------> how do I prevent the email address from showing up and rather show the name of the recipient? heres my code: $row = mysql_fetch_array($result1); $to_id = $row["user_id"]; $query = "SELECT user_email FROM user_mgr WHERE user_id='$userid'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $user_email = $row["user_email"]; $query = "INSERT INTO messages (message,user_id,status,subject,from_p,received,to_email,time_sent) VALUES ('$message_x','$userid','1','$subject','$user_email','$DATE','$to','$TIME')"; $resultquery= mysql_query($query); $sentmsg_ID = mysql_insert_id(); $sentquery = "INSERT INTO sent_messages (user_id, message_id) VALUES ('$userid', '$sentmsg_ID')"; $resultsent=mysql_query($sentquery); $id = mysql_insert_id(); $headers .= "From: $MCName <$donotreply>\n"; $headers .= "X-Sender: <$donotreply>\n"; $headers .= "X-Mailer: PHP\n"; // mailer $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Return-Path: <$varreturnpath>\n"; // Return path for errors $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $message = $name." has sent a message to you through ABC's message center. In order to get this message follow this link ".$varurlMC.". <p> PLEASE DO NOT REPLY TO THIS EMAIL AS THIS IS AN UNATTENDED, AUTO GENERATED EMAIL. </p>"; mail($to, "New ABC Mail From: ".$name, $message, $headers); header("Location: main.php?m1=".$_POST["m1"]."&d1=".$_POST["d1"]."&y1=".$_POST["y1"]."&m2=".$_POST["m2"]."&d2=".$_POST["d2"]."&y2=".$_POST["y2"]); exit; this is how i select the recipient from a drop-down... <tr> <td width="16"> </td> <td width="87"> <div align="right"><b>To: </b></div></td> <td colspan="2"> <?PHP $query="select user_mgr.user_email, user_mgr.user_fname, user_mgr.user_lname from user_mgr, phy_det where user_mgr.user_id=phy_det.user_id AND phy_det.phy_disabled != 'Disable' union select user_email, user_fname, user_lname from user_mgr Where operational_user= 'Yes' order by user_lname asc, user_fname asc"; $result= mysql_query ($query); if ($result) { print ("<select name='to'>"); if ($row = mysql_fetch_array($result)) { do { $email_db = $row["user_email"]; print("<option value=\"$email_db\""); if($from_p == $email_db) { print(" selected>"); } else { print(">"); } print $row["user_lname"]; print (", "); print $row["user_fname"]; print("</option>"); } while($row = mysql_fetch_array($result)); } } print ("</select>"); ?> </td> <td colspan="2"> <?PHP $toquery="select user_id, user_lname, user_fname, user_email from user_mgr order by phy_lname, phy_fname"; $toresult= mysql_query ($toquery); if ($toresult) { print ("<select name='to'>"); if ($torow = mysql_fetch_array($toresult)) { do { print("<option value=\""); print $torow["user_email"]; if($from_p == $torow["user_email"]) { print("\" selected>"); } else { print("\">"); } print $torow["user_lname"]; print (", "); print $torow["user_fname"]; print("</option>"); } while($torow = mysql_fetch_array($toresult)); } } print ("</select>"); ?> </td> </tr> <tr> <td width="16"> </td> <td width="87"> <div align="right"><b>Subject: </b></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="subject" value="<?PHP if(isset($subject)){print("RE: ".$subject); } ?>"> </td> </tr> <tr> <td width="16"> </td> <td width="87"> <div align="right"><b></b></div></td> <td width="287"> </td> <td width="220"> </td> </tr> <tr> <td width="16"> </td> <td width="87" align="left" valign="top"> <div align="right"><b>Message: </b></div></td> <td colspan="2" rowspan="4" align="left" valign="top"> <textarea class="txtareaLg" name="message" cols="50" rows="15"></textarea> </td> </tr> <tr> <td width="16"> </td> <td width="87"> </td> </tr> how can i use this value in the To field when the recipient views the email rather than show the email address thanx
  13. this is a block of code from my actual code... if (!isset($error)) { //print "Here"; $headers = ""; //$headers .= "From: $PHY_NAME<$PHY_EMAIL>\n"; $headers .= "From: $PHY_NAME\n"; $headers .= "X-Sender: <$PHY_EMAIL>\n"; $headers .= "X-Mailer: PHP\n"; // mailer $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Return-Path: <$varreturnpath>\n"; // Return path for errors $message = $PHY_NAME."*".$PHY_EMAIL." has sent a message to you through ABC's message center. In order to get this message follow this link ".$varurlMC."\r\n\n PLEASE DO NOT REPLY TO THIS EMAIL AS THIS IS AN UNATTENDED, AUTO GENERATED EMAIL."; mail($to, "New XYZ Mail From: ".$PHY_NAME, $message, $headers); } how can i hide the senders email address from this or show something like this ... DoNotReply@xyz.com instead of the senders email address to prevent any reply to this message?
  14. ok. i have to implement the logout stuff. when logout is clicked on screen, i send it to logout.php where i am doing this... <?PHP //require_once ("phpInclude/config.php"); require_once ("../config.php"); header("Expires: Mon, 26 Jul 2001 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>INSTICOMM</title> <link rel='stylesheet' type='text/css' href='css/styleSheet.css'> <Script language=javascript> </Script> </head> <BODY onload="window.scroll(0,yoffset)"> <table width="900" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4" bgcolor="#FFFFFF"> <div align="left"><font color="#FFFFFF"></font></div> <div align="right"><font color="#FFFFFF"><img src="images/title_barom.jpg" width="900" height="69"></font></div></td> </tr> <tr> <td align="left" valign="top" width="300"> <table width="300" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> <SCRIPT language="JavaScript"> tree.loadState() tree.display() </SCRIPT> </td> </tr> </table> <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">***********************<br> XYZ Software<br> Version <? print("$version"); ?><br> *********************** <? if ($demo_disclaimer_option =='ON') { print("<br>"); print("<b>$demo_disclaimer1</b>"); print("<br>"); print("$demo_disclaimer2"); } ?> </p> <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><? print("<b>$copyright1</b>"); ?></p> </td> <td colspan="3" align="left" valign="top"> <br> <br> <table width="450" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> For security reasons, please close your browser immediately. </table> </body> </html> still, when Back button is clicked on browser, it goes back. Its another thing that it wont let be do anything when I click some link or button on the previous page(after clicking Back button). It will take me to the login screen. but, still, as long as i keep clicking back button, it takes me through all thepages showing all of the info on screen!! is there a way to block that? thanx
  15. is there a way to disable the Back button on the browser? i would like to prevent users from using it to go to the previous page!
  16. thanx chronister. i guess i understand this one little more clearly. still, not too sure i can do it myself. here is my code(remaining part, actually). this block is the POST block: if($client_id= $_POST["client_id"]) { $m1=$_POST["m1"]; $d1=$_POST["d1"]; $y1=$_POST["y1"]; $m2=$_POST["m2"]; $d2=$_POST["d2"]; $y2=$_POST["y2"]; $patfname=$_POST["patfname"]; $patlname=$_POST["patlname"]; $org_name=$_POST["location"]; print("LOC IS...: " .$org_name); $searchon=$_POST["searchon"]; $client_id=$_POST["client_id"]; $searchon=$_POST["searchon"]; if ($client_id == 'NULL') { $client_id= '0'; } $patdob=$_POST["patdob"]; $ActiveStatus=$_POST["ActiveStatus"]; } this is my query: $queryexec="SELECT DISTINCT admission.id, admission.pat_id, pat_dgraphics.pat_first_name, pat_dgraphics.pat_last_name, admission.admit_phy_id, admission.admit_loc, admission.admit_encounter, admission.admit_date, admission.discharge_date, DATE_FORMAT(admission.discharge_date, '%m/%d/%Y') as discharge_dates, DATE_FORMAT(admission.admit_date, '%m/%d/%Y') as admit_dates, CONCAT(DATEDIFF(curdate(), admission.admit_date) + 1, ' <b><font color=green>ACTIVE</font></b>') as days, admit_time, discharge_time FROM admission, pat_dgraphics WHERE admission.discharge_date = '0000-00-00' AND admission.admit_date <= '$dates' AND admission.admit_date >= '$datez' AND admission.pat_id=pat_dgraphics.pat_ID AND pat_dgraphics.pat_first_name like '$patfname%' AND pat_dgraphics.pat_last_name like '$patlname%' AND admission.admit_loc like '%$location%' AND admission.admission_client_id like '$client_id' AND DATE_FORMAT(pat_dgraphics.pat_dob, '%m/%d/%Y') like '$patdob' ORDER BY admit_date DESC, admit_time DESC, pat_last_name ASC, pat_first_name ASC"; These are the filters I am using for the query: <tr> <td width="15"> </td> <td rowspan="3" align="left" valign="top" width="498"> <form method="post" action="Encountersearch.php" name="Form" onSubmit="return validate()"> <table width="497" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="14" width="232"> </td> <td height="14" width="265"> </td> </tr> <tr> <td height="14" width="232"> </td> <td height="14" width="265"> </td> </tr> <tr> <td height="14"> <div align="right"><font class="inputLbl">First Name: </font></div></td> <td height="14" width="265"> <input class="txtboxLarge" type="text" name="patfname" value="<? if (isset ($patfname)){ print ("$patfname"); } ?>" > </td> </tr> <tr> <td height="11"> <div align="right"><font class="inputLbl">Last Name: </font></div></td> <td height="11" width="265"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input class="txtboxLarge" type="text" name="patlname" value="<? if (isset($patlname)){ print ("$patlname"); } ?>" > </font></td> </tr> <tr> <td height="22"><div align="right"><font class="inputLbl">Location: </font></div></td> <td colspan="2" align="left" valign="top"><select name="location" id="location"> <?PHP $query_loc="select org_ID, org_name from orgs where org_id!=1 order by org_name"; $result_loc = mysql_query ($query_loc); if ($result_loc) { while($row_loc = mysql_fetch_array($result_loc)) { if($row->admit_loc == $row_loc["org_name"]) { print ('<option selected value="'.$row_loc["org_name"].'">'.$row_loc["org_name"].'</option>'); } else { print ('<option value="'.$row_loc["org_name"].'">'.$row_loc["org_name"].'</option>'); } $location = $row_loc["org_name"]; } print ("</select>"); } ?> </td> </tr> <tr> <td height="22"><div align="right"><font class="inputLbl">Date of Birth as (mm/dd/yyyy): </font></div></td> <td height="22"><input name="patdob" type="text" class="txtboxLarge" id="patdob" value="<? if (isset($patdob) & ($patdob != '%%')) { print ("$patdob"); } ?>" ></td> </tr> and then I display the records - row by row hope this helps. thanx
  17. thanx barand and frost for taking time to reply! issues resolved
  18. ???? thanx for replying, but sorry! i didnt get you! could you be more specific?
  19. this is my code... <tr> <td height="22"><div align="right"><font class="inputLbl">Location: </font></div></td> <td colspan="2" align="left" valign="top"><select name="location" id="location"> <?PHP $query_loc="select org_ID, org_name from orgs where org_id!=1 order by org_name"; $result_loc = mysql_query ($query_loc); if ($result_loc) { //print ("<select name='location'>\n"); print ("<option value=\"\"></option>\n"); while($row_loc = mysql_fetch_array($result_loc)) { if($row->admit_loc == $row_loc["org_name"]) { print ('<option selected value="'.$row_loc["org_ID"].'">'.$row_loc["org_name"].'</option>'); } else { print ('<option value="'.$row_loc["org_ID"].'">'.$row_loc["org_name"].'</option>'); } } print ("</select>"); } ?> </td> </tr> this field, Location, is one of the search filters(parameters) on a screen. What it does is display a list of all patients in a particular location(hospital). User selects a location from the drop-down list and hits on Search button on screen to display results for that location. The whole thing works fine. except that, after the search is displayed(the same screen reloads), on the list screen, this drop-field goes back to the default value - blank. it does not show the selected location. i would like to show the selected location so users know what location was chosen. help anyone?
×
×
  • 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.