当前位置: 首页>>代码示例>>PHP>>正文


PHP module::confirm_delete方法代码示例

本文整理汇总了PHP中module::confirm_delete方法的典型用法代码示例。如果您正苦于以下问题:PHP module::confirm_delete方法的具体用法?PHP module::confirm_delete怎么用?PHP module::confirm_delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module的用法示例。


在下文中一共展示了module::confirm_delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process_consult_lab_sputum


//.........这里部分代码省略.........
                mysql_query("START TRANSACTION;") or die(mysql_error());


                if ($release_flag=="Y") {
                    if(empty($_POST["lab_diagnosis"])):
                        echo "<script language='Javascript'>";
                        echo "window.alert('Cannot close / release sputum exam yet. Please indicate LAB DIAGNOSIS!')";                        
                        echo "</script>";
                        
                    elseif(empty($_POST["sputum_period"])):
                        echo "<script language='Javascript'>"; 
                        echo "window.alert('Cannot close / release sputum exam yet.  Please indicate PERIOD OF SPUTUM EXAMS!')"; 
                        echo "</script>";
                                                                
                    else:
                    
                    $sql = "update m_consult_lab set ".
                           "done_timestamp = sysdate(), ".
                           "request_done = 'Y', ".
                           "done_user_id = '".$_SESSION["userid"]."' ".
                           "where request_id = '".$post_vars["request_id"]."'";
                    if ($result = mysql_query($sql)) {
                        // successful.. so just go to next SQL statement in
                        // transaction set
                    } else {
                        mysql_query("ROLLBACK;") or die(mysql_error());
                        mysql_query("SET autocommit=1;") or die(mysql_error());
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&module=".$get_vars["module"]."&request_id=".$post_vars["request_id"]."&lab_id=".$get_vars["lab_id"]."&ptmenu=LABS");
                    }
                                                
                    endif;
                }
                              
                // try insert first, will fail if previous request has been inserted
                // because of primary key constraint - then it will cascade to update below...
                
                $sql_sputum = "insert into m_consult_lab_sputum (consult_id, request_id, patient_id, ".
                              "lab_timestamp, sp1_collection_date, sp2_collection_date, sp3_collection_date, ".
                              "sp1_appearance, sp2_appearance, sp3_appearance, ".
                              "sp1_reading, sp2_reading, sp3_reading, lab_diag1, lab_diag2, lab_diag3, lab_diagnosis, sputum_period, ".
                              "user_id, release_flag) values ('".$get_vars["consult_id"]."', '".$post_vars["request_id"]."', ".
                              "'$patient_id', sysdate(), '$sp1_collection_date', '$sp2_collection_date', '$sp3_collection_date', ".
                              "'".$post_vars["sp1_appearance"]."', '".$post_vars["sp2_appearance"]."', '".$post_vars["sp3_appearance"]."', ".
                              "'".$post_vars["sp1_reading"]."', '".$post_vars["sp2_reading"]."', '".$post_vars["sp3_reading"]."', ".
                              "'".$post_vars["lab_diag1"]."', '".$post_vars["lab_diag2"]."', '".$post_vars["lab_diag3"]."', ".                              
                              "'".$post_vars["lab_diagnosis"]."', '".$post_vars["sputum_period"]."', '".$_SESSION["userid"]."', '$release_flag')";
                  
                  
                              
                if ($result_sputum = mysql_query($sql_sputum)) {
                    mysql_query("COMMIT;") or die(mysql_error());
                    mysql_query("SET autocommit=1;") or die(mysql_error());
                    //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&module=".$get_vars["module"]."&request_id=".$get_vars["request_id"]."&lab_id=".$get_vars["lab_id"]."&ptmenu=LABS");
                } else {
                    $sql_update = "update m_consult_lab_sputum set ".
                                  "lab_timestamp = sysdate(), ".
                                  "sp1_collection_date = '$sp1_collection_date', ".
                                  "sp2_collection_date = '$sp2_collection_date', ".
                                  "sp3_collection_date = '$sp3_collection_date', ".
                                  "sp1_appearance = '".$post_vars["sp1_appearance"]."', ".
                                  "sp2_appearance = '".$post_vars["sp2_appearance"]."', ".
                                  "sp3_appearance = '".$post_vars["sp3_appearance"]."', ".
                                  "sp1_reading = '".$post_vars["sp1_reading"]."', ".
                                  "sp2_reading = '".$post_vars["sp2_reading"]."', ".
                                  "sp3_reading = '".$post_vars["sp3_reading"]."', ".
                                  "lab_diag1 = '".$post_vars["lab_diag1"]."', ".
                                  "lab_diag2 = '".$post_vars["lab_diag2"]."', ".                                  
                                  "lab_diag3 = '".$post_vars["lab_diag3"]."', ".                                                                    
                                  "lab_diagnosis = '".$post_vars["lab_diagnosis"]."', ".
                                  "sputum_period = '".$post_vars["sputum_period"]."', ".
                                  "user_id = '".$_SESSION["userid"]."', ".
                                  "release_flag = '$release_flag' ".
                                  "where request_id = '".$post_vars["request_id"]."'";
                    if ($result_update = mysql_query($sql_update)) {                        
                        mysql_query("COMMIT;") or die(mysql_error());
                        mysql_query("SET autocommit=1;") or die(mysql_error());
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&module=".$get_vars["module"]."&ptmenu=LABS"."&module=sputum"."&request_id=".$get_vars["request_id"]."#sputum");
                    } else {
                        mysql_query("ROLLBACK;") or die(mysql_error());
                        mysql_query("SET autocommit=1;") or die(mysql_error());
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&module=".$get_vars["module"]."&ptmenu=LABS"."&module=sputum"."&request_id=".$get_vars["request_id"]."#sputum");
                    }
                }                
                
                break;
            case "Delete Lab Exam":
                if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                    $sql = "delete from m_consult_lab where request_id = '".$post_vars["request_id"]."'";
                    if ($result = mysql_query($sql)) {
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&module=".$get_vars["module"]."&ptmenu=LABS");
                    }
                } 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"]."&module=".$get_vars["module"]."&ptmenu=LABS");
                    }
                }
                break;
            }
        }
    }
