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


PHP sqlFetchArray函数代码示例

本文整理汇总了PHP中sqlFetchArray函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlFetchArray函数的具体用法?PHP sqlFetchArray怎么用?PHP sqlFetchArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: newpatient_report

function newpatient_report($pid, $encounter, $cols, $id)
{
    $res = sqlStatement("select * from form_encounter where pid='{$pid}' and id='{$id}'");
    print "<table><tr><td>\n";
    while ($result = sqlFetchArray($res)) {
        print "<span class=bold>" . xl('Reason') . ": </span><span class=text>" . $result["reason"] . "<br>\n";
        print "<span class=bold>" . xl('Facility') . ": </span><span class=text>" . $result["facility"] . "<br>\n";
    }
    print "</td></tr></table>\n";
}
开发者ID:robonology,项目名称:openemr,代码行数:10,代码来源:report.php

示例2: load_menu

function load_menu($menu_set)
{
    $menuTables = " SHOW TABLES LIKE ?";
    $res = sqlQuery($menuTables, array("menu_trees"));
    if ($res === false) {
        return array();
    }
    $menuQuery = " SELECT * FROM menu_trees, menu_entries WHERE menu_trees.entry_id=menu_entries.id AND menu_set=? ORDER BY parent, seq";
    $res = sqlStatement($menuQuery, array($menu_set));
    $retval = array();
    $entries = array();
    $parent_not_found = array();
    while ($row = sqlFetchArray($res)) {
        $entries[$row['entry_id']] = menu_entry_to_object($row);
        if (empty($row['parent'])) {
            array_push($retval, $entries[$row['entry_id']]);
        } else {
            if (isset($entries[$row['parent']])) {
                $parent = $entries[$row['parent']];
                array_push($parent->children, $entries[$row['entry_id']]);
            } else {
                array_push($parent_not_found, $entries[$row['entry_id']]);
            }
        }
    }
    foreach ($parent_not_found as $row) {
        if (isset($entries[$row->parent])) {
            $parent = $entries[$row->parent];
            array_push($parent->children, $row);
        } else {
            array_push($parent_not_found2, $row);
        }
    }
    return json_decode(json_encode($retval));
}
开发者ID:juggernautsei,项目名称:openemr,代码行数:35,代码来源:menu_db.php

示例3: generate_validate_constraints

 public static function generate_validate_constraints($form_id)
 {
     $fres = sqlStatement("SELECT layout_options.*,list_options.notes as validation_json \n              FROM layout_options  \n              LEFT JOIN list_options ON layout_options.validation=list_options.option_id AND list_options.list_id = 'LBF_Validations'\n              WHERE layout_options.form_id = ? AND layout_options.uor > 0 AND layout_options.field_id != '' \n              ORDER BY layout_options.group_name, layout_options.seq ", array($form_id));
     $constraints = array();
     $validation_arr = array();
     $required = array();
     while ($frow = sqlFetchArray($fres)) {
         $id = 'form_' . $frow['field_id'];
         $validation_arr = array();
         $required = array();
         //Keep "required" option from the LBF form
         if ($frow['uor'] == 2) {
             $required = array(self::VJS_KEY_REQUIRED => true);
         }
         if ($frow['validation_json']) {
             if (json_decode($frow['validation_json'])) {
                 $validation_arr = json_decode($frow['validation_json'], true);
             } else {
                 trigger_error($frow['validation_json'] . " is not a valid json ", E_USER_WARNING);
             }
         }
         if (!empty($required) || !empty($validation_arr)) {
             $constraints[$id] = array_merge($required, $validation_arr);
         }
     }
     return json_encode($constraints);
 }
开发者ID:mi-squared,项目名称:openemr,代码行数:27,代码来源:LBF_Validation.php

示例4: catch_logs

function catch_logs()
{
    $sql = sqlStatement("select * from log where id not in(select log_id from log_validator) and checksum is NOT null and checksum != ''");
    while ($row = sqlFetchArray($sql)) {
        sqlInsert("INSERT into log_validator (log_id,log_checksum) VALUES(?,?)", array($row['id'], $row['checksum']));
    }
}
开发者ID:bradymiller,项目名称:openemr,代码行数:7,代码来源:log_validation.php

