本文整理汇总了PHP中GetDB函数的典型用法代码示例。如果您正苦于以下问题:PHP GetDB函数的具体用法?PHP GetDB怎么用?PHP GetDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RemoveExisting
public static function RemoveExisting($upload_id)
{
$DB = GetDB();
$upload = $DB->Row('SELECT * FROM `tbx_upload` WHERE `upload_id`=?', array($upload_id));
if (!empty($upload)) {
$path = Config::Get('document_root') . $upload['uri'];
if (file_exists($path)) {
@unlink($path);
}
$DB->Update('DELETE FROM `tbx_upload` WHERE `upload_id`=?', array($upload_id));
}
}
示例2: Verify
public static function Verify()
{
// Retrieve
$DB = GetDB();
$captcha = $DB->Row('SELECT * FROM # WHERE `session`=?', array(self::TABLE, $_COOKIE[self::COOKIE]));
// Validate
$v = Validator::Create();
$v->Register(!empty($captcha) && strtoupper($captcha['code']) == strtoupper(Request::Get('captcha')), Validator_Type::IS_TRUE, _T('Validation:Invalid Captcha'));
// Remove
$DB->Update('DELETE FROM # WHERE `session`=?', array(self::TABLE, $_COOKIE[self::COOKIE]));
setcookie(self::COOKIE, null, time() - self::EXPIRES, Config::Get('cookie_path'), Config::Get('cookie_domain'));
}
示例3: Render
function Render(&$AConclusion)
{
$vDB = GetDB();
$vHeavitiesList = $vDB->GetRBList('rb_trauma_heavity', 'id', 'name', true);
$this->SetMargins(20, 20, 20);
$this->SetAutoPageBreak(true, 30);
$vBranchInfo = GetBranchInfo();
$this->AddPage();
$this->SetFont('arial_rus', '', 10);
$vWidth = $this->GetAreaWidth();
$vHeight = $this->FontSize * 1.5;
$vX = $this->GetX();
$vY = $this->GetY();
$this->SetXY($vX, $vY);
$this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), 'B', 0, 'L');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'Медицинская документация', '', 0, 'R');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'Учетная форма № 315/у', '', 0, 'R');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'УТВЕРЖДЕНА', '', 0, 'R');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'Приказом Минздравсоцразвития России', '', 0, 'R');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'От 15 апреля 2005 г. №275', '', 0, 'R');
$this->Ln($vHeight);
$this->Ln($vHeight);
$this->SetFont('arial_rus', '', 14);
$vHeight = $this->FontSize * 1.5;
$this->Cell($vWidth, $vHeight, 'МЕДИЦИНСКОЕ ЗАКЛЮЧЕНИЕ', '', 0, 'C');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'о характере полученных повреждений здоровья в результате несчастного', '', 0, 'C');
$this->Ln($vHeight);
$this->Cell($vWidth, $vHeight, 'случая на производстве и степени их тяжести', '', 0, 'C');
$this->Ln($vHeight);
$this->Ln($vHeight);
$this->SetFont('arial_rus', '', 10);
$vHeight = $this->FontSize * 1.5;
$vBlock = array();
$vBlock[] = array('title' => 'Выдано', 'text' => iconv("utf8", "windows-1251", @$AConclusion['employment_place']));
$vBlock[] = array('title' => 'О том, что пострадавший', 'text' => iconv("utf8", "windows-1251", FormatNameEx($AConclusion)));
$vBlock[] = array('title' => 'дата рождения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AConclusion['born_date'])));
$vBlock[] = array('title' => 'должность (профессия)', 'text' => iconv("utf8", "windows-1251", @$AConclusion['profession']));
$vBlock[] = array('title' => 'поступил в', 'text' => iconv("utf8", "windows-1251", @$vBranchInfo['name']));
$vBlock[] = array('title' => 'дата и время обращения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AConclusion['create_time'])));
$vBlock[] = array('title' => 'Диагноз', 'text' => iconv("utf8", "windows-1251", @$AConclusion['diagnosis']));
$vBlock[] = array('title' => 'Код диагноза по МКБ', 'text' => iconv("utf8", "windows-1251", @$AConclusion['diagnosis_mkb']));
$this->BlockNotes($vBlock, $vWidth);
$this->Cell($vWidth, $vHeight, 'Согласно схеме определения степени тяжести повреждения здоровья при несчастных случаях', '', 0, 'L');
$this->Ln($vHeight);
$vBlock = array();
$vBlock[] = array('title' => 'на производстве указанное повреждение относится к категории', 'text' => iconv("utf8", "windows-1251", @$vHeavitiesList[$AConclusion['heavity']]));
$this->BlockNotes($vBlock, $vWidth);
$this->Ln($vHeight);
$vBlock = array();
$vBlock[] = array('title' => 'Врач', 'text' => iconv("utf8", "windows-1251", FormatUserName(@$AConclusion['doctor_id'])));
$vBlock[] = array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong($vDB->ConvertToDate(time()))));
$this->BlockNotes($vBlock, $vWidth);
$this->Ln($vHeight);
}
示例4: GenerateFromCustom
public static function GenerateFromCustom($type)
{
$DB = GetDB();
$schema = GetDBSchema();
$xtable = $schema->el('//table[naming/type="' . $type . '"]');
$primary_key = $xtable->columns->primaryKey->val();
$custom_schema_table = $xtable->custom->val() . '_schema';
$html = '';
$result = $DB->Query('SELECT * FROM # ORDER BY `field_id`', array($custom_schema_table));
while ($field = $DB->NextRow($result)) {
switch ($field['type']) {
case self::TEXT:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <input type="text" size="60" name="' . $field['name'] . '" value="' . Request::Get($field['name']) . '" />' . ' </span>' . '</div>';
break;
case self::TEXTAREA:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <textarea name="' . $field['name'] . '" rows="5" cols="80">' . Request::Get($field['name']) . '</textarea>' . ' </span>' . '</div>';
break;
case self::SELECT:
$html .= '<div class="field">' . ' <label>' . $field['label'] . ':</label>' . ' <span class="field-container">' . ' <select name="' . $field['name'] . '">' . self::OptionsSimple($field['options'], Request::Get($field['name'])) . ' </select>' . ' </span>' . '</div>';
break;
case self::CHECKBOX:
$html .= '<div class="field">' . ' <label></label>' . ' <span class="field-container">' . ' <div class="checkbox">' . ' <input type="hidden" name="' . $field['name'] . '" value="' . Request::Get($field['name']) . '" />' . ' ' . $field['label'] . ' </div>' . ' </span>' . '</div>';
break;
}
}
$DB->Free($result);
if (empty($html)) {
$html = '<div class="message-warning text-center">No Custom Fields Have Been Defined</div>';
}
return $html;
}
示例5: FilterSearchTerms
public static function FilterSearchTerms()
{
$DB = GetDB();
$words = $DB->FetchAll('SELECT `regex`,`value` FROM `tbx_blacklist` WHERE `type`=?', array(self::TYPE_WORD));
$result = $DB->Query('SELECT * FROM `tbx_search_term_new`');
while ($term = $DB->NextRow($result)) {
$blacklisted = false;
foreach ($words as $w) {
if (!$w['regex']) {
$w['value'] = preg_quote($w['value'], '~');
}
if (preg_match('~(' . $w['value'] . ')~i', $term['term'])) {
$blacklisted = true;
break;
}
}
if (!$blacklisted) {
if ($DB->Update('UPDATE `tbx_search_term` SET `frequency`=`frequency`+? WHERE `term`=?', array($term['frequency'], $term['term'])) == 0) {
$DB->Update('INSERT INTO `tbx_search_term` VALUES (?,?,?)', array(null, $term['term'], 1));
}
}
$DB->Update('DELETE FROM `tbx_search_term_new` WHERE `term_id`=?', array($term['term_id']));
}
$DB->Free($result);
}
示例6: GetTable
function GetTable()
{
$vDB = GetDB();
list($vTable, $vFilter, $vOrder) = ConstructSurgeriesQuery($vDB, $_GET);
$vShowDiagnosis = @$_GET['show_diagnosis'];
$vShowCure = @$_GET['show_cure'];
$vTab =& new TTable($vTable, 'emst_surgeries.*, ' . 'emst_cases.first_name, emst_cases.last_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male', $vFilter, $vOrder, 'case_id');
$vTab->AddColumn('case_id', '№', array('align' => 'right'));
$vTab->AddDateColumn('date', 'Дата и время приёма');
$vTab->AddColumn('user_id', 'Врач', array('align' => 'left', 'fmt' => 'tcfUserName'));
$vTab->AddColumn('id', 'Фамилия Имя Отчество', array('align' => 'left', 'fmt' => 'tcfName'));
// $vTab->AddColumn('date', 'Дата рождения, полных лет', array('align'=>'left', 'fmt'=>'tcfBornDate'));
// $vTab->AddColumn('is_male', 'Пол', array('align'=>'center', 'fmt'=>'tcfSex'));
$vTab->AddTextColumn('objective', 'Объективный статус');
if ($vShowDiagnosis) {
$vTab->AddTextColumn('diagnosis', 'Диагноз');
}
// $vTab->AddColumn('diagnosis_mkb', 'МКБ');
if ($vShowCure) {
$vTab->AddTextColumn('cure', 'Лечение');
}
$vTab->AddRowAction('изменение', 'case_edit.html?id=', '../images/edit_24x24.gif', 24, 24);
$vTab->AddRowAction('печать', '../reg/case.pdf?id=', '../images/print_24x24.gif', 24, 24);
$vFilter = array();
CopyRecordRefValue($vFilter, $_GET, 'case_id');
CopyRecordRefValue($vFilter, $_GET, 'doctor_id');
CopyRecordStrValue($vFilter, $_GET, 'first_name');
CopyRecordStrValue($vFilter, $_GET, 'last_name');
CopyRecordStrValue($vFilter, $_GET, 'patr_name');
CopyRecordDateValue($vFilter, $_GET, 'beg_date');
CopyRecordDateValue($vFilter, $_GET, 'end_date');
// $vTab->AddTableAction('печать', CompoundURL('cases_list.pdf', $vFilter));
$vResult = $vTab->ProduceHTML($vDB, GetPageIdxOrLast(), 20);
return $vResult;
}
示例7: PostProcessSuccess
public function PostProcessSuccess($video_id)
{
// Adjust permissions and move directory
$old_directory = $this->video_dir->GetBaseDir();
@chmod($old_directory, 0777);
$directory = Video_Dir::DirNameFromId($video_id);
$this->video_dir->MoveTo($directory);
// Add the embed code to the database
DatabaseAdd('tbx_video_clip', array('video_id' => $video_id, 'clip' => $this->source[Video_Source::FIELD_EMBED], 'type' => 'Embed'));
// Get the relative URL for each thumb and add to database
$thumb_ids = array();
foreach ($this->thumbs as $thumb) {
$thumb = str_replace(array($old_directory, Config::Get('document_root')), array($directory, ''), $thumb);
$thumb_ids[] = DatabaseAdd('tbx_video_thumbnail', array('video_id' => $video_id, 'thumbnail' => $thumb));
}
// Determine number of thumbnails and select random display thumbnail
$num_thumbnails = count($this->thumbs);
$display_thumbnail = null;
if ($num_thumbnails > 0) {
// Select display thumbnail randomly from the first 40%
$display_thumbnail = $thumb_ids[rand(0, floor(0.4 * $num_thumbnails))];
}
$update = array('video_id' => $video_id, 'num_thumbnails' => $num_thumbnails, 'display_thumbnail' => $display_thumbnail, 'duration' => $this->duration);
$DB = GetDB();
$DB->Update('DELETE FROM `tbx_conversion_queue` WHERE `video_id`=?', array($video_id));
DatabaseUpdate('tbx_video', $update);
}
示例8: GetDB
public static function &GetDiffs($username, $since)
{
$db = GetDB();
$sql = 'select followers.follower_id, followers.followed_at, followers.unfollowed_at, twitterusers.* from followers left join twitterusers on followers.follower_id = twitterusers.id where followers.username = "' . mysql_real_escape_string($username, $db) . '" and (followers.followed_at > ' . $since . ' or followers.unfollowed_at > ' . $since . ') order by followers.unfollowed_at asc, followers.followed_at asc';
$retval = mysql_query($sql, $db);
return $retval;
}
示例9: Save
function Save()
{
if (!$this->validate()) {
return FALSE;
}
$vDB = GetDB();
$vValues = $this->getSubmitValues(TRUE);
$vId = @$vValues['id'];
$vRecord = array();
if (!empty($vId)) {
$vRecord['id'] = $vId;
} else {
$vRecord['create_time'] = $vDB->ConvertToDateTime(time());
$vRecord['next_visit_date'] = $vDB->ConvertToDate(time());
}
$vRecord['modify_time'] = $vDB->ConvertToDateTime(time());
CopyRecordStrValue($vRecord, $vValues, 'last_name');
CopyRecordStrValue($vRecord, $vValues, 'first_name');
CopyRecordStrValue($vRecord, $vValues, 'patr_name');
/* Здесь нужна проверка введенных данных в поле ПОЛИС СМО*/
$vResult = $vDB->InsertOrUpdateById('emst_cases', $vRecord);
// var_dump($vRecord);
// var_dump($vDB);
return $vResult;
}
示例10: GetTable
function GetTable()
{
$vDB = GetDB();
list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $_GET);
$vTab =& new TTable($vTable, 'emst_cases.*, emst_surgeries.cec_number as cec_number, emst_surgeries.case_id as case_id, emst_surgeries.date as cec_date, emst_surgeries.user_id as doctor_id', $vFilter, $vOrder, 'case_id');
$vTab->AddColumn('cec_number', '№ ВК');
$vTab->AddDateColumn('cec_date', 'Дата');
$vTab->AddColumn('case_id', '№', array('align' => 'right'));
$vTab->AddColumn('doctor_id', 'Врач', array('align' => 'left', 'fmt' => 'tcfUserName'));
$vTab->AddColumn('id', 'Фамилия Имя Отчество', array('align' => 'left', 'fmt' => 'tcfName'));
$vTab->AddColumn('cec_date', 'Дата рождения, полных лет', array('align' => 'left', 'fmt' => 'tcfBornDate'));
$vTab->AddColumn('is_male', 'Пол', array('align' => 'center', 'fmt' => 'tcfSex'));
$vTab->AddRowAction('приём', 'accept.html?id=', '../images/sugrery_24x24.gif', 24, 24);
$vTab->AddRowAction('изменение', 'case_edit.html?id=', '../images/edit_24x24.gif', 24, 24);
$vTab->AddRowAction('печать', '../reg/case.pdf?id=', '../images/print_24x24.gif', 24, 24);
$vTab->AddTextColumn('diagnosis', 'Диагноз');
$vTab->AddColumn('diagnosis_mkb', 'МКБ');
// $vTab->AddColumn('antitetanus_series', 'Серия');
$vFilter = array();
CopyRecordDateValue($vFilter, $_GET, 'beg_date');
CopyRecordDateValue($vFilter, $_GET, 'end_date');
$vTab->AddTableAction('печать', CompoundURL('cec_list.pdf', $vFilter));
// $vTab->AddTableAction('сводный отчет', CompoundURL('antitetanuses_report.pdf', $vFilter));
$vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
return $vResult;
}
示例11: CheckLoginName
function CheckLoginName()
{
if ($this->validate()) {
$vValues = $this->getSubmitValues(TRUE);
$vName = $vValues['Name'];
$vPassword = $vValues['Password'];
$vDB = GetDB();
$vUserRecord = $vDB->Get('users', '*', $vDB->CondAnd($vDB->CondEqual('login', $vName), $vDB->CondEqual('password', $vPassword), $vDB->CondEqual('retired', 0)));
// unset($vDB);
$vRoles = $vUserRecord['roles'];
list($vMenu, $vFirstPage) = GetMenuAndFirstPage($vRoles);
if ($vFirstPage != '') {
$_SESSION['User.ID'] = $vUserRecord['id'];
$_SESSION['User.Login'] = $vName;
$_SESSION['User.Name'] = $vUserRecord['full_name'];
$_SESSION['User.Roles'] = $vRoles;
$_SESSION['User.FirstPage'] = $vFirstPage;
$_SESSION['User.Menu'] = $vMenu;
setcookie('LoginName', $vName, time() + 9999999);
//var_dump($vFirstPage);
//exit();
Redirect($vFirstPage);
}
}
return FALSE;
}
示例12: Save
function Save()
{
if (!$this->validate()) {
return FALSE;
}
$vDB = GetDB();
$vValues = $this->getSubmitValues(TRUE);
$vId = @$vValues['id'];
$vRecord = array();
if (!empty($vId)) {
$vRecord['id'] = $vId;
} else {
$vRecord['create_time'] = $vDB->ConvertToDateTime(time());
$vRecord['next_visit_date'] = $vDB->ConvertToDate(time());
}
$vRecord['modify_time'] = $vDB->ConvertToDateTime(time());
CopyRecordStrValue($vRecord, $vValues, 'last_name');
CopyRecordStrValue($vRecord, $vValues, 'first_name');
CopyRecordStrValue($vRecord, $vValues, 'patr_name');
CopyRecordBoolValue($vRecord, $vValues, 'is_male');
CopyRecordDateValue($vRecord, $vValues, 'born_date');
CopyRecordRefValue($vRecord, $vValues, 'doc_type_id');
CopyRecordStrValue($vRecord, $vValues, 'doc_series');
CopyRecordStrValue($vRecord, $vValues, 'doc_number');
CopyRecordRefValue($vRecord, $vValues, 'insurance_company_id');
CopyRecordStrValue($vRecord, $vValues, 'polis_series');
CopyRecordStrValue($vRecord, $vValues, 'polis_number');
CopyRecordDateValue($vRecord, $vValues, 'patient_polis_from');
CopyRecordDateValue($vRecord, $vValues, 'patient_polis_to');
CopyRecordStrValue($vRecord, $vValues, 'paytype');
CopyRecordStrValue($vRecord, $vValues, 'addr_reg_street');
CopyRecordStrValue($vRecord, $vValues, 'addr_reg_num');
CopyRecordStrValue($vRecord, $vValues, 'addr_reg_subnum');
CopyRecordStrValue($vRecord, $vValues, 'addr_reg_apartment');
CopyRecordStrValue($vRecord, $vValues, 'addr_phys_street');
CopyRecordStrValue($vRecord, $vValues, 'addr_phys_num');
CopyRecordStrValue($vRecord, $vValues, 'addr_phys_subnum');
CopyRecordStrValue($vRecord, $vValues, 'addr_phys_apartment');
CopyRecordStrValue($vRecord, $vValues, 'phone');
CopyRecordRefValue($vRecord, $vValues, 'employment_category_id');
CopyRecordStrValue($vRecord, $vValues, 'employment_place');
CopyRecordStrValue($vRecord, $vValues, 'profession');
CopyRecordRefValue($vRecord, $vValues, 'trauma_type_id');
CopyRecordStrValue($vRecord, $vValues, 'notes');
CopyRecordStrValue($vRecord, $vValues, 'accident');
CopyRecordDateTimeValue($vRecord, $vValues, 'accident_datetime');
CopyRecordStrValue($vRecord, $vValues, 'accident_place');
CopyRecordBoolValue($vRecord, $vValues, 'phone_message_required');
CopyRecordBoolValue($vRecord, $vValues, 'ice_trauma');
CopyRecordBoolValue($vRecord, $vValues, 'animal_bite_trauma');
CopyRecordBoolValue($vRecord, $vValues, 'ixodes_trauma');
CopyRecordStrValue($vRecord, $vValues, 'message_number');
/* Здесь нужна проверка введенных данных в поле ПОЛИС СМО*/
$vResult = $vDB->InsertOrUpdateById('emst_cases', $vRecord);
// var_dump($vRecord);
// var_dump($vDB);
return $vResult;
}
示例13: getUserEisCode
function getUserEisCode($AUserId)
{
$vDB = GetDB();
$vRecord = $vDB->GetById('users', $AUserId, 'eisCode');
$vResult = $vRecord ? $vRecord['eisCode'] : NULL;
$vResult = $vResult ? $vResult : '0';
# print_r( array( $AUserId, $vRecord, $vResult) );
return $vResult;
}
示例14: GetTable
function GetTable()
{
$vDB = GetDB();
$vTab =& new TTable('rb_vistit_targets', '*', '', 'name', 'id');
$vTab->AddColumn('name', 'Наименование');
$vTab->AddRowAction('изменить', 'vistit_target_edit.html?id=');
$vTab->AddTableAction('новая запись', 'vistit_target_edit.html');
$vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
return $vResult;
}
示例15: ProduceTable
function ProduceTable($ABegDate, $AEndDate)
{
$vDB = GetDB();
list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, array('beg_date' => $ABegDate, 'end_date' => $AEndDate));
$vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
$vNo = 0;
while ($vRecord = $vRecords->Fetch()) {
DrawLine(++$vNo, $vRecord);
}
}