Jump to content

technotool

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

technotool's Achievements

Member

Member (2/5)

0

Reputation

  1. HI i'm having a problem with a loop within a loop concept. First, I save appointments in a mysql database with their associated unix timestamp. I save this in a variable called $scheduledtimestamp. I can pull the appointments with a while loop. Next, I list the appointments with a table that has a start time (again with a unix timestamp which I convert to human time with the date function) and loop through appointment blocks by adding the appropriate amount of seconds and then echo the unix timestamp for the start of the next appointment. Each appointment starttime is saved as a variable $timestamp 08:00 appointment 08:15 appointment 08:30 appointment 08:45 appointment 09:00 appointment I use an if statement to check if ($timestamp== $scheduledtimestamp(from database) ){ then echo appointment in table} My problem is that I cannot seem to make the while loop work inside the for loop so that whenever there is a scheduled appointment with variable $scheduledtimestamp == display table variable $timestamp ==> the table displays the appropriate appointment message. What is happening now is that the table only lists the last $scheduledtimestamp value which is equal to the table $timestamp and then displays only one appointment in the table. I suspect because the the two strings above are not being checked at each appointment block appropriately. Please check the while loop in the for loop. This current way also makes a mysql request at every iteration of the for loop...costly!!! There must be a better way..basically, I am thinking that there must be a way to check all the $scheduledtimestamp values in an array from the database and compare the array values(loop) with each $timestamp. if there is a hit, then echo the appointment. <? //get the date from the calendar $appointment_date= $_GET['thedate']; echo "appointment date: "; $timestampfromstring=strtotime($appointment_date); $monthfromstring=date("m", $timestampfromstring); $dayfromstring=date("d", $timestampfromstring); $yearfromstring=date("Y", $timestampfromstring); $month=$monthfromstring; $day=$dayfromstring; $year=$yearfromstring; $appointmentblock_time_min=15; //appointment blocks $start_timestamp=mktime(8,0,0,$month,$day,$year); //start time echo $starttimestringthis=date("m-d-y H:i:s", $start_timestamp); $appointments=30; $personId=$_SESSION['person_id']; echo "<table>"; echo "<strong>Patient: ".$_SESSION['patient_lastname'].", ".$_SESSION['patient_firstname']."&nbsp DOB:".$_SESSION['patient_dob']."$nbsp ID:".$_SESSION['person_id']."</strong><br><br>"; for ($i=0; $i<$appointments; $i++){ echo "<tr>"; echo "<td>"; echo $timestamp = $start_timestamp + (60*$appointmentblock_time_min)*($i); //echo date("H:i", $timestamp); echo "<br>"; // list the appointments that have already been scheduled $query="SELECT * FROM calendar"; $result=mysql_query($query); while ($rows=mysql_fetch_assoc($result)){ $scheduledid=$rows['id']; $scheduledappointment=$rows['appointment']; $scheduledtimestamp=$rows['timestamp']; $scheduleduserid=$rows['userid']; } if ($timestamp== $scheduledtimestamp){ echo "</td>"; echo "<td>$scheduledappointment"; echo "</td>"; echo "</tr>"; } else{ echo "</td>"; echo "<td id=\"$timestamp\" onmouseover=\"this.style.background='#FECE6E';\" onmouseout=\"this.style.background='#FFF'; \" onclick=\"setAppointment(this.id,$personId,setObj()); \">"; echo "appointment"; echo "</td>"; echo "</tr>"; } } echo "</table>"; ?>
  2. Now that you found the typo. the code is working perfectly as a basic javascript tab system. Each heading turns red when clicked and shows the corresponding div. My brain is too small to understand your code. sorry. but thanks again for your help. <script type="text/javascript"> var sections = new Array('partOne', 'partTwo', 'partThree', 'partFour'); var sectionHeadings = new Array('headingOne', 'headingTwo', 'headingThree', 'headingFour'); function init() { show('partOne'); colorChange(sectionsHeadings[0], 'red'); document.getElementById('subj_txtOutput').focus(); } function show(section) { for (var i = 0; i < sections.length; i++) { if (sections[i] == section) { document.getElementById(sections[i]).style.display = 'block'; colorChange(sectionHeadings[i], 'red'); } else { document.getElementById(sections[i]).style.display = 'none'; colorChange(sectionHeadings[i], 'black'); } } } function colorChange(id, val){ var e = document.getElementById(id); if(!(e)) { alert("This change is not possible!"); return(false); } e.style.color = val; return(true); } </script> [code]
  3. I am trying to modify some code so that the clickable headings act like css tabs (color changes to red if active div is displayed) using javascript. I have added an id to each clickable span element and put that into an array. When I try to incorporate the colorChange function into the function show() below. I cannot seem to get it right. I added the following code to the functions show(): colorChange(sectionHeadings[i], 'red'); as below but it is not working. Any suggestions as to how I can turn the headings red when they are clicked to give the viewer a richer experience. (hehe-that sounds funny) much thanks technotool. <script type="text/javascript"> var sections = new Array('partOne', 'partTwo', 'partThree', 'partFour'); var sectionsHeadings = new Array('headingOne', 'headingTwo', 'headingThree', 'headingFour'); function init() { show('partOne'); colorChange(sectionsHeadings[0], 'red'); document.getElementById('subj_txtOutput').focus(); } function show(section) { for (var i = 0; i < sections.length; i++) { if (sections[i] == section) { document.getElementById(sections[i]).style.display = 'block'; colorChange(sectionHeadings[i], 'red'); } else { document.getElementById(sections[i]).style.display = 'none'; } } } function colorChange(id, val) { var e = document.getElementById(id); if(!(e)) { alert("This change is not possible!"); return(false); } e.style.color = val; return(true); } </script> <html> <body onload="init();"> <span id="headingOne" onClick="show('partOne');">HeadingOne</span> | <span id="headingTwo" onClick="show('partTwo')">HeadingTwo</span> | <span id="headingThree" onClick="show('partThree')">HeadingThree</span> | <span id="headingFour" onClick="show('partFour')">HeadingFour</span> <div id="partOne">stuff</div> <div id="partTwo">more stuff</div> <div id="partThree">even more stuff</div> <div id="partFour">too much freakin' stuff already</div> <html>
  4. Hi, I have a successful implementation of the suggestion above. I am trying to make the clickable headings act like css tabs (color changes if active) using javascript. I have added an id to each clickable span element and put that into an array. When I try to incorporate this into the function show() below. I cannot seem to get it right. for example, I added the following code to the functions show(): colorChange(sectionHeadings[i], 'red'); as below but it is not working. Any suggestions as to how I can turn the headings red when they are clicked. much thanks technotool. <script type="text/javascript"> var sections = new Array('partOne', 'partTwo', 'partThree', 'partFour'); var sectionsHeadings = new Array('headingOne', 'headingTwo', 'headingThree', 'headingFour'); function init() { show('partOne'); colorChange(sectionsHeadings[0], 'red'); document.getElementById('subj_txtOutput').focus(); } function show(section) { for (var i = 0; i < sections.length; i++) { if (sections[i] == section) { document.getElementById(sections[i]).style.display = 'block'; colorChange(sectionHeadings[i], 'red'); } else { document.getElementById(sections[i]).style.display = 'none'; } } } function colorChange(id, val) { var e = document.getElementById(id); if(!(e)) { alert("This change is not possible!"); return(false); } e.style.color = val; return(true); } </script> <html> <body onload="init();"> <span id="headingOne" onClick="show('partOne');">DEMOGRAPHIC</span> | <span id="headingTwo" onClick="show('partTwo')">PROCEDURE</span> | <span id="headingThree" onClick="show('partThree') ">FINDINGS</span> | <span id="headingFour" onClick="show('partFour')">FOLLOW-UP/SIG</span> <html>
  5. HI, I am helping to make a php app for some vets. basically, when the vet sees an animal they create an encounter by inputting the information into a form. Each encouter is unique for a given date. Of course the form from the encounter gets stored in a MySQL database. easy enough. The vets now want a directory tree of each encounter for a given animal. so for example, the vet clicks an animal, SPOT ==> a directory tree (I am calling this a directory tree but really it is an encouter tree) pops up with the animal's name as a heading and each encounter form date as a branch. I mean I think that I can pull each date from the MySQL database stick it in a table format-- but how do you make the lines that we see with a directory tree. Is there some prepackaged script somewhere. Thanks in advace for taking the time to read this. technotool. Spot | |_12/12/2007 New Animal Encounter |_12/20/2007 Followup Encounter |_12/30/2007 Followup Hit by baseball
  6. Thanks so much. This is a much more efficient way to handle the data. I didn't want to have to keep sending and recieving data from the database. Sincerely, theTechnotool.
  7. hi all, I have created a form with four sections (a, b,c,d). each section has a specific textarea for dataentry (textarea-a, textarea-b, textarea-c, textarea-d). I need to save all the data together as a single entry. The data in parts mean nothing. if all the form parts (textareas-a,b,c,d) are all on the same page it is no problem because they will all save at the same time to the MySQL database with a save button at the end of the form. My problem: I would like to use a tab system(A, B, C, D) for each section(a, b,c,d) with a save button after textarea-d. The tab system calls up a unique URL for each tab and on each URL is a part of the form (tabA-->textarea-a, tabB-->textarea-b, tabC-->textarea-c, tabD-->textarea-d). The hope is that the save button at the end would save all the textarea's from the different URL's. I can certainly set-up the tabs and the textareas--> I am looking for advice on how to set up the form so that the data from textarea-a, textarea-b, textarea-c,textarea-d are all saved with a singular save button after the last section(d) is completed. Should I save each section before moving to the next section in a MySQL database and then make a final save after recalling the items from the database. I think that will be inefficient. Can this be done with Javascript. or Ajax. your help with this design issue is greatly appreciated. the technotool
  8. function recallText() didn't have enough closing braces "}" and so it was executing the function downstream. basically needed to close off each of the ajax functions with closing "}". It is working great now. thanks
  9. First, thanks for taking the time to read this problem. I have a script which uses some text in <span> tags. When the user onMouseOver 's the text an ajax function( toolTip() ) is called and --> some text in a div displays. When the same text is onClick 'ed another ajax function( recallText() ) is called and some text is inserted into a textarea. individually, the ajax behaviors work perfectly but when I combine the behaviors only the onMouseOver function works. The onClick function doesn't work. I keep both functions on the same js source file. Here is the span segment. Do I need to do something special when there are 2 requests in the same tag? echo "<span id=\"$field_id\" onMouseOver=\"toolTip(this.id);\" onMouseOut=\"clearPopup();\" onClick=\"recallText(this.id);\">".$field_title."</span><br>"; Here is the entire code files in one text file. //////////////////////////// get_pText.php file //////////////////////// <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'root', 'password'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("osemr", $con); $sql="SELECT * FROM textfields WHERE fld_id = '".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo $row['fld_text']; } mysql_close($con); ?> /////////////////end get_pText.php file /////////////////////////// /////////////////// soap3.inc.php file starts (this is really the opening HTML file.) //////////////////////// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="content-language" content="en"> <meta name="author" content=""> <meta http-equiv="Reply-to" content="@.com"> <meta name="generator" content="PhpED 5.2"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="creation-date" content="09/20/2007"> <meta name="revisit-after" content="15 days"> <title>Untitled</title> <link rel="stylesheet" type="text/css" href="my.css"> <script src="select_pText.js"></script> </head> <body> <?php $con = mysql_connect('localhost', 'root', 'password'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("osemr", $con); $sql="SELECT * FROM textfields"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $field_id= $row[fld_id]; $field_title= $row[fld_title]; echo "<span id=\"$field_id\" onMouseOver=\"toolTip(this.id);\" onMouseOut=\"clearPopup();\" onClick=\"recallText(this.id);\">".$field_title."</span><br>"; } ?> <div> <textarea cols="25" rows="10" id="txtOutput">User info will be listed here.</textarea> </div> <div id="toolTip">popup here</div> </body> </html> ///////////////end soap3.inc.php/////////////////////////////////////////////////////////// /////////////////////start file select_pText.js ////////////////////////////////////////////////////// var xmlHttp function recallText(str) // AJAX function to insert data into the textbox (id="txtOutput"). { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="get_pText.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtOutput").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function toolTip(str) // AJAX function to insert data into the div (id="toolTip"). { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="get_pText.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("toolTip").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function clearPopup(str) //clear xmlHttp request { xmlHttp=GetXmlHttpObject() ; xmlHttp=null ; document.getElementById("toolTip").innerHTML=''; //reset toolTip innerHTML } ///////////////////////////////end javascript file select_pText.js ///////////////////// //////////////////////////// start textfields.sql file ////////////////////// -- phpMyAdmin SQL Dump -- version 2.11.5.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 01, 2008 at 11:50 PM -- Server version: 5.0.51 -- PHP Version: 5.2.4-2ubuntu5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `osemr` -- -- -------------------------------------------------------- -- -- Table structure for table `textfields` -- CREATE TABLE IF NOT EXISTS `textfields` ( `fld_id` int(11) NOT NULL auto_increment, `fld_position` int(11) NOT NULL default '0', `fld_title` varchar(200) NOT NULL default '', `fld_text` text NOT NULL, `fld_type` varchar(50) NOT NULL default '', `fld_style` varchar(100) NOT NULL default '', `form_id` varchar(5) default NULL, PRIMARY KEY (`fld_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `textfields` -- INSERT INTO `textfields` (`fld_id`, `fld_position`, `fld_title`, `fld_text`, `fld_type`, `fld_style`, `form_id`) VALUES (2, 1, 'it''s only', 'when I lose myself\r\nwith someone else\r\nthat I find', 'change', '%link%<font color=''red''><b>%title%</b></font>%/link%', '3'), (3, 3, 'in your room', 'time stands still', 'append', '%link%<u>%no%.%title%</u>%/link%', '3'), (4, 4, 'changing me', 'and I''ve changed! once more a change', 'change', '%link%%no%. %title% %/link%', '3'), (5, 2, 'emptyyy', '', 'empty', '<b>%title%</b>', '3'), (6, 5, 'this item is directly inserted', 'this item is directly inserted', 'append', '', '3'); ////end
  10. Hi, I am trying to modify a html/php/js form that essentially takes text and populates a textbox once the user onclicks on the text. (for example, items under the textbox might say 1. apple pie 2. cherry pie 3. pumpkin pie ==> user clicks #2.cherry pie ==> the textbox now displays cherries, custard, dough, sugar, 2eggs) no problem that part works great. I am looking for some direction because we now want the user to be able to define the text under the textbox and the text which populates the textbox once the choice is selected. (for example, user clicks edit button and changes the 2nd selection to 2. pecan pie and the population text to "pecans, sugar, maple syrup, dough") Right now the selections are all hardcoded into the form and not in a database. thanks for your advice and if you can work with our code I would be happy to reward you financially. thanks again technotool. <html> <head> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <script type="text/javascript" src="../javascript/jquery-1.2.2.pack.js"></script> <script type="text/javascript" src="../javascript/animatedcollapse.js"> /*********************************************** * Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> <script type="text/javascript"> animatedcollapse.addDiv('subjective', 'fade=0,height=150px') animatedcollapse.addDiv('objective', 'fade=1,height=300px') animatedcollapse.addDiv('impression', 'fade=1,height=150px') animatedcollapse.addDiv('plan', 'fade=1,height=150px') /* animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets') animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,persist=1,hide=1') animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1') */ animatedcollapse.init() </script> <script> function spanListener_s() { var spans = document.getElementById("span_list_s").getElementsByTagName("span") var target = document.getElementById("targetTextArea_s") for(var i = 0; i < spans.length; i++) { spans[i].onclick = function() { if(target.value != "") { target.value = target.value + "," } target.value = target.value + this.firstChild.data } } } function spanListener_o() { var spans = document.getElementById("span_list_o").getElementsByTagName("span") var target = document.getElementById("targetTextArea_o") for(var i = 0; i < spans.length; i++) { spans[i].onclick = function() { if(target.value != "") { target.value = target.value + "," } target.value = target.value + this.firstChild.data } } } function spanListener_i() { var spans = document.getElementById("span_list_i").getElementsByTagName("span") var target = document.getElementById("targetTextArea_i") for(var i = 0; i < spans.length; i++) { spans[i].onclick = function() { if(target.value != "") { target.value = target.value + "," } target.value = target.value + this.firstChild.data } } } function spanListener_p() { var spans = document.getElementById("span_list_p").getElementsByTagName("span") var target = document.getElementById("targetTextArea_p") for(var i = 0; i < spans.length; i++) { spans[i].onclick = function() { if(target.value != "") { target.value = target.value + "," } target.value = target.value + this.firstChild.data } } } window.onload = function() { spanListener_s() spanListener_o() spanListener_i() spanListener_p() } </script> <?php $test="test 1, 2,3,4,,5"; ?> <script> var muscular_backpain="Pateint with complaints of low backpain that started four weeks ago. The pain is severe and he cannot lift anything over 5 lbs. The patient went to the ER. The ER gave the patient muscle relaxers, pain relievers and anti-inflammatory medications."; var normalExam="normal exam items"; var abnormalExam="abnormal exam items"; var empty= $test; </script> </head> <body> <br> SUBJECTIVE:<br> <form name="form_fu" action="../process/fu_lbp_p.php" method="post"> <textarea id="targetTextArea_s" cols="65" rows="3" name="subjective"></textarea> <a href="javascript:animatedcollapse.toggle('subjective')">os</a> <div id="subjective" style="width: 550px; background: #FFFFCC; display:none"> <a href="#" onmouseover="window.document.form_fu.subjective.value=empty;"><font color="red">empty</font></a> <a href="#" onMouseOver="window.document.form_fu.subjective.value=abnormalExam;">Abnormal Exam</a> <div id="span_list_s"> <span id="item1">The patient returns for follow-up after lumbar ESI.</span> <br> <span id="item2"></span> <span id="item3">The patient reports subsatantial relief in leg pain.</span> <br> <span id="item4">The patient reports little relief in leg pain. </span> <span id="item5">100% relief.</span> <span id="item6"></span> <span id="item7">75% relief.</span> <span id="item8"></span> <span id="item9">50% relief.</span> <span id="item10"></span> <span id="item11">25% relief.</span> <br> <span id="item12"></span> <span id="item13">The patient's axial pain was not improved following the epidural steroid injection.</span> <span id="item14"></span> <span id="item15">injection</span> <span id="item16"></span> <span id="item17"></span> </div> </div> <br> OBJECTIVE: <br> <textarea id="targetTextArea_o" cols="65" rows="3" name="objective">Alert and Oriented x3, NAD, Normal Respiration, Normal Mood</textarea> <a href="javascript:animatedcollapse.toggle('objective')">os</a> <div id="objective" style="width: 550px; background: #FFFFCC; display:none"> <a href="#" onmouseover="window.document.form_fu.objective.value=empty;"><font color="red">empty</font></a> <a href="#" onmouseover="window.document.form_fu.objective.value=normalExam;">Normal Exam</a> <a href="#" onMouseOver="window.document.form_fu.objective.value=abnormalExam;">Abnormal Exam</a> <br> <div id="span_list_o"> <span id="item1">No</span> <span id="item2">Normal</span> <span id="item3">Not Detected</span> <span id="item4">Abnormal</span> <span id="item5">Labored</span> <span id="item6">Detected</span> <span id="item7">Increased</span> <span id="item8">Decreased</span> <span id="item9">Right</span> <span id="item10">Left</span> <span id="item11">Midline</span> <span id="item12">Intact</span> <span id="item13">Absent</span> <span id="item14">None</span> <span id="item15">Generalized</span> <span id="item16">Focal</span> <span id="item17">kyphotic deformity</span> <span id="item18">paravertebral spasm</span> <span id="item19"></span> <span id="item20"></span> <span id="item21"></span> <span id="item22"></span> </div> </div> <br> IMPRESSION: <br> <textarea id="targetTextArea_i" cols="65" rows="3" name="impression" ></textarea> <a href="javascript:animatedcollapse.toggle('impression')">os</a> <div id="impression" style="width: 550px; background: #FFFFCC; display:none"> <a href="#" onmouseover="window.document.form_fu.impression.value=empty;"><font color="red">empty</font></a> <a href="#" onmouseover="window.document.form_fu.impression.value=normalExam;">Normal Exam</a> <a href="#" onMouseOver="window.document.form_fu.impression.value=abnormalExam;">Abnormal Exam</a> <div id="span_list_i"> <span id="item1">Lumbosacral Radiculopathy</span> <span id="item2">Lumbar Spondylosis</span> <span id="item3">Facet Syndrome (L or T) </span> <span id="item4">Lumbar Disc Protrusion</span> <span id="item5">Lumbar DDD</span> <span id="item6">Failed Back Syndrome</span> <span id="item7">Lumbar Internal Dics Disruption</span> <span id="item8">Lumbar Spinal Stenosis</span> <span id="item9">Spondylosisthesis/Spondylosis</span> <span id="item10">LBP</span> <span id="item11">SI Joint Disorder</span> <span id="item12">Epidural Adhesions</span> <span id="item13">CRPS (RSD) LE</span> <span id="item14">CRPS (RSD) UE</span> <span id="item15">Cervical Radiculopathy</span> <span id="item16">Cervical Spondylosis</span> <span id="item17">Cervical Facet Syndrome</span> <span id="item18">Cervical Disc Protrusion</span> <span id="item19">Cervical DDD</span> <span id="item20">Failed Neck Syndrome</span> <span id="item21">Cervical IDD</span> <span id="item22">Cervical Spinal Stenosis</span> <span id="item23">Headache</span> <span id="item24">Thoracic DDD</span> <span id="item25">Failed Thoracic Back Syndrome</span> <span id="item26">Thoracic IDD</span><span id="item27"></span> <span id="item27"></span> <span id="item28"></span> <span id="item29"></span> <span id="item30"></span> </div> </div> <br> PLAN: <br> <textarea id="targetTextArea_p" cols="65" rows="3" name="plan" ></textarea> <a href="javascript:animatedcollapse.toggle('plan')">os</a> <div id="plan" style="width: 550px; background: #FFFFCC; display:none"> <a href="#" onmouseover="window.document.form_fu.plan.value=empty;"><font color="red">empty</font></a> <a href="#" onmouseover="window.document.form_fu.plan.value=normalExam;">Normal Exam</a> <a href="#" onMouseOver="window.document.form_fu.plan.value=abnormalExam;">Abnormal Exam</a> <div id="span_list_p"> <span id="item1"></span> <span id="item2"></span> <span id="item3"></span> <span id="item4"></span> <span id="item5"></span> </div> </div> <br> <br> <input type="submit" name="submit" value="submit" /> </form> </body> </html>
  11. Below I have code which processes a form. I am trying to insert certain parts of the data into a MySQL database. The SQL insert statements are working but 2 pieces of data are not being inserted. "levels" and "procedure" take variables $procedure_levels and $procedure_totals which are formed by the concatination of other strings and variables. if I echo out $procedure_levels and $procedure_totals they echo out fine but they just wont go into the database. Thanks for your help. technotool -- -- Table structure for table `procedure_log` -- CREATE TABLE IF NOT EXISTS `procedure_log` ( `id` tinyint(11) NOT NULL auto_increment, `person_id` tinyint(11) NOT NULL, `levels` text NOT NULL, `procedure` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; <?php // //tfesi.php processing form //database osemrcom_dictation // session_start(); include ("../mylibrary/common.php"); db_connect(); // debug(); require ("../config/config.php"); //configuration file with POST[array] conversions $procedure1=$_POST['procedure1']; $procedure2=$_POST['procedure2']; $procedure3=$_POST['procedure3']; $proclevel_1=$_POST['proclevel_1']; $proclevel_2=$_POST['proclevel_2']; $proclevel_3=$_POST['proclevel_3']; $procedure_levels=$proclevel_1." ".$proclevel_2." ".$proclevel_3; $procedure_totals=$procedure1." ".$procedure2." ".$procedure3.; $output=<<<html_tag <head> <link rel="stylesheet" type="text/css" media="screen" href="../style/report.css" /> <link rel="stylesheet" type="text/css" media="print" href="../style/print.css" /> </head> <body> <div id="headertitle"> <p class="headertitle"> Lumbar Transforminal Epidural Steroid Injection under Fluoroscopic Guidance </p> </div> <div id="demographic"> <p class="demographic"> <b>Patient Name:</b> <b> $lastname, $firstname </b> <br> <b>Date:</b>&nbsp $date &nbsp <b> Record#:</b> <br> <b>Pre-Operative Diagnosis:</b> $preopdx &nbsp <b>Post-Op Diagnosis:</b> &nbsp $postopdx <br> <b>Procedure:</b> &nbsp $proclevel_1 $proclevel_2 $proclevel_3 $proclevel_4 $proclevel_5 $proclevel_6 &nbsp Lumbar Interlaminar Epidural Steroid Injection with Epidurogram<br> <b>Injectate:</b> $mgsteroid $steroid &nbsp $ccanes $anest <br> <b>Contrast:</b> $contrast <br> <b>Anesthesia:</b> &nbsp Local with 1% Lidocaine<br> <p> </div> <div id="indications"> <p class="title">indications:</p> <p class="content"> After reviewing the clinical history, physical exam, and appropriate imaging studies, the following procedures were deemed to be of further diagnostic and therapeutic benefit.<br> </p> </div> <div id="procedure"> <p class="title">procedure:</p> <p class="content"> The patient presented to the minor procedure suite for therapeutic epidural steroid injection under fluoroscopic guidance. The benefits and risks and potential complications of the procedure were explained to the patient, and all questions were answered. The written consent form was signed by the patient and witnessed. </p> <p class="content"> The patient assumed a prone position on the fluoroscopy table. Physiologic monitors were applied, and vital signs were recorded in the nursing record. Fluoroscopic visualization was used to identify the lumbosacral anatomy. The skin was sterilized with three applications of betadine (or cholorhexidine if there was an iodine allergy) and sterile drapes were applied. The skin was anesthetized with 1% lidocaine via a 27-gauge 1.5 inch needle. Next, A $needlesize was then advanced towards the superolateral aspect of the $side &nbsp $proclevel_1 $proclevel_2 $proclevel_3 $proclevel_4 $proclevel_5 $proclevel_6 neuroforamen with the aide of AP and Lateral fluoroscopic projections to ensure proper needle position. Next, after negative aspiration of CSF or blood, 1-2 cubic centimeters of contrast dye was instilled under live anterior-posterior fluoroscopy, which identified dye spread along the nerve and into the epidural space. Results of the epidurogram are described below. Next, a steroid solution (described above) was divided equally and injected into each neuroforaminal space mentioned above. Washout was visualized on the fluoroscope. </p> <p class="content"> Following steroid administration,the needle was then withdrawn slowly and carefully. Hemostasis was established and sterile dressings were applied. The patient tolerated the procedure well, and was discharged to the recovery room in stable condition. </p> </div> <div id="findings"> <p class="title">findings:</p> <p class="content"> Epidurogram was normal and showed good outline of the exiting nerve root(s). Contrast dye could be seen extending superior and medial to the pedicle at the above mentioned level(s). Under live fluoroscopy, there was no intravascular uptake and dye flow was extradural. The patient tolerated the procedure well and was discharged ambulatory in stable condition. &nbsp $addfind </p> </div> <div id="followup"> <p class="title">follow-up: $fu</p> </div> <div id="closing"> <br> <p class="closing"> ____________________________________<br> <br> Attending Interventional Physiatrist<br> Board Certified Physical Medicine and Rehabilitation/Pain </p> </div> </body> html_tag; //echo $output; if ($_POST['formshow']=='noshow') { $procedure1=$_POST['procedure1']; $procedure2=$_POST['procedure2']; $procedure3=$_POST['procedure3']; $proclevel_1=$_POST['proclevel_1']; $proclevel_2=$_POST['proclevel_2']; $proclevel_3=$_POST['proclevel_3']; $procedure_levels=$proclevel_1." ".$proclevel_2." ".$proclevel_3; $procedure_totals=$procedure1." ".$procedure2." ".$procedure3.; $final_report=$_POST['final_report']; $userid=$_SESSION['userid']; $person_id=$_SESSION['person_id']; echo $final_report; $sql1="INSERT INTO procedure_log (`id`,`person_id`,`levels`,`procedure`) VALUES ('NULL','$person_id','$procedure_levels','$procedure_totals')"; $result=mysql_query($sql1) or die ('Unable to add dictation1'); if ($result) echo "recorded1"; else "not recorded1"; $sql="INSERT INTO transcription ( `id`,`person_id`,`dictation`,`created`,`user`) VALUES ('NULL','$person_id','$final_report',CURRENT_TIMESTAMP,'$userid')"; $result=mysql_query($sql) or die ('Unable to add dictation'); if ($result) echo "recorded"; else "not recorded"; }else { echo "<form action=\"$PHPSELF\" METHOD=\"POST\">"; echo "<textarea name=\"final_report\" rows=\"30\" cols=\"100\">$output</textarea>"; echo "<input type=\"submit\" name=\"submitvalue\" VALUE=\"finalize\">"; echo "<input type=\"hidden\" name=\"formshow\" value=\"noshow\">"; echo "</form>"; } ?>
  12. does anyone know of a OOP tutorial which builds an application, shopping cart or blog site, with explanations. I made a moonleap in understanding after I read a tutorial on building a shopping cart using PHP. I was able to port many of the concepts to make some real world php applications. If there was a good OOP tutorial on building a shopping cart or other application. I know that I would and others would be thankful for the input and the learning. sinicerely technotool
  13. this should get you about 80% there. <html> <head> <script> function addUp(){ var one, two, three one = document.getElementById("boxone").value; two = document.getElementById("boxtwo").value; three=document.getElementById("boxthree").value; var sum = ( Math.abs(one) + Math.abs(two) ) - Math.abs(three) alert(sum); } </script> </head> <form name="boxaddup"> a<input type="text" id="boxone" size="3"><br> b<input type="text" id="boxtwo" size="3"><br> c<input type="text" id="boxthree" size="3" onChange="addUp()"><br> </form> </html>
  14. Hi -i'm back. I know. I am trying to Populate(onClick) a textarea with checked items from a selection of radiobuttons and checkboxes. The enduser will make necessary selections and then click populate to fill the textarea with selected items. here is what I have thusfar. In a div container id="pe_exam", checkboxes and radiobuttons are ordered by the id= ' "pe_item"+n ' as below however when I click populate noting is being populated. any assistance would be greatly appreciated. technotool <script language="Javascript" type="text/javascript"> function populateTextArea(){ var pe = document.getElementByTagName("pe_exam") var items = pe.getElementById('pe_item' + i) var target = document.getElementById("targetarea") for(var i = 0; i < items.length; i++) { if (items[i].checked == true){ target.value = target.value + items[i].value } else { } } </script> </head> <body> <textarea id="targetarea" cols="100" rows="5"></textarea> <br><b>Physical Exam:</b><br> <form name="form_pe" method="" action=""> <a href="#" onClick="populateTextArea();">Populate</a> General<br> <div id="pe_exam"> <input type="radio" name="pe_gen1" id="pe_item2" value="alert and oriented x 3">A & O x3 <br> <input type="radio" name="pe_gen2" id="pe_item4" value="No apparent distress">NAD <input type="radio" name="pe_gen2" id="pe_item6" value="Obvious distress">Obvious distress<br> <input type="radio" name="pe_gen3" id="pe_item8" value="normal respiation">Normal Respiration <input type="radio" name="pe_gen3" id="pe_item10" value="Labored Respiration">Labored Respiration <br> <input type="radio" name="pe_gen4" id="pe_item12" value="normal mood">Normal mood <input type="radio" name="pe_gen4" id="pe_item14" value="Depressed Mood">Depressed Mood<br>
  15. thanks so much. I knew that I was missing something. function!!! technotool
×
×
  • 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.