开发者ID:henrybai,项目名称:chits,代码行数:101,代码来源:class.sputum.php

示例2: process_template

 function process_template()
 {
     //
     // called from _sms_template()
     //
     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];
         //print_r($arg_list);
     }
     if ($post_vars["submittemplate"]) {
         if ($post_vars["appointment"] && $post_vars["template_text"]) {
             switch ($post_vars["submittemplate"]) {
                 case "Add Template":
                     $sql = "insert into m_lib_reminder_sms_template (appointment_id, template_text) " . "values ('" . $post_vars["appointment"] . "', '" . addslashes($post_vars["template_text"]) . "')";
                     if ($result = mysql_query($sql)) {
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                     }
                     break;
                 case "Update Template":
                     $sql = "update m_lib_reminder_sms_template set " . "template_text = '" . addslashes($post_vars["template_text"]) . "' " . "where appointment_id = '" . $post_vars["appointment"] . "'";
                     if ($result = mysql_query($sql)) {
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                     }
                     break;
                 case "Delete Template":
                     if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                         $sql = "delete from m_lib_reminder_sms_template " . "where appointment_id = '" . $post_vars["appointment"] . "'";
                         if ($result = mysql_query($sql)) {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                         }
                     } else {
                         if ($post_vars["confirm_delete"] == "No") {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                         }
                     }
                     break;
             }
         }
     }
 }
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:43,代码来源:class.reminder.php

示例3: process_content

 function process_content()
 {
     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);
     }
     if ($get_vars["delete_id"]) {
         if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
             $sql = "delete from content where module_id = '" . $post_vars["module_id"] . "'";
             if ($result = mysql_query($sql)) {
                 header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&method=" . $get_vars["method"]);
             }
         }
     }
     switch ($post_vars["submitmodule"]) {
         case "Add Module":
             if ($post_vars["module"] && $post_vars["mod_column"] && $post_vars["mod_level"]) {
                 $sql = "insert into content (content_module, content_column, content_level, content_active) " . "values ('" . $post_vars["module"] . "', '" . $post_vars["mod_column"] . "', '" . $post_vars["mod_level"] . "', 'Y')";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&method=" . $get_vars["method"]);
                 }
             }
             break;
         case "Update Module":
             if ($post_vars["module"] && $post_vars["mod_column"] && $post_vars["mod_level"]) {
                 $sql = "update content set content_module = '" . $post_vars["module"] . "', " . "content_column = '" . $post_vars["mod_column"] . "', " . "content_level = '" . $post_vars["mod_level"] . "' " . "where content_id = '" . $post_vars["content_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&method=" . $get_vars["method"]);
                 }
             }
             break;
         case "Delete Module":
             if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                 $sql = "delete from content where content_id = '" . $post_vars["content_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&method=" . $get_vars["method"]);
                 }
             } else {
                 if ($post_vars["confirm_delete"] == "No") {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&method=" . $get_vars["method"]);
                 }
             }
             break;
     }
 }
开发者ID:BackupTheBerlios,项目名称:aefitools-svn,代码行数:50,代码来源:class.site.php

