Jump to content

Php and mysql---Confused again


kenny724

Recommended Posts

ok...there is heredoc in the php. So I have this drop own menu

 

<select name="sup_id_fk" size="1"><option value="72"> Canfield, Scot [Nurse Practitioner/Supervisor]</option><option value="66"> Jackson, Tia [supervisor/Therapist]</option><option value="124"> Lira, Misti [intake Coordinator/Supervisor]</option><option value="38"> Martin, Lillian [Asst. Clinical Director/Supervisor]</option></select></td>

so the sup_id_fk becomes the value correct? or am I missing something? The the correct syntax would be

if($sup_id_fk == 72) $sup_sig = <img src="sigs/Scot_Canfield.png" border="0" />;

Correct?

 

Then to print the signature

if(($completed_date_string != ""))
   {
echo '
<tr>
   <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center>
      <table border="0" width="100%">
         <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr>
         <tr>
            <td valign="bottom">'. $clinician_sig. '<hr /></td>
            <td valign="bottom">'. $completed_date_string. '<hr />Date:</td>
         </tr>
         <tr>
            <td valign="bottom">'. $sup_sig. '<hr /></td>
            <td valign="bottom">'. $completed_date_string. '<hr />Date:</td>
         </tr>

Link to comment
Share on other sites

ok...there is heredoc in the php. So I have this drop own menu

 

<select name="sup_id_fk" size="1"><option value="72"> Canfield, Scot [Nurse Practitioner/Supervisor]</option><option value="66"> Jackson, Tia [supervisor/Therapist]</option><option value="124"> Lira, Misti [intake Coordinator/Supervisor]</option><option value="38"> Martin, Lillian [Asst. Clinical Director/Supervisor]</option></select></td>

so the sup_id_fk becomes the value correct?

 

one of the numbers for "value" would become value. it would be stored in $_POST['sub_id_fk'] or $_GET['sub_id_fk'] depending on what method your form is using

Link to comment
Share on other sites

so instead of this ...

 

if(IsSet($_POST['sup_id_fk']))	$sup_id_fk =          mysql_real_escape_string($_POST['sup_id_fk']);
	else $sup_id_fk = "";

 

it would be this:

 

if(IsSet($_POST['sup_id_fk']))	$value =          mysql_real_escape_string($_POST['sup_id_fk']);
	else $sup_id_fk = "";

Link to comment
Share on other sites

I shouldn't get it from the post...I should post it to the sup_id_fk column in the activity_therapy_note table. Each user has 4 ids...and the id will populate a png picture signature file. I get all sorts of errors.....because probably I don't know what the heck I'm doing...arghhh....took this site over from someone

Link to comment
Share on other sites

get sql error on line 7 and error in signature.inc file: Sorry for code length..i'm desparate to figure this out..ugh.

 

signature.inc file

 

<?php

// Include this file to add signatures to the print output
// This file will set two signature variables: md_sig and clinician_sig

//first step is to use the query results from the cpt_form.inc for the billed_by var
if(IsSet($billed_by))
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $billed_by";
else
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $completed_by_fk";
//echo "clinician_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$clinician_sig = $sql_array[0];
$clinician_name_string = "$sql_array[1] $sql_array[2]";


if(file_exists($clinician_sig))
$clinician_sig = "<img src=\"$clinician_sig\" border=\"0\" />";


else
$clinician_sig = "<br /><br /><br />";





//now clean up the date format
if(IsSet($completed_date))
$completed_date_string = strftime("%m/%d/%Y", strtotime($completed_date));
else
$completed_date_string="";

if(IsSet($approved_by) && $approved_by != "")
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $approved_by";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$md_sig = $sql_array[0];
//echo "sig: $md_sig <br />";
$md_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($md_sig))
{
	$md_sig = "<img src=\"$md_sig\" border=\"0\" alt=\"\" />";
	$md_date_string = strftime("%m/%d/%Y", strtotime($approved_date));

}

else
{
	$md_sig = "<br /><br /><br />";
}	
//now clean up the date format
$approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date));
}
else
{
$md_sig = "";
$md_name_string = "FORM IS NOT APPROVED";
$approved_date_string="";
}

if(IsSet($psychiatrist_id_fk) && $psychiatrist_id_fk != 0)
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $psychiatrist_id_fk";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$psychiatrist_sig = $sql_array[0];
$psychiatrist_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($psychiatrist_sig))
	$psychiatrist_sig = "<img src=\"$psychiatrist_sig\" border=\"0\" alt=\"test\" />";
	$approved_date_string = strftime("%m/%d/%Y", strtotime($approved_date));


}
else
{
$psychiatrist_sig = "<br /><br /><br />";
$psychiatrist_name_string = "Not Assigned";
$approved_date_string="";
}

if(IsSet($therapist_id_fk) && $therapist_id_fk != 0)
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $therapist_id_fk";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$therapist_sig = $sql_array[0];
$therapist_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($therapist_sig))
	$therapist_sig = "<img src=\"$therapist_sig\" border=\"0\" alt=\"test\" />";
	$therapist_date_string = strftime("%m/%d/%Y", strtotime($completed_date));


}
else
{
$therapist_sig = "<br /><br /><br />";
$therapist_name_string="";
$therapist_date_string="";
}