示例5: fetchEvents

function fetchEvents($from_date, $to_date, $where_param = null, $orderby_param = null)
{
    $where = "( (e.pc_endDate >= '{$from_date}' AND e.pc_eventDate <= '{$to_date}' AND e.pc_recurrtype = '1') OR " . "(e.pc_eventDate >= '{$from_date}' AND e.pc_eventDate <= '{$to_date}') )";
    if ($where_param) {
        $where .= $where_param;
    }
    $order_by = "e.pc_eventDate, e.pc_startTime";
    if ($orderby_param) {
        $order_by = $orderby_param;
    }
    $query = "SELECT " . "e.pc_eventDate, e.pc_endDate, e.pc_startTime, e.pc_endTime, e.pc_duration, e.pc_recurrtype, e.pc_recurrspec, e.pc_recurrfreq, e.pc_catid, e.pc_eid, " . "e.pc_title, e.pc_hometext, e.pc_apptstatus, " . "p.fname, p.mname, p.lname, p.pid, p.pubpid, p.phone_home, p.phone_cell, " . "u.fname AS ufname, u.mname AS umname, u.lname AS ulname, u.id AS uprovider_id, " . "c.pc_catname, c.pc_catid " . "FROM openemr_postcalendar_events AS e " . "LEFT OUTER JOIN patient_data AS p ON p.pid = e.pc_pid " . "LEFT OUTER JOIN users AS u ON u.id = e.pc_aid " . "LEFT OUTER JOIN openemr_postcalendar_categories AS c ON c.pc_catid = e.pc_catid " . "WHERE {$where} " . "ORDER BY {$order_by}";
    $res = sqlStatement($query);
    $events = array();
    if ($res) {
        while ($row = sqlFetchArray($res)) {
            // if it's a repeating appointment, fetch all occurances in date range
            if ($row['pc_recurrtype']) {
                $reccuringEvents = getRecurringEvents($row, $from_date, $to_date);
                $events = array_merge($events, $reccuringEvents);
            } else {
                $events[] = $row;
            }
        }
    }
    return $events;
}
开发者ID:jatin-52,项目名称:erm,代码行数:26,代码来源:appointments.inc.php

示例6: doPatientCheck

 public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
 {
     $return = false;
     $listOptions = Codes::lookup($this->getOptionId(), 'CVX');
     if (count($listOptions) > 0) {
         $sqlQueryBind = array();
         $query = "SELECT * " . "FROM immunizations " . "WHERE patient_id = ? AND added_erroneously = '0' " . "AND administered_date >= ? " . "AND administered_date <= ? ";
         $query .= "AND ( ";
         $count = 0;
         array_push($sqlQueryBind, $patient->id, $beginDate, $endDate);
         foreach ($listOptions as $option_id) {
             $query .= "cvx_code = ? ";
             $count++;
             if ($count < count($listOptions)) {
                 $query .= "OR ";
             }
             array_push($sqlQueryBind, $option_id);
         }
         $query .= " ) ";
         $result = sqlStatement($query, $sqlQueryBind);
         $rows = array();
         for ($iter = 0; $row = sqlFetchArray($result); $iter++) {
             $rows[$iter] = $row;
         }
         if (isset($options[self::OPTION_COUNT]) && count($rows) >= $options[self::OPTION_COUNT]) {
             $return = true;
         } else {
             if (!isset($options[self::OPTION_COUNT]) && count($rows) > 0) {
                 $return = true;
             }
         }
     }
     return $return;
 }
开发者ID:mi-squared,项目名称:openemr,代码行数:34,代码来源:Medication.php

示例7: getListOptionById

 private function getListOptionById($id)
 {
     $query = "SELECT * " . "FROM `list_options` " . "WHERE list_id = ? " . "AND option_id = ?";
     $results = sqlStatement($query, array($this->getListId(), $id));
     $arr = sqlFetchArray($results);
     return $arr;
 }