示例4: process_question

 function process_question()
 {
     if (func_num_args()) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         print_r($arg_list);
     }
     switch ($post_vars["submitquestion"]) {
         case "New Category":
             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
             break;
         case "Add Question":
             if ($post_vars["question_text"] && $post_vars["type_id"]) {
                 $alert = $post_vars["alert_flag"] ? "Y" : "N";
                 $sql = "insert into m_lib_questions (question_text, answer_type, alert_flag, question_cat) " . "values ('" . addslashes($post_vars["question_text"]) . "', '" . $post_vars["type_id"] . "', '{$alert}', '" . $post_vars["cat_id"] . "')";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             }
             break;
         case "Update Question":
             if ($post_vars["question_text"] && $post_vars["type_id"]) {
                 $alert = $post_vars["alert_flag"] ? "Y" : "N";
                 $sql = "update m_lib_questions set " . "question_text = '" . addslashes($post_vars["question_text"]) . "', " . "answer_type = '" . $post_vars["type_id"] . "', " . "question_cat = '" . $post_vars["cat_id"] . "', " . "alert_flag = '{$alert}' " . "where question_id = '" . $post_vars["question_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             }
             break;
         case "Delete Question":
             if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                 $sql = "delete from m_lib_questions where question_id = '" . $post_vars["question_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             } else {
                 if ($post_vars["confirm_delete"] == "No") {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             }
             break;
     }
 }
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:45,代码来源:class.history.php

示例5: process_drug

 function process_drug() {
     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);
     }
     if ($post_vars["submitdrug"]) {
         if ($post_vars["drugcat"] && $post_vars["drugprep"] && $post_vars["drugform"] && $post_vars["drugman"] && $post_vars["drug_name"]) {
             switch($post_vars["submitdrug"]) {
             case "Add Drug":
                 print $sql = "insert into m_lib_drugs (drug_cat, drug_name, drug_preparation, drug_formulation, manufacturer_id, drug_source, admin_desc) ".
                        "values ('".$post_vars["drugcat"]."', ".
                        "'".ucwords($post_vars["drug_name"])."', ".
                        "'".$post_vars["drugprep"]."', ".
                        "'".$post_vars["drugform"]."', ".
                        "'".$post_vars["drugman"]."', ".
                        "'".$post_vars["drugsource"]."', ".
                        "'".ucfirst($post_vars["admin_desc"])."')";
                 if ($result = mysql_query($sql)) {
                     header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                 }
                 break;
             case "Update Drug":
                 $sql = "update m_lib_drugs set ".
                        "drug_name = '".ucwords($post_vars["drug_name"])."', ".
                        "drug_cat = '".$post_vars["drugcat"]."', ".
                        "drug_formulation = '".$post_vars["drugform"]."', ".
                        "manufacturer_id = '".$post_vars["drugman"]."', ".
                        "drug_source = '".$post_vars["drugsource"]."', ".
                        "admin_desc = '".ucfirst($post_vars["admin_desc"])."' ".
                        "where drug_id = '".$post_vars["drug_id"]."'";
                 if ($result = mysql_query($sql)) {
                     header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                 }
                 break;
             case "Delete Drug":
                 if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                     $sql = "delete from m_lib_drugs where drug_id = '".$post_vars["drug_id"]."'";
                     if ($result = mysql_query($sql)) {
                         header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                     }
                 } else {
                     if ($post_vars["confirm_delete"]=="No") {
                         header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                     }
                 }
                 break;
             }
         } else {
             print "<font color='red'>Please complete entries.</font><br>";
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:chits-svn,代码行数:57,代码来源:class.drug.php

示例6: process_riskfactor

 function process_riskfactor() {
     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($post_vars);
     }
     if ($post_vars["submitriskfactor"]) {
         if ($post_vars["risk_name"]) {
             $hospital_flag = ($post_vars["hospital_flag"]?"Y":"N");
             $monitor_flag = ($post_vars["monitor_flag"]?"Y":"N");
             switch($post_vars["submitriskfactor"]) {
             case "Add Risk Factor":
                 $sql = "insert into m_lib_mc_risk_factors (risk_name, hospital_flag, monitor_flag) ".
                        "values ('".$post_vars["risk_name"]."', '$hospital_flag', '$monitor_flag')";
                 if ($result = mysql_query($sql)) {
                     header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id");
                 }
                 break;
             case "Update Risk Factor":
                 $sql = "update m_lib_mc_risk_factors set ".
                        "hospital_flag = '$hospital_flag', ".
                        "monitor_flag = '$monitor_flag', ".
                        "risk_name = '".$post_vars["risk_name"]."' ".
                        "where risk_id = '".$post_vars["risk_id"]."'";
                 if ($result = mysql_query($sql)) {
                     header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id");
                 }
                 break;
             case "Delete Risk Factor":
                 if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                     $sql = "delete from m_lib_mc_risk_factors where risk_id = '".$post_vars["risk_id"]."'";
                     if ($result = mysql_query($sql)) {
                         header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id");
                     }
                 } else {
                     if ($post_vars["confirm_delete"]=="No") {
                         header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                     }
                 }
                 break;
             }
         }
     }
 }
开发者ID:henrybai,项目名称:chits,代码行数:48,代码来源:class.mc.php

