Jump to content

rsammy

Members
  • Posts

    212
  • Joined

  • Last visited

    Never

Everything posted by rsammy

  1. i have a screen where apart from other fields, i have these two fields: <tr> <td><div align="right"><font class="inputLbl">Wireless Access: </font></div></td> <td><select name="wirelessaccess" > <? if (isset ($wireless)) { print ("<option value='$wireless' selected>$wireless</option>"); if ($wireless == "Yes") { print("<option value='No'>No</option> "); } elseif ($wireless == "No") { print("<option value='Yes'>Yes</option>"); } } else { print("<option value='No' selected>No</option> "); print("<option value='Yes'>Yes</option>"); } ?> </select></td> </tr> <tr> <td><div align="right"><font class="inputLbl">PIN: </font></div></td> <td><input name="phypin" type="text" class="txtboxLarge" id="phypin" value="<?PHP print($rowz["phy_pin"]); ?>"></td> </tr> what i need to do is, be able to enter some info in the field if the wirelessaccess field takes the value 'Yes'. the field can be made readonly if wireless access field takes 'No'. How can i do this? i am stuck at this point. is this possible with php - i guess php is a server side script. any help will be gladly appreciated. thanx in advance
  2. thanx mate. appreciate ur response.
  3. i have a query: SELECT * FROM orgs WHERE org_name='$org_name' AND org_type='$org_type' now, how can i get just the frist 8 characters of the org_name field? I want the query to return just 8 characters for me. Is this possible? thanx
  4. i have a page where i build a report(a batch report that consists of n number of items). one of the columns of this report is patient # column. this patient # can either be 9 characters long(all numerics, usually) or 18 characters long(starts with P or Q followed by 17 numerics). the page has a button - Generate Final Report. When this button is clicked, if the system sees any patient # with a P or Q, it should throw up a message alerting the user on this. Clicking OK on the alert box will generate the report. Cancel brings user back to the current page. here is the code that somehow does not do what it is supposed to do. I am check the length of the field(patient # field) but I am sure thats not how it is done. can someone help me out after checking the code out??? this is the button text: <td width="252"> <div align="left"> </div></td> <td colspan="1"> <? if (strlen($row2->pat_num == 9)) { ?> <form name="billingPostCard" method="post" action="billingPostCard.php?type=posttcard" > <? } else { ?> <form name="billingPostCard" method="post" action="billingPostCard.php?type=posttcard" onClick="return validateGenerateReport()"> <? } ?> <div align="center"> <p> <input name="posted" type="hidden" value="Yes"> <input type="hidden" name="visit_time" value="<? print ("$visit_time"); ?>"> <input type="hidden" name="visit_loc" value="<? print ("$visit_loc"); ?>"> <input type="hidden" name="pat_phy_id" value="<? print ("$pat_phy_id"); ?>"> <input type="hidden" name="pat_num" value="<? print("$pat_num"); ?>"> <input type="hidden" name="visit_palm_db_id" value="<? print ("$row2->visit_palm_db_id"); ?>"> <input name="y2" type="hidden" id="y2" value="<? print("$y2"); ?>"> <input name="d2" type="hidden" id="d2" value="<? print ("$d2"); ?>"> <input name="m2" type="hidden" id="m2" value="<? print ("$m2"); ?>"> <input name="y1" type="hidden" id="y1" value="<? print("$y1"); ?>"> <input name="d1" type="hidden" id="d1" value="<? print("$d1"); ?>"> <input name="m1" type="hidden" id="m1" value="<? print ("$m1"); ?>"> <input name="select" type="hidden" id="select" value="<? print("$select"); ?>"> <input name="select1" type="hidden" id="select1" value="<? print("$select1"); ?>"> <input name="select2" type="hidden" id="select2" value="<? print("$select2"); ?>"> <input name="select3" type="hidden" id="select3" value="<? print("$select3"); ?>"> <input name="select4" type="hidden" id="select4" value="<? print("$select4"); ?>"> <input name="select5" type="hidden" id="select5" value="<? print("$select5"); ?>"> <input name="select6" type="hidden" id="select6" value="<? print("$select6"); ?>"> <input name="search5" type="hidden" id="search5" value="<? print("$search5"); ?>"> <input name="search4" type="hidden" id="search4" value="<? print("$search4"); ?>"> <input name="search3" type="hidden" id="search3" value="<? print("$search3"); ?>"> <input name="search2" type="hidden" id="search2" value="<? print("$search2"); ?>"> <input name="search1" type="hidden" id="search1" value="<? print("$search1"); ?>"> <input type="hidden" name="physician" value="<? print ("$physician"); ?>"> <input name="billingrecordtype" type="hidden" id="billingrecordtype" value="<? print ("$billingrecordtype"); ?>"> <input type="hidden" name="loc" value="<? print ("$loc"); ?>"> <input type="hidden" name="diag" value="<? print ("$diag"); ?>"> <input type="hidden" name="proc" value="<? print ("$proc"); ?>"> <input type="hidden" name="visitdate" value="<? print ("$row2->date"); ?>"> <input type="hidden" name="prefprov_phyid" value="<? print ("$prefprov_phyid"); ?>"> <input type="hidden" name="username" value="<? print ("$USER_NAME"); ?>"> <? //**********Following variable is used to check if Search button has been clicked already! if button is clicked, this variable //contains the value YES else it has a NO. if this variable is a NO, hide the printfriendly button on this page and show it only //when it is YES********** - 02/21/2007 if (($searchon == "Yes") AND ($billingrecordtype=="Billable") OR (isset($rowNum))) { ?> <input class="sbttn" type="submit" align="center" name="action" tabindex ="16" value="Generate Final Report"> <? } ?> </p> </div> </form> </td> this is the function validateGenerateReport(): function validateGenerateReport() { var answer= confirm("Warning: Please note that you are generating a Final billing Report that contains temporary Pt. #'s.\r\n\nIf you wish to proceed, click 'OK' below.\r\nIf you wish to go back to Registered Patients and convert to permanent Pt. #'s, click the 'Cancel' button below."); //echo("var answer = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. ');"); //alert(answer); if (answer) return(true); else return (false); } patient numbers starting with a P or Q (and usually >9 in length) are called temporary patient numbers and those with exactly 9 characters(usually numeric) are called permanent patient numbers. and this is the code to display the values in the report: for($q=0;$q<$limit_results && $rowNum < $num_rows2;$q++) { if(mysql_data_seek($result2, $rowNum++)) { if ($i++%2) { print ("<tr bgcolor=\"#cccccc\">"); } else { print ("<tr>"); } $row2 = mysql_fetch_object($result2); $dcn_posted_for_billing=$row2->dcn_posted_for_billing; print("<td height=\"14\"> <div align=\"left\">"); print($row2->pat_last_name); print(", "); if($row2->pat_mid_init!="") { print ($row2->pat_first_name); print(" "); print ($row2->pat_mid_init); print("."); } else { print($row2->pat_first_name); } print("</div></td>"); print("<td height=\"14\"> <div align=\"left\">"); //print($row2->date); print ("<a href=\"Recorddetails_billing.php?select=$select&select1=$select1&select2=$select2&select3=$select3&select4=$select4&select5=$select5&select6=$select6&search1=$search1&search2=$search2&search3=$search3&search4=$search4&search5=$search5&m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2&visit_id=$row2->visit_id&visit_type=ICN&visit_status=$row2->visit_status&visit_loc=$row2->visit_loc&pat_first_name=$row2->pat_first_name&pat_mid_init=$row2->pat_mid_init&pat_last_name=$row2->pat_last_name&phy_fname=$row2->phy_fname&phy_lname=$row2->phy_lname&pat_dob=$row2->pat_birthday&pat_num=$row2->pat_num&pat_sex=$row2->pat_sex&billingrecordtype=$billingrecordtype&dcn_posted_for_billing=$dcn_posted_for_billing&visit_palm_db_id=$visit_palm_db_id&rowNum=$rowNum\">$row2->date</a>"); print("</div></td>"); // 12.3 GD Align Left print("<td height=\"14\"> <div align=\"left\">"); //print("<td height=\"14\"> <div align=\"center\">"); // 12.3 GD find the procedure matching pat id and visit id $procquery="SELECT proc_proc FROM proc WHERE proc_patid='$row2->pat_ID' AND proc_visit_id='$row2->visit_id'"; //$procquery="SELECT proc_proc from proc where proc_patid='$row2->pat_ID'"; $procresult=mysql_query($procquery); $procrow = mysql_fetch_array($procresult); $proc = $procrow["proc_proc"]; print($proc); print("</div></td>"); print("<td height=\"14\"> <div align=\"left\">"); // 12.3 GD find the diagnosis matching pat id and visit id $diagquery="SELECT diag_diag FROM diag WHERE diag_patid='$row2->pat_ID' AND diag_visit_id='$row2->visit_id'"; $diagresult=mysql_query($diagquery); $diagrow = mysql_fetch_array($diagresult); //$diagquery="SELECT diag_diag from diag where diag_patid='$row2->pat_ID'"; //$procresult=mysql_query($diagquery); //$diagrow = mysql_fetch_array($procresult); $diag = $diagrow["diag_diag"]; print($diag); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); //print("Prov. "); //**********Changes made to the following code on 11/15/2006 to display the attending provider first initial, mid initial and last initial rather than the full first and last names. Also included code for displaying preferred providers similarly - RM ********** print($row2->phy_fname[0]); print($row2->phy_minit); print($row2->phy_lname[0]); print("</div></td>"); //**********Save prefphyid from above query into a variable********** $prefprov_phyid=$row2->prefphyid; print("<td height=\"14\"> <div align=\"center\">"); //**********Following code displays only the first 8 characters of the location field(even if it is >********** if (strlen($row2->visit_loc)> { $shortloc = $row2->visit_loc; //$shortloclimit=8; echo substr($shortloc,0,; } else { print($row2->visit_loc); } print("</div></td>"); //$dcn_posted_for_billing=$row->dcn_posted_for_billing; //print("DCNPOSBILL IS ...: ".$dcn_posted_for_billing); print("<td height=\"14\"> <div align=\"center\">"); //**********Following code displays only the first and last 8 characters of the ssn field(even if it is >9)********** if (strlen($row2->pat_num)>9) { $shortstr = $row2->pat_num; echo substr($shortstr,0,1).substr($shortstr,strlen($shortstr)-; } else { print($row2->pat_num); } //print($row2->pat_num); print("</div></td>"); print("</tr>"); } } print ("<tr>"); print("<td colspan=\"6\" height=\"14\"> <div align=\"center\">"); $pages = intval($num_rows2/$limit_results); if($num_rows2%$limit_results) { $pages++; } print("<b>Page</b> "); i need to check the patient # column for any temporary patient #s(starting with P or Q and >9 characters long) and alert the user if such a patient # exists in the batch. Any help will be greatly appreciated
  5. i realized it after i posted the thread! sorry bout that. and thanx for ur reply anyways!
  6. how do i change the tab order of fields on my screen. At the moment they work left to right. I need to change it to top to bottom on column 1 and then top to bottom on column 2. thanx
  7. thanx a lot! appreciate ur help - it works. topic solved
  8. thanx for ur replies. now i have another question. i am using a pre-determined date - say 10/30/2007 as the value for $datez. how can i get this to reflect to 15 days earlier($datez should now hold a date that is 15 days older than 10/30/2007). help wud be greatly appreciated. thanx again
  9. i need to find a date 15 dates from today. how do i do this? i have this code: if (empty($m2)&& empty($d2) && empty ($y2)) { $datez="0000-00-00"; } and i use this $datez in my query. but how do i make this $datez to reflect 15 days earlier from todays date? thanx
  10. never mind, i figured it out. thanx for the responses anyways.
  11. not sure how to put it. i have a screen where i am generating a report on patient activity. i can either enter the search parameters or just hit the search button without specifying any parameters. when i hit search, i build a table(insert the values from different tables into this one) and then i am supposed to call values from this newly built table to display them on screen. again, i can only display 25 records at a time. there are page number links at the bottom of the screen and clicking on a number takes me to that particular page(the page is reloaded). now, how do i accomplish the task above without executing the build table(insert into table) query when page is reloaded to display the items on screen? i can give u the code i have if anyone wants to check it out... thanx in advance
  12. i have a sting which is 18 characters in length. the first character starts off with either a 'P' or a 'Q' followed by 17 numerics. (something like this:P12220070806181242 or Q12220071030162349). i do not have enough room on the screen to display this entire string as it is. I want to crop it. would like to display the first character('P' or 'Q') followed by the last 8 digits(06181242 or 30162349). how can i do this? the string should show up as Q30162349 or P06181242 to be able to save space on the display screen. any help will be greatly appreciated. thanx
  13. never mind, i figured it out. thanx for ur response though! really do appreciate it.
  14. i have a page where i display a list of records each with a hyperlink called 'delete'. when this delete hyperlink is clicked, a javascript funtion is called to throw a confirmation box(with OK and cancel buttons). when i say OK on the current page should reload with the other remaining records in the list (minus the record chosen to be delted). how it works now: page first loads blank. i click on search button to load the page(POST) with the list of records. then i choose one of them(by clicking on the delete hyperlink). confirmation box comes up, i click OK. it reloads the page - but it is blank. it does not show the page with the remainder of the records from the list. there is also another function on this page that uses the GET method. if there are more than 25 records on the page, i display them on the next page. so, if i click on page # 2 at the bottom, the GET method starts working and the page is (re)loaded with the next 25 records. here is the code if it can help! <?PHP //File for database information require_once ("../config.php"); include ("phpInclude/cookie.php"); if ($select=$_POST["select"]) { $select1=$_POST["select1"]; $select=$_POST["select"]; print ("SELECT1 is...: ".$select1); print ("SELECT is...: ".$select); $m1=$_POST["m1"]; $d1=$_POST["d1"]; $y1=$_POST["y1"]; $m2=$_POST["m2"]; $d2=$_POST["d2"]; $y2=$_POST["y2"]; $searchon=$_POST["searchon"]; } elseif ($select=$_GET["select"]) { $rowNum=$_GET["rowNum"]; $select=$_GET["select"]; $select1=$_GET["select1"]; print("SELECT IS...: ".$select); $m1=$_GET["m1"]; $d1=$_GET["d1"]; $y1=$_GET["y1"]; $m2=$_GET["m2"]; $d2=$_GET["d2"]; $y2=$_GET["y2"]; } $batch_ID=$_GET["batch_ID"]; //print("BATCH ID IS...: ".$batch_ID); if (isset($USER_NAME)) { list($user_fname, $user_lname) = explode (' ', $USER_NAME); if ($USER_NAME == ' Office Manager') { $query= "SELECT grp_name FROM group_details"; } else { $query= "SELECT grp_name FROM group_details, user_mgr WHERE user_mgr.user_fname='$user_fname' AND user_mgr.user_lname='$user_lname' AND user_mgr.user_grp_id=group_details.grp_id"; } $result=mysql_query($query); $row = mysql_fetch_array($result); $group_name = $row["grp_name"]; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>BILLING</title> <link rel='stylesheet' type='text/css' href='css/styleSheet.css'> <SCRIPT language="JavaScript" src="js/tree.js"> </SCRIPT> <SCRIPT language="JavaScript"> <?PHP //Navigation File require_once ("../nav.php"); ?> </SCRIPT> <SCRIPT language="JavaScript"> function trim(inputString) { // Removes leading and trailing spaces from the passed string. Also // removes consecutive spaces and replaces it with one space. var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { // Check for spaces at the beginning of the string retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { // Check for spaces at the end of the string retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length); } while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings } return retValue; // Return the trimmed string back to the user } // Ends the "trim" function 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; if (trim(y1).length < 1) { if ((m1.length < 1) || (d1.length < 1)) { err_msg[i] = "Invalid Date."; i++; } } if (trim(y2).length < 1) { if ((m2.length <0) || (d2.length <1)) { err_msg[i] = "Invalid Date."; 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> <script> function deleteReport() { //alert("HERE IN FUNCTION"); var answer= confirm("Warning: You are about to \'Detele\' a Final Billing Report.\r\nDeleting this report will return ALL of the encounters on that report to the billable encounter pool.\r\nThey are then eligible to be committed to another FINAL Billing Report or to be rendered \'Not Billable\'.\r\n\nIf you wish to Delete this Final Report, click \'OK\'. If you do not want to delete this report, click \'Cancel\' below."); //echo("var answer = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. ');"); alert(answer); if (answer) return(true); else return (false); } </script> <? if (isset($batch_ID)) { //print("BATCH ID IS...: ".$batch_ID); //print("Here in update"); $updatequery="UPDATE dcn SET dcn_posted_for_billing='No', dcn_billing_batch_ID='' WHERE dcn_billing_batch_ID='$batch_ID'"; print $updatequery; $resultupdatequery=mysql_query($updatequery); if (! $resultupdatequery) { $error="Error updating dcn"; } //print("Here in delete"); $deletequery="DELETE FROM billing_batch WHERE batch_ID='$batch_ID'"; $resultdeletequery=mysql_query($deletequery); if (! $resultdeletequery) { $error="Error deleting from billing_batch"; } } ?> </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="276" height="571"> <table width="276" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><div align="center"><img src="../images/clear.gif" height="15" width="1"><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" height="571"> <br> <br> <table width="614" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699"> <b><font color="#FFFFFF">PREVIOUS REPORTS</font></b> </td> </tr> <tr> <td height="472"> <table width="592" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"><img src="../images/clear.gif" width="1" height="15"></td> </tr> <tr> <td width="15"> </td> <td rowspan="3" align="left" valign="top" width="563"> <form action="previousPostingBatches.php" method="post" name="form1" id="form1" onSubmit="return validate()"> <!--**********Begin Search Parameters table (before Search button) **********--> <table width="564" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="297"> <div align="right"><font class="inputLbl"> <input type="hidden" name="select" value="<? print ("ICN"); ?>"> </font></div></td> <td colspan="2"> </td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl">From Date: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxsm" type="text" name="m2" maxlength="2" value="<? if (isset($m2)){ print ("$m2"); }?>" > / <input class="txtboxsm" type="text" name="d2" maxlength="2" value="<? if (isset($d2)){ print ("$d2"); }?>" > / <input class="txtboxsm" type="text" name="y2" maxlength="4" value="<? if (isset($y2)){ print ("$y2"); }?>" > </td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl">To Date: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxsm" type="text" name="m1" maxlength="2" value="<? if (isset($m1)){ print ("$m1"); }?>" > / <input class="txtboxsm" type="text" name="d1" maxlength="2" value="<? if (isset($d1)){ print ("$d1"); }?>" > / <input class="txtboxsm" type="text" name="y1" maxlength="4" value="<? if (isset($y1)){ print ("$y1"); }?>" > <script language="JavaScript"></script> </td> </tr> <tr> <td width="297"> <div align="right"><font class="inputLbl">Display Results In: </font></div></td> <td width="267" colspan="2"><font class ="SELECT"> <select name="select1"> <? if (isset ($select1)){ print ("<option value='$select1' selected>"); if($select1==DESC){print "Descending Order"; } elseif ($select1==ASC){print "Ascending Order"; } print ("</option>"); if ($select1 != 'DESC'){ print ("<option value='DESC'>Descending Order</option>"); } if ($select1 != 'ASC') { print ("<option value='ASC'>Ascending Order</option>"); } } else { ?> <option value="DESC" >Descending Order</option> <option value="ASC">Ascending Order</option> </select> <? } ?> </font></td> </tr> <tr> <td width="297"> <div align="right"></div></td> <td width="267" colspan="2"> <input name="searchon" type="hidden" id="searchon" value="Yes"> <input class="sbttn" type="submit" name="Submit" value="Search"> </td> </tr> </table> </form> <table width="565" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#006699"> <div align="left"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Batch ID </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Date Generated</font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Time Generated</font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Generated By</font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Delete Rpt</font></font></b></div> <div align="center"><b><font color="#FFFFFF"></font></b></div></td> </tr> <?PHP if ($select) { if (empty($m1)&& empty($d1) && empty ($y1)) { $query3="select Date_Format(curdate(), '%Y/%m/%d/') as dates"; $resultz=mysql_db_query("$database[dbname]", $query3); $rz=mysql_fetch_array($resultz); $dates=$rz["dates"]; } else { $dates=trim("$y1")."/".trim("$m1")."/".trim("$d1"); } if (empty($m2)&& empty($d2) && empty ($y2)) { $datez=""; } else { $datez=trim("$y2")."/".trim("$m2")."/".trim("$d2"); } print("HERE AFTER DEKETE"); $query2="SELECT batch_ID, Date_Format(batch_date_created, '%m/%d/%Y') as batch_date_created, Time_Format(batch_time_created, '%h:%i %p') as batch_time_created, batch_created_by FROM billing_batch WHERE batch_date_created <= '$dates' AND batch_date_created >= '$datez' ORDER BY batch_ID $select1"; //print($query2); $result=mysql_db_query("$database[dbname]", $query2); $num_rows=mysql_num_rows($result); $num_results=mysql_num_rows($result); $row2 = mysql_fetch_array($result); $batch_ID=$row2["batch_ID"]; $batch_created_dt=$row2["batch_date_created"]; $batch_created_tm=$row2["batch_time_created"]; $batch_created_by=$row2["batch_created_by"]; //print("BATCH ID IS ...: ".$batch_ID); $i=1; if(!isset($rowNum)) { $rowNum = 0; } $rowNumHold = $rowNum; //echo "$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>"); } $row = mysql_fetch_object($result); print("<td height=\"14\"> <div align=\"left\">"); print($row->batch_ID); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); //print($row->batch_date_created); print ("<a href=\"billingPostCard1.php?batch_ID=$row->batch_ID\">$row->batch_date_created</a>"); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row->batch_time_created); print(" "); print("$servertimezone"); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row->batch_created_by); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); //print ("<a href=\"billingPostCard1.php?batch_ID=$row->batch_ID\">Select</a>"); print ("<a href=\"previousPostingBatches.php?batch_ID=$row->batch_ID\" onClick=\"return deleteReport()\">Delete</a>"); //print ("<a href=\"previousPostingBatches.php?batch_ID=$row->batch_ID\" onClick=\"return confirm('Warning: You are about to \'Detele\' a Final Billing Report.\r\nDeleting this report will return ALL of the encounters on that report to the billable encounter pool.\r\nThey are then eligible to be committed to another FINAL Billing Report or to be rendered \'Not Billable\'.\r\n\nIf you wish to Delete this Final Report, click \'OK\'. If you do not want to delete this report, click \'Cancel\' below.')\">Delete</a>"); print("</div></td>"); print("</tr>"); } } print ("<tr>"); print("<td colspan=\"6\" height=\"14\"> <div align=\"center\">"); $pages = intval($num_rows/$limit_results); if($num_rows%$limit_results) { $pages++; } print("<br>"); print("<b>Page</b> "); for($z=0;$z<$pages;$z++) { print("<a href=\"previousPostingBatches.php?rowNum="); print ($limit_results*$z); print("&select="); print($select); print("&select1="); print($select1); print("&m1="); print($m1); print("&m2="); print($m2); print("&y1="); print($y1); print("&y2="); print($y2); print("&d1="); print($d1); print("&d2="); print($d2); print("\">"); if(($z + 1) == (($rowNumHold/$limit_results) + 1)) { print("["); print($z + 1); print("]"); } else { print($z + 1); } print("</a> "); } print(" ($num_rows records found)"); print("</div></td>"); print("</tr>"); } else { ?> <tr> <td height="14" bgcolor="#CCCCCC"> </td> <td height="14" bgcolor="#CCCCCC">No Posting Card Batches Found ...</td> <td height="14" bgcolor="#CCCCCC"> </td> <td height="14" bgcolor="#CCCCCC"> </td> </tr> <?PHP } } ?> </table></td> <tr> <td width="15" height="431"><img src="../images/clear.gif" width="15" height="8"></td> <!--<td width="15" height="431"> </td>--> </tr> </table></td> </tr> <table width="564" border="0" cellspacing="0" cellpadding="0"> <br> <tr> <td width="252"> <div align="left"> </div></td> <td colspan="3"> <form action="billingPrintlists.php?type=billingbatch" method="post" name="form1" id="form"> <input name="y2" type="hidden" id="y2" value="<? print("$y2"); ?>"> <input name="d2" type="hidden" id="d2" value="<? print ("$d2"); ?>"> <input name="m2" type="hidden" id="m2" value="<? print ("$m2"); ?>"> <input name="y1" type="hidden" id="y1" value="<? print("$y1"); ?>"> <input name="d1" type="hidden" id="d1" value="<? print("$d1"); ?>"> <input name="m1" type="hidden" id="m1" value="<? print ("$m1"); ?>"> <input name="select" type="hidden" id="select" value="<? print("$select"); ?>"> <input name="select1" type="hidden" id="select1" value="<? print("$select1"); ?>"> <? if (($searchon == "Yes") OR (isset($_GET["rowNum"]))) { ?> <input class="sbttn" type="submit" name="Submit2" value="Print-Friendly"> <? } ?> </form> </td> </tr> </table> </table> </tr> </table> </body> </html> <?PHP mysql_close(); ?> how do i make the third action on this screen work the way i want it to? any help will be great. thanx
  15. thanx for replying BlueSkyIS ... i tried this out. im sure im messing it somewhere. could you take a look at my code and tell me where and what to do --- the button text is at the bottom. here is my code... <?PHP //File for database information //require_once ("phpInclude/config.php"); require_once ("../config.php"); //File to verify authenticated user include ("phpInclude/cookie.php"); //$dcn_approved_for_billing = $_GET["approval"]; //$dcn_tran_id = $_GET["tran_id"]; $dcn_approved_for_billing = $_POST["approval"]; $dcn_tran_id = $_POST["tran_id"]; $billingrecordtype=$_POST["billingrecordtype"]; $dcn_billing_status= $_POST["dcn_billing_status"]; //$querydcn = "UPDATE dcn SET dcn_approved_for_billing='$dcn_approved_for_billing', dcn_billing_status='$dcn_billing_status' WHERE dcn_tran_ID='$dcn_tran_id' "; $querydcn = "UPDATE dcn SET dcn_approved_for_billing='$dcn_approved_for_billing', dcn_billing_status='$dcn_billing_status', dcn_posted_for_billing='$dcn_posted_for_billing' WHERE dcn_tran_ID='$dcn_tran_id' "; //echo "$query"; mysql_query($querydcn); if ($select1=$_POST["select1"]) { //echo "$select1"; $search1=$_POST["search1"]; $search2=$_POST["search2"]; $search3=''; $search4=''; $search5=''; //$billingrecordtype=$_POST["billingrecordtype"]; //print("BILLIN REC TYPE IN POST BLOCK IS ...: " . $billingrecordtype); $select=$_POST["select"]; $select2=$_POST["select2"]; $select2=stripslashes($select2); $select4=$_POST["select4"]; $select5=$_POST["select5"]; $select5=stripslashes($select5); $physician=$_POST["physician"]; $select3=$_POST["select3"]; $m1=$_POST["m1"]; $d1=$_POST["d1"]; $y1=$_POST["y1"]; $m2=$_POST["m2"]; $d2=$_POST["d2"]; $y2=$_POST["y2"]; //$client_id=$_POST["client_id"]; $prv_rowNum=$_POST["rowNum"]; print("PHY IS ...: ".$physician); } elseif ($select1=$_GET["select1"]) { //if (is_null($rowNum)){$rowNum='0';} //echo "$rowNum"; $rowNum=$_GET["rowNum"]; $search1=$_GET["search1"]; $search2=$_GET["search2"]; $search3=''; $search4=''; $search5=''; $billingrecordtype=$_GET["billingrecordtype"]; $select=$_GET["select"]; $select2=$_GET["select2"]; $select2=stripslashes($select2); $select4=$_GET["select4"]; $select5=$_GET["select5"]; $select5=stripslashes($select5); $select3=$_GET["select3"]; $select6=$_GET["select6"]; $billingrecordtype=$_GET["billingrecordtype"]; $physician=$_GET["physician"]; $m1=$_GET["m1"]; $d1=$_GET["d1"]; $y1=$_GET["y1"]; $m2=$_GET["m2"]; $d2=$_GET["d2"]; $y2=$_GET["y2"]; print("PHY IS ...: ".$physician); } if (isset($USER_NAME)) { list($user_fname, $user_lname) = explode (' ', $USER_NAME); if ($USER_NAME == ' Office Manager') { $query= "SELECT grp_name FROM group_details"; } else { $query= "SELECT grp_name FROM group_details, user_mgr WHERE user_mgr.user_fname='$user_fname' AND user_mgr.user_lname='$user_lname' AND user_mgr.user_grp_id=group_details.grp_id"; } $result=mysql_query($query); $row = mysql_fetch_array($result); $group_name = $row["grp_name"]; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <link rel='stylesheet' type='text/css' href='css/styleSheet.css'> <SCRIPT language="JavaScript" src="js/tree.js"> </SCRIPT> <SCRIPT language="JavaScript"> <?PHP //Navigation File require_once ("../nav.php"); ?> </SCRIPT> <SCRIPT language="JavaScript"> function trim(inputString) { var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { // Check for spaces at the beginning of the string retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { // Check for spaces at the end of the string retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length); } while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings } return retValue; // Return the trimmed string back to the user } // Ends the "trim" function 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; if (trim(y1).length < 1) { if ((m1.length < 1) || (d1.length < 1)) { err_msg[i] = "Invalid Date."; i++; } } if (trim(y2).length < 1) { if ((m2.length <0) || (d2.length <1)) { err_msg[i] = "Invalid Date."; 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; } } /* function validateGenerateButton() { alert("here"); var result = true; //if (!IsNumeric(document.forms[0].pat_ssn)) if (!IsNumeric(document.form[1].pat_ssn)) { alert("in if loop"); result = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. '); } alert("here after if"); return result; } function IsNumeric(pat_ssn) // check for valid numeric strings { var strValidChars = "0123456789-"; var strChar; var blnResult = true; if (pat_ssn.length == 0) return false; // test strString consists of valid characters listed above for (i = 0; i < pat_ssn.length && blnResult == true; i++) { strChar = pat_ssn.charAt(i); if (strValidChars.indexOf(strChar) == -1) { blnResult = false; } } return blnResult; } */ </SCRIPT> <? if if (strlen($pat_ssn)!=9) { //post to conflictssn.php echo("<SCRIPT LANGUAGE=Javascript>"); echo("function validateGenerateButton(){"); echo("alert("here");"); echo("var result = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. ');}"); echo(" if (!result) history.go(-1);"); echo("else document.forms['form1'].submit();"); alert("here after if"); //echo("var answer = confirm('You are attempting to assign a Patient # that is already assigned to an existing patient in the InstiComm system. Entered Patient # already exists! The new patient you just entered is:\\n\\n Name: " .$PatientFirstName . " " .$PatientMiddleInitial . " " .$PatientLastName." \\n Patient #: " .$SavedSSN . " \\n Date of Birth: " .$PatientDOB . " \\n Enter Date: " .$PatientRegDate . "\\n\\nYou can choose to: \\n\\n a) Return to the previous screen and make a correction to the entered Patient # or, \\n b)Merge information of the two patients and losing all Patient Registration information pertaining to the patient displayed above, retaining \\n any ICN\'s/Encounters.\\n\\nThe resulting patient \'status\' will be \'Active\' if one of the merged patients is in the \'Active\' or \'Follow\' state. It will result in \'Not Active\' if both of the merged patients are \'Not Active\' or \'Do Not Follow\'. \\n\\nTHIS PATIENT WILL NO LONGER EXIST IN THE InstiComm SYSTEM.\\n\\nInformation pertaining to patient listed below will overwrite all information except the earliest Enter Date, pertaining to patient displayed at the top of this message. The patient already in the InstiComm system with entered patient # is:\\n\\n Name: " .$dbfname . " " . $dbmidinit . " " . $dblname ."\\n Patient #: " .$dbssn . "\\n Date of Birth: " .$dbdob . " \\n Enter Date: " .$dbregdate . "\\n\\n Click on OK to replace patient information(above) with new patient information(below) or, \\n CANCEL to go back and change the Patient # whose information you wish to update!\\n\\n*** CLICKING ON OK WILL DELETE ALL EXISTING PATIENT REGISTRATION INFORMATION BELONGING TO PATIENT DISPLAYED\\n AT THE TOP BUT RETAIN ALL PATIENT ICNs/ENCOUNTERS. THE RESULTING PATIENT \'STATUS\' WILL BE ACTIVE IF ONE OF\\n THE MERGED PATIENTS IS IN THE \'Active\' OR \'Follow\' STATE. IT WILL RESULT IN \'Not Active\' IF BOTH OF THE MERGED\\n PATIENTS ARE \'NOT ACTIVE\' OR \'Do Not Follow\' *** ');"); //echo(" if (!answer) history.go(-1);"); //echo("else document.forms['UpdatedPatInfo'].submit();"); echo("</SCRIPT>"); } else ?> </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="276" height="571"> <table width="276" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><div align="center"><img src="../images/clear.gif" height="15" width="1"><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><font face="Verdana, Arial, Helvetica, sans-serif" size="2">***********************<br> ABC 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" width="624" height="571"> <br> <br> <table width="614" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699"> <b><font color="#FFFFFF">BILLING BATCH REPORT: GET LIST</font></b> </td> </tr> <tr> <td height="472"> <table width="592" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"><img src="../images/clear.gif" width="1" height="15"></td> </tr> <tr> <td width="15"> </td> <td rowspan="3" align="left" valign="top" width="563"> <form action="billingMgtList.php" method="post" name="form1" id="form1" onSubmit="return validate()"> <table width="564" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="297"> <div align="right"><font class="inputLbl"> <input type="hidden" name="select1" value="<? print ("ICN"); ?>"> </font></div></td> <td colspan="2"> </td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl"> Patient Last Name: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxLarge" type="text" name="search1" value="<? if (isset($search1)){ print ("$search1"); }?>" > </td> <td width="297"> <div align="right"><font class="inputLbl">Primary Sort: </font></div></td> <td width="133"><font class ="SELECT"> <select name="select2"> <? if (isset ($select2)){ print ("<option value ='$select2' selected>"); if ($select2== visit_date){print "Visit Date";} elseif ($select2==pat_name){print "Patient Name"; } print ("</option>"); if ($select2!='visit_date'){ print ("<option value='visit_date' >Visit Date</option>");} if ($select2 !='pat_name'){ //print ("<option value='pat_last_name'>Patient Name</option>"); } print ("<option value='pat_name'>Patient Name</option>"); } } else{ ?> <option value="visit_date" selected>Patient Name</option> <option value="pat_name">Visit Date</option> </select> <? } ?> </font></td> <td width="134"></font></td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl">Patient First Name: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxLarge" type="text" name="search2" value="<? if (isset($search2)){ print ("$search2"); }?>" > </td> </tr> <tr> <td width="297"> <div align="right"><font class="inputLbl">Attending Provider: </font></div></td> <td width="267" colspan="2"> <?PHP $query="select phy_id, phy_fname, phy_lname from phy_det where phy_disabled = 'Enable' order by phy_lname, phy_fname"; $result = mysql_query ($query); if ($result) { print ("<select name='physician'>\n"); print ("<option value=\"\"></option>\n"); while($row = mysql_fetch_array($result)) { if($pat_phy_id == $row["phy_id"]) { print ('<option selected value="'.$row["phy_id"].'">'.$row["phy_lname"].', '.$row["phy_fname"].'</option>'); } else { print ('<option value="'.$row["phy_id"].'">'.$row["phy_lname"].', '.$row["phy_fname"].'</option>'); } } print ("</select>"); } ?> <font class="redTxt">*</font> </td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl">From Date: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxsm" type="text" name="m2" maxlength="2" value="<? if (isset($m2)){ print ("$m2"); }?>" > / <input class="txtboxsm" type="text" name="d2" maxlength="2" value="<? if (isset($d2)){ print ("$d2"); }?>" > / <input class="txtboxsm" type="text" name="y2" maxlength="4" value="<? if (isset($y2)){ print ("$y2"); }?>" > </td> <td width="297"> <div align="right"><font class="inputLbl">Secondary Sort: </font></div></td> <td width="133"><font class ="SELECT"> <select name="select5"> <? if (isset ($select5)){ print ("<option value ='$select5' selected>"); if ($select5== visit_date){print "Visit Date";} elseif ($select5==pat_name){print "Patient Name"; } print ("</option>"); if ($select5!='visit_date'){ print ("<option value='visit_date' >Visit Date</option>");} if ($select5 !='pat_name'){ //print ("<option value='pat_last_name'>Patient Name</option>"); } print ("<option value='pat_name'>Patient Name</option>"); } } else{ ?> <option value="visit_date" selected>Visit Date</option> <option value="pat_name">Patient Name</option> </select> <? } ?> </font></td> <td width="134"></font></td> </tr> <tr> <td width="297"> <div align="right"> <div align="right"><font class="inputLbl">To Date: </font></div> </div></td> <td width="267" colspan="2"> <input class="txtboxsm" type="text" name="m1" maxlength="2" value="<? if (isset($m1)){ print ("$m1"); }?>" > / <input class="txtboxsm" type="text" name="d1" maxlength="2" value="<? if (isset($d1)){ print ("$d1"); }?>" > / <input class="txtboxsm" type="text" name="y1" maxlength="4" value="<? if (isset($y1)){ print ("$y1"); }?>" > <script language="JavaScript"></script> </td> </tr> <tr> <td width="297"> <div align="right"><font class="inputLbl">Billing Status: </font></div></td> <td width="267" colspan="2" align="left" valign="top"><select name="billingrecordtype" id="billingrecordtype"> <?PHP if($billingrecordtype == "Not Billable") { ?> <option value="Not Billable" selected>Not Billable</option> <option value="Billable">Billable</option> <? } else { ?> <!--**********'Active' option is the default option for this field on page load**********--> <option value="Billable" selected>Billable</option> <option value="Not Billable">Not Billable</option> <? } ?> </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 width="297"> <div align="right"></div></td> <td width="267" colspan="2"> <input class="sbttn" type="submit" name="Submit" value="Search"> </td> </tr> </table> </form> <table width="614" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#006699"> <div align="left"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Name </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Visit Date </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Procedure </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Diagnosis </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">APrv </font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Location </font></font></b></div></td> <td bgcolor="#006699"> <div align="center"><b><font color="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Patient # </font></font></b></div></td> <div align="center"><b><font color="#FFFFFF"></font></b></div></td> </tr> <?PHP if ($select1) { if (empty($m1)&& empty($d1) && empty ($y1)) { $query3="select Date_Format(curdate(), '%Y/%m/%d/') as dates"; $resultz=mysql_db_query("$database[dbname]", $query3); $rz=mysql_fetch_array($resultz); $dates=$rz["dates"]; } else { //$dates=trim("$y1")."/".trim("$m1")."/".trim("$d1+1"); $dates=trim("$y1")."/".trim("$m1")."/".trim("$d1"); //**********new line added to implement date format in mm/dd/yyyy when displayed on screen for date created field********** $dateto=trim("$m1")."/".trim("$d1")."/".trim("$y1"); } if (empty($m2)&& empty($d2) && empty ($y2)) { $datez=""; $datefrom=""; } else { $datez=trim("$y2")."/".trim("$m2")."/".trim("$d2"); $datefrom=trim("$m2")."/".trim("$d2")."/".trim("$y2"); } $search1=trim("$search1"); $search2=trim("$search2"); $search3=trim("$search3"); $search4=trim("$search4"); $select1=trim("$select1"); $select2=trim("$select2"); $select5=trim("$select5"); if(($select2 == 'visit_date') AND ($select== 'DESC')) { $select3= "visit_date DESC, visit_time"; } elseif(($select2 == 'visit_date') AND ($select== 'ASC')) { $select3= "visit_date ASC, visit_time"; } elseif(($select2 == 'pat_name') AND ($select== 'ASC')) { $select3= "pat_last_name ASC, " . "pat_first_name"; } elseif(($select2 == 'pat_name') AND ($select== 'DESC')) { $select3= "pat_last_name DESC, " . "pat_first_name"; } if(($select5 == 'visit_date') AND ($select4== 'DESC')) { $select6= "visit_date DESC, visit_time"; } elseif(($select5 == 'visit_date') AND ($select4== 'ASC')) { $select6= "visit_date ASC, visit_time"; } elseif(($select5 == 'pat_name') AND ($select4== 'ASC')) { $select6= "pat_last_name ASC, " . "pat_first_name"; } elseif(($select5 == 'pat_name') AND ($select4== 'DESC')) { $select6= "pat_last_name DESC, " . "pat_first_name"; } $query2="SELECT visit_mgr.visit_id, visit_mgr.visit_pat_id, visit_mgr.visit_phy_id, visit_mgr.visit_status, Date_Format(visit_mgr.visit_date, '%m/%d/%Y') as date, phy_det.phy_fname, phy_det.phy_minit, phy_det.phy_lname, pat_dgraphics.pat_ID, pat_dgraphics.pat_first_name, pat_dgraphics.pat_mid_init, pat_dgraphics.pat_last_name, Date_Format(pat_dgraphics.pat_dob, '%m/%d/%Y') as pat_birthday, pat_dgraphics.pat_ssn, pat_dgraphics.pat_sex, pat_dgraphics.pat_ID, visit_mgr.client_id, dcn.dcn_approved_for_billing, dcn.dcn_posted_for_billing, dcn.dcn_billing_status FROM visit_mgr, phy_det, pat_dgraphics, dcn WHERE visit_mgr.visit_type like '%$select1%' AND phy_det.phy_id=visit_mgr.visit_phy_id AND visit_mgr.visit_pat_id=pat_dgraphics.pat_ssn AND phy_det.phy_fname like '%$search3%' AND phy_det.phy_lname like '%$search4%' AND pat_dgraphics.pat_first_name like '%$search1%' AND pat_dgraphics.pat_last_name like '%$search2%' AND pat_dgraphics.pat_ssn like '%$search5%' AND visit_mgr.visit_date <= '$dates' AND visit_mgr.visit_date >= '$datez' AND dcn.dcn_tran_ID=visit_mgr.visit_palm_db_id AND dcn.dcn_posted_for_billing='No' AND dcn.dcn_billing_status='$billingrecordtype' ORDER BY $select3 $select6"; print($query2); $result2=mysql_db_query("$database[dbname]", $query2); $num_rows2=mysql_num_rows($result2); $num_results2=mysql_num_rows($result2); $i=1; if(!isset($rowNum)) { $rowNum = 0; } $rowNumHold = $rowNum; //echo "$rowNum"; $count = 1; $limit_results = 25; if ($num_rows2 > 0) { $billing_batch_flag='No'; for($q=0;$q<$limit_results && $rowNum < $num_rows2;$q++) { if(mysql_data_seek($result2, $rowNum++)) { if ($i++%2) { print ("<tr bgcolor=\"#cccccc\">"); } else { print ("<tr>"); } $row2 = mysql_fetch_object($result2); print("<td height=\"14\"> <div align=\"left\">"); print($row2->pat_last_name); print(", "); if($row2->pat_mid_init!="") { print ($row2->pat_first_name); print(" "); print ($row2->pat_mid_init); print("."); } else { print($row2->pat_first_name); } print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print ("<a href=\"Recorddetails_billing.php?select=$select&select1=$select1&select2=$select2&select3=$select3&m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2&visit_id=$row2->visit_id&visit_type=ICN&client_id=$row2->client_id&visit_status=$row2->visit_status&visit_loc=$row2->visit_loc&pat_first_name=$row2->pat_first_name&pat_mid_init=$row2->pat_mid_init&pat_last_name=$row2->pat_last_name&phy_fname=$row2->phy_fname&phy_lname=$row2->phy_lname&pat_dob=$row2->pat_birthday&pat_ssn=$row2->pat_ssn&pat_sex=$row2->pat_sex&billingrecordtype=$billingrecordtype&rowNum=$rowNum\">$row2->date</a>"); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); $procquery="SELECT proc_proc from proc where proc_patid='$row2->pat_ID'"; $procresult=mysql_query($procquery); $procrow = mysql_fetch_array($procresult); $proc = $procrow["proc_proc"]; print($proc); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); $diagquery="SELECT diag_diag from diag where diag_patid='$row2->pat_ID'"; $procresult=mysql_query($diagquery); $diagrow = mysql_fetch_array($procresult); $diag = $diagrow["diag_diag"]; print($diag); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); //print("Prov. "); print($row2->phy_fname[0]); print($row2->phy_minit); print($row2->phy_lname[0]); print("</div></td>"); $prefprov_phyid=$row2->prefphyid; print("<td height=\"14\"> <div align=\"center\">"); $locquery="SELECT admit_loc from admission where pat_id='$row2->pat_ID'"; $locresult=mysql_query($locquery); $locrow = mysql_fetch_array($locresult); $loc = $locrow["admit_loc"]; print($loc); print("</div></td>"); print("<td height=\"14\"> <div align=\"center\">"); print($row2->pat_ssn); print("</div></td>"); $client_id=($row2->client_id); print("</tr>"); } } print ("<tr>"); print("<td colspan=\"6\" height=\"14\"> <div align=\"center\">"); $pages = intval($num_rows2/$limit_results); if($num_rows2%$limit_results) { $pages++; } print("<b>Page</b> "); for($z=0;$z<$pages;$z++) { print("<a href=\"billingMgtList.php?rowNum="); print ($limit_results*$z); print("&select1="); print($select1); print("&select="); print($select); print("&select2="); print($select2); print("&select3="); print($select3); print("&search3="); print($search3); print("&select4="); print($select4); print("&select5="); print($select5); print("&select6="); print($select6); print("&search1="); print($search1); print("&search2="); print($search2); print("&search4="); print($search4); print("&search5="); print($search5); print("&billingrecordtype="); print($billingrecordtype); print("&m1="); print($m1); print("&m2="); print($m2); print("&y1="); print($y1); print("&y2="); print($y2); print("&d1="); print($d1); print("&d2="); print($d2); print("\">"); if(($z + 1) == (($rowNumHold/$limit_results) + 1)) { print("["); print($z + 1); print("]"); } else { print($z + 1); } print("</a> "); } print(" ($num_rows2 records found)"); print("</div></td>"); print("</tr>"); } else { ?> <tr> <td height="14" bgcolor="#CCCCCC"> </td> <td height="14" bgcolor="#CCCCCC">No Records ...</td> <td height="14" bgcolor="#CCCCCC"> </td> <td height="14" bgcolor="#CCCCCC"> </td> <td height="14" bgcolor="#CCCCCC"> </td> </tr> <?PHP } } ?> </table></td> <tr> <td width="15" height="431"><img src="../images/clear.gif" width="15" height="8"></td> <td width="15" height="431"> </td> </tr> <tr> <td colspan="3" height="2"> </td> </tr> </table></td> <table width="564" border="0" cellspacing="0" cellpadding="0"> <br> <tr> <td width="15"> </td> <td width="14"> </td> </tr> <tr> <td width="252"> <div align="left"> </div></td> <td colspan="1"> <!--<form name="form1" method="post" action="billingPostCard.php?type=posttcard">--> <form name="form1" method="post" action="billingPostCard.php?type=posttcard" onSubmit="return validateGenerateButton()"> <div align="center"> <p> <input type="hidden" name="visit_time" value="<? print ("$visit_time"); ?>"> <input type="hidden" name="visit_loc" value="<? print ("$visit_loc"); ?>"> <input type="hidden" name="pat_first_name" value="<? print ("$pat_first_name"); ?>"> <input type="hidden" name="pat_last_name" value="<? print ("$pat_last_name"); ?>"> <input type="hidden" name="pat_phy_id" value="<? print ("$pat_phy_id"); ?>"> <input type="hidden" name="pat_ssn" value="<? print("$pat_ssn"); ?>"> <input type="hidden" name="enter_date" value="<? print ("$enter_date"); ?>"> <input type="hidden" name="visit_timestamp_received" value="<? print ("$visit_timestamp_received"); ?>"> <input type="hidden" name="visit_palm_db_id" value="<? print ("$visit_palm_db_id"); ?>"> <input name="y2" type="hidden" id="y2" value="<? print("$y2"); ?>"> <input name="d2" type="hidden" id="d2" value="<? print ("$d2"); ?>"> <input name="m2" type="hidden" id="m2" value="<? print ("$m2"); ?>"> <input name="y1" type="hidden" id="y1" value="<? print("$y1"); ?>"> <input name="d1" type="hidden" id="d1" value="<? print("$d1"); ?>"> <input name="m1" type="hidden" id="m1" value="<? print ("$m1"); ?>"> <input name="select2" type="hidden" id="select2" value="<? print("$select2"); ?>"> <input name="select" type="hidden" id="select" value="<? print("$select"); ?>"> <input name="select1" type="hidden" id="select1" value="<? print("$select1"); ?>"> <input name="select4" type="hidden" id="select4" value="<? print("$select4"); ?>"> <input name="select5" type="hidden" id="select5" value="<? print("$select5"); ?>"> <input name="search5" type="hidden" id="search5" value="<? print("$search5"); ?>"> <input name="search4" type="hidden" id="search4" value="<? print("$search4"); ?>"> <input name="search3" type="hidden" id="search3" value="<? print("$search3"); ?>"> <input name="search2" type="hidden" id="search2" value="<? print("$search2"); ?>"> <input name="search1" type="hidden" id="search1" value="<? print ("$search1"); ?> "> <input name="billingrecordtype" type="hidden" id="billingrecordtype" value="<? print ("$billingrecordtype"); ?> "> <input type="hidden" name="username" value="<? print ("$USER_NAME"); ?>"> <input class="sbttn" type="submit" align="center" name="action" value="Generate Final Report"> <? /* if (!is_numeric($pat_ssn)) { //post to billingPostCard.php echo("<SCRIPT LANGUAGE=Javascript>"); echo("var answer = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. ');"); echo(" if (!answer) history.go(-1);"); echo("else document.forms['billingPostCard'].submit();"); echo("</SCRIPT>"); } */ ?> </p> </div> </form> </td> <td width="222"> <div align="left"> </div></td> <td colspan="3"> <!--<td colspan="3" width="624"><div align="center">--> <form action="billingPrintlists.php?type=billinglist" method="post" name="form1" id="form"> <input name="y2" type="hidden" id="y2" value="<? print("$y2"); ?>"> <input name="d2" type="hidden" id="d2" value="<? print ("$d2"); ?>"> <input name="m2" type="hidden" id="m2" value="<? print ("$m2"); ?>"> <input name="y1" type="hidden" id="y1" value="<? print("$y1"); ?>"> <input name="d1" type="hidden" id="d1" value="<? print("$d1"); ?>"> <input name="m1" type="hidden" id="m1" value="<? print ("$m1"); ?>"> <input name="select2" type="hidden" id="select2" value="<? print("$select2"); ?>"> <input name="select" type="hidden" id="select" value="<? print("$select"); ?>"> <input name="select1" type="hidden" id="select1" value="<? print("$select1"); ?>"> <input name="select3" type="hidden" id="select3" value="<? print("$select3"); ?>"> <input name="select4" type="hidden" id="select4" value="<? print("$select4"); ?>"> <input name="select5" type="hidden" id="select5" value="<? print("$select5"); ?>"> <input name="select6" type="hidden" id="select6" value="<? print("$select6"); ?>"> <input name="search5" type="hidden" id="search5" value="<? print("$search5"); ?>"> <input name="search4" type="hidden" id="search4" value="<? print("$search4"); ?>"> <input name="search3" type="hidden" id="search3" value="<? print("$search3"); ?>"> <input name="search2" type="hidden" id="search2" value="<? print("$search2"); ?>"> <input name="search1" type="hidden" id="search1" value="<? print("$search1"); ?> "> <input name="billingrecordtype" type="hidden" id="billingrecordtype" value="<? print("$billingrecordtype"); ?> "> <input name="billing_batch_flag" type="hidden" id="billing_batch_flag" value="<? print("$billing_batch_flag"); ?> "> <input name="client_id" type="hidden" id="client_id" value="<? print ("$client_id"); ?>"> <input class="sbttn" type="submit" name="Submit2" value="Print-Friendly"> </form> </td> </tr> </table> </tr> </table><p> </p></td> </tr> </table> </body> </html> <?PHP mysql_close(); ?> thanx
  16. i am working on an application where a batch of records is approved to generate a final billing report. user clicks on the Generate Final Report on the page. However, before generating the report, user needs to check and see if the patient # field has any non-numeric characters. If yes, it needs to pop a warning message telling the user that there are some temporary patients(patients with non-numeric patient numbers) in this list. Click OK to continue or Cancel to go back to change these patient #s to permanent patient #s(numeric). i am sure the code i have written is not right. can someone help me out with this? here is wat i've come up with... <form name="form1" method="post" action="billingPostCard.php?type=posttcard"> <div align="center"> <p> <input type="hidden" name="visit_time" value="<? print ("$visit_time"); ?>"> <input type="hidden" name="visit_loc" value="<? print ("$visit_loc"); ?>"> <input type="hidden" name="pat_first_name" value="<? print ("$pat_first_name"); ?>"> <input type="hidden" name="pat_last_name" value="<? print ("$pat_last_name"); ?>"> <input type="hidden" name="pat_phy_id" value="<? print ("$pat_phy_id"); ?>"> <input type="hidden" name="pat_num" value="<? print("$pat_num"); ?>"> <input type="hidden" name="enter_date" value="<? print ("$enter_date"); ?>"> <input type="hidden" name="visit_timestamp_received" value="<? print ("$visit_timestamp_received"); ?>"> <input type="hidden" name="visit_palm_db_id" value="<? print ("$visit_palm_db_id"); ?>"> <input name="y2" type="hidden" id="y2" value="<? print("$y2"); ?>"> <input name="d2" type="hidden" id="d2" value="<? print ("$d2"); ?>"> <input name="m2" type="hidden" id="m2" value="<? print ("$m2"); ?>"> <input name="y1" type="hidden" id="y1" value="<? print("$y1"); ?>"> <input name="d1" type="hidden" id="d1" value="<? print("$d1"); ?>"> <input name="m1" type="hidden" id="m1" value="<? print ("$m1"); ?>"> <input name="billingrecordtype" type="hidden" id="billingrecordtype" value="<? print ("$billingrecordtype"); ?> "> <input type="hidden" name="username" value="<? print ("$USER_NAME"); ?>"> <input class="sbttn" type="submit" align="center" name="action" value="Generate Final Report"> <? if (!is_numeric($pat_num)) { //post to billingPostCard.php echo("<SCRIPT LANGUAGE=Javascript>"); echo("var answer = confirm('Please note that you are generating a Final billing Report that contains temporary Pt. #\'s. If you wish to proceed, click \'OK\' below. If you wish to go back to Registered Patients and convert to permanent Pt. #\'s, click the \'Back\' button below. ');"); echo(" if (!answer) history.go(-1);"); echo("else document.forms['billingPostCard'].submit();"); echo("</SCRIPT>"); } } ?> </p> </div> </form> basically this check needs to be done on button click or when Generate Final Report button is clicked. If user says OK go ahead to the next page(billingPostCard.php) or if Cancel is clicked, stay in the same page. (the code example shows me sending it to the previous page - which is not wat i want). i have this code at the bottom of the page where buttons are declared. any help will be greatly appreciated. thanx
  17. thanx chocopi! it worked. thanx to all the replies. appreciate ur help guys
  18. thanx a lot for replying, shankar. im sure its an sql issue. this is where i am stuck $querye =("INSERT INTO messages (message, user_id,status,subject,from_p,received,to_email,time_sent, clientid, tran_ID) VALUES ('$message','$to_id','1','$subject','$PHY_EMAIL','$DATE','$to','$TIME', '$client_id', '$unqID') "); $resulte=mysql_query($querye); if (!$resulte) { $error="Error 441"; } in the query above, '$message' is a blob - a combination of several fields. one of the fields - follow up notes - contains this special character. and thats what is failing. how do i use mysql_real_escape_string() in this query? im sure the single quote(') in this blob is failing the query - i keep getting error 441. i need this real quick - thanx again.
  19. i use an apostrophe or single quote in a blob and it returns an error. any message without the apostrophe passes on smooth. is there some escape character or something i need to use for this one? thanks
  20. not sure how to put it. i have a table: temp_pat_id_history with four fields: temp_pat_id, temp_enter_date, merged_pat_id, merged_enter_date. temp_pat_id is the id (a 13 or 18 digit autogenerated id) for a new patient added(registered) to the system. temp_enter_date is the date the patient is entered(registered) into the system merged_pat_id is the id(a 9 digit id) that the Office Staff assigns to that patient to replace the temp id. merged_enter_date is the date this change was effected. The scenario is: the doctor ADDs(registers) a new patient on his device(mobile device) and it assigns a temp id to this patient. He sends in the diagnosis/procedure/medication info and the date he saw the patient to the server. All info gets into different tables and the temp_pat_id_history table receives values for the two temp fields(temp_pat_id and temp_enter_date). lets say the patient is John Doe, d-o-b: 12/10/1967 when the doctor sends in the info it comes in with a pat_id: P12220070822121554 and enter date: 08-16-2007 11:39:54. Office staff changes the temp_pat_id(18 digit id) to a 9 digit id(this step is mandatory). the temp_pat_id_history table gets updated with the merged_pat_id and merged_enter_date fields getting populated in this step. $inserttempidquery=("INSERT INTO temp_pat_id_history(temp_pat_id, temp_enter_date) VALUES ('$pat_num', '$visit_date_reformat')" ) ; $resulttempidquery=mysql_query($inserttempidquery); $Id = mysql_insert_id(); John Doe's info in temp_pat_id_history table now shows up as: temp_pat_id: P12220070822121554; temp_enter_date: 08-16-2007 11:39:54; merged_pat_id: 7410022166; merged_enter_date: 2007-08-19 14:22:59 Next Step: Office Staff (erroneously) adds the same patient all over again on the server side. (Checks are in place to prevent duplicates from being entered, but she uses a different last name or date-of-birth and then edits the info). when the OFfice Staff enters this patient, it comes in with a pat_id:714002146 and enter date: system or current date(say, 08-16-2007 15:13:06). There are now two entries for the same patient with the same id. Office Staff realizes that two entries for the same patient exist with different ids when she changes the pat_id from a temporary (18 digit) id to the mandatory permanent id(9 digit) and decides to eliminate one of them by merging the two patients. (this process eliminates one of them - criteria of elimination follows an algorithm already in place). during the merge, the temp_pat_id_history is again updated with the new permanent pat_id and the merged_enter_date information. $updateidquery="UPDATE temp_pat_id_history SET temp_pat_id= '$SavedID', merged_pat_id= '$PatientID' WHERE temp_pat_id='$SavedID' " ; $resultupdateid= mysql_query($updatedidquery) or die("Error updating temp id table: ".mysql_error()); the issue is: while doing this: i would like to change the merged_pat_id and merged_enter_date fields for the already updated patient(already changed from temp_pat_id to a permanent(merged_pat_id)). For instance: the merged_pat_id for John Doe from the doctor's device is 741002164 with the enterdate of the merge time. The pat_id for John Doe from the Office Staff is 741002166 with the enter date being the time this patient was registered. I need the query to change the merged_pat_id and merged_enter_date of John Doe that came from the doctors device also. In other words, all John Doe s should show the same merged_pat_ssn and enter_date irrespective of where they came from. How can I tweak the query here? Hope I am being clear here@!@!
  21. wow! thanx for your reply. actually, i need to both generate and put this number in teh field on form load. if user chooses, this can be overwritten with a proper number. for example, this is the patient number field with is very similar to the patient ssn. but at the time of registration, the office manager may not have all info of the patient available to enter it. so just chooses to enter the name and other info with a temp patient #. h/she can later change this part by editing the info with the correct patient #(which is 9 digits long). to make it more clear, i am pasting my code here - so it can be more clear to you on what im doing... <?PHP //File for database information //require_once ("phpInclude/config.php"); require_once ("../config.php"); //File to verify authenticated user include ("phpInclude/cookie.php"); $ClientName=$_GET["Client_Name"]; $ClientName='Group'; $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"; 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>"; } } if (isset($USER_NAME)) { list($user_fname, $user_lname) = explode (' ', $USER_NAME); //$pat_ID=$_POST["pat_ID"]; if ($USER_NAME == ' Office Manager') { $query= "SELECT grp_name FROM group_details"; } else { $query= "SELECT grp_name FROM group_details, user_mgr WHERE user_mgr.user_fname='$user_fname' AND user_mgr.user_lname='$user_lname' AND user_mgr.user_grp_id=group_details.grp_id"; } $result=mysql_query($query); $row = mysql_fetch_array($result); $group_name = $row["grp_name"]; } $message = ""; $goodMessage = ""; ?> <!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" 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 trim(inputString) { // Removes leading and trailing spaces from the passed string. Also // removes consecutive spaces and replaces it with one space. var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { // Check for spaces at the beginning of the string retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { // Check for spaces at the end of the string retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length); } while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings } return retValue; // Return the trimmed string back to the user } // Ends the "trim" function 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; PatientFirstName = document.admitpat.PatientFirstName.value; PatientLastName = document.admitpat.PatientLastName.value; PatientDOB = document.admitpat.PatientDOB.value; //PatientSex = document.admitpat.PatientSex.value; PatientSSN = document.admitpat.PatientSSN.value; InsuranceProvider = document.admitpat.InsuranceProvider.value; InsuranceID = document.admitpat.InsuranceID.value; //alert (PatientSSN); //return false; if (trim(PatientFirstName).length < 1) { err_msg[i] = "First name cannot be blank."; i++; } if (trim(PatientLastName).length < 1) { err_msg[i] = "Last name cannot be blank."; i++; } if (trim(PatientDOB).length < 1) { err_msg[i] = "Date of Birth cannot be blank."; i++; } if (admitpat.PatientSex.value == "") { err_msg[i] = "Patient Sex cannot be blank."; i++; } if(!(isDate(PatientDOB))) { err_msg[i] = "Date of Birth is not valid. It must be in this format: mm/dd/yyyy."; i++; } if (trim(PatientSSN).length < 1) { err_msg[i] = "Patient Number cannot be blank."; i++; } if(!(SSNValidation(PatientSSN))) { err_msg[i] = "Patient # is not valid."; i++; } if (admitpat.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> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function changeCase(frmObj) { var index; var tmpStr; var tmpChar; var preString; var postString; var strlen; //**********Changes made by RM on 07/11/2006 to retain what user types in field - if typed in Upper Case or change first character of each word from lower case to upper case********** //tmpStr = frmObj.value.toLowerCase(); tmpStr = frmObj.value; //**********End Changes by RM********** strLen = tmpStr.length; if (strLen > 0) { for (index = 0; index < strLen; index++) { if (index == 0) { tmpChar = tmpStr.substring(0,1).toUpperCase(); postString = tmpStr.substring(1,strLen); tmpStr = tmpChar + postString; } else { tmpChar = tmpStr.substring(index, index+1); if (tmpChar == " " && index < (strLen-1)) { tmpChar = tmpStr.substring(index+1, index+2).toUpperCase(); preString = tmpStr.substring(0, index+1); postString = tmpStr.substring(index+2,strLen); tmpStr = preString + tmpChar + postString; } } } } frmObj.value = tmpStr; } // End --> </SCRIPT> <SCRIPT language="JavaScript"> <?PHP //Navigation File //require_once ("phpInclude/nav.php"); require_once ("../nav.php"); ?> </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="276"> <table width="276" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><div align="center"><img src="../images/clear.gif" height="15" width="1"><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="right"><a href=javascript:window.history.back(-1)><strong><br></strong> </a><br> <br> </div> <table width="614" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699"> <b><font color="#FFFFFF">New Patient Registration</font></b> </td> </tr> <tr> <td> <table width="608" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"><img src="../images/clear.gif" width="1" height="15"></td> </tr> <tr> <td width="15"> </td> <td width="578" rowspan="3" align="left" valign="top"> <form name="admitpat" method="post" action="newPatientAdded.php" onSubmit="return validate()"> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"><font class="inputLbl"> <input type="hidden" name="pat_ID" value="<? print ("$pat_ID"); ?>"> </font></div></td> <td colspan="2"> </td> </tr> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"><font class="inputLbl">First Name: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientFirstName" value="<? print ("$pat_first_name"); ?>" onBlur="javascript:changeCase(document.admitpat.PatientFirstName);"> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Middle Initial: </font></div></td> <td colspan="2"> <input class="txtbox" type="text" name="PatientMiddleInitial" value="<? print("$pat_mid_init"); ?>" onBlur="javascript:changeCase(document.admitpat.PatientMiddleInitial);"> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Last Name: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientLastName" value="<? print("$pat_last_name"); ?>" onBlur="javascript:changeCase(document.admitpat.PatientLastName);"> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Date of Birth as mm/dd/yyyy: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientDOB" value="<? print("$pat_dob"); ?>" onBlur="validateBDay();"> <script language=javascript> function validateBDay() { var BirthdayDay = document.admitpat.PatientDOB.value; var bDate = BirthdayDay.split("/"); var bMonth = bDate[0]; var bDay = bDate[1]; var bYear = bDate[2]; var BDate = new Date(bYear, (bMonth - 1), bDay); var Today = new Date(); TodayDay = Today.getDate(); TodayMon = Today.getMonth()+1; TodayYear = Today.getYear(); if (TodayYear < 2000) TodayYear += 1900; //var sysdate = new Date(); if (BDate > Today) alert("Birthday cannot be greater than today's date"); } </script> <font class="redTxt">*</font> </td> <tr> <td width="275"> <div align="right"><font class="inputLbl">Sex: </font></div></td> <td colspan="2" align="left" valign="top"><select name="PatientSex" id="pat_sex"> <option value="" selected></option> <option value="Male">Male</option> <option value="Female">Female</option> <?PHP if($pat_ID == $row["pat_ID"]) { print("\" selected>"); } else { print("\">"); } print ("</select>"); ?> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Patient # (9-digit number): </font></div></td> <td width="172"> <input class="txtboxLarge" type="text" name="PatientSSN" value="<? print("$pat_ssn"); ?>" > <font class="redTxt">*</font> </td> <td width="108"><font class="errTxt"> </font></td> </tr> </table> </table> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"></div></td> <td width="280"> </td> </tr> <tr> <td width="283"> <div align="right"></div></td> <td width="280"> </td> </tr> <tr> <td width="283"> <div align="right"></div></td> <td width="280"> <input class="sbttn" type="submit" name="action" value="Register"> </td> </tr> </form> </tr> <tr> <td width="15"> </td> <td width="15"> </td> </tr> </table></td> </tr> </table> <p> </p></td> </tr> </table> </body> </html> <?PHP mysql_close(); ?> pat_ssn field is what im talking about. it should be a 18 character field with alphanumerics. i would like to generate a unique number here - consisting of full date and time and an alphabet. say something like "Q20070716021418" to denote that thsi is a temporary patient.
  22. i have a screen where there is a field called patient #. this is a text write in field. this field should already display a number(can be anything - alphanumeric) when page loads. user can either retain the same number or type in another number on top of it and hit submit to retain whatever was chosen. is there a way we can auto-generate a number( a function or something like that) that i can use to populate this field? at this time, user can only enter a number(all numerics) in this field. i should let them either write in their number or keep the system generated number. thanx
  23. i have a screen where i register a new patient into the system. way the system works now is that user enters the patient details(first name, middle initial, last name, dob, sex, insuracne, and so on). along with this user also enters the patient # for each patient(its a 9 digit unique number - on the lines of the ssn). the system validates this field upon submittin gthe page. it should contain only numerics ad shoud be 9 characters long. it returns an error message if this field does not match the validations. the new requirement now is that user should allow (automatically) a number (18 characters - alphanumeric) to be generated when page is loaded. user can either keep this number (system generated) or should be able to enter a new(numeric - 9 digits) when registering a patient. they can come back later and edit it with a proper patient number. is there a way i can put a check-box or somethign which i can check and then be able to enter alphanumeric value(18 digits) in the same box (used for 9 digit patient number)? if yes, how do i do it? here is the code for the actual data entry page... <?PHP //File for database information //require_once ("phpInclude/config.php"); require_once ("../config.php"); //File to verify authenticated user include ("phpInclude/cookie.php"); $ClientName=$_GET["Client_Name"]; $ClientName='Group'; $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>"; } } if (isset($USER_NAME)) { list($user_fname, $user_lname) = explode (' ', $USER_NAME); //$pat_ID=$_POST["pat_ID"]; if ($USER_NAME == ' Office Manager') { $query= "SELECT grp_name FROM group_details"; } else { $query= "SELECT grp_name FROM group_details, user_mgr WHERE user_mgr.user_fname='$user_fname' AND user_mgr.user_lname='$user_lname' AND user_mgr.user_grp_id=group_details.grp_id"; } $result=mysql_query($query); $row = mysql_fetch_array($result); $group_name = $row["grp_name"]; } $message = ""; $goodMessage = ""; ?> <!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" 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 trim(inputString) { // Removes leading and trailing spaces from the passed string. Also // removes consecutive spaces and replaces it with one space. var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { // Check for spaces at the beginning of the string retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { // Check for spaces at the end of the string retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length); } while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings } return retValue; // Return the trimmed string back to the user } // Ends the "trim" function 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; PatientFirstName = document.admitpat.PatientFirstName.value; PatientLastName = document.admitpat.PatientLastName.value; PatientDOB = document.admitpat.PatientDOB.value; PatientSSN = document.admitpat.PatientSSN.value; InsuranceProvider = document.admitpat.InsuranceProvider.value; InsuranceID = document.admitpat.InsuranceID.value; if (trim(PatientFirstName).length < 1) { err_msg[i] = "First name cannot be blank."; i++; } if (trim(PatientLastName).length < 1) { err_msg[i] = "Last name cannot be blank."; i++; } if (trim(PatientDOB).length < 1) { err_msg[i] = "Date of Birth cannot be blank."; i++; } if (admitpat.PatientSex.value == "") { err_msg[i] = "Patient Sex cannot be blank."; i++; } if(!(isDate(PatientDOB))) { err_msg[i] = "Date of Birth is not valid. It must be in this format: mm/dd/yyyy."; i++; } if (trim(PatientSSN).length < 1) { err_msg[i] = "Patient Number cannot be blank."; i++; } if(!(SSNValidation(PatientSSN))) { err_msg[i] = "Patient # is not valid."; i++; } if (admitpat.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> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function changeCase(frmObj) { var index; var tmpStr; var tmpChar; var preString; var postString; var strlen; tmpStr = frmObj.value; strLen = tmpStr.length; if (strLen > 0) { for (index = 0; index < strLen; index++) { if (index == 0) { tmpChar = tmpStr.substring(0,1).toUpperCase(); postString = tmpStr.substring(1,strLen); tmpStr = tmpChar + postString; } else { tmpChar = tmpStr.substring(index, index+1); if (tmpChar == " " && index < (strLen-1)) { tmpChar = tmpStr.substring(index+1, index+2).toUpperCase(); preString = tmpStr.substring(0, index+1); postString = tmpStr.substring(index+2,strLen); tmpStr = preString + tmpChar + postString; } } } } frmObj.value = tmpStr; } // End --> </SCRIPT> <SCRIPT language="JavaScript"> <?PHP //Navigation File //require_once ("phpInclude/nav.php"); require_once ("../nav.php"); ?> </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="276"> <table width="276" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"><div align="center"><img src="../images/clear.gif" height="15" width="1"><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="2">***********************<br> ABC Software<br> Version <? print("$version"); ?><br> *********************** <? if ($demo_disclaimer_option =='ON') { print("<br>"); print("<b>$demo_disclaimer1</b>"); print("<br>"); print("$demo_disclaimer2"); //DemoDisclaimerDisplay(); } ?> </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" width="624"> <div align="right"><a href=javascript:window.history.back(-1)><strong><br></strong> </a><br> <br> </div> <table width="614" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#006699"> <tr> <td bgcolor="#006699"> <b><font color="#FFFFFF">New Patient Registration</font></b> </td> </tr> <tr> <td> <table width="608" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"><img src="../images/clear.gif" width="1" height="15"></td> </tr> <tr> <td width="15"> </td> <td width="578" rowspan="3" align="left" valign="top"> <form name="admitpat" method="post" action="newPatientAdded.php" onSubmit="return validate()"> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"><font class="inputLbl"> <input type="hidden" name="pat_ID" value="<? print ("$pat_ID"); ?>"> </font></div></td> <td colspan="2"> </td> </tr> <p align="center"><b><font color="#CC0000"><br> Patient Information </font></b></p> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"><font class="inputLbl">First Name: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientFirstName" value="<? print ("$pat_first_name"); ?>" onBlur="javascript:changeCase(document.admitpat.PatientFirstName);"> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Last Name: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientLastName" value="<? print("$pat_last_name"); ?>" onBlur="javascript:changeCase(document.admitpat.PatientLastName);"> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Date of Birth as mm/dd/yyyy: </font></div></td> <td colspan="2"> <input class="txtboxLarge" type="text" name="PatientDOB" value="<? print("$pat_dob"); ?>" onBlur="validateBDay();"> <script language=javascript> function validateBDay() { var BirthdayDay = document.admitpat.PatientDOB.value; var bDate = BirthdayDay.split("/"); var bMonth = bDate[0]; var bDay = bDate[1]; var bYear = bDate[2]; var BDate = new Date(bYear, (bMonth - 1), bDay); var Today = new Date(); TodayDay = Today.getDate(); TodayMon = Today.getMonth()+1; TodayYear = Today.getYear(); if (TodayYear < 2000) TodayYear += 1900; //var sysdate = new Date(); if (BDate > Today) alert("Birthday cannot be greater than today's date"); } </script> <font class="redTxt">*</font> </td> <tr> <td width="275"> <div align="right"><font class="inputLbl">Sex: </font></div></td> <td colspan="2" align="left" valign="top"><select name="PatientSex" id="pat_sex"> <option value="" selected></option> <option value="Male">Male</option> <option value="Female">Female</option> <?PHP if($pat_ID == $row["pat_ID"]) { print("\" selected>"); } else { print("\">"); } print ("</select>"); ?> <font class="redTxt">*</font> </td> </tr> <tr> <td width="283"> <div align="right"><font class="inputLbl">Patient # (9-digit number): </font></div></td> <td width="172"> <input class="txtboxLarge" type="text" name="PatientSSN" value="<? print("$pat_ssn"); ?>" > <font class="redTxt">*</font> </td> <td width="108"><font class="errTxt"> </font></td> </tr> <tr> <td width="275"> <div align="right"><font class="inputLbl">Preferred Provider: </font></div></td> <td colspan="2"> <?PHP $query="select phy_id, phy_fname, phy_lname from phy_det where phy_disabled = 'Enable' order by phy_lname, phy_fname"; $result = mysql_query ($query); if ($result) { print ("<select name='physician'>\n"); print ("<option value=\"\"></option>\n"); while($row = mysql_fetch_array($result)) { if($pat_phy_id == $row["phy_id"]) { print ('<option selected value="'.$row["phy_id"].'">'.$row["phy_lname"].', '.$row["phy_fname"].'</option>'); } else { print ('<option value="'.$row["phy_id"].'">'.$row["phy_lname"].', '.$row["phy_fname"].'</option>'); } } print ("</select>"); } ?> <font class="redTxt">*</font> </td> </tr> <tr> <td><div align="right"><font class="inputLbl">Insurance Provider: </font></div></td> <td colspan="2"><input class="txtboxLarge" type="text" name="InsuranceProvider" value="<? print("$ins_pro"); ?>" onBlur="javascript:changeCase(document.admitpat.InsuranceProvider);"> </td> </tr> </table> </table> <table width="563" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="283"> <div align="right"></div></td> <td width="280"> <input class="sbttn" type="submit" name="action" value="Register"> </td> </tr> </form> </tr> <tr> <td width="15"> </td> <td width="15"> </td> </tr> </table></td> </tr> </table> <p> </p></td> </tr> </table> </body> </html> <?PHP mysql_close(); ?> thanx for your help
×
×
  • 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.