开发者ID:mindfeederllc,项目名称:openemr,代码行数:7,代码来源:ClinicalType.php

示例8: review_of_systems_report

function review_of_systems_report($pid, $encounter, $cols, $id)
{
    $count = 0;
    $data = formFetch("form_review_of_systems", $id);
    $sql = "SELECT name from form_review_of_systems_checks where foreign_id = '" . add_escape_custom($id) . "'";
    $results = sqlQ($sql);
    $data2 = array();
    while ($row = sqlFetchArray($results)) {
        $data2[] = $row['name'];
    }
    $data = array_merge($data, $data2);
    if ($data) {
        print "<table><tr>";
        foreach ($data as $key => $value) {
            if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") {
                continue;
            }
            if ($value == "on") {
                $value = "yes";
            }
            $key = ucwords(str_replace("_", " ", $key));
            if (is_numeric($key)) {
                $key = "check";
            }
            print "<td><span class=bold>{$key}: </span><span class=text>{$value}</span></td>";
            $count++;
            if ($count == $cols) {
                $count = 0;
                print "</tr><tr>\n";
            }
        }
    }
}
开发者ID:aaricpittman,项目名称:openemr,代码行数:33,代码来源:report.php

示例9: slInvoiceNumber

function slInvoiceNumber(&$out)
{
    $invnumber = $out['our_claim_id'];
    $atmp = preg_split('/[ -]/', $invnumber);
    $acount = count($atmp);
    $pid = 0;
    $encounter = 0;
    if ($acount == 2) {
        $pid = $atmp[0];
        $encounter = $atmp[1];
    } else {
        if ($acount == 3) {
            $pid = $atmp[0];
            $brow = sqlQuery("SELECT encounter FROM billing WHERE " . "pid = '{$pid}' AND encounter = '" . $atmp[1] . "' AND activity = 1");
            $encounter = $brow['encounter'];
        } else {
            if ($acount == 1) {
                $pres = sqlStatement("SELECT pid FROM patient_data WHERE " . "lname LIKE '" . addslashes($out['patient_lname']) . "' AND " . "fname LIKE '" . addslashes($out['patient_fname']) . "' " . "ORDER BY pid DESC");
                while ($prow = sqlFetchArray($pres)) {
                    if (strpos($invnumber, $prow['pid']) === 0) {
                        $pid = $prow['pid'];
                        $encounter = substr($invnumber, strlen($pid));
                        break;
                    }
                }
            }
        }
    }
    if ($pid && $encounter) {
        $invnumber = "{$pid}.{$encounter}";
    }
    return array($pid, $encounter, $invnumber);
}
开发者ID:hompothgyorgy,项目名称:openemr,代码行数:33,代码来源:sl_eob.inc.php

示例10: lbf_report

function lbf_report($pid, $encounter, $cols, $id, $formname)
{
    require_once $GLOBALS["srcdir"] . "/options.inc.php";
    $arr = array();
    $shrow = getHistoryData($pid);
    $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = ? AND uor > 0 " . "ORDER BY group_name, seq", array($formname));
    while ($frow = sqlFetchArray($fres)) {
        $field_id = $frow['field_id'];
        $currvalue = '';
        if ($frow['edit_options'] == 'H') {
            if (isset($shrow[$field_id])) {
                $currvalue = $shrow[$field_id];
            }
        } else {
            $currvalue = lbf_current_value($frow, $id, $encounter);
            if ($currvalue === FALSE) {
                continue;
            }
            // should not happen
        }
        // For brevity, skip fields without a value.
        if ($currvalue === '') {
            continue;
        }
        // $arr[$field_id] = $currvalue;
        // A previous change did this instead of the above, not sure if desirable? -- Rod
        $arr[$field_id] = wordwrap($currvalue, 30, "\n", true);
    }
    echo "<table>\n";
    display_layout_rows($formname, $arr);
    echo "</table>\n";
}
开发者ID:gidsil,项目名称:openemr,代码行数:32,代码来源:report.php

示例11: checkCreateCDB