if(IsSet($activity_therapist_id_fk) && $activity_therapist_id_fk != 0)
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $activity_therapist_id_fk";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$activity_therapist_sig = $sql_array[0];
$activity_therapist_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($activity_therapist_sig))
	$activity_therapist_sig = "<img src=\"$activity_therapist_sig\" border=\"0\" alt=\"test\" />";
    $activity_date_string = strftime("%m/%d/%Y", strtotime($completed_date));


}
else
{
$activity_therapist_sig = "<br /><br /><br />";
$activity_therapist_name_string="";
$activity_date_string="";
}

if(IsSet($case_manager_id_fk) && $case_manager_id_fk != 0)
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $case_manager_id_fk";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$case_manager_sig = $sql_array[0];
$case_manager_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($case_manager_sig))
	$case_manager_sig = "<img src=\"$case_manager_sig\" border=\"0\" alt=\"test\" />";
    $case_date_string = strftime("%m/%d/%Y", strtotime($completed_date));
}
else
{
$case_manager_sig = "<br /><br /><br />";
$case_manager_name_string="";
$case_date_string="";
}


if(IsSet($other_id_fk) && $other_id_fk != 0)
{
$sql_query = "SELECT sig_file, user_first_name, user_last_name FROM users_table WHERE user_id_pk = $other_id_fk";
//echo "md_sig: $sql_query <br />";
$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query2 signatures.inc");
$sql_array = mysql_fetch_array($sql_query_result);
$other_sig = $sql_array[0];
$other_name_string = "$sql_array[1] $sql_array[2]";

if(file_exists($other_sig))
	$other_sig = "<img src=\"$other_sig\" border=\"0\" alt=\"test\" />";
	$other_date_string = strftime("%m/%d/%Y", strtotime($completed_date));

	}
else
{
	$other_sig = "<br /><br /><br />";
	$other_name_string="";
        $other_date_string="";
}


?>

 

 

 

and activity_therapy_note_insert.inc

 

