本文整理汇总了PHP中module::pad_zero方法的典型用法代码示例。如果您正苦于以下问题:PHP module::pad_zero方法的具体用法?PHP module::pad_zero怎么用?PHP module::pad_zero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module
的用法示例。
在下文中一共展示了module::pad_zero方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _consult_lab_urinalysis_results
function _consult_lab_urinalysis_results()
{
$q_lab_urinalysis = mysql_query("SELECT date_format(date_lab_exam,'%m/%d/%Y') as 'date_lab_exam',physical_color,physical_reaction,physical_transparency,physical_gravity,physical_ph,chem_albumin,chem_sugar,chem_pregnancy,sediments_rbc,sediments_pus,sediments_epithelial,sediments_urates,sediments_calcium,sediments_fat,sediments_phosphate,sediments_uric,sediments_amorphous,sediments_carbonates,sediments_bacteria,sediments_mucus,cast_coarsely,cast_pus,cast_hyaline,cast_finely,cast_redcell,cast_waxy FROM m_consult_lab_urinalysis WHERE request_id='{$_GET['request_id']}' AND release_flag='Y'") or die("Cannot query 146" . mysql_error());
$q_lab_details = mysql_query("SELECT patient_id,date_format(request_timestamp,'%a %d %b %Y, %h %i %p') as 'date_requested', request_user_id, date_format(done_timestamp,'%a %d %b %Y, %h %i %p') as 'date_done', request_done, done_user_id FROM m_consult_lab WHERE request_id='{$_GET['request_id']}' AND request_done='Y'") or die("Cannot query 147:" . mysql_error());
list($date_lab_exam, $color, $reaction, $transparency, $gravity, $ph, $albumin, $sugar, $pregnancy, $rbc, $pus, $epithelial, $urates, $calcium, $fat, $phosphate, $uric, $amorphous, $carbonates, $bacteria, $mucus, $cast_coarsely, $cast_pus, $cast_hyaline, $cast_finely, $cast_redcell, $cast_waxy) = mysql_fetch_array($q_lab_urinalysis);
list($pxid, $date_request, $request_user_id, $date_done, $request_done, $done_user_id) = mysql_fetch_array($q_lab_details);
echo "<a name='urinalysis_result'></a>";
echo "<table style='border: 1px dotted black' width='400'><tr><td colspan='2'>";
echo "<span class='tinylight'>";
echo "<b>URINALYSIS RESULTS FOR " . strtoupper(patient::get_name($pxid)) . "</b><br/>";
echo "REQUEST ID: <font color='red'>" . module::pad_zero($_GET["request_id"], 7) . "</font><br/>";
echo "DATE REQUESTED: " . $date_request . "<br/>";
echo "REQUESTED BY: " . user::get_username($request_user_id) . "<br/>";
echo "DATE COMPLETED: " . $date_done . "<br/>";
echo "PROCESSED BY: " . ($done_user_id ? user::get_username($done_user_id) : "NA") . "<br/>";
echo "RELEASED: " . $request_done . "<br/>";
echo "<hr size='1'/>";
echo "<tr><td colspan='2' class='boxtitle'>URINALYSIS EXAM DATE: {$date_lab_exam}";
echo "</td></tr>";
echo "<tr><td class='boxtitle'>PHYSICAL APPEARANCE</td><td class='boxtitle'>QUANT. CHEMICAL TEST</td></tr>";
echo "<tr>";
echo "<td>";
echo "<table>";
echo "<tr><td class='boxtitle'>COLOR:</td><td class='tinylight'>{$color}</td></tr>";
echo "<tr><td class='boxtitle'>REACTION:</td><td class='tinylight'>{$reaction}</td></tr>";
echo "<tr><td class='boxtitle'>TRANSPARENCY:</td><td class='tinylight'>{$transparency}</td></tr>";
echo "<tr><td class='boxtitle'>SPECIFIC GRAVITY:</td><td class='tinylight'>{$gravity}</td></tr>";
echo "<tr><td class='boxtitle'>pH:</td><td class='tinylight'>{$ph}</td></tr>";
echo "</table>";
echo "</td>";
echo "<td valign='top'>";
echo "<table>";
echo "<tr><td class='boxtitle'>ALBUMIN:</td><td class='tinylight'>{$albumin}</td></tr>";
echo "<tr><td class='boxtitle'>SUGAR:</td><td class='tinylight'>{$sugar}</td></tr>";
echo "<tr><td class='boxtitle'>PREGNANCY TEST:</td><td class='tinylight'>{$pregnancy}</td></tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan='2' class='boxtitle'><hr size='1'>SEDIMENTS</td></tr>";
echo "<tr><td valign='top'>";
echo "<table>";
echo "<tr><td class='boxtitle'>RED BLOOD CELLS:</td><td class='tinylight'>{$rbc}</td></tr>";
echo "<tr><td class='boxtitle'>PUS CELLS:</td><td class='tinylight'>{$pus}</td></tr>";
echo "<tr><td class='boxtitle'>EPHITHELIAL CELLS:</td><td class='tinylight'>{$epithelial}</td></tr>";
echo "<tr><td class='boxtitle'>AMORPHOUS URATES:</td><td class='tinylight'>{$urates}</td></tr>";
echo "<tr><td class='boxtitle'>CALCIUM OXALATES:</td><td class='tinylight'>{$calcium}</td></tr>";
echo "<tr><td class='boxtitle'>FAT GLOBULES:</td><td class='tinylight'>{$fat}</td></tr>";
echo "</table>";
echo "</td>";
echo "<td class='boxtitle'>";
echo "<table>";
echo "<tr><td class='boxtitle'>TRIPLE PHOSPHATES:</td><td class='tinylight'>{$phosphate}</td></tr>";
echo "<tr><td class='boxtitle'>URIC ACID CRYSTALS:</td><td class='tinylight'>{$uric}</td></tr>";
echo "<tr><td class='boxtitle'>AMORPHOUS PHOSPATES:</td><td class='tinylight'>{$amorphous}</td></tr>";
echo "<tr><td class='boxtitle'>BACTERIA:</td><td class='tinylight'>{$bacteria}</td></tr>";
echo "<tr><td class='boxtitle'>MUCUS THREADS:</td><td class='tinylight'>{$mucus}</td></tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2' class='boxtitle'><hr size='1'>CASTS</td></tr>";
echo "<tr>";
echo "<td class='boxtitle'>";
echo "<table>";
echo "<tr><td class='boxtitle'>COARSELY GRANULAR CAST:</td><td class='tinylight'>{$cast_coarsely}</td></tr>";
echo "<tr><td class='boxtitle'>PUS CELLS CAST:</td><td class='tinylight'>{$cast_pus}</td></tr>";
echo "<tr><td class='boxtitle'>HYALINE CAST:</td><td class='tinylight'>{$cast_hyaline}</td></tr>";
echo "</table>";
echo "</td>";
echo "<td class='boxtitle'>";
echo "<table>";
echo "<tr><td class='boxtitle'>FINELY GRANULAR CAST:</td><td class='tinylight'>{$cast_finely}</td></tr>";
echo "<tr><td class='boxtitle'>RED CELL CAST:</td><td class='tinylight'>{$cast_redcell}</td></tr>";
echo "<tr><td class='boxtitle'>WAXY CAST:</td><td class='tinylight'>{$cast_waxy}</td></tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</span>";
echo "</table>";
}
示例2: display_service_record_details
function display_service_record_details() {
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);
}
$sql = "select mc_id, consult_id, user_id, patient_id, mc_timestamp, date_format(mc_timestamp, '%a %d %b %Y, %h:%i%p'), ".
"service_id, visit_type, actual_service_date, service_qty ".
"from m_consult_mc_services where ".
"mc_id = '".$get_vars["mc_id"]."' and service_id = '".$get_vars["service_id"]."' and ".
"mc_timestamp = '".$get_vars["sts"]."'";
$result = mysql_query($sql) or die(mysql_error());
if ($result) {
if (mysql_num_rows($result)) {
while(list($cdid, $cid, $uid, $pid, $cstamp, $sdate, $sid, $vtype, $actual_date, $qty) = mysql_fetch_array($result))
{
print "<a name='detail'>";
print "<table width='250' cellpadding='3' style='border:1px dashed black'><tr><td>";
print "<form name='form_service_detail' method='post' action='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=".$get_vars["ptmenu"]."&module=".$get_vars["module"]."&mc=".$get_vars["mc"]."&mc_id=".$get_vars["mc_id"]."&sts=".$get_vars["sts"]."&service_id=".$get_vars["service_id"].'#detail'."'>";
print "<span class='tinylight'>";
print "REGISTRY ID: <font color='red'>".module::pad_zero($cdid,7)."</font><br/>";
print "SERVICE: ".mc::get_service_name($sid)."<br/>";
print "VISIT TYPE: $vtype<br/>";
print "REPORT DATE: $sdate<br/>";
print "RECORDED BY: ".user::get_username($uid)."<br/>";
print "DATE SERVICE WAS GIVEN: ";
list($reported_date) = explode(' ',$cstamp);
$actual = ($actual_date=='0000-00-00')?$reported_date.' <font color=\'red\'>(no date given, report date instead)</font>':$actual_date;
$disp_date = ($actual_date=='0000-00-00')?$reported_date:$actual_date;
list($yr,$month,$date) = explode('-',$disp_date);
$disp = $month.'/'.$date.'/'.$yr;
echo $actual.'<br>';
print "SET DATE <input type='text' size='10' class='tinylight' name='actual_service_date' value='$disp' style='border: 1px solid #000000' readonly></input>";
print "<a href=\"javascript:show_calendar4('document.form_service_detail.actual_service_date', document.form_service_detail.actual_service_date.value);\"><img src='../images/cal.gif' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a><br><br>";
print "QUANTITY <input type='text' size='10' class='tinylight' name='service_qty' value='$qty' style='border: 1px solid #000000'></input><br><br>";
print "<input type='hidden' name='service' value='$sid'/>";
print "<input type='hidden' name='sts' value='$cstamp'/>";
print "<input type='hidden' name='mc_id' value='$cdid'/>";
if($_SESSION["priv_update"]):
print "<input type='submit' name='submitdetail' value='Update Service' class='tinylight' style='border: 1px solid black'/> ";
endif;
if ($_SESSION["priv_delete"]) {
print "<input type='submit' name='submitdetail' value='Delete Service' class='tinylight' style='border: 1px solid black'/> ";
}
print "</span>";
print "</form>";
print "</td></tr></table>";
}
}
}
}
示例3: patient_info
function patient_info() {
//print_r($_SESSION);
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["consult_id"]) {
$sql = "select p.patient_id, p.patient_lastname, p.patient_firstname, round((to_days(now())-to_days(p.patient_dob))/365 , 1) computed_age, p.patient_gender, p.patient_dob, c.see_doctor_flag ".
"from m_patient p, m_consult c ".
"where c.patient_id = p.patient_id and c.consult_id = '".$get_vars["consult_id"]."'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
$ptinfo = mysql_fetch_array($result);
}
}
}
print "<table width='600' cellpadding='2' cellspacing='0' style='border: 2px solid black'>";
print "<tr><td colspan='2' bgcolor='#FFFFCC'>";
print "<span class='library'>".strtoupper($ptinfo["patient_lastname"].", ".$ptinfo["patient_firstname"])."</span> <br/>";
print LBL_FAMILY_NUMBER." <b>".family::search_family($ptinfo["patient_id"])."</b> "."AGE: <b>".($ptinfo["computed_age"]<1?($ptinfo["computed_age"]*12)."M":$ptinfo["computed_age"]."Y")."/".$ptinfo["patient_gender"]."</b> BIRTHDATE: <b>".$ptinfo["patient_dob"]."</b><br/>";
print "</td></tr>";
print "<tr valign='top' bgcolor='#FFFF99'><td>";
print LBL_PATIENT_ID.": <b>".module::pad_zero($ptinfo["patient_id"],7)."</b><br/>";
print LBL_TOTAL_VISITS.": <b>".$this->get_totalvisits($ptinfo["patient_id"])."</b> ".LBL_LAST_VISIT." <b>".$this->get_lastvisit($ptinfo["patient_id"])."</b><br/>";
print "</td><td> ";
print "</td></tr>";
print "<tr><td colspan='2' bgcolor='#FFFF66'>";
print LBL_ELAPSED_TIME." <b>".$this->get_elapsedtime($get_vars["consult_id"])."</b> ";
print "</td></tr>";
print "</table>";
}
示例4: process_search
function process_search() {
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];
}
if ($post_vars["family_number"]) {
$sql = "select family_id from m_family where family_id = '".$post_vars["family_number"]."'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&family_id=".$post_vars["family_number"]);
} else {
header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]);
}
}
} else {
// cascade through selection
if ($post_vars["last"]) {
$index .= "lower(patient_lastname) like '%".strtolower($post_vars["last"])."%'";
}
// check with ternary operator and isset whether $index has been initialized
if ($post_vars["first"]) {
$index .= (isset($index)?" AND ":" ") ." lower(patient_firstname) like '%".strtolower($post_vars["first"])."%' ";
}
// query the database and append $index to WHERE
if (isset($index)) {
$sql = "SELECT patient_id, patient_firstname,patient_lastname, patient_gender, patient_dob, round((to_days(now())-to_days(patient_dob))/365 , 1) computed_age ".
"FROM m_patient WHERE $index ";
if ($result=mysql_query($sql)) {
if ($rows = mysql_num_rows($result)) {
print "<span class='module'>SEARCH RESULTS</span><br><br>";
print "<b>Found <font color='red'>$rows</font> record".($rows>1?"s":"").". ";
if ($get_vars["family_id"]) {
print "Please select a patient to add to the family above by clicking on the selected patient name. ";
} else {
print "You have not selected nor created a family to add patients to. ";
}
print "If you see the ".
"<img src='../images/family.gif' border='0'/> icon, click on it to view family members.</b><br><br>";
print "<table width='250' cellspacing='0' cellpadding='3'>";
print "<form method='post' action=''>";
while(list($id,$first,$last,$gender, $dob, $age)=mysql_fetch_array($result)) {
print "<tr bgcolor='#FFFF99'><td>";
$fid = $this->search_family($id);
if ($fid) {
print "<font color='red'>".module::pad_zero($id,7)."</font> $first $last ($age/$gender) ";
print ($fid?"<a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&family_id=$fid'><img src='../images/family.gif' border='0'/></a>":"");
} else {
if ($get_vars["family_id"]) {
print "<input type='checkbox' name='include_patient[]' value='$id'/> ";
//print "<img src='../images/arrow_redwhite.gif' border='0'/> ";
print "<font color='red'>".module::pad_zero($id,7)."</font> <a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id&add_id=$id&family_id=".$get_vars["family_id"]."'>$first $last ($age/$gender) </a> ";
} else {
print "<font color='red'>".module::pad_zero($id,7)."</font> $first $last ($age/$gender) ";
}
}
print "<input type='hidden' name='family_id' value='$family_id'/>";
print "</td></tr>" ;
}
print "<tr><td>";
print "<input type='submit' name='submitpatient' value='Add to Family' class='tinylight' style='border: 1px solid black' />";
print "</td></tr>";
print "</form>";
print "<tr><td><br>";
print "</td></tr>";
print "</table>";
} else {
print "<font color='red'>No records found.</font><br/>";
}
}
}
}
}
示例5: display_consult_notes_detail
function display_consult_notes_detail() {
if (func_num_args()) {
$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];
}
// do some processing here
if ($get_vars["delete_complaint_id"]) {
if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
$sql = "delete from m_consult_notes_complaint ".
"where notes_id = '".$get_vars["notes_id"]."' and ".
"consult_id = '".$get_vars["consult_id"]."' and ".
"complaint_id = '".$get_vars["delete_complaint_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"]."&ptmenu=DETAILS&module=notes¬es=".$get_vars["notes"]."¬es_id=".$get_vars["notes_id"]);
}
} 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=notes¬es=".$get_vars["notes"]."¬es_id=".$get_vars["notes_id"]);
}
}
}
if ($get_vars["delete_class_id"]) {
if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
$sql = "delete from m_consult_notes_dxclass ".
"where notes_id = '".$get_vars["notes_id"]."' and ".
"consult_id = '".$get_vars["consult_id"]."' and ".
"class_id = '".$get_vars["delete_class_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"]."&ptmenu=DETAILS&module=notes¬es=".$get_vars["notes"]."¬es_id=".$get_vars["notes_id"]);
}
} 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=notes¬es=".$get_vars["notes"]."¬es_id=".$get_vars["notes_id"]);
}
}
}
// continue with real task
$sql = "select notes_id, consult_id, notes_history, ".
"notes_physicalexam, notes_plan, user_id, date_format(notes_timestamp, '%a %d %b %Y, %h:%i%p') ts ".
"from m_consult_notes where consult_id = '".$get_vars["consult_id"]."' and ".
"notes_id = '".$get_vars["notes_id"]."'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
$notes = mysql_fetch_array($result);
print "<form method='post' action=''>";
print "<table width='300' cellpadding='2' style='border: 1px dashed black'><tr><td>";
print "<span class='tinylight'>";
print "<b>NOTES ID:</b> <font color='red'>".module::pad_zero($notes["notes_id"],7)."</font><br/>";
print "<b>DATE/TIME:</b> ".$notes["ts"]."<br/>";
print "<b>TAKEN BY:</b> ".user::get_username($notes["user_id"])."<br/>";
print "<hr size='1'/>";
print "<b>COMPLAINTS:</b><br/>";
notes::show_complaints($menu_id, $post_vars, $get_vars);
print "<hr size='1'/>";
print "<b>HISTORY:</b><br/>";
if (strlen($notes["notes_history"])>0) {
print stripslashes(nl2br($notes["notes_history"]))."<br/>";
if ($_SESSION["priv_update"]) {
print "<br/>";
print "<input type='submit' name='submitdetail' value='Update History' class='tinylight' style='border: 1px solid black'";
}
} else {
print "<font color='red'>No recorded history.</font><br/>";
}
print "<hr size='1'/>";
print "<b>PHYSICAL EXAM:</b><br/>";
if (strlen($notes["notes_physicalexam"])>0) {
print stripslashes(nl2br($notes["notes_physicalexam"]))."<br/>";
if ($_SESSION["priv_update"]) {
print "<br/>";
print "<input type='submit' name='submitdetail' value='Update PE' class='tinylight' style='border: 1px solid black'";
}
} else {
print "<font color='red'>No recorded PE.</font><br/>";
}
print "<hr size='1'/>";
print "<b>DIAGNOSIS:</b><br/>";
notes::show_diagnosis($menu_id, $post_vars, $get_vars);
print "<hr size='1'/>";
print "<b>PLAN:</b><br/>";
if (strlen($notes["notes_plan"])>0) {
print stripslashes(nl2br($notes["notes_plan"]))."<br/>";
if ($_SESSION["priv_update"]) {
print "<br/>";
print "<input type='submit' name='submitdetail' value='Update Plan' class='tinylight' style='border: 1px solid black'";
}
} else {
print "<font color='red'>No recorded plan.</font><br/>";
}
print "<hr size='1'/>";
print "<input type='hidden' name='notes_id' value='".$get_vars["notes_id"]."' />";
if ($_SESSION["priv_delete"]) {
print "<input type='submit' name='submitdetail' value='Delete Notes' class='tinylight' style='border: 1px solid black; background-color: #FF6633;'/> ";
}
print "</span>";
print "</td></tr></table><br>";
//.........这里部分代码省略.........
示例6: _consult_lab_sputum_results
function _consult_lab_sputum_results() {
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];
}
$sql = mysql_query("select l.request_id, l.request_user_id, l.request_done, ".
"date_format(l.request_timestamp, '%a %d %b %Y, %h:%i%p') request_timestamp, ".
"s.consult_id, s.patient_id, done_user_id, ".
"if(l.done_timestamp<>'00000000000000', date_format(l.done_timestamp, '%a %d %b %Y, %h:%i%p'), 'NA') done_timestamp, ".
"if(l.request_done='Y', (unix_timestamp(l.done_timestamp)-unix_timestamp(l.request_timestamp))/3600,(unix_timestamp(sysdate())-unix_timestamp(l.request_timestamp))/3600) elapsed, ".
"s.sp1_collection_date, s.sp2_collection_date, s.sp3_collection_date, ".
"s.sp1_appearance, s.sp2_appearance, s.sp3_appearance, ".
"s.sp1_reading, s.sp2_reading, s.sp3_reading, s.lab_diagnosis, ".
"s.user_id, s.request_id, s.release_flag, s.sputum_period,s.lab_diag1,s.lab_diag2,s.lab_diag3 ".
"from m_consult_lab_sputum s, m_consult_lab l ".
"where l.request_id = s.request_id and ".
"s.request_id = '".$get_vars["request_id"]."'") or die("Cannot query ".mysql_error());
if ($sql) {
if (mysql_num_rows($sql)) {
$sputum = mysql_fetch_array($sql);
$res1 = ((!empty($sputum["lab_diag1"])?(($sputum["lab_diag1"]=="P")?"Positive":(($sputum["lab_diag1"]=="N")?"Negative":"Doubtful")):"No diagnosis yet"));
$res2 = ((!empty($sputum["lab_diag2"])?(($sputum["lab_diag2"]=="P")?"Positive":(($sputum["lab_diag2"]=="N")?"Negative":"Doubtful")):"No diagnosis yet"));
$res3 = ((!empty($sputum["lab_diag3"])?(($sputum["lab_diag3"]=="P")?"Positive":(($sputum["lab_diag3"]=="N")?"Negative":"Doubtful")):"No diagnosis yet"));
print "<a name='sputum_result'>";
print "<table style='border: 1px dotted black'><tr><td>";
print "<span class='tinylight'>";
print "<b>SPUTUM RESULTS FOR ".strtoupper(patient::get_name($sputum["patient_id"]))."</b><br/>";
print "REQUEST ID: <font color='red'>".module::pad_zero($sputum["request_id"],7)."</font><br/>";
print "DATE REQUESTED: ".$sputum["request_timestamp"]."<br/>";
print "REQUESTED BY: ".user::get_username($sputum["request_user_id"])."<br/>";
print "DATE COMPLETED: ".$sputum["done_timestamp"]."<br/>";
print "PROCESSED BY: ".($sputum["done_user_id"]?user::get_username($sputum["done_user_id"]):"NA")."<br/>";
print "HOURS ELAPSED: ".$sputum["elapsed"]."<br/>";
print "RELEASED: ".$sputum["release_flag"]."<br/>";
print "<hr size='1'/>";
print "SPUTUM EXAM PERIOD:<br/> ";
print " ".sputum::get_sputum_period_name($sputum["sputum_period"])."<br/>";
print "<hr size='1'/>";
print "SPECIMEN COLLECTION DATES - DIAGNOSIS<br/>";
print "sp #1: ".$sputum["sp1_collection_date"]." - ".$res1."<br/>";
print "sp #2: ".$sputum["sp2_collection_date"]." - ".$res2."<br/>";
print "sp #3: ".$sputum["sp3_collection_date"]." - ".$res3."<br/>";
print "<hr size='1'/>";
print "SPECIMEN VISUAL APPEARANCE:<br/>";
print "sp #1: ".sputum::get_sputum_appearance_name($sputum["sp1_appearance"])."<br/>";
print "sp #2: ".sputum::get_sputum_appearance_name($sputum["sp2_appearance"])."<br/>";
print "sp #3: ".sputum::get_sputum_appearance_name($sputum["sp3_appearance"])."<br/>";
print "<hr size='1'/>";
print "SPECIMEN READING:<br/>";
print "sp #1: ".sputum::get_sputum_reading_name($sputum["sp1_reading"])."<br/>";
print "sp #2: ".sputum::get_sputum_reading_name($sputum["sp2_reading"])."<br/>";
print "sp #3: ".sputum::get_sputum_reading_name($sputum["sp3_reading"])."<br/>";
print "<hr size='1'/>";
print "FINAL LAB DIAGNOSIS: ".sputum::get_diagnosis_name($sputum["lab_diagnosis"])."<br/>";
print "</span>";
print "</td></tr></table>";
}
}
}
示例7: _consult_lab_hematology_results
function _consult_lab_hematology_results()
{
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];
}
$q_hema = mysql_query("SELECT date_format(date_lab_exam,'%m/%d/%Y') as 'date_lab_exam',hemoglobin,hematocrit,rbc,rbc_mcv,rbc_mchc,rbc_mch,wbc,wbc_polys,wbc_lympho,wbc_mxd,wbc_mono,wbc_eosin,wbc_baso,platelet,reticulocytes,esr,clotting_time,bleeding_time,malaria,slit_smear,fbs,blood_type,user_id,patient_id,others,rh,stabs FROM m_consult_lab_hematology WHERE request_id='{$_GET['request_id']}'") or die("Cannot query: 131" . mysql_error());
$q_lab = mysql_query("SELECT patient_id,date_format(request_timestamp,'%a %d %Y,%h %i %p') as 'date_requested',request_user_id,date_format(done_timestamp,'%a %d %b %Y, %h %i %p') as 'date_done',request_done,done_user_id FROM m_consult_lab WHERE request_id='{$_GET['request_id']}'") or die("Cannot query 132" . mysql_error());
if (mysql_num_rows($q_hema) != 0) {
list($date_lab_exam, $hemo, $hema, $rbc, $mcv, $mchc, $mch, $wbc, $polys, $lympho, $mxd, $mono, $eosin, $baso, $platelet, $reticulocytes, $esr, $clotting_time, $bleeding_time, $malaria, $slit_smear, $fbs, $blood_type, $user_id, $patient_id, $others, $rh, $stabs) = mysql_fetch_array($q_hema);
} else {
$date_lab_exam = date('m/d/Y');
}
list($pxid, $date_request, $request_user_id, $date_done, $request_done, $done_user_id) = mysql_fetch_array($q_lab);
echo "<a name='hematology_result'></a>";
echo "<table style='border: 1px dotted black' width='400'><tr><td colspan='4'>";
echo "<span class='tinylight'>";
echo "<b>HEMATOLOGY RESULTS FOR " . strtoupper(patient::get_name($pxid)) . "</b><br/>";
echo "REQUEST ID: <font color='red'>" . module::pad_zero($_GET["request_id"], 7) . "</font><br/>";
echo "DATE REQUESTED: " . $date_request . "<br/>";
echo "REQUESTED BY: " . user::get_username($request_user_id) . "<br/>";
echo "DATE COMPLETED: " . $date_done . "<br/>";
echo "PROCESSED BY: " . ($done_user_id ? user::get_username($done_user_id) : "NA") . "<br/>";
echo "RELEASED: " . $request_done . "<br/>";
echo "<hr size='1'></td></tr>";
echo "<tr><td colspan='4' class='boxtitle'>DATE EXAMINED {$date_lab_exam}";
echo "</td></tr>";
echo "<tr><td>TEST</td><td>RESULT</td><td>TEST</td><td>RESULT</td></tr>";
echo "<tr><td class='boxtitle'>HEMOGLOBIN</td><td class='tinylight'>{$hemo}</td><td class='boxtitle'>PLATELET</td><td class='tinylight'>{$platelet}</td></tr>";
echo "<tr><td class='boxtitle'>HEMATOCRIT</td><td class='tinylight'>{$hema}</td><td class='boxtitle'>RETICULOCYTES</td><td class='tinylight'>{$reticulocytes}</td></tr>";
echo "<tr><td class='boxtitle'>RBC</td><td class='tinylight'>{$rbc}</td><td class='boxtitle'>ESR</td><td class='tinylight'>{$esr}</td></tr>";
echo "<tr><td class='boxtitle'>MCV</td><td class='tinylight'>{$mcv}</td><td class='boxtitle'>CLOTING TIME</td><td class='tinylight'>{$clotting_time}</td></tr>";
echo "<tr><td class='boxtitle'>MCHC</td><td class='tinylight'>{$mchc}</td><td class='boxtitle'>BLEEDING TIME</td><td class='tinylight'>{$bleeding_time}</td></tr>";
echo "<tr><td class='boxtitle'>MCH</td><td class='tinylight'>{$mch}</td><td class='boxtitle'>MALARIA</td><td class='tinylight'>{$malaria}</td></tr>";
echo "<tr><td class='boxtitle'>WBC</td><td class='tinylight'>{$wbc}</td><td class='boxtitle'>SLIT SMEAR</td><td class='tinylight'>{$slit_smear}</td></tr>";
echo "<tr><td class='boxtitle'>POLYS</td><td class='tinylight'>{$polys}</td><td class='boxtitle'>FBS</td><td class='tinylight'>{$fbs}</td></tr>";
echo "<tr><td class='boxtitle'>LYMPHO</td><td class='tinylight'>{$lympho}</td><td class='boxtitle'>";
$blood_type = $blood_type == '0' ? '' : $blood_type;
echo "BLOOD TYPE";
echo "</td><td class='tinylight'>{$blood_type}";
echo "</td></tr>";
echo "<tr><td class='boxtitle'>RH</td><td class='tinylight'>{$rh}</td><td colspan='2'> </td></tr>";
echo "<tr><td class='boxtitle'>MXD</td><td class='tinylight'>{$mxd}</td><td colspan='2'> </td></tr>";
echo "<tr><td class='boxtitle'>MONO</td><td class='tinylight'>{$mono}</td><td colspan='2'> </td></tr>";
echo "<tr><td class='boxtitle'>EOSIN</td><td class='tinylight'>{$eosin}</td><td colspan='2'> </td></tr>";
echo "<tr><td class='boxtitle'>BASO</td><td class='tinylight'>{$baso}</td><td colspan='2'> </td></tr>";
echo "<tr><td class='boxtitle'>STABS</td><td class='tinylight'>{$stabs}</td><td colspan='2'> </td></tr>";
echo "</table>";
$_SESSION["lab_print"] = "HEMATOLOGY RESULTS FOR " . strtoupper(patient::get_name($pxid)) . "<br/>" . "DATE REQUESTED: " . $date_request . "<br/>" . "REQUESTED BY: " . user::get_username($request_user_id) . "<br/>" . "DATE COMPLETED: " . $date_done . "<br/>" . "PROCESSED BY: " . ($done_user_id ? user::get_username($done_user_id) : "NA") . "<br/>" . "<br/><br/>" . "HEMOGLOBIN: {$hemo}<br/>PLATELET: {$platelet}<br/>" . "HEMATOCRIT: {$hema}<br/>RETICULOCYTES: {$reticulocytes}<br/>" . "RBC: {$rbc}<br/>ESR: {$esr}<br/>" . "MCV: {$mcv}<br/>CLOTING TIME: {$clotting_time}<br/>" . "MCHC: {$mchc}<br/>BLEEDING TIME: {$bleeding_time}<br/>" . "MCH: {$mch}<br/>MALARIA: {$malaria}<br/>" . "WBC: {$wbc}<br/>SLIT SMEAR: {$slit_smear}<br/>" . "POLYS: {$polys}<br/>FBS: {$fbs}<br/>" . "LYMPHO: {$lympho}<br/>" . "BLOOD TYPE: {$blood_type}" . "<br/>" . "RH: {$rh}<br/>" . "MXD: {$mxd}<br/>" . "MONO: {$mono}<br/>" . "EOSIN: {$eosin}<br/>" . "BASO: {$baso}<br/>" . "STABS: {$stabs}";
}
示例8: display_consult_reminder_detail
function display_consult_reminder_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);
}
// do processing here
if ($post_vars["submitsms"] == "Delete SMS") {
if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
$sql = "delete from m_consult_reminder where reminder_id = '" . $post_vars["reminder_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"] . "&ptmenu=DETAILS&module=reminder&reminder=" . $get_vars["reminder"]);
}
} 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=reminder&reminder=" . $get_vars["reminder"]);
}
}
}
$sql = "select reminder_id, reminder_text, patient_id, consult_id, sent_flag, user_id, reminder_date " . "from m_consult_reminder where reminder_id = '" . $get_vars["reminder_id"] . "'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
$sms = mysql_fetch_array($result);
print "<form method='post' action=''>";
print "<table style='border: 1px dotted black'><tr><td>";
print "<span class='tinylight'>";
print "REMINDER NO: <font color='red'>" . module::pad_zero($sms["reminder_id"], 7) . "</font><br/>";
print "SENT: " . $sms["sent_flag"] . "<br/>";
print "REMINDER DATE: " . $sms["reminder_date"] . "<br/>";
print "CREATED BY: " . user::get_username($sms["user_id"]) . "<br/>";
print "<hr size='1'/>";
print "REMINDER TEXT:<br/>";
print $sms["reminder_text"] . "<br/>";
print "<br/>";
print "<input type='hidden' name='reminder_id' value='" . $sms["reminder_id"] . "' />";
if ($_SESSION["priv_delete"]) {
print "<input type='submit' name='submitsms' value='Delete SMS' class='tinylight' style='border: 1px solid black'/>";
}
print "</span>";
print "</td></tr></table>";
print "</form>";
}
}
}
示例9: display_patient_data
function display_patient_data()
{
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_id = healthcenter::get_patient_id($get_vars["consult_id"]);
$actual_weight = wtforage::get_body_weight($get_vars["consult_id"]);
$ccdev_id = ccdev::registry_record_exists($patient_id);
print "<span class='tinylight'>";
print LBL_CCDEV_ID . ": <font color='red'>" . ($ccdev_id ? module::pad_zero($ccdev_id, 7) : "none") . "</font><br/>";
print LBL_AGE_IN_WEEKS . ": " . ccdev::get_age_weeks($patient_id) . "<br/>";
print LBL_WEIGHT . ": {$actual_weight}<br/>";
list($min, $max, $class) = wtforage::_wtforage($get_vars["consult_id"]);
if ($class) {
print LBL_WT_FOR_AGE . ": <font color='red'>" . strtoupper($class) . "</font> (min: {$min}, max: {$max})<br/>";
} else {
print LBL_WT_FOR_AGE . ": <font color='red'>" . LBL_NO_WEIGHT_AVAILABLE . "</font><br/>";
}
print LBL_IMMUNIZATION_STATUS . ": ";
$vacc_status = ccdev::determine_vacc_status($patient_id);
if ($vacc_status == 'Incomplete') {
echo "<font color='red'><b>{$vacc_status}</b></font><br>";
} else {
echo "<b>{$vacc_status}</b><br>";
}
print "CHILD PROTECTECTED AT BIRTH" . ": ";
echo ccdev::get_cpab_status($ccdev_id, $patient_id) . "<br>";
print "LOW BIRTH WEIGHT" . ": ";
echo ccdev::check_low_birth_wt($ccdev_id, $patient_id) . '<br>';
print "</span>";
}
示例10: _consult_lab_fecalysis_results
function _consult_lab_fecalysis_results() {
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];
}
$sql = "select l.request_id, l.request_user_id, l.request_done, ".
"date_format(l.request_timestamp, '%a %d %b %Y, %h:%i%p') request_timestamp, ".
"f.consult_id, f.patient_id, done_user_id, ".
"if(l.done_timestamp<>'00000000000000', date_format(l.done_timestamp, '%a %d %b %Y, %h:%i%p'), 'NA') done_timestamp, ".
"if(l.request_done='Y', (unix_timestamp(l.done_timestamp)-unix_timestamp(l.request_timestamp))/3600,(unix_timestamp(sysdate())-unix_timestamp(l.request_timestamp))/3600) elapsed, ".
"f.fec_collection_date, ".
"f.fec_macro_findings, ".
"f.fec_micro_findings, ".
"f.user_id, f.request_id ".
"from m_consult_lab_fecalysis f, m_consult_lab l ".
"where l.request_id = f.request_id and ".
"f.request_id = '".$get_vars["request_id"]."'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
$fecalysis = mysql_fetch_array($result);
print "<a name='fecalysis'>";
print "<table style='border: 1px dotted black'><tr><td>";
print "<span class='tinylight'>";
print "<b>FECALYSIS RESULTS FOR ".strtoupper(patient::get_name($fecalysis["patient_id"]))."</b><br/>";
print "REQUEST ID: <font color='red'>".module::pad_zero($fecalysis["request_id"],7)."</font><br/>";
print "DATE REQUESTED: ".$fecalysis["request_timestamp"]."<br/>";
print "REQUESTED BY: ".user::get_username($fecalysis["request_user_id"])."<br/>";
print "DATE COMPLETED: ".$fecalysis["done_timestamp"]."<br/>";
print "PROCESSED BY: ".($fecalysis["done_user_id"]?user::get_username($fecalysis["done_user_id"]):"NA")."<br/>";
print "RELEASED: ".$fecalysis["release_flag"]."<br/>";
print "<hr size='1'/>";
print "SPECIMEN COLLECTION DATE:<br/>";
print $fecalysis["fec_collection_date"]."<br/>";
print "<hr size='1'/>";
print "MACROSCOPIC FINDINGS:<br/>";
print $fecalysis["fec_macro_findings"]."<br/>";
print "<hr size='1'/>";
print "MICROSCOPIC FINDINGS:<br/>";
print $fecalysis["fec_micro_findings"]."<br/>";
print "<hr size='1'/>";
print "</span>";
print "</td></tr></table>";
}
}
}
示例11: _consult_lab_fecalysis_results
function _consult_lab_fecalysis_results()
{
$q_fecalysis = mysql_query("SELECT date_format(date_lab_exam,'%m/%d/%Y') as 'date_lab_exam',fecal_color,fecal_consistency,fecal_occultblood,fecal_ova,fecal_wbc,fecal_rbc,fecal_bacteria,fecal_fat,fecal_starch,fecal_others,user_id,patient_id FROM m_consult_lab_fecalysis WHERE request_id='{$_GET['request_id']}' AND release_flag='Y'") or die("Cannot query 150" . mysql_error());
$q_lab_details = mysql_query("SELECT patient_id,date_format(request_timestamp,'%a %d %b %Y, %h %i %p') as 'date_requested', request_user_id, date_format(done_timestamp,'%a %d %b %Y, %h %i %p') as 'date_done', request_done, done_user_id FROM m_consult_lab WHERE request_id='{$_GET['request_id']}' AND request_done='Y'") or die("Cannot query 151:" . mysql_error());
list($pxid, $date_request, $request_user_id, $date_done, $request_done, $done_user_id) = mysql_fetch_array($q_lab_details);
list($date_lab_exam, $color, $consistency, $blood, $ova, $wbc, $rbc, $bacteria, $fat, $starch, $others, $userid, $pxid) = mysql_fetch_row($q_fecalysis);
echo "<a name='fecalysis_result'></a>";
echo "<table style='border: 1px dotted black'><tr><td>";
print "<span class='tinylight'>";
print "<b>FECALYSIS RESULTS FOR " . strtoupper(patient::get_name($pxid)) . "</b><br/>";
print "REQUEST ID: <font color='red'>" . module::pad_zero($_GET["request_id"], 7) . "</font><br/>";
print "DATE REQUESTED: " . $date_request . "<br/>";
print "REQUESTED BY: " . user::get_username($request_user_id) . "<br/>";
print "DATE COMPLETED: " . $date_done . "<br/>";
print "PROCESSED BY: " . ($done_user_id ? user::get_username($done_user_id) : "NA") . "<br/>";
print "RELEASED: " . $request_done . "<br/>";
print "<hr size='1'/>";
print "<b>FECALYSIS EXAM DATE: </b>" . $date_lab_exam . "<br/> ";
print "<b>MACROSCOPIC</b><br/><b>PHYSICAL</b><br/>";
print "<b>COLOR: </b>" . $color . "<br/>";
print "<b>CONSISTENCY: </b>" . $consistency . "<br/>";
print "<b>CHEMICAL</b><br/>";
print "<b>OCCULT BLOOD: </b>" . $blood . "<br/>";
print "<hr size='1'/>";
print "<b>MICROSCOPIC </b><br/>";
print "<b>OVA OR PARASITE: </b>" . $ova . "<br/>";
print "<b>WBC: </b>" . $wbc . "<br/>";
print "<b>RBC: </b>" . $rbc . "<br/>";
print "<b>BACTERIA: </b>" . $bacteria . "<br/>";
print "<b>FAT GLOBULES: </b>" . $fat . "<br/>";
print "<b>STARCH GRANULES: </b>" . $starch . "<br/>";
print "<b>OTHERS: </b>" . $others . "<br/>";
print "</span>";
echo "</td></tr></table>";
}
示例12: display_service_record_details
function display_service_record_details() {
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);
}
$sql = "select mc_id, consult_id, user_id, patient_id, mc_timestamp, date_format(mc_timestamp, '%a %d %b %Y, %h:%i%p'), ".
"service_id, visit_type ".
"from m_consult_mc_services where ".
"mc_id = '".$get_vars["mc_id"]."' and service_id = '".$get_vars["service_id"]."' and ".
"mc_timestamp = '".$get_vars["sts"]."'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
list($cdid, $cid, $uid, $pid, $cstamp, $sdate, $sid, $vtype) = mysql_fetch_array($result);
print "<a name='detail'>";
print "<table width='250' cellpadding='3' style='border:1px dashed black'><tr><td>";
print "<form name='form_service_detail' method='post' action='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=".$get_vars["ptmenu"]."&module=".$get_vars["module"]."&mc=".$get_vars["mc"]."'>";
print "<span class='tinylight'>";
print "REGISTRY ID: <font color='red'>".module::pad_zero($cdid,7)."</font><br/>";
print "SERVICE: ".mc::get_service_name($sid)."<br/>";
print "VISIT TYPE: $vtype<br/>";
print "REPORT DATE: $sdate<br/>";
print "RECORDED BY: ".user::get_username($uid)."<br/>";
print "<input type='hidden' name='service' value='$sid'/>";
print "<input type='hidden' name='sts' value='$cstamp'/>";
print "<input type='hidden' name='mc_id' value='$cdid'/>";
if ($_SESSION["priv_delete"]) {
print "<input type='submit' name='submitdetail' value='Delete Service' class='tinylight' style='border: 1px solid black'/> ";
}
print "</span>";
print "</form>";
print "</td></tr></table>";
}
}
}
示例13: display_patient_data
function display_patient_data() {
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_id = healthcenter::get_patient_id($get_vars["consult_id"]);
$actual_weight = wtforage::get_body_weight($get_vars["consult_id"]);
$ccdev_id = ccdev::registry_record_exists($patient_id);
print "<span class='tinylight'>";
print LBL_CCDEV_ID.": <font color='red'>".($ccdev_id?module::pad_zero($ccdev_id,7):"none")."</font><br/>";
print LBL_AGE_IN_WEEKS.": ".ccdev::get_age_weeks($patient_id)."<br/>";
print LBL_WEIGHT.": $actual_weight<br/>";
list($min, $max, $class) = wtforage::_wtforage($get_vars["consult_id"]);
if ($class) {
print LBL_WT_FOR_AGE.": <font color='red'>".strtoupper($class)."</font> (min: $min, max: $max)<br/>";
} else {
print LBL_WT_FOR_AGE.": <font color='red'>".LBL_NO_WEIGHT_AVAILABLE."</font><br/>";
}
print LBL_IMMUNIZATION_STATUS.": ".ccdev::get_immunization_status($patient_id)."<br/>";
print "</span>";
}
示例14: process_backup
function process_backup() {
//
// assumes mysqldump is present in path
// test this first before implementing
//
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 (file_exists("/usr/bin/mysqldump")) {
// backtick operator
$user = $_SESSION["dbuser"];
$pass = $_SESSION["dbpass"];
$dbname = $_SESSION["dbname"];
$filename = "$dbname-".module::pad_zero($_SESSION["userid"],3)."-".date("Ymd-His").".sql";
// -t for no create table
// -n for no create db
// --single-transaction get consistent state for InnoDB tables
// --quick do not buffer query
// --extended-insert
`/usr/bin/mysqldump -u $user -p$pass -t -n --quick --extended-insert --single-transaction $dbname > ../dump/$filename`;
}
}
示例15: display_ntp_lab_requests
function display_ntp_lab_requests()
{
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);
}
// manage delete here
print "<a name='lab_requests'>";
if ($get_vars["delete_request_id"]) {
if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
$sql = "delete from m_consult_ntp_labs_request where request_id = '" . $get_vars["delete_request_id"] . "'";
if ($result = mysql_query($sql)) {
$sql_lab = "delete from m_consult_lab where request_id = '" . $get_vars["delete_request_id"] . "'";
$result_lab = mysql_query($sql_lab);
header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=ntp&ntp=" . $get_vars["ntp"] . "&ntp_id=" . $get_vars["ntp_id"]);
}
} 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=ntp&ntp=" . $get_vars["ntp"] . "&ntp_id=" . $get_vars["ntp_id"]);
}
}
}
$sql = "select n.ntp_id, n.request_id, n.request_timestamp, l.lab_name, l.lab_module " . "from m_consult_ntp_labs_request n, m_consult_lab c, m_lib_laboratory l " . "where n.request_id = c.request_id and c.lab_id = l.lab_id " . "and n.ntp_id = '" . $get_vars["ntp_id"] . "'";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) {
while (list($nid, $rid, $nts, $name, $mod) = mysql_fetch_array($result)) {
print "<img src='../images/arrow_redwhite.gif'/> ";
print "<font color='red'>" . module::pad_zero($rid, 7) . "</font>: <a href='" . $_SERVER["PHPS-SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=LABS&module={$mod}&request_id={$rid}#{$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&module=ntp&ntp=" . $get_vars["ntp"] . "&ntp_id=" . $get_vars["ntp_id"] . "&delete_request_id={$rid}#lab_requests'><img src='../images/delete.png' border='0' /></a>";
print "<br/>";
}
} else {
print "<font color='red'>No recorded requests.</font><br/>";
}
}
}