function checkCreateCDB()
{
    $globalsres = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name IN \n  ('couchdb_host','couchdb_user','couchdb_pass','couchdb_port','couchdb_dbase','document_storage_method')");
    $options = array();
    while ($globalsrow = sqlFetchArray($globalsres)) {
        $GLOBALS[$globalsrow['gl_name']] = $globalsrow['gl_value'];
    }
    $directory_created = false;
    if ($GLOBALS['document_storage_method'] != 0) {
        // /documents/temp/ folder is required for CouchDB
        if (!is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/')) {
            $directory_created = mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/', 0777, true);
            if (!$directory_created) {
                echo htmlspecialchars(xl("Failed to create temporary folder. CouchDB will not work."), ENT_NOQUOTES);
            }
        }
        $couch = new CouchDB();
        if (!$couch->check_connection()) {
            echo "<script type='text/javascript'>alert('" . addslashes(xl("CouchDB Connection Failed.")) . "');</script>";
            return;
        }
        if ($GLOBALS['couchdb_host'] || $GLOBALS['couchdb_port'] || $GLOBALS['couchdb_dbase']) {
            $couch->createDB($GLOBALS['couchdb_dbase']);
            $couch->createView($GLOBALS['couchdb_dbase']);
        }
    }
    return true;
}
开发者ID:nickolasnikolic,项目名称:openemr,代码行数:28,代码来源:edit_globals.php

示例12: showExamLine

function showExamLine($line_id, $description, &$linedbrow, $sysnamedisp)
{
    $dres = sqlStatement("SELECT * FROM form_physical_exam_diagnoses " . "WHERE line_id = '{$line_id}' ORDER BY ordering, diagnosis");
    echo " <tr>\n";
    echo "  <td align='center'><input type='checkbox' name='form_obs[{$line_id}][wnl]' " . "value='1'" . ($linedbrow['wnl'] ? " checked" : "") . " /></td>\n";
    echo "  <td align='center'><input type='checkbox' name='form_obs[{$line_id}][abn]' " . "value='1'" . ($linedbrow['abn'] ? " checked" : "") . " /></td>\n";
    echo "  <td nowrap>{$sysnamedisp}</td>\n";
    echo "  <td nowrap>{$description}</td>\n";
    echo "  <td><select name='form_obs[{$line_id}][diagnosis]' onchange='seldiag(this, \"{$line_id}\")' style='width:100%'>\n";
    echo "   <option value=''></option>\n";
    $diagnosis = $linedbrow['diagnosis'];
    while ($drow = sqlFetchArray($dres)) {
        $sel = '';
        $diag = $drow['diagnosis'];
        if ($diagnosis && $diag == $diagnosis) {
            $sel = 'selected';
            $diagnosis = '';
        }
        echo "   <option value='{$diag}' {$sel}>{$diag}</option>\n";
    }
    // If the diagnosis was not in the standard list then it must have been
    // there before and then removed.  In that case show it in parentheses.
    if ($diagnosis) {
        echo "   <option value='{$diagnosis}' selected>({$diagnosis})</option>\n";
    }
    echo "   <option value='*'>-- Edit --</option>\n";
    echo "   </select></td>\n";
    echo "  <td><input type='text' name='form_obs[{$line_id}][comments]' " . "size='20' maxlength='250' style='width:100%' " . "value='" . htmlentities($linedbrow['comments']) . "' /></td>\n";
    echo " </tr>\n";
}
开发者ID:katopenzz,项目名称:openemr,代码行数:30,代码来源:new.php

示例13: fetchEvents