<?PHP
// activity_therapy_note_insert.inc
// our vars
if(IsSet($_SESSION['User_ID']) and $_SESSION['User_level'] > 10) //valid user with access privs?
{
$this_validation = NULL;
if(IsSet($_POST['this_validation']))		$this_validation =           mysql_real_escape_string($_POST['this_validation']);
elseif(IsSet($_GET['this_validation']))		$this_validation =           mysql_real_escape_string($_GET['this_validation']);

$host_form_id = "NULL";
if(IsSet($_POST['host_form_id']))		$host_form_id =           mysql_real_escape_string($_POST['host_form_id']);
elseif(IsSet($_GET['host_form_id']))		$host_form_id =           mysql_real_escape_string($_GET['host_form_id']);
$host_form_name = "";
if(IsSet($_POST['host_form_name']))	$host_form_name =           mysql_real_escape_string($_POST['host_form_name']);
elseif(IsSet($_GET['host_form_name']))	$host_form_name =           mysql_real_escape_string($_GET['host_form_name']);

$completed_by_fk = 	$User_ID;

if(IsSet($_POST['completed_date']))	$completed_date =          mysql_real_escape_string($_POST['completed_date']);
$last_edited = "'" . date("Y-m-d G:i:s") . "'";

if(IsSet($_POST['seen_date']))	$seen_date =          mysql_real_escape_string($_POST['seen_date']);
	else $seen_date = "";
if(IsSet($_POST['diagnosis']))	$diagnosis =          mysql_real_escape_string($_POST['diagnosis']);
	else $diagnosis = "";
/*if(IsSet($_POST['end_time']))	$end_time =          mysql_real_escape_string($_POST['end_time']);
	else $end_time = "";*/
$start_time=NULL;	
$end_time=NULL;	
if(IsSet($_POST['goals']))	$goals =          mysql_real_escape_string($_POST['goals']);
	else $goals = "";
if(IsSet($_POST['objectives']))	$objectives =          mysql_real_escape_string($_POST['objectives']);
	else $objectives = "";
if(IsSet($_POST['interventions']))	$interventions =          mysql_real_escape_string($_POST['interventions']);
	else $interventions = "";
if(IsSet($_POST['response']))	$response =          mysql_real_escape_string($_POST['response']);
	else $response = "";
if(IsSet($_POST['progress']))	$progress =          mysql_real_escape_string($_POST['progress']);
	else $progress = "";
if(IsSet($_POST['time_in_1']))	$time_in_1 =          mysql_real_escape_string($_POST['time_in_1']);
	else $time_in_1 = "";
if(IsSet($_POST['time_out_1']))	$time_out_1 =          mysql_real_escape_string($_POST['time_out_1']);
	else $time_out_1 = "";
if(IsSet($_POST['time_in_2']))	$time_in_2 =          mysql_real_escape_string($_POST['time_in_2']);
	else $time_in_2 = "";
if(IsSet($_POST['time_out_2']))	$time_out_2 =          mysql_real_escape_string($_POST['time_out_2']);
	else $time_out_2 = "";
if(IsSet($_POST['time_in_3']))	$time_in_3 =          mysql_real_escape_string($_POST['time_in_3']);
	else $time_in_3 = "";
if(IsSet($_POST['time_out_3']))	$time_out_3 =          mysql_real_escape_string($_POST['time_out_3']);
	else $time_out_3 = "";
if(IsSet($_POST['time_in_4']))	$time_in_4 =          mysql_real_escape_string($_POST['time_in_4']);
	else $time_in_4 = "";
if(IsSet($_POST['time_out_4']))	$time_out_4 =          mysql_real_escape_string($_POST['time_out_4']);
	else $time_out_4 = "";
if(IsSet($_POST['total_time']))	$total_time =          mysql_real_escape_string($_POST['total_time']);
	else $total_time = "";
if(IsSet($_POST['program_location']))	$program_location =          mysql_real_escape_string($_POST['program_location']);
	else $program_location = "";
if(IsSet($_POST['program_where']))	$program_where =          mysql_real_escape_string($_POST['program_where']);
	else $program_where = "";

  // Added 11/6/2009 We need to look at the seen_date and start and end times to make sure they don't overlap an already billed form
  // If it does, we provide a "message" and we set the validation to Conflict
  //$start_time
  //include('cpt_time_check.inc');
  
if($this_form_action == "Insert")
{
if(!$host_form_id)  $host_form_id = "NULL";

if($this_validation == "Bill")	$completed_date = "'" . date("Y-m-d G:i:s") . "'";
else $completed_date = "NULL";

$insert_string = "INSERT INTO activity_therapy_note
(form_id_pk, patient_id_fk, completed_date, last_edited, seen_date, completed_by_fk,diagnosis, start_time, end_time, goals, objectives, interventions, response, 
 progress, time_in_1, time_out_1, time_in_2, time_out_2, time_in_3, time_out_3, time_in_4, time_out_4, total_time, sup_id_fk, program_location,program_where, 
 host_form_id_fk, host_form_table_name
)VALUES
(NULL, '$this_patient_id',$completed_date,$last_edited,'$seen_date', '$User_ID','$diagnosis', NULL, NULL, '$goals', '$objectives','$interventions', '$response', '$progress',
 '$time_in_1', '$time_out_1', '$time_in_2', '$time_out_2', '$time_in_3', '$time_out_3', '$time_in_4', '$time_out_4','$total_time', '$sup_id_fk', $program_location','$program_where',
 $host_form_id,'$host_form_name'
)";
//echo "<br /><br /><br />$insert_string";
$message = "<html><body><br /><br /><center>";
        $insert_result = mysql_query($insert_string);
        if(mysql_error() == "")
        {
          $message .= "<font color=#0000DD>Success. $first_name $last_name's $form_title_string was inserted.</font>";
        }
        else
          print(mysql_error());
      //Use built-in function to get the new patient's ID
      $this_eval_form_id = mysql_insert_id();
      // Now Update our billing code for this patient/this form
      // for below 
      //<INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','width=680,height=680,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />";

      if($this_validation == "Bill") 
        {
        	include("cpt_form_insert.inc");
        	$message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\">
				<input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\">
				<input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\">
				<INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />";
				$this_form_action = 'Blank';
        }
        else
        {
          //$message .= $cpt_time_message;
        	$this_form_action = 'Update';
        }
  		//echo $insert_string;
  }

/**/  
if($this_form_action == "Add" && (!$completed_date || $completed_date == "NULL") )
{
if($this_validation == "Bill")	$completed_date = "'" . date("Y-m-d G:i:s") . "'";
else $completed_date = "NULL";

  	$update_string = "UPDATE `activity_therapy_note` SET
  	`completed_date` =  $completed_date,
  	`completed_by_fk` = $User_ID,
'sup_id_fk' = $sup_id_fk
  	`last_edited` = $last_edited,
  	`seen_date` =  '$seen_date',
  	`diagnosis` = '$diagnosis',
  	`start_time` =  NULL,
  	`end_time` =  NULL,
  	`goals` =  '$goals',
  	`objectives` =  '$objectives',
	`interventions` =  '$interventions',
	`response` =  '$response',
	`progress` =  '$progress',
	`time_in_1` =  '$time_in_1',
	`time_out_1` =  '$time_out_1',
	`time_in_2` =  '$time_in_2',
	`time_out_2` =  '$time_out_2',
	`time_in_3` =  '$time_in_3',
	`time_out_3` =  '$time_out_3',
	`time_in_4` =  '$time_in_4',
	`time_out_4` =  '$time_out_4',
	`total_time` =  '$total_time',
    `program_location` =  '$program_location',
    `program_where` =  '$program_where'
  	WHERE `form_id_pk` = '$this_eval_form_id' LIMIT 1"; 
  	
  	//echo $update_string . "<br />";
  	 $update_result = mysql_query($update_string);
     if(mysql_affected_rows() == 1)
     {
     	// Now Update our billing code for this patient/this form
     	//else include("cpt_form_update.inc");
        $message = "<html><body><br /><br /><center><font color=\"#0000DD\">Success. $first_name $last_name's $form_title_string was updated.</font>";
        if($this_validation == "Bill") 
        {
        	include("cpt_form_insert.inc");
        	$message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\">
				<input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\">
				<input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\">
				<INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form<br />";
				$this_form_action = 'Blank';
        }
        else
        {
          //$message .= $cpt_time_message;
        	$this_form_action = 'Update';
        }
     }
     else
     {
     	 print(mysql_error());
     	 // Now Update our billing code for this patient/this form
     //	else include("cpt_form_update.inc");
     	 $message = "<html><body><br /><br /><center><font color=#0000DD>No information was changed so nothing to update.</font>";
     	 
     	 if($this_validation == "Bill") 
        {
        	include("cpt_form_insert.inc");
        	$message .= "<form method=\"post\" action=\"activity_therapy_note.php\" target=\"mywindow\" enctype=\"application_x-www-form-urlencoded\">
				<input type=\"hidden\" name=\"patient_id\" value=\"$this_patient_id\">
				<input type=\"hidden\" name=\"eval_form_id\" value=\"$this_eval_form_id\">
				<INPUT TYPE=\"submit\" name=\"submit_b\" VALUE=\"Print\" onclick=\"newwindow=window.open('ct_splash.html','mywindow','$win_width,menubar=yes,scrollbars=yes,resizable=yes');if(window.focus)newwindow.focus()\"></form> this Activity Therapy Note form or<br />";
        }
     	 else
     	 {
     	    //$message .= $cpt_time_message;
     	 		$this_form_action = 'Update';
     	 }
     }
  }
  elseif($this_form_action == "Add")
  {
  	$message = "<html><body><br /><br /><center><font class=req>Error: you are not allowed to update a signed and billed form. Open an Addendum.</font>";
  }
}
?>