示例7: show_visitdetails

    function show_visitdetails() {
    //
    // data shown on the right side when DETAILS  is clicked
    //
        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);
        }
        $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]);
        print "<b>".FTITLE_PATIENT_GROUP."</b><br/>";

        if ($get_vars["deletets"] && $get_vars["deletegroup"]) {
            if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                $sql_delete = "delete from m_consult_ptgroup where consult_id = '".$get_vars["consult_id"]."' and ptgroup_timestamp = '".$get_vars["deletets"]."' and ptgroup_id = '".$get_vars["deletegroup"]."'";
                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=DETAILS");
                }
            } 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=DETAILS");
                }
            }
        }
        $sql_ptgroup = "select g.ptgroup_name, g.ptgroup_module, c.ptgroup_timestamp, c.ptgroup_id from m_consult_ptgroup c, m_lib_ptgroup g ".
                       "where g.ptgroup_id = c.ptgroup_id and c.consult_id = '".$get_vars["consult_id"]."'";
        if ($result = mysql_query($sql_ptgroup)) {
            if (mysql_num_rows($result)) {
                while (list($name, $mod, $ts, $grp) = mysql_fetch_array($result)) {
                    print "<img src='../images/arrow_redwhite.gif' border='0'/> <a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=".$get_vars["ptmenu"]."&module=$mod'>$name</a> ";
                    print "<a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=DETAILS&deletets=$ts&deletegroup=$grp'><img src='../images/delete.png' border='0'/></a><br/>";
                }
            } else {
                print "<font color='red'>none</font><br/>";
            }
        }
        print "<br/>";
        print "<b>".FTITLE_PATIENT_GROUP_HX."</b><br/>";

        $sql_ptgroup = "select count(c.ptgroup_id), g.ptgroup_name, g.ptgroup_module, c.ptgroup_id, c.consult_id ".
                       "from m_consult_ptgroup c, m_lib_ptgroup g, m_consult h ".
                       "where g.ptgroup_id = c.ptgroup_id and ".
                       "h.consult_id = c.consult_id and ".
                       "h.patient_id = '$patient_id' ".
                       "group by c.ptgroup_id";
        if ($result = mysql_query($sql_ptgroup)) {
            if (mysql_num_rows($result)) {
                print "<span class='tinylight'>";
                while (list($count, $name, $mod, $grp, $cid) = mysql_fetch_array($result)) {
                    print "<img src='../images/arrow_redwhite.gif' border='0'/> ";
                    print "$name: $count ".($count>1?" visits":"visit")."<br/> ";
                }
                print "</span>";
            } else {
                print "<font color='red'>No records.</font><br/>";
            }
        }
        /*
        print "<br/>";
        print "<b>".FTITLE_CONSULT_COMPLAINTS."</b><br/>";
        // process delete here
        if ($get_vars["deletets"] && $get_vars["deletecomplaint"]) {
            if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                $sql_delete = "delete from m_consult_complaint where consult_id = '".$get_vars["consult_id"]."' and complaint_timestamp = '".$get_vars["deletets"]."' and complaint_id = '".$get_vars["deletecomplaint"]."'";
                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=DETAILS");
                }
            } 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=DETAILS");
                }
            }
        }
        $sql_complaint = "select l.complaint_name, l.complaint_module, c.complaint_timestamp, c.complaint_id from m_consult_complaint c, m_lib_complaint l ".
                         "where l.complaint_id = c.complaint_id and c.consult_id = '".$get_vars["consult_id"]."'";
        if ($result = mysql_query($sql_complaint)) {
            if (mysql_num_rows($result)) {
                while (list($name, $mod, $ts, $comp) = mysql_fetch_array($result)) {
                    print "<img src='../images/arrow_redwhite.gif' border='0'/> <a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=".$get_vars["ptmenu"]."&module=$mod'>$name</a> ";
                    print "<a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=DETAILS&deletets=$ts&deletecomplaint=$comp'><img src='../images/delete.png' border='0'/></a><br/>";
                }
            } else {
                print "<font color='red'>none</font><br/>";
            }
        }
        */
        print "<br/>";
        print "<b>".FTITLE_CONSULT_MODULES."</b><br/>";
        $sql_modules = "select m.module_desc, h.module_id ".
                       "from m_healthcenter_modules h, modules m ".
                       "where h.module_id = m.module_id";
        if ($result = mysql_query($sql_modules)) {
            if (mysql_num_rows($result)) {
                while (list($desc, $mod) = mysql_fetch_array($result)) {
                    // remove the CHITS prefix
                    $desc = ereg_replace("CHITS ","", $desc);
//.........这里部分代码省略.........
开发者ID:angelogarcia,项目名称:chits,代码行数:101,代码来源:class.healthcenter.php

示例8: process_patient

 function process_patient()
 {
     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];
         $patient = $arg_list[3];
         //print_r($post_vars);
     }
     list($month, $day, $year) = explode("/", $post_vars["patient_dob"]);
     $dob = $year . "-" . str_pad($month, 2, "0", STR_PAD_LEFT) . "-" . str_pad($day, 2, "0", STR_PAD_LEFT);
     $post_vars["conv_dob"] = $dob;
     switch ($post_vars["submitpatient"]) {
         case "Add Patient":
             if ($post_vars["patient_lastname"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"] && $post_vars["patient_dob"] && $post_vars["patient_mother"]) {
                 // check for duplicates
                 $threshold = 93;
                 $sim_index = $this->get_duplicates($post_vars, $threshold);
                 if ($sim_index < $threshold) {
                     /*$sql = "insert into m_patient (patient_lastname, patient_firstname, patient_middle, patient_dob, patient_gender, registration_date, user_id, healthcenter_id, patient_mother,patient_cellphone) ".
                       "values ('".ucwords($post_vars["patient_lastname"])."', '".ucwords($post_vars["patient_firstname"])."', '".ucwords($post_vars["patient_middle"])."', ".
                       "'$dob', '".$post_vars["patient_gender"]."', sysdate(), '".$_SESSION["userid"]."', '".$_SESSION["datanode"]["code"]."', '".ucwords($post_vars["patient_mother"])."','".$post_vars["patient_cellphone"]."')"; */
                     //$sql = 'insert into m_patient (patient_lastname,patient_firstname, patient_middle, patient_dob, patient_gender, registration_date, user_id, healthcenter_id, patient_mother,patient_cellphone) values('.ucwords($post_vars["patient_lastname"]).','.ucwords($post_vars["patient_firstname"]).','.ucwords($post_vars["patient_middle"]).','.$dob.','.$post_vars["patient_gender"].','.'sysdate()'.','.$_SESSION["userid"].','.$_SESSION["datanode"]["code"].','.ucwords($post_vars["patient_mother"]).','.$post_vars["patient_cellphone"].')';
                     $get_last = mysql_query("SELECT patient_id FROM m_patient ORDER by patient_id DESC LIMIT 1") or die("Cannot query: 387" . mysql_error());
                     list($pxid) = mysql_fetch_array($get_last);
                     $next_id = $pxid + 1;
                     $sql = "insert into m_patient set patient_id='{$next_id}',patient_lastname='" . ucwords($post_vars[patient_lastname]) . "', patient_firstname='" . ucwords($post_vars[patient_firstname]) . "',patient_middle='" . ucwords($post_vars[patient_middle]) . "',patient_dob='{$dob}',patient_gender='{$post_vars['patient_gender']}',registration_date=sysdate(),user_id='{$_SESSION['userid']}',healthcenter_id='{$_SESSION['datanode']}[code]',patient_mother='" . ucwords($post_vars[patient_mother]) . "',patient_cellphone='{$post_vars['patient_cellphone']}'";
                     //print_r($post_vars);
                     $result = mysql_query($sql) or die(mysql_error());
                     if ($result) {
                         echo "<script language=\"Javascript\">";
                         echo "alert('Patient {$post_vars['patient_firstname']}, {$post_vars['patient_lastname']} was successfully added!')";
                         //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                         echo "</script>";
                     }
                 } else {
                     echo "<script language=\"Javascript\">";
                     echo "alert('Patient was not added due to similarity with existing records!')";
                     echo "</script>";
                     print "<font size='5' color='red'><b>Duplicate detected " . round($sim_index, 2) . "%.</b></font><br/>";
                 }
             } else {
                 echo "<script language=\"Javascript\">";
                 echo "alert('Patient was not added due to missing fields!')";
                 echo "</script>";
                 $this->display_inc($post_vars);
                 //return;
             }
             break;
         case "Update Patient":
             if ($post_vars["patient_lastname"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"] && $post_vars["patient_mother"]) {
                 $sql = "update m_patient set " . "patient_firstname = '" . ucwords($post_vars["patient_firstname"]) . "', " . "patient_middle = '" . ucwords($post_vars["patient_middle"]) . "', " . "patient_lastname = '" . ucwords($post_vars["patient_lastname"]) . "', " . "user_id = '" . $_SESSION["userid"] . "', " . "patient_gender = '" . $post_vars["patient_gender"] . "', " . "patient_mother = '" . $post_vars["patient_mother"] . "', " . "patient_cellphone = '" . $post_vars["patient_cellphone"] . "', " . "patient_dob = '{$dob}' " . "where patient_id = '" . $post_vars["patient_id"] . "'";
                 $result = mysql_query($sql) or die(mysql_error());
                 if ($result) {
                     echo "<script language=\"Javascript\">";
                     echo "alert('Record of patient {$post_vars['patient_firstname']} {$post_vars['patient_lastname']} was successfully been updated.')";
                     echo "</script>";
                     //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                 } else {
                     echo "<script language=\"Javascript\">";
                 }
                 //echo "alert('Record of patient $post_vars[patient_firstname] $post_vars[patient_lastname] was not updated.')";
                 echo "</script>";
             }
             break;
         case "Delete Patient":
             if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                 $sql = "delete from m_patient where patient_id = '" . $post_vars["patient_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             } else {
                 if ($post_vars["confirm_delete"] == "No") {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
             }
             break;
         case "Cancel":
             empty($post_vars["patient_firstname"]);
             unset($patient["patient_firstname"]);
             //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=657");
             break;
     }
 }
开发者ID:alisonperez,项目名称:chits,代码行数:85,代码来源:class.patient.php

示例9: unassign_brgy

 function unassign_brgy()
 {
     if (func_num_args() > 0) {
         $arr = func_get_args();
         $postvars = $arr[0];
         $getvars = $arr[1];
     }
     if ($getvars["action"] == 'delete') {
         $q_brgy = mysql_query("SELECT barangay_id,barangay_name FROM m_lib_barangay WHERE barangay_id='{$getvars['brgy_id']}'") or die("Cannot query: 176 " . mysql_error());
         $q_facility = mysql_query("SELECT facility_name FROM m_lib_health_facility WHERE facility_id='{$getvars['facility_id']}'") or die("Cannot query: 178 " . mysql_error());
         list($facility_name) = mysql_fetch_array($q_facility);
         if (mysql_num_rows($q_brgy) != 0) {
             list($brgy_id, $brgy_name) = mysql_fetch_array($q_brgy);
             //echo "You are about to unassign <b>".$brgy_name."</b> from <b>".$facility_name."</b><br>";
             if (module::confirm_delete($getvars["menu_id"], $postvars, $getvars)) {
                 $delete_brgy = mysql_query("DELETE FROM m_lib_health_facility_barangay WHERE barangay_id='{$getvars['brgy_id']}'") or die("Cannot query 188 " . mysql_error());
                 if ($delete_brgy) {
                     echo "<script language='Javascript'>";
                     echo "window.alert('The barangay {$brgy_name} was successfully been unassigned from the {$facility_name}!')";
                     echo "</script>";
                 }
             } else {
             }
         } else {
             echo "<script language='Javascript'>";
             echo "window.alert('Cannot delete. The barangay ID does not exists!')";
             echo "</script>";
         }
     }
 }
开发者ID:alisonperez,项目名称:chits,代码行数:30,代码来源:class.health_facility.php

示例10: process_notifiable_disease

 function process_notifiable_disease()
 {
     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);
     }
     if ($post_vars["submitdisease"]) {
         if ($post_vars["disease_id"] && $post_vars["disease_name"]) {
             switch ($post_vars["submitdisease"]) {
                 case "Delete ICD Codes":
                     if ($post_vars["deletecode"]) {
                         foreach ($post_vars["deletecode"] as $key => $value) {
                             $sql = "delete from m_lib_disease_icdcode " . "where disease_id = '" . $post_vars["disease_id"] . "' and " . "icd_code = '{$value}'";
                             $result = mysql_query($sql);
                         }
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                     }
                     break;
                 case "Search":
                     // dummy entry
                     // processing code is process_search()
                     break;
                 case "Add Disease":
                     $sql = "insert into m_lib_disease_notifiable (disease_id, disease_name) " . "values ('" . strtoupper($post_vars["disease_id"]) . "', '" . $post_vars["disease_name"] . "')";
                     if ($result = mysql_query($sql)) {
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                     }
                     break;
                 case "Update Disease":
                     $sql = "update m_lib_disease_notifiable set " . "disease_name = '" . $post_vars["disease_name"] . "' " . "where disease_id = '" . $post_vars["disease_id"] . "'";
                     if ($result = mysql_query($sql)) {
                         foreach ($post_vars["code"] as $key => $value) {
                             $sql_icd = "insert into m_lib_disease_icdcode (disease_id, icd_code) " . "values ('" . $post_vars["disease_id"] . "', '{$value}')";
                             $result_icd = mysql_query($sql_icd);
                         }
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                     }
                     break;
                 case "Delete Disease":
                     if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                         $sql = "delete from m_lib_disease_notifiable where disease_id = '" . $post_vars["disease_id"] . "'";
                         if ($result = mysql_query($sql)) {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                         }
                     } else {
                         if ($post_vars["confirm_delete"] == "No") {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                         }
                     }
                     break;
             }
         }
     }
 }
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:59,代码来源:class.notifiable.php

示例11: process_patient

	/**
	 * Process Patient
	 * 
	 * Process the operation being performed on the patient information
	 * @param string $menu_id
	 * @param array $past_vars
	 * @param array $get_vars
	 * @param boolean $validuser
	 * @param booleam $isadmin
	 */
	function process_patient() {
        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];
            //print_r($post_vars);
        }
        list($month,$day,$year) = explode("/", $post_vars["patient_dob"]);
        $dob = $year."-".str_pad($month, 2, "0", STR_PAD_LEFT)."-".str_pad($day, 2, "0", STR_PAD_LEFT);
        $post_vars["conv_dob"] = $dob;
        switch ($post_vars["submitpatient"]) {
        case "Add Patient":
            if ($post_vars["patient_lastname"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"] && $post_vars["patient_dob"] && $post_vars["patient_mother"]) {
                // check for duplicates
                $threshold = 93;
                $sim_index = $this->get_duplicates($post_vars, $threshold);
                if ($sim_index<$threshold) {
                    $sql = "insert into m_patient (patient_lastname, patient_firstname, patient_middle, patient_dob, patient_gender, registration_date, user_id, healthcenter_id, patient_mother) ".
                           "values ('".ucwords($post_vars["patient_lastname"])."', '".ucwords($post_vars["patient_firstname"])."', '".ucwords($post_vars["patient_middle"])."', ".
                           "'$dob', '".$post_vars["patient_gender"]."', sysdate(), '".$_SESSION["userid"]."', '".$_SESSION["datanode"]["code"]."', '".ucwords($post_vars["patient_mother"])."')";
                    if ($result = mysql_query($sql)) {
                        header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                    }
                } else {
                    print "<font size='5' color='red'><b>Duplicate detected ".round($sim_index,2)."%.</b></font><br/>";
                }
            } else {
                return;
            }
            break;
        case "Update Patient":
            if ($post_vars["patient_lastname"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"]) {
                $sql = "update m_patient set ".
                       "patient_firstname = '".ucwords($post_vars["patient_firstname"])."', ".
                       "patient_middle = '".ucwords($post_vars["patient_middle"])."', ".
                       "patient_lastname = '".ucwords($post_vars["patient_lastname"])."', ".
                       "user_id = '".$_SESSION["userid"]."', ".
                       "patient_dob = '$dob' ".
                       "where patient_id = '".$post_vars["patient_id"]."'";
                if ($result = mysql_query($sql)) {
                    header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                }
            }
            break;
        case "Delete Patient":
            if (module::confirm_delete($menu_id,$post_vars,$get_vars)) {
                $sql = "delete from m_patient where patient_id = '".$post_vars["patient_id"]."'";
                if ($result = mysql_query($sql)) {
                    header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                }
            } else {
                if ($post_vars["confirm_delete"]=="No") {
                    header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                }
            }
            break;
        }

	}
开发者ID:BackupTheBerlios,项目名称:chits-svn,代码行数:70,代码来源:class.patient.php

示例12: display_consult_icd10

 function display_consult_icd10()
 {
     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 ($get_vars["delete_icd10_code"]) {
         if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
             $sql = "delete from m_consult_icd10 " . "where consult_id = '" . $get_vars["consult_id"] . "' and " . "diagnosis_code = '" . $get_vars["delete_icd10_code"] . "'";
             if ($result = mysql_query($sql)) {
                 header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=icd10");
             }
         } 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=DETAILS&module=icd10");
             }
         }
     }
     $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]);
     $patient_name = patient::get_name($get_vars["patient_id"]);
     print "<table width='300'>";
     print "<tr valign='top'><td>";
     print "<b>" . FTITLE_CONSULT_ICD10 . "</b><br>";
     print "</td></tr>";
     $sql = "select h.consult_id, h.diagnosis_code, l.description " . "from m_lib_icd10_en l, m_consult_icd10 h " . "where l.diagnosis_code = h.diagnosis_code and h.consult_id = '" . $get_vars["consult_id"] . "' " . "order by h.diagnosis_code";
     if ($result = mysql_query($sql)) {
         if (mysql_num_rows($result)) {
             print "<tr valign='top'><td>";
             while (list($cid, $icd, $name) = mysql_fetch_array($result)) {
                 print "<img src='../images/arrow_redwhite.gif' border='0'/> ";
                 print "<b>{$icd}</b> {$name} ";
                 if ($_SESSION["priv_delete"]) {
                     print "<a href='" . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=icd10&&delete_icd10_code={$icd}'><img src='../images/delete.png' border='0' /></a> ";
                 }
                 print "<br/>";
             }
             print "</td></tr>";
         } else {
             print "<tr valign='top'><td><font color='red'>No records.</font></td></tr>";
         }
     }
     print "</table><br>";
 }
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:49,代码来源:class.icd10.php