function fetchEvents( $from_date, $to_date, $where_param = null, $orderby_param = null, $tracker_board = false ) 
{
   
   $where =
        "( (e.pc_endDate >= '$from_date' AND e.pc_eventDate <= '$to_date' AND e.pc_recurrtype = '1') OR " .
  	    "(e.pc_eventDate >= '$from_date' AND e.pc_eventDate <= '$to_date') )";

    if ( $where_param ) $where .= $where_param;
	
    $order_by = "e.pc_eventDate, e.pc_startTime";
    if ( $orderby_param ) {
       $order_by = $orderby_param;
    }

    // Tracker Board specific stuff
    $tracker_fields = '';
    $tracker_joins = '';     
    if ($tracker_board) {     
    $tracker_fields = "e.pc_room, e.pc_pid, t.id, t.date, t.apptdate, t.appttime, t.eid, t.pid, t.original_user, t.encounter, t.lastseq, t.random_drug_test, t.drug_screen_completed, " .
    "q.pt_tracker_id, q.start_datetime, q.room, q.status, q.seq, q.user, " .
    "s.toggle_setting_1, s.toggle_setting_2, s.option_id, " ;
    $tracker_joins = "LEFT OUTER JOIN patient_tracker AS t ON t.pid = e.pc_pid AND t.apptdate = e.pc_eventDate AND t.appttime = e.pc_starttime AND t.eid = e.pc_eid " .
  	"LEFT OUTER JOIN patient_tracker_element AS q ON q.pt_tracker_id = t.id AND q.seq = t.lastseq " .
    "LEFT OUTER JOIN list_options AS s ON s.list_id = 'apptstat' AND s.option_id = q.status " ;
}

	$query = "SELECT " .
  	"e.pc_eventDate, e.pc_endDate, e.pc_startTime, e.pc_endTime, e.pc_duration, e.pc_recurrtype, e.pc_recurrspec, e.pc_recurrfreq, e.pc_catid, e.pc_eid, " .
  	"e.pc_title, e.pc_hometext, e.pc_apptstatus, " .
  	"p.fname, p.mname, p.lname, p.pid, p.pubpid, p.phone_home, p.phone_cell, " .
  	"u.fname AS ufname, u.mname AS umname, u.lname AS ulname, u.id AS uprovider_id, " .
  	"$tracker_fields" .
    "c.pc_catname, c.pc_catid " .
  	"FROM openemr_postcalendar_events AS e " .
    "$tracker_joins" .
  	"LEFT OUTER JOIN patient_data AS p ON p.pid = e.pc_pid " .
  	"LEFT OUTER JOIN users AS u ON u.id = e.pc_aid " .
	"LEFT OUTER JOIN openemr_postcalendar_categories AS c ON c.pc_catid = e.pc_catid " .
	"WHERE $where " . 
	"ORDER BY $order_by";

	$res = sqlStatement( $query );
	$events = array();
	if ( $res )
	{
		while ( $row = sqlFetchArray($res) ) 
		{
			// if it's a repeating appointment, fetch all occurances in date range
			if ( $row['pc_recurrtype'] ) {
				$reccuringEvents = getRecurringEvents( $row, $from_date, $to_date );
				$events = array_merge( $events, $reccuringEvents );
			} else {
				$events []= $row;
			}
		}
	}

	return $events;
}
开发者ID:jayvicson,项目名称:openemr,代码行数:59,代码来源:appointments.inc.php

示例14: recursiveDelete

function recursiveDelete($typeid)
{
    $res = sqlStatement("SELECT procedure_type_id FROM " . "procedure_type WHERE parent = '{$typeid}'");
    while ($row = sqlFetchArray($res)) {
        recursiveDelete($row['procedure_type_id']);
    }
    sqlStatement("DELETE FROM procedure_type WHERE " . "procedure_type_id = '{$typeid}'");
}
开发者ID:mindfeederllc,项目名称:openemr,代码行数:8,代码来源:types_edit.php

示例15: getPatientCopay

function getPatientCopay($patient_id, $encounter)
{
    $resMoneyGot = sqlStatement("SELECT sum(pay_amount) as PatientPay FROM ar_activity where " . "pid = ? and encounter = ? and payer_type=0 and account_code='PCP'", array($patient_id, $encounter));
    //new fees screen copay gives account_code='PCP'
    $rowMoneyGot = sqlFetchArray($resMoneyGot);
    $Copay = $rowMoneyGot['PatientPay'];
    return $Copay * -1;
}
开发者ID:nitinkunte,项目名称:openemr,代码行数:8,代码来源:front_payment.php


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