Link to comment
Share on other sites

and

 

activity_therapy.php

 

<?php //activity_therapy.php

/*
This is the Activity Therapy Note form
*/

require_once('custom_tech.inc');
//error_reporting(E_ALL);
include("tool_tip2.inc");

$form_title_string = "Activity Therapy Note";		
$pre_note = "";
$patient_multi_string = "";
$multi_pre_note  = "";
$completed_date="";
$message="";
$host_form_items_string="";
$program_loc_string="";
$sup_id_fk="";

   
//echo "This form: $this_form_action and this patient: $this_patient_id<br />"; 
include_once('note_processing.inc');


/*echo "<br />";
print_r($_POST);
echo "<br />";*/

// Connect to database for following queries
mysql_connect("localhost", $db_user, $db_pass) or die("Failure to communicate with database");
mysql_select_db($db_database) or die("Unable to select database");

include_once('patient_demos.inc');

// Include our Insert code
include_once('activity_therapy_note_insert.inc');

if( ($this_form_action == "Print" || $this_form_action == "View") && ($this_eval_form_id != NULL) && ($this_patient_id != NULL) )
{
$disabled_string = "";//" disabled=\"disabled\"";
//echo "we are in Print";
require('activity_therapy_note_print_query.inc');
include("cpt_form.inc");
include('signatures.inc');
include('print_style.inc');

//echo "This is the query $intake_eval_query";

$frm_str = <<<EOP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    <title>$this_custom_tech_customer  $form_title_string</title>
$print_style_string
<tr>
<td><br /><b>ACTIVITY THERAPY NOTE:</b><br /></td>
</tr>
$diagnosis_string
<tr>
<td><b>DOB:</b> <font class="dbd">$dob</font></td>
</tr>

<tr>
<td><br><b>GOALS FROM THE MTP:</b><br /><font class="dbd">$goals</font></td>
</tr>
<tr>
<td><br><b>OBJECTIVES FROM THE MTP:</b><br /><font class="dbd">$objectives</font></td>
</tr>
<tr>
<td><br><b>INTERVENTIONS FROM THE MTP:</b><br /><font class="dbd">$interventions</font></td>
</tr>

<tr>
<td><br /><b>PROGRESS/RESPONSE:</b>
<table width="100%" border="0">
	<tr>
		<td width="5%"> </td>
		<td>How is the client responding to your efforts?<br />
		<font class="dbd">$response</font></td>
	</tr>
	<tr>
		<td width="5%"> </td>
		<td>Is the client improving, regressing, or staying the same?<br />
		<font class="dbd">$progress</font></td>
	</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0">
	<tr>
		<td width="15%"><b>TIME IN:</b></td>
		<td><b>TIME OUT:</b></td>
	</tr>
	<tr>
		<td><font class="dbd">$time_in_1</font></td>
		<td><font class="dbd">$time_out_1</font></td>
	</tr>
	<tr>
		<td><font class="dbd">$time_in_2</font></td>
		<td><font class="dbd">$time_out_2</font></td>
	</tr>
	<tr>
		<td><font class="dbd">$time_in_3</font></td>
		<td><font class="dbd">$time_out_3</font></td>
	</tr>
	<tr>
		<td><font class="dbd">$time_in_4</font></td>
		<td><font class="dbd">$time_out_4</font></td>
	</tr>
</table>
      <b>TOTAL TIME: </b><font class="dbd">$total_time</font> minutes</td>
</tr>
<tr>
<td><br><br><b>PROGRAM LOCATION:</b> $program_loc_string <font class="dbd">$program_location</font></td>
</tr>
/html>

EOP;
echo $frm_str.'<hr>';

if(($completed_date_string != ""))
   {
echo '

         <tr>
            <td valign="bottom">'. $clinician_sig. '<hr /></td>
            <td valign="bottom">'. $completed_date_string. '<hr />Date:</td>
         </tr>
         <tr>
            <td valign="bottom">'. $sup_sig. '<hr /></td>
            <td valign="bottom">'. $completed_date_string. '<hr />Date:</td>
         </tr>


	</table>
</td>
</tr>	
</td>
</tr>'; }

$frm_str = <<<EOP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>


</tbody>
</table>
</div>
</div>
</body>
</html>
EOP;

$message = $frm_str;
}


if($this_form_action == "Multi")
{
$thisfile="activity_therapy_note_multi.php";
include('activity_therapy_note_multi.php');
exit;
}


if($this_form_action == "New" || $this_form_action == "Update")
{
// query the database for any existing information
//echo "$time_in_1 <br />";
if($this_form_action == "Update")
{
	require('activity_therapy_note_print_query.inc');
	$insert_or_update = "Add";
	$ioru_1 = "update";
	$ioru_2 = "in";
	//$this_time = $start_time;
}
else
{
	// Include our code support queries here
	$insert_or_update = "Insert";
	$ioru_1 = "add";
	$ioru_2 = "to";
	//$start_time = $this_time;
	//$seen_date = $this_entry_date;

	// Added 4/13/2010 Need to have the most recent diagnosis from the Psych Eval or MD Review
	$sql_query = "SELECT form_id_pk, MAX( completed_date ), patient_id_fk, dsm_axis1 FROM psychiatric_eval WHERE patient_id_fk = $this_patient_id AND completed_date IS NOT NULL GROUP BY form_id_pk, patient_id_fk ORDER BY completed_date DESC LIMIT 1";
	$sql_result = mysql_query($sql_query) or die ("Error in psychiatric_eval_query");
	$psych_hist_array = mysql_fetch_array($sql_result);	
	if( $psych_hist_array[0] != 0 ){
      //echo "<br /><br /><br />$sql_query";
      $diagnosis = $psych_hist_array['dsm_axis1'];
      //echo "<br />$host_form_id $host_form_name";
    }
    else {
      $psych_hist_array[1] = "1970-01-01 00:00:00";
    }
    // Now check the Med Managment note
    $sql_query = "SELECT form_id_pk, MAX( completed_date ), patient_id_fk, dsm_axis1 FROM med_management WHERE patient_id_fk = $this_patient_id AND completed_date IS NOT NULL GROUP BY form_id_pk, patient_id_fk ORDER BY completed_date DESC LIMIT 1";
	$sql_result = mysql_query($sql_query) or die ("Error in med_management_query");
	$med_hist_array = mysql_fetch_array($sql_result);	
	if( $med_hist_array[0] != 0 && $med_hist_array[1] > $psych_hist_array[1]){
      //echo "<br /><br /><br />$sql_query";
      $diagnosis = $med_hist_array['dsm_axis1'];
      //echo "<br />$host_form_id $host_form_name";
    }
    else {
      $diagnosis = $psych_hist_array['dsm_axis1'];
    }
    		
	// we want to pick the most recent MTP or 90-day. To do this we will use the views
	// first grab the MTP date and form_id
	$sql_query = "SELECT form_id_pk, MAX(approved_date), patient_id_fk FROM approved_master_treat WHERE patient_id_fk = $this_patient_id GROUP BY form_id_pk, patient_id_fk ORDER BY approved_date desc LIMIT 1"; 
	$sql_result = mysql_query($sql_query) or die ("Error in approved_master_treat_query");
	$mtp_hist_array = mysql_fetch_array($sql_result);	
    if( $mtp_hist_array[0] != 0 ){
      //echo "<br /><br /><br />$sql_query";
      $host_form_id = $mtp_hist_array['form_id_pk'];
      $host_form_name = "master_treat";
      //echo "<br />$host_form_id $host_form_name";
    }
    else {
      $mtp_hist_array[1] = "1970-01-01 00:00:00";
    }
    
    // Now see if we have a more recent date for a 90-day review
    $sql_query = "SELECT form_id_pk, MAX(approved_date), patient_id_fk FROM approved_ninety_review WHERE patient_id_fk = $this_patient_id AND approved_date > STR_TO_DATE('$mtp_hist_array[1]','%Y-%m-%d %H:%i:%s') GROUP BY form_id_pk, patient_id_fk ORDER BY approved_date desc LIMIT 1"; //2009-07-21 23:02:43
	$sql_result = mysql_query($sql_query) or die ("Error in approved_ninety_review_query");
	$ninety_hist_array = mysql_fetch_array($sql_result);
    if( $ninety_hist_array[0] != NULL){
      //echo "<br /><br /><br />$sql_query";
      $host_form_id = $ninety_hist_array['form_id_pk'];
      $host_form_name = "ninety_review";
      //echo "<br />$host_form_id $host_form_name";
    }
    else {
      $ninety_hist_array[1] = "1970-01-01 00:00:00";
    }


    
    // Must have a MTP or 90-day to work from
    if( $host_form_id == NULL ){
      $message = "<html><body><br /><br /><br /><br /><center><h2>No Approved Master Treatment Plan or Ninety Day Review found. Please report this to your site coordinator.</h2>
      Causes for this are: <li>The doctor has not yet approved the form<li>No treatement plan has been submitted<br /><br /><hr><h3>Please close this window to continue.</h3></center></body></html>";
      print($message);
      exit;
    }
}

	if(IsSet($host_form_id) && $host_form_name == "activity_therapy_note")
	{
		$this_eval_form_id = $host_form_id;
		$pre_note = "<br /><font class=\"note\">Values brought over from a previous Activity Therapy Note</font>";
		include('activity_therapy_note_print_query.inc');
		$completed_date = "NULL";
		$sup_id_fk="";
		$seen_date = "";
		$start_time = "";
		$end_time = "";
		$response = "";
		$progress = "";
		$time_in_1 = $time_in_2 = $time_in_3 = $time_in_4 = "";
		$time_out_1 = $time_out_2 = $time_out_3 = $time_out_4 = $total_time = ""; 
	}
	else 
	if(IsSet($host_form_id) && $host_form_name == "master_treat")
	{

		$sql_query = "select problem_1_statement,problem_1_goal,problem_1_obj,problem_1_int,
												 problem_2_statement,problem_2_goal,problem_2_obj,problem_2_int,
												 problem_3_statement,problem_3_goal,problem_3_obj,problem_3_int,completed_date 
		FROM $host_form_name 
		WHERE patient_id_fk = '$this_patient_id' and form_id_pk = $host_form_id";
		//echo " $sql_query ";
		$sql_results = mysql_query($sql_query) or die ("Error in $host_form_name query");
  		$sql_array = mysql_fetch_array($sql_results);
  		
  		$pre_note = "<font class=note>Values brought over from Master Treatment Plan dated " . stripslashes($sql_array['completed_date']) . "</font>";
  		
  		// Updates made 4/15/2008 per LSA. We need to parse out the individual Objectives and Interventions to allow the 
  		// clinicians to chekc the ones they want included on this note
  		// Each item should be number sequentially starting from 1., 2. , ... n.
  		// First get the Objectives in a string to parse
  		$temp_string = stripslashes($sql_array['problem_1_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_1,"goal1","goals");
  		$temp_string = stripslashes($sql_array['problem_1_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_1,"obj1","objectives");
  		$temp_string = stripslashes($sql_array['problem_1_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_1,"int1","interventions");	
  		
  		// Problem 2
  		$temp_string = stripslashes($sql_array['problem_2_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_2,"goal2","goals");
  		$temp_string = stripslashes($sql_array['problem_2_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_2,"obj2","objectives");
  		$temp_string = stripslashes($sql_array['problem_2_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_2,"int2","interventions");
  		
  		// Problem 3
  		$temp_string = stripslashes($sql_array['problem_3_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_3,"goal3","goals");
  		$temp_string = stripslashes($sql_array['problem_3_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_3,"obj3","objectives");
  		$temp_string = stripslashes($sql_array['problem_3_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_3,"int3","interventions");
  		
  		$problem_2_statement = $sql_array['problem_2_statement'];
  		$problem_3_statement = $sql_array['problem_3_statement'];
  		
  		// Now that we have our parsed strings, we need to bundle them into a nice neat presentation
  		{
  			$host_form_items_string =    "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 1:</b> " . stripslashes($sql_array['problem_1_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_1</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_1</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_1</div></div>";
  		}
  		if(isSet($problem_2_statement) && $problem_2_statement != "")
  		{
  			$host_form_items_string .=   "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 2:</b> " . stripslashes($sql_array['problem_2_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_2</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_2</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_2</div></div>";
  		}
  		if(isSet($problem_3_statement) && $problem_3_statement != "")
  		{
  			$host_form_items_string .=   "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 3:</b> " . stripslashes($sql_array['problem_3_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_3</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_3</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_3</div></div>";
  		}
  		//$problem_1_goal = stripslashes($sql_array['problem_1_goal']) . "\n" . stripslashes($sql_array['problem_2_goal']) . "\n" . stripslashes($sql_array['problem_3_goal']) . "\nObjectives: " . stripslashes($sql_array['problem_1_obj']) . "\n" . stripslashes($sql_array['problem_2_obj']) . "\n" . stripslashes($sql_array['problem_3_obj']);
  		//$interventions = stripslashes($sql_array['problem_1_int']) . "\n" . stripslashes($sql_array['problem_2_int']) . "\n" . stripslashes($sql_array['problem_3_int']);

	}
	elseif(IsSet($host_form_id) && $host_form_name == "ninety_review")
	{
		$sql_query = "select problem_1_statement,problem_1_goal,problem_1_obj,problem_1_int,
												 problem_2_statement,problem_2_goal,problem_2_obj,problem_2_int,
												 problem_3_statement,problem_3_goal,problem_3_obj,problem_3_int,completed_date 
		FROM ninety_review 
		WHERE patient_id_fk = '$this_patient_id' and form_id_pk = $host_form_id";
		//echo " $sql_query ";
		$sql_results = mysql_query($sql_query) or die ("Error in ninety_review query");
  		$sql_array = mysql_fetch_array($sql_results);
  		
  		$pre_note = "<font class=note>Values brought over from 90-Day Review dated " . stripslashes($sql_array['completed_date']) . "</font>";
  		
  		// Updates made 4/15/2008 per LSA. We need to parse out the individual Objectives and Interventions to allow the 
  		// clinicians to chekc the ones they want included on this note
  		// Each item should be number sequentially starting from 1., 2. , ... n.
  		// First get the Objectives in a string to parse
  		$temp_string = stripslashes($sql_array['problem_1_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_1,"goal1","goals");
  		$temp_string = stripslashes($sql_array['problem_1_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_1,"obj1","objectives");
  		$temp_string = stripslashes($sql_array['problem_1_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_1,"int1","interventions");	
  		
  		// Problem 2
  		$temp_string = stripslashes($sql_array['problem_2_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_2,"goal2","goals");
  		$temp_string = stripslashes($sql_array['problem_2_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_2,"obj2","objectives");
  		$temp_string = stripslashes($sql_array['problem_2_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_2,"int2","interventions");
  		
  		// Problem 3
  		$temp_string = stripslashes($sql_array['problem_3_goal']);
  		// now call our parseText function
  		parseText($temp_string,$goal_prob_3,"goal3","goals");
  		$temp_string = stripslashes($sql_array['problem_3_obj']);
  		// now call our parseText function
  		parseText($temp_string,$objectives_prob_3,"obj3","objectives");
  		$temp_string = stripslashes($sql_array['problem_3_int']);
  		// now call our parseText function
  		parseText($temp_string,$interventions_prob_3,"int3","interventions");
  		
  		$problem_2_statement = $sql_array['problem_2_statement'];
  		$problem_3_statement = $sql_array['problem_3_statement'];
  		
  		// Now that we have our parsed strings, we need to bundle them into a nice neat presentation
  		{
  			$host_form_items_string =    "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 1:</b> " . stripslashes($sql_array['problem_1_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_1</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_1</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_1</div></div>";
  		}
  		if(isSet($problem_2_statement) && $problem_2_statement != "")
  		{
  			$host_form_items_string .=   "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 2:</b> " . stripslashes($sql_array['problem_2_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_2</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_2</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_2</div></div>";
  		}
  		if(isSet($problem_3_statement) && $problem_3_statement != "")
  		{
  			$host_form_items_string .=   "<div style=\"position:relative; left:8%; width: 625; border: 1px solid black;\"><div style=\"text-align: left; background-color: #CCC\"><b>Problem 3:</b> " . stripslashes($sql_array['problem_3_statement']) . "</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Goal:</b> <font class=\"note\">Check all that apply</font><br />$goal_prob_3</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Objectives:</b> <font class=\"note\">Check all that apply</font><br />$objectives_prob_3</div>";
  			$host_form_items_string .=   "<div style=\"position:relative; left:10px\"><b>Interventions:</b> <font class=\"note\">Check all that apply</font><br />$interventions_prob_3</div></div>";
  		}
	}


//get our program locations codes
$codes_query_string = "SELECT * FROM code_support WHERE type_cd=39 ORDER BY item_cd ASC";
//if($User_ID==1) echo "$codes_query_string<br/>";
$codes_query_result = mysql_query($codes_query_string) or die ("Error in program locs query");
$program_loc_string = "";
$i = 0;
while($codes_query_array = mysql_fetch_array($codes_query_result))
{
	$program_loc_string .= "<input ctp_reqrd=\"1\" type=\"radio\" name=\"program_where\" value=\"$codes_query_array[1]\"";
	if(IsSet($program_where))
	{
		if($program_where == $i + 1)  
			$program_loc_string .= " checked=\"checked\"$disabled_string>$codes_query_array[2] ";
		else
			$program_loc_string .= "$disabled_string>$codes_query_array[2] ";
	}
	else $program_loc_string .= "$disabled_string>$codes_query_array[2] ";
	$i++;
}


require_once("form_submit.inc");
include_once("cpt_form.inc");
include_once("form_check.inc");
include_once("date_functions.inc");



$frm_str = <<<EOT
<html>
    <head>
    <title>$this_custom_tech_customer $form_title_string</title>
    $style_string
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
<body onload="calc_total_time('time_in_','time_out_',4,'total_time')">
$javascript_select_function
$javascript_string
$date_javascript
$form_check_java
<center>
<form name="psych_eval" method="post" action="$thisfile" enctype="application_x-www-form-urlencoded" onKeyUp="highlight(event)" onClick="highlight(event)">
$patient_multi_string
<table width="625" border="0">
<tr>
<td colspan="2">
<table width="100%" border="0" bgcolor="$my_bgcolor" class="ui-corner-all">
	<tr>
		<td><b>NAME:</b> <font class="dbd">$first_name $last_name</font></td>
		<td><b>CLIENT #:</b> <font class="dbd">$patient_num</font>   <b>Medical Record#:</b> <font class="dbd">$medical_record_num</font>
		<input type="hidden" name="patient_id" value="$this_patient_id"></td>
	</tr>
	<tr>
		<td><b>$this_custom_tech_customer</b></td>
  		<td><b>LOCATION:</b> <font class="dbd">$clinic_name $clinic_provider_num</font></td>
	</tr>
	<tr>
		<td><b>DATE:</b> <input date="1" ctp_reqrd="1" type="text" id="seen_date" name="seen_date" size="8" value="$seen_date"><input type="hidden" name="completed_date" value="$completed_date"></td>

	</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><br /><b>ACTIVITY THERAPY NOTE:</b><br /></td>
</tr>
<tr>
<td colspan="2"><b>DIAGNOSIS:</b> <font class="dbd">$diagnosis</font><input type="hidden" name="diagnosis" value="$diagnosis"></td>
</tr>
<tr>
<td colspan="2"><b>DOB:</b> <font class="dbd">$dob</font></td>
</tr>
<tr>
<td colspan="2"><br><b>DATA FROM THE MTP:</b>$pre_note<br />$host_form_items_string
<table width="100%" border="0">
	<tr>
		<td width="5%"> </td>
		<td><b>GOALS FROM THE MTP:</b>$multi_pre_note<br />
		<textarea ctp_reqrd="1" id="goals" name="goals" rows="5" cols="80">$goals</textarea></td>
	</tr>
	<tr>
		<td width="5%"> </td>
		<td><b>OBJECTIVES FROM THE MTP:</b>$multi_pre_note<br />
		<textarea ctp_reqrd="1" id="objectives" name="objectives" rows="5" cols="80">$objectives</textarea></td>
	</tr>
	<tr>
		<td width="5%"> </td>
		<td><b>INTERVENTIONS FROM THE MTP:</b><br />
		<textarea ctp_reqrd="1" id="interventions" name="interventions" rows="5" cols="80">$interventions</textarea></td>
		</td>
	</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2"><br /><b>PROGRESS/RESPONSE:</b>
<table width="100%" border="0">
	<tr>
		<td width="5%"> </td>
		<td>How is the client responding to your efforts?$multi_pre_note<br />
		<textarea ctp_reqrd="1" name="response" rows="5" cols="80">$response</textarea></td>
	</tr>
	<tr>
		<td width="5%"> </td>
		<td>Is the client improving, regressing, or staying the same?$multi_pre_note<br />
		<textarea ctp_reqrd="1" name="progress" rows="5" cols="80">$progress</textarea></td>
	</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><center><font class="note">Please enter times using the HH:MM A/PM format such as 12:45 pm</font>
<table border="0">
	<tr>
		<td><b>TIME IN:</b></td>
		<td><b>TIME OUT:</b></td>
	</tr>
	<tr>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" ctp_reqrd="1" type="text" id="time_in_1" name="time_in_1" size="7" value="$time_in_1"></td>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" ctp_reqrd="1" type="text" id="time_out_1" name="time_out_1" size="7" value="$time_out_1"></td>
	</tr>
	<tr>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_2" name="time_in_2" size="7" value="$time_in_2"></td>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_2" name="time_out_2" size="7" value="$time_out_2"></td>
	</tr>
	<tr>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_3" name="time_in_3" size="7" value="$time_in_3"></td>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_3" name="time_out_3" size="7" value="$time_out_3"></td>
	</tr>
	<tr>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_in_4" name="time_in_4" size="7" value="$time_in_4"></td>
		<td><input onblur="calc_total_time('time_in_','time_out_',4,'total_time')" type="text" id="time_out_4" name="time_out_4" size="7" value="$time_out_4"></td>
	</tr>
</table><font class="note">Note: The Total Time will be system calculated</font><br />
      <b>TOTAL TIME: </b><input type="text" id="total_time" name="total_time" size="8" value="$total_time">minutes</center>
</td>
</tr>
<tr>
<td><br /><center><b>Supervisor's Signature</b></center>
	<table border=0 width=100%>
		<tr><td colspan="2"></td></tr>
	<tr>
			<td width="70%"><b>Supervisor:</b> <select name="sup_id_fk" size="1"><option value="72"> Canfield, Scot [Nurse Practitioner/Supervisor]</option><option value="66"> Jackson, Tia [supervisor/Therapist]</option><option value="124"> Lira, Misti [intake Coordinator/Supervisor]</option><option value="38"> Martin, Lillian [Asst. Clinical Director/Supervisor]</option></select></td>

			<td>Date:<u>                 </u></td>
		</tr>



	</table>	
</td>
</tr>
<tr>
<td colspan="2"><br><br><b>PROGRAM LOCATION:</b>$program_loc_string<br /><input ctp_reqrd="1" type="text" name="program_location" size="110" value="$program_location"></td>
</tr>
<tr>
<td colspan="2">$adult_cpt_select_string</td>
</tr>
<tr>    
  <th colspan="2">$submit_button_string</th>
</tr>
</table>
</form>
</center>
</body>
</html>
EOT;

$message = $frm_str;
}

print($message);

?>

Link to comment
Share on other sites

Change this Line:

$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query signatures.inc: ".mysql_error());

To

$sql_query_result = mysql_query($sql_query) or die ("Error in sql_query signatures.inc: <br />Query: $sql_query <br />".mysql_error());

 

I suggest this, because the error looks funny.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.