示例13: process_ptgroup

 function process_ptgroup()
 {
     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);
     }
     if ($post_vars["submitptgroup"]) {
         if ($post_vars["group_id"] && $post_vars["group_name"]) {
             switch ($post_vars["submitptgroup"]) {
                 case "Add Group":
                     $sql = "insert into m_lib_ptgroup (ptgroup_id, ptgroup_name, ptgroup_module, ptgroup_condition) " . "values ('" . $post_vars["group_id"] . "', '" . $post_vars["group_name"] . "', '" . $post_vars["module"] . "', '" . $post_vars["group_condition"] . "')";
                     if ($result = mysql_query($sql)) {
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                     }
                     break;
                 case "Update Group":
                     $sql = "update m_lib_ptgroup set " . "ptgroup_name = '" . $post_vars["group_name"] . "', " . "ptgroup_module = '" . $post_vars["module"] . "', " . "ptgroup_condition = '" . $post_vars["group_condition"] . "' " . "where ptgroup_id = '" . $post_vars["group_id"] . "'";
                     if ($result = mysql_query($sql)) {
                         header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                     }
                     break;
                 case "Delete Group":
                     if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                         $sql = "delete from m_lib_ptgroup where ptgroup_id = '" . $post_vars["group_id"] . "'";
                         if ($result = mysql_query($sql)) {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}");
                         }
                     } else {
                         if ($post_vars["confirm_delete"] == "No") {
                             header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                         }
                     }
                     break;
             }
         }
     }
 }
