本文整理汇总了PHP中sqlInsert函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlInsert函数的具体用法?PHP sqlInsert怎么用?PHP sqlInsert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlInsert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addBilling2
function addBilling2($encounter, $code_type, $code, $code_text, $modifier = "", $units = "", $fee = "0.00", $justify)
{
$justify_string = '';
if ($justify) {
//trim eahc entry
foreach ($justify as $temp_justify) {
$justify_trimmed[] = trim($temp_justify);
}
//format it
$justify_string = implode(":", $justify_trimmed) . ":";
}
$code_type = formDataCore($code_type);
$code = formDataCore($code);
$code_text = formDataCore($code_text);
$modifier = formDataCore($modifier);
$units = formDataCore($units);
$fee = formDataCore($fee);
$justify_string = formDataCore($justify_string);
// set to authorize billing codes as default - bm
// could place logic here via acls to control who
// can authorize as a feature in the future
$authorized = 1;
$sql = "insert into billing (date, encounter, code_type, code, code_text, pid, authorized, user, groupname,activity,billed,provider_id,modifier,units,fee,justify) values (NOW(), '" . $_SESSION['encounter'] . "', '{$code_type}', '{$code}', '{$code_text}', '" . $_SESSION['pid'] . "', '{$authorized}', '" . $_SESSION['authId'] . "', '" . $_SESSION['authProvider'] . "',1,0," . $_SESSION['authUserID'] . ",'{$modifier}','{$units}','{$fee}','{$justify_string}')";
return sqlInsert($sql);
}
示例2: portal_connection
/**
* Offsite Portal connection function library.
*
* Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
*
* LICENSE: This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Eldho Chacko <eldho@zhservices.com>
* @author Vinish K <vinish@zhservices.com>
* @link http://www.open-emr.org
*/
function portal_connection(){
global $credentials;
$password = $GLOBALS['portal_offsite_password'];
$randkey = '';
$timminus = date("Y-m-d H:m",(strtotime(date("Y-m-d H:m"))-7200)).":00";
sqlStatement("DELETE FROM audit_details WHERE audit_master_id IN(SELECT id FROM audit_master WHERE type=5 AND created_time<=?)",array($timminus));
sqlStatement("DELETE FROM audit_master WHERE type=5 AND created_time<=?",array($timminus));
do{
$randkey = substr(md5(rand().rand()), 0, 8);
$res = sqlStatement("SELECT * FROM audit_details WHERE field_value = ?",array($randkey));
$cnt = sqlNumRows($res);
}
while($cnt>0);
$password = sha1($password.gmdate("Y-m-d H").$randkey);
$grpID = sqlInsert("INSERT INTO audit_master SET type=5");
sqlStatement("INSERT INTO audit_details SET field_value=? , audit_master_id=?",array($randkey,$grpID));
$credentials = array($GLOBALS['portal_offsite_username'],$password,$randkey);
//CALLING WEBSERVICE ON THE PATIENT-PORTAL
$client = new SoapClient(null, array(
'location' => $GLOBALS['portal_offsite_address_patient_link']."/webservice/webserver.php",
'uri' => "urn://portal/req"
)
);
return $client;
}
示例3: 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']));
}
}
示例4: p_new
/**
* Provision new radius account(s)
*/
function p_new()
{
$db =& DB();
$this->account['id'];
for ($i = 0; $i < $this->plugin_data['max']; $i++) {
$fields = array('service_id' => $this->service['id'], 'account_id' => $this->account['id'], 'auth' => $this->plugin_data['auth']);
$db->Execute(sqlInsert($db, "radius_service", $fields));
}
return true;
}
示例5: arPostSession
function arPostSession($payer_id, $check_number, $check_date, $pay_total, $post_to_date, $deposit_date, $debug)
{
$query = "INSERT INTO ar_session( " . "payer_id,user_id,closed,reference,check_date,pay_total,post_to_date,deposit_date,patient_id,payment_type,adjustment_code,payment_method " . ") VALUES ( " . "'{$payer_id}'," . $_SESSION['authUserID'] . "," . "0," . "'ePay - {$check_number}'," . "'{$check_date}', " . "{$pay_total}, " . "'{$post_to_date}','{$deposit_date}', " . "0,'insurance','insurance_payment','electronic'" . ")";
if ($debug) {
echo $query . "<br>\n";
} else {
$sessionId = sqlInsert($query);
return $sessionId;
}
}
示例6: md5_pass
function md5_pass($length = 8)
{
$randkey = substr(md5(rand() . rand()), 0, $length);
$res = sqlStatement("SELECT * FROM audit_master AS am LEFT OUTER JOIN audit_details AS ad ON ad.audit_master_id=am.id WHERE type=5 AND field_value=?", array($randkey));
if (sqlNumRows($res)) {
md5_pass();
} else {
$grpID = sqlInsert("INSERT INTO audit_master SET type=5");
sqlStatement("INSERT INTO audit_details SET field_value=? , audit_master_id=?", array($randkey, $grpID));
return $randkey;
}
}
示例7: setNewPassword
function setNewPassword($account_id, $password, $hashed = true)
{
$db =& DB();
if (!$hashed) {
$this->hashPassword($password);
}
/* update last_date in existing passwords to indicate they are no longer in use */
$fields['date_last'] = time();
$db->Execute($sql = "update " . AGILE_DB_PREFIX . "account_password_history set date_last = " . time() . " where account_id = {$account_id}");
/* insert new password */
$fields = array('date_orig' => time(), 'date_last' => 0, 'account_id' => $account_id, 'password' => $password, 'ip' => USER_IP);
$db->Execute(sqlInsert($db, "account_password_history", $fields));
}
示例8: do_visit_form
function do_visit_form($irow, $encounter, $first)
{
global $insert_count, $debug, $verbose;
$pid = $irow['pid'];
// If a gcac form already exists for this visit, get out.
$row = sqlQuery("SELECT COUNT(*) AS count FROM forms WHERE " . "pid = '{$pid}' AND encounter = '{$encounter}' AND " . "formdir = 'LBFgcac' AND deleted = 0");
if ($row['count']) {
echo "<br />*** Visit {$pid}.{$encounter} skipped, already has a GCAC visit form ***\n";
return;
}
$a = array('client_status' => $irow['client_status'], 'in_ab_proc' => $irow['in_ab_proc'], 'ab_location' => $irow['ab_location'], 'complications' => $irow['fol_compl'], 'contrameth' => $irow['contrameth']);
// logic that applies only to the first related visit
if ($first) {
if ($a['ab_location'] == 'ma') {
$a['ab_location'] = 'proc';
}
$a['complications'] = $irow['rec_compl'];
$a['contrameth'] = '';
}
$newid = 0;
$didone = false;
foreach ($a as $field_id => $value) {
if ($value !== '') {
if ($newid) {
$query = "INSERT INTO lbf_data " . "( form_id, field_id, field_value ) " . " VALUES ( '{$newid}', '{$field_id}', '{$value}' )";
if ($verbose) {
echo "<br />{$query}\n";
}
if (!$debug) {
sqlStatement($query);
}
} else {
$query = "INSERT INTO lbf_data " . "( field_id, field_value ) " . " VALUES ( '{$field_id}', '{$value}' )";
if ($verbose) {
echo "<br />{$query}\n";
}
if (!$debug) {
$newid = sqlInsert($query);
}
}
$didone = true;
}
}
if ($newid && !$debug) {
addForm($encounter, 'IPPF GCAC', $newid, 'LBFgcac', $pid, 1);
++$insert_count;
}
if (!$didone) {
echo "<br />*** Empty issue skipped for visit {$pid}.{$encounter} ***\n";
}
}
示例9: createToken
function createToken($userId, $create = true, $device_token = '')
{
$token = md5(uniqid(rand(), 1));
$query = "SELECT * FROM api_tokens WHERE user_id = ?";
$token_result = sqlQuery($query, array($userId));
if ($create || !$token_result) {
$strQuery = "INSERT INTO api_tokens VALUES('', '" . add_escape_custom($userId) . "' ,'" . add_escape_custom($token) . "','" . add_escape_custom($device_token) . "' ,'" . date('Y-m-d h:i:s') . "', '',0,0,0,0)";
$result = sqlInsert($strQuery);
} else {
$strQuery = "UPDATE `api_tokens` SET `token` = '" . add_escape_custom($token) . "' ";
if ($device_token) {
$strQuery .= ",`device_token` = '" . add_escape_custom($device_token) . "' ";
}
$strQuery .= "WHERE `user_id` = ?";
$result = sqlStatement($strQuery, array($userId));
}
if ($result) {
return $token;
} else {
return false;
}
}
示例10: frontPayment
function frontPayment($patient_id, $encounter, $method, $source, $amount1, $amount2, $timestamp, $auth = "")
{
if (empty($auth)) {
$auth = $_SESSION['authUser'];
}
$tmprow = sqlQuery("SELECT date FROM form_encounter WHERE " . "encounter=? and pid=?", array($encounter, $patient_id));
//the manipulation is done to insert the amount paid into payments table in correct order to show in front receipts report,
//if the payment is for today's encounter it will be shown in the report under today field and otherwise shown as previous
$tmprowArray = explode(' ', $tmprow['date']);
if (date('Y-m-d') == $tmprowArray[0]) {
if ($amount1 == 0) {
$amount1 = $amount2;
$amount2 = 0;
}
} else {
if ($amount2 == 0) {
$amount2 = $amount1;
$amount1 = 0;
}
}
$payid = sqlInsert("INSERT INTO payments ( " . "pid, encounter, dtime, user, method, source, amount1, amount2 " . ") VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)", array($patient_id, $encounter, $timestamp, $auth, $method, $source, $amount1, $amount2));
return $payid;
}
示例11: todaysEncounter
function todaysEncounter($patient_id, $reason = '')
{
global $today, $userauthorized;
if (empty($reason)) {
$reason = xl('Please indicate visit reason');
}
// Was going to use the existing encounter for today if there is one, but
// decided it's right to always create a new one. Leaving the code here
// (and corresponding function above) in case it is ever wanted later.
/*******************************************************************
$encounter = todaysEncounterIf($patient_id);
if ($encounter) return $encounter;
*******************************************************************/
$tmprow = sqlQuery("SELECT username, facility, facility_id FROM users " . "WHERE id = ?", array($_SESSION["authUserID"]));
$username = $tmprow['username'];
$facility = $tmprow['facility'];
$facility_id = $tmprow['facility_id'];
$conn = $GLOBALS['adodb']['db'];
$encounter = $conn->GenID("sequences");
$provider_id = $userauthorized ? $_SESSION['authUserID'] : 0;
addForm($encounter, "New Patient Encounter", sqlInsert("INSERT INTO form_encounter SET date = ?, onset_date = ?, " . "reason = ?, facility = ?, facility_id = ?, pid = ?, encounter = ?, " . "provider_id = ?", array($today, $today, $reason, $facility, $facility_id, $patient_id, $encounter, $provider_id)), "newpatient", $patient_id, $userauthorized, "NOW()", $username);
return $encounter;
}
示例12: addNewLabFacility
/**
*
* @param <type> $facility
* @return <type> returns the id
*/
function addNewLabFacility($facility)
{
$query = "INSERT INTO users ( " . "username, password, authorized, info, source, " . "title, fname, lname, mname, " . "federaltaxid, federaldrugid, upin, facility, see_auth, active, npi, taxonomy, " . "specialty, organization, valedictory, assistant, billname, email, url, " . "street, streetb, city, state, zip, " . "street2, streetb2, city2, state2, zip2," . "phone, phonew1, phonew2, phonecell, fax, notes, abook_type " . ") VALUES ( " . "'', " . "'', " . "0, " . "'', " . "NULL, " . "'" . trim($facility->FacilityDirectorTitle) . "', " . "'" . trim($facility->FacilityDirectorFirstName) . "', " . "'" . trim($facility->FacilityDirectorLastName) . "', " . "'', " . "'', " . "'', " . "'', " . "'', " . "0, " . "1, " . "'', " . "'', " . "'', " . "'" . trim($facility->FacilityName) . "', " . "'', " . "'', " . "'', " . "'', " . "'', " . "'" . trim($facility->FacilityAddress) . "', " . "'', " . "'" . trim($facility->FacilityCity) . "', " . "'" . trim($facility->FacilityState) . "', " . "'" . trim($facility->FacilityZip) . "', " . "'', " . "'', " . "'', " . "'', " . "'', " . "'" . trim($facility->FacilityPhone) . "', " . "'', " . "'', " . "'', " . "'', " . "'', " . "'ord_lab'" . ")";
return sqlInsert($query);
}
示例13: check_file_dir_name
include_once "../../globals.php";
// allow a custom 'delete' form
$deleteform = $incdir . "/forms/" . $_REQUEST["formname"] . "/delete.php";
check_file_dir_name($_REQUEST["formname"]);
if (file_exists($deleteform)) {
include_once $deleteform;
exit;
}
// if no custom 'delete' form, then use a generic one
// when the Cancel button is pressed, where do we go?
$returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
if ($_POST['confirm']) {
// set the deleted flag of the indicated form
$sql = "update forms set deleted=1 where id= ?";
if ($_POST['id'] != "*" && $_POST['id'] != '') {
sqlInsert($sql, array($_POST['id']));
}
// log the event
newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "Form " . $_POST['formname'] . " deleted from Encounter " . $_POST['encounter']);
// redirect back to the encounter
$address = "{$GLOBALS['rootdir']}/patient_file/encounter/{$returnurl}";
echo "\n<script language='Javascript'>top.restoreSession();window.location='{$address}';</script>\n";
exit;
}
?>
<html>
<head>
<?php
html_header_show();
?>
示例14: sqlStatement
$runit['option_id'] = $runit['option_id'] + 1;
}
}
if ($medArray[$i]['DosageFrequencyDescription']) {
$qint = sqlStatement("SELECT option_id FROM list_options WHERE list_id='drug_interval' AND title = ?", array($medArray[$i]['DosageFrequencyDescription']));
$rint = sqlFetchArray($qint);
if (sqlNumRows($qint) <= 0) {
$rint = sqlQuery("SELECT option_id AS option_id FROM list_options WHERE list_id='drug_interval' ORDER BY ABS(option_id) DESC LIMIT 1");
sqlQuery("INSERT INTO list_options (list_id,option_id,title,seq) VALUES ('drug_interval',?,?,?)", array($rint['option_id'] + 1, $medArray[$i]['DosageFrequencyDescription'], $rint['option_id'] + 1));
$rint['option_id'] = $rint['option_id'] + 1;
}
}
$check = sqlStatement("select * from prescriptions where prescriptionguid=? and patient_id=? and prescriptionguid is not null", array($medArray[$i]['PrescriptionGuid'], $medArray[$i]['ExternalPatientID']));
$prescription_id = '';
if (sqlNumRows($check) == 0) {
$prescription_id = sqlInsert("insert into prescriptions \n (\n patient_id,provider_id,encounter,date_added,drug,drug_id,drug_info_erx,form,dosage,size,unit,route,`INTERVAL`,refills,note,`DATETIME`,\n `USER`,site,prescriptionguid,erx_source,rxnorm_drugcode\n )\n values\n (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW(),?,?,?,'1',?)", array($medArray[$i]['ExternalPatientID'], $provider['id'], $encounter, substr($medArray[$i]['PrescriptionDate'], 0, 10), $medArray[$i]['DrugName'], $medArray[$i]['DrugID'], $medArray[$i]['DrugInfo'], $rin['option_id'], $medArray[$i]['DosageNumberDescription'], number($medArray[$i]['Strength']), $runit['option_id'], $rroute['option_id'], $rint['option_id'], $medArray[$i]['Refills'], $medArray[$i]['PrescriptionNotes'], $_SESSION['authUserID'], $medArray[$i]['SiteID'], $medArray[$i]['PrescriptionGuid'], $medArray[$i]['rxcui']));
$j++;
} else {
sqlQuery("update prescriptions set \n provider_id=?, drug=?, drug_id=?, drug_info_erx=?, form=?, dosage=?, size=? ,unit=?, route=?, `INTERVAL`=?, refills=?, note=?, \n `DATETIME`=NOW(),`USER`=?, site=? ,erx_source='1', rxnorm_drugcode=?, active='1'\n WHERE prescriptionguid=? AND patient_id=?\n ", array($provider['id'], $medArray[$i]['DrugName'], $medArray[$i]['DrugID'], $medArray[$i]['DrugInfo'], $rin['option_id'], $medArray[$i]['DosageNumberDescription'], number($medArray[$i]['Strength']), $runit['option_id'], $rroute['option_id'], $rint['option_id'], $medArray[$i]['Refills'], $medArray[$i]['PrescriptionNotes'], $_SESSION['authUserID'], $medArray[$i]['SiteID'], $medArray[$i]['rxcui'], $medArray[$i]['PrescriptionGuid'], $medArray[$i]['ExternalPatientID']));
}
$result = sqlFetchArray($check);
if ($result['id']) {
$prescription_id = $result['id'];
}
processAmcCall('e_prescribe_amc', true, 'add', $medArray[$i]['ExternalPatientID'], 'prescriptions', $prescription_id);
}
if ($j != 0) {
sqlQuery("update patient_data set soap_import_status=? where pid=?", array('2', $pid));
}
if ($xml_response_count == 0) {
echo htmlspecialchars(xl("Nothing to import for Prescription"), ENT_NOQUOTES);
示例15: invalue
}
}
</script>
</head>
<body class="body_top">
<?php
// If we are saving, then save and close the window.
//
if ($_POST['form_save']) {
if ($userid) {
$query = "UPDATE users SET " . "abook_type = " . invalue('form_abook_type') . ", " . "title = " . invalue('form_title') . ", " . "fname = " . invalue('form_fname') . ", " . "lname = " . invalue('form_lname') . ", " . "mname = " . invalue('form_mname') . ", " . "specialty = " . invalue('form_specialty') . ", " . "organization = " . invalue('form_organization') . ", " . "valedictory = " . invalue('form_valedictory') . ", " . "assistant = " . invalue('form_assistant') . ", " . "federaltaxid = " . invalue('form_federaltaxid') . ", " . "upin = " . invalue('form_upin') . ", " . "npi = " . invalue('form_npi') . ", " . "taxonomy = " . invalue('form_taxonomy') . ", " . "email = " . invalue('form_email') . ", " . "url = " . invalue('form_url') . ", " . "street = " . invalue('form_street') . ", " . "streetb = " . invalue('form_streetb') . ", " . "city = " . invalue('form_city') . ", " . "state = " . invalue('form_state') . ", " . "zip = " . invalue('form_zip') . ", " . "street2 = " . invalue('form_street2') . ", " . "streetb2 = " . invalue('form_streetb2') . ", " . "city2 = " . invalue('form_city2') . ", " . "state2 = " . invalue('form_state2') . ", " . "zip2 = " . invalue('form_zip2') . ", " . "phone = " . invalue('form_phone') . ", " . "phonew1 = " . invalue('form_phonew1') . ", " . "phonew2 = " . invalue('form_phonew2') . ", " . "phonecell = " . invalue('form_phonecell') . ", " . "fax = " . invalue('form_fax') . ", " . "notes = " . invalue('form_notes') . " " . "WHERE id = '{$userid}'";
sqlStatement($query);
} else {
$userid = sqlInsert("INSERT INTO users ( " . "username, password, authorized, info, source, " . "title, fname, lname, mname, " . "federaltaxid, federaldrugid, upin, facility, see_auth, active, npi, taxonomy, " . "specialty, organization, valedictory, assistant, billname, email, url, " . "street, streetb, city, state, zip, " . "street2, streetb2, city2, state2, zip2, " . "phone, phonew1, phonew2, phonecell, fax, notes, abook_type " . ") VALUES ( " . "'', " . "'', " . "0, " . "'', " . "NULL, " . invalue('form_title') . ", " . invalue('form_fname') . ", " . invalue('form_lname') . ", " . invalue('form_mname') . ", " . invalue('form_federaltaxid') . ", " . "'', " . invalue('form_upin') . ", " . "'', " . "0, " . "1, " . invalue('form_npi') . ", " . invalue('form_taxonomy') . ", " . invalue('form_specialty') . ", " . invalue('form_organization') . ", " . invalue('form_valedictory') . ", " . invalue('form_assistant') . ", " . "'', " . invalue('form_email') . ", " . invalue('form_url') . ", " . invalue('form_street') . ", " . invalue('form_streetb') . ", " . invalue('form_city') . ", " . invalue('form_state') . ", " . invalue('form_zip') . ", " . invalue('form_street2') . ", " . invalue('form_streetb2') . ", " . invalue('form_city2') . ", " . invalue('form_state2') . ", " . invalue('form_zip2') . ", " . invalue('form_phone') . ", " . invalue('form_phonew1') . ", " . invalue('form_phonew2') . ", " . invalue('form_phonecell') . ", " . invalue('form_fax') . ", " . invalue('form_notes') . ", " . invalue('form_abook_type') . " " . ")");
}
} else {
if ($_POST['form_delete']) {
if ($userid) {
// Be careful not to delete internal users.
sqlStatement("DELETE FROM users WHERE id = '{$userid}' AND username = ''");
}
}
}
if ($_POST['form_save'] || $_POST['form_delete']) {
// Close this window and redisplay the updated list.
echo "<script language='JavaScript'>\n";
if ($info_msg) {
echo " alert('{$info_msg}');\n";
}