Exemplo n.º 1
0
    function vitals_detail() {
        if (func_num_args()>0) {
            $arg_list = func_get_args();
            $menu_id = $arg_list[0];
            $post_vars = $arg_list[1];
            $get_vars = $arg_list[2];
            $validuser = $arg_list[3];
            $isadmin = $arg_list[4];
            //print_r($arg_list);
        }
        // process delete here
        if ($post_vars["submitvitals"]) {
            if ($post_vars["submitvitals"]=="Delete") {
                if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                    $sql_delete = "delete from m_consult_vitals ".
                                  "where consult_id = '".$get_vars["consult_id"]."' and ".
                                  "vitals_timestamp = '".$get_vars["timestamp"]."'";
                    if ($result_delete = mysql_query($sql_delete)) {
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS");
                    }
                } else {
                    if ($post_vars["confirm_delete"]=="No") {
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS");
                    }
                }
            }
            
            
        }
        $sql = "select user_id, vitals_weight, vitals_temp, vitals_systolic, vitals_diastolic, vitals_heartrate, vitals_resprate,vitals_height,vitals_pulse ".
               "from m_consult_vitals where consult_id = '".$get_vars["consult_id"]."' and vitals_timestamp = '".$get_vars["timestamp"]."'";

		$edad  = healthcenter::get_patient_age($get_vars["consult_id"]);				

        if ($result = mysql_query($sql)) {
            if (mysql_num_rows($result)) {
                list($uid, $wt, $temp, $syst, $diast, $hrate, $rrate,$ht,$pulse) = mysql_fetch_array($result);
                print "<a name='detail'>";
                print "<form method='post' action='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS&timestamp=".$get_vars["timestamp"]."' name='form_vitals_detail'>";
                print "<table width='250' style='border: 1px dotted black'><tr><td colspan='2'>";
                print "Taken by: ".user::get_username($uid)."<br/>";
                print "<td></tr>";
                print "<tr valign='top'><td>";
                print "BP: $syst/$diast<br/>";
                print "HR: $hrate<br/>";
                print "RR: $rrate<br/>";
                print "Pulse Rate: $pulse<br/>";
                print "</td><td>";
                print "Weight (kg): $wt<br/>";
                print "Temp deg C: $temp<br/>";
                print "Height: $ht cms<br/>";
                print "</td></tr>";
                print "<tr><td colspan='2'>";
                print "HPN STAGE: ".healthcenter::hypertension_stage($syst, $diast, $edad)."<br/>";
		print healthcenter::compute_bmi($ht,$wt);
                print "</td></tr>";
                print "<tr><td colspan='2'>";
                //if ($_SESSION["priv_delete"]) {
                print "<input type='submit' name='submitvitals' value='Update' class='tinylight' style='border: 1px solid black'/>&nbsp;&nbsp;";
                print "<input type='submit' name='submitvitals' value='Delete' class='tinylight' style='border: 1px solid black'/>";
                //}
                print "</td></tr>";
                print "</table>";
                print "</form>";
            }
        }
    }