开发者ID:alisonperez,项目名称:chits,代码行数:42,代码来源:class.ptgroup.php

示例14: process_patient

 function process_patient()
 {
     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];
         $patient = $arg_list[3];
         //print_r($post_vars);
     }
     list($month, $day, $year) = explode("/", $post_vars["patient_dob"]);
     $dob = $year . "-" . str_pad($month, 2, "0", STR_PAD_LEFT) . "-" . str_pad($day, 2, "0", STR_PAD_LEFT);
     $post_vars["conv_dob"] = $dob;
     $q_sms_enroll = mysql_query("SELECT menu_id FROM module_menu WHERE menu_id='1370'") or die("Cannot quer 535: " . mysql_error());
     if (mysql_num_rows($q_sms_enroll) != 0) {
         $arr_sms = $_POST['sms_prog'];
     }
     switch ($post_vars["submitpatient"]) {
         case "Add Patient":
             if ($post_vars["patient_lastname"] && $post_vars["patient_middle"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"] && $post_vars["patient_dob"] && $post_vars["patient_mother"] && $post_vars['patient_cellphone'] == $post_vars['confirm_cellphone']) {
                 // check for duplicates
                 $threshold = 93;
                 $sim_index = $this->get_duplicates($post_vars, $threshold);
                 if ($sim_index < $threshold) {
                     $get_last = mysql_query("SELECT patient_id FROM m_patient ORDER by patient_id DESC LIMIT 1") or die("Cannot query: 387" . mysql_error());
                     list($pxid) = mysql_fetch_array($get_last);
                     $next_id = $pxid + 1;
                     if (in_array('pwd', $post_vars['p_group'])) {
                         $pwd = 'Y';
                     }
                     if (in_array('ind', $post_vars['p_group'])) {
                         $ind = 'Y';
                     }
                     $sql = "insert into m_patient set patient_id='{$next_id}',patient_lastname='" . ucwords($post_vars[patient_lastname]) . "', patient_firstname='" . ucwords($post_vars[patient_firstname]) . "',patient_middle='" . ucwords($post_vars[patient_middle]) . "',patient_dob='{$dob}',patient_gender='{$post_vars['patient_gender']}',registration_date=sysdate(),user_id='{$_SESSION['userid']}',healthcenter_id='{$_SESSION['datanode']}[code]',patient_mother='" . ucwords($post_vars[patient_mother]) . "',patient_cellphone='{$post_vars['patient_cellphone']}',pwd_flag='{$pwd}',ind_flag='{$ind}' ";
                     //print_r($post_vars);
                     $result = mysql_query($sql) or die(mysql_error());
                     $pxid = mysql_insert_id();
                     if (isset($arr_sms) && !empty($post_vars['patient_cellphone'])) {
                         $this->sms_patient_enroll($pxid, $arr_sms);
                     } else {
                         echo "<script language=\"Javascript\">";
                         echo "alert('Patient {$post_vars['patient_firstname']} {$post_vars['patient_lastname']} was not enrolled for SMS alert.')";
                         //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                         echo "</script>";
                     }
                     if ($result) {
                         //echo "<script>";
                         echo "<script>alert('Patient {$post_vars['patient_firstname']} {$post_vars['patient_lastname']} was successfully added!')</script>";
                         echo "<script>window.location = '{$_SERVER['PHP_SELF']}?page=PATIENTS&menu_id=691'</script>";
                         //echo "}";
                         //echo "</script>";
                         //header("location: $_SERVER[PHP_SELF]?page=PATIENTS&menu_id=691");
                     }
                 } else {
                     echo "<script language=\"Javascript\">";
                     echo "alert('Patient was not added due to similarity with existing records!')";
                     echo "</script>";
                     print "<font size='5' color='red'><b>Duplicate detected " . round($sim_index, 2) . "%.</b></font><br/>";
                 }
             } else {
                 echo "<script language=\"Javascript\">";
                 echo "alert('Patient was not added due to missing fields!')";
                 echo "</script>";
                 $this->display_inc($post_vars);
                 //return;
             }
             break;
         case "Update Patient":
             if ($post_vars["patient_lastname"] && $post_vars["patient_middle"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"] && $post_vars["patient_mother"] && $post_vars['patient_cellphone'] == $post_vars['confirm_cellphone']) {
                 if (in_array('pwd', $post_vars['p_group'])) {
                     $pwd = 'Y';
                 }
                 if (in_array('ind', $post_vars['p_group'])) {
                     $ind = 'Y';
                 }
                 $sql = "update m_patient set " . "patient_firstname = '" . ucwords($post_vars["patient_firstname"]) . "', " . "patient_middle = '" . ucwords($post_vars["patient_middle"]) . "', " . "patient_lastname = '" . ucwords($post_vars["patient_lastname"]) . "', " . "user_id = '" . $_SESSION["userid"] . "', " . "patient_gender = '" . $post_vars["patient_gender"] . "', " . "patient_mother = '" . $post_vars["patient_mother"] . "', " . "patient_cellphone = '" . $post_vars["patient_cellphone"] . "', " . "patient_dob = '{$dob}', " . "pwd_flag='{$pwd}', " . "ind_flag='{$ind}' " . "where patient_id = '" . $post_vars["patient_id"] . "'";
                 $result = mysql_query($sql) or die(mysql_error());
                 if ($result) {
                     if (isset($arr_sms) && !empty($post_vars["patient_cellphone"])) {
                         $this->sms_patient_enroll($post_vars["patient_id"], $arr_sms, '');
                         //else:
                         //$this->sms_patient_enroll($post_vars["patient_id"],$arr_sms,'no');
                     }
                     echo "<script language=\"Javascript\">";
                     echo "alert('Record of patient {$post_vars['patient_firstname']} {$post_vars['patient_lastname']} was successfully been updated.')";
                     echo "</script>";
                     //header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
                 } else {
                     echo "<script language=\"Javascript\">";
                 }
                 //echo "alert('Record of patient $post_vars[patient_firstname] $post_vars[patient_lastname] was not updated.')";
                 echo "</script>";
             }
             break;
         case "Delete Patient":
             if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
                 $sql = "delete from m_patient where patient_id = '" . $post_vars["patient_id"] . "'";
                 if ($result = mysql_query($sql)) {
                     header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"]);
                 }
//.........这里部分代码省略.........
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:101,代码来源:class.patient.php

示例15: process_patient

 function process_patient() {
     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];
     }
     list($month,$day,$year) = explode("/", $post_vars["patient_dob"]);
     $dob = $year."-".str_pad($month, 2, "0", STR_PAD_LEFT)."-".str_pad($day, 2, "0", STR_PAD_LEFT);
     switch ($post_vars["submitpatient"]) {
     case "Remove Patient":
         if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
             $sql = "delete from m_family_members where patient_id = '".$get_vars["patient_id"]."' and family_id='".$get_vars["family_id"]."'";
             if ($result = mysql_query($sql)) {
                 header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
             }
         } else {
             if ($post_vars["confirm_delete"]=="No") {
                 header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
             }
         }
         break;
     case "Add Patient":
         if ($post_vars["patient_lastname"] && $post_vars["patient_firstname"] && $post_vars["patient_gender"]) {
             $sql = "insert into m_patient (patient_lastname, patient_firstname, patient_middle, patient_dob, patient_age, patient_gender) ".
                    "values ('".ucwords($post_vars["patient_lastname"])."', '".ucwords($post_vars["patient_firstname"])."', '".ucwords($post_vars["patient_middle"])."', ".
                    "'$dob', '".$post_vars["patient_age"]."', '".$post_vars["patient_gender"]."')";
             $result = mysql_query($sql);
         } else {
             return;
         }
         break;
     }
 }
开发者ID:angelogarcia,项目名称:chits,代码行数:34,代码来源:class.family.php


注:本文中的module::confirm_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。