Exemplo n.º 1
2
 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));
     }
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
 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 = "******" 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;
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
 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;
 }
Exemplo n.º 12
0
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;
}
Exemplo n.º 13
0
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);
    }
}
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
 function GetTable()
 {
     $vDB = GetDB();
     $vTab =& new TTable('rb_employment_categories', '*', '', 'name', 'id');
     $vTab->AddColumn('name', 'Наименование');
     $vTab->AddBoolColumn('need_ill_doc', 'Нужен б/л или справка');
     $vTab->AddRowAction('изменить', 'employment_category_edit.html?id=');
     $vTab->AddTableAction('новая запись', 'employment_category_edit.html');
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 16
0
 public static function Add($id)
 {
     $retval = false;
     $db = GetDB();
     $sql = 'insert into twitterusers set id = "' . mysql_real_escape_string($id, $db) . '" on duplicate key update id = "' . mysql_real_escape_string($id, $db) . '"';
     $retval = mysql_query($sql, $db);
     if (!$retval) {
         echo 'TwitterUsers::Add(' . $id . '): ' . mysql_error($db) . "\n\n";
     }
     return $retval;
 }
Exemplo n.º 17
0
 public static function &Get($username)
 {
     $retval = array();
     $db = GetDB();
     $sql = 'select data from queue where username = "******" order by sent_at asc';
     $query = mysql_query($sql, $db);
     while ($row = mysql_fetch_array($query)) {
         $retval[] = unserialize($row[0]);
     }
     return $retval;
 }
Exemplo n.º 18
0
 function GetTable()
 {
     $vDB = GetDB();
     $vTab =& new TTable('rb_manipulations', '*', '', 'name', 'id');
     $vTab->AddColumn('name', 'Наименование');
     $vTab->AddBoolColumn('is_plaster', 'В журнал гипс');
     $vTab->AddRowAction('изменить', 'manipulation_edit.html?id=');
     $vTab->AddTableAction('новая запись', 'manipulation_edit.html');
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 19
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = Date2ReadableLong(iconv('utf-8', 'cp1251', $AParams['beg_date']));
     $this->EndDate = Date2ReadableLong(iconv('utf-8', 'cp1251', $AParams['end_date']));
     $vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Exemplo n.º 20
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vRecords = $vDB->Select($vTable, 'emst_cases.*, emst_surgeries.manipulation_text, rb_manipulations.name as manipulation_name', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Exemplo n.º 21
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $_GET);
     $vTab =& new TCasesTableEx($vTable, 'emst_cases.*', $vFilter, $vOrder);
     $vFilter = array();
     CopyRecordDateValue($vFilter, $_GET, 'beg_date');
     CopyRecordDateValue($vFilter, $_GET, 'end_date');
     $vTab->AddTableAction('печать', CompoundURL('dms_list.pdf', $vFilter));
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 22
0
 public static function RemoveFromFrequency($tags)
 {
     if (String::IsEmpty($tags)) {
         return;
     }
     $DB = GetDB();
     foreach (explode(' ', $tags) as $tag) {
         $tag = trim($tag);
         $DB->Update('UPDATE `tbx_video_tag` SET `frequency`=`frequency`-1 WHERE `tag`=?', array($tag));
     }
     $DB->Update('DELETE FROM `tbx_video_tag` WHERE `frequency` < 1');
 }
Exemplo n.º 23
0
 function GetTable()
 {
     $vDB = GetDB();
     $vTab =& new TTable('rb_clinical_outcomes', '*', '', 'name', 'id');
     $vTab->AddColumn('name', 'Наименование');
     $vTab->AddBoolColumn('can_skip_ill_doc_on_disability', "В случае указания\nнетрудоспособности\nможет быть опущен б/л");
     $vTab->AddBoolColumn('can_use_ill_doc_in_ability', "Б/л может быть\nуказан при сохранении\nтрудоспособности");
     $vTab->AddBoolColumn('req_epicrisis', "Требуется указание\nэпикриза при печати\nистории болезни");
     $vTab->AddRowAction('изменить', 'clinical_outcome_edit.html?id=');
     $vTab->AddTableAction('новая запись', 'clinical_outcome_edit.html');
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 24
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vFields = 'emst_rg.*, emst_cases.last_name, emst_cases.first_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male,' . 'emst_cases.addr_reg_street,  emst_cases.addr_reg_num,  emst_cases.addr_reg_subnum,  emst_cases.addr_reg_apartment,' . 'emst_cases.addr_phys_street, emst_cases.addr_phys_num, emst_cases.addr_phys_subnum, emst_cases.addr_phys_apartment,' . 'emst_cases.phone';
     $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Exemplo n.º 25
0
 function GetTable()
 {
     $vDB = GetDB();
     $vTab =& new TTable('users', '*', '', 'login', 'id');
     $vTab->AddColumn('login', 'Логин');
     $vTab->AddColumn('full_name', 'ФИО');
     $vTab->AddColumn('eisCode', 'Код ЕИС ОМС');
     $vTab->AddColumn('roles', 'Роли', array('fmt' => 'tcfRoles'));
     $vTab->AddColumn('retired', 'Запрещён', array('align' => 'center', 'fmt' => 'tcfBoolean'));
     $vTab->AddRowAction('изменить', 'user_edit.html?id=');
     $vTab->AddTableAction('новый', 'user_edit.html');
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 26
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $_GET);
     $vTab =& new TCasesTableEx($vTable, 'emst_cases.*, emst_surgeries.manipulation_text, rb_manipulations.name as manipulation_name', $vFilter, $vOrder);
     $vTab->AddColumn('manipulation_name', 'Манипуляция');
     $vTab->AddColumn('manipulation_text', 'Описание');
     $vFilter = array();
     CopyRecordDateValue($vFilter, $_GET, 'beg_date');
     CopyRecordDateValue($vFilter, $_GET, 'end_date');
     $vTab->AddTableAction('печать', CompoundURL('plasters_list.pdf', $vFilter));
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 27
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $_GET);
     $vTab =& new TCasesTableEx($vTable, 'emst_cases.*, rb_antitetanus.name as antitetanus_name', $vFilter, $vOrder);
     $vTab->AddColumn('antitetanus_name', 'Прививка');
     $vTab->AddColumn('antitetanus_series', 'Серия');
     $vFilter = array();
     CopyRecordDateValue($vFilter, $_GET, 'beg_date');
     CopyRecordDateValue($vFilter, $_GET, 'end_date');
     $vTab->AddTableAction('печать', CompoundURL('antitetanuses_list.pdf', $vFilter));
     $vTab->AddTableAction('сводный отчет', CompoundURL('antitetanuses_report.pdf', $vFilter));
     $vResult = $vTab->ProduceHTML($vDB, $_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Exemplo n.º 28
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $_GET);
     $vTab =& new TCasesTable($vTable, 'emst_cases.*', $vFilter, $vOrder);
     //        $vTab->AddRowAction('изменить',  'case_edit.html?id=');
     //        $vTab->AddRowAction('печать', '/reg/case.pdf?id=');
     //        $vTab->AddRowAction('"заключение..."',  '/info/conclusion.html?id=');
     $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->AddRowAction('"заключение..."',  '/info/conclusion.html?id=');
     $vTab->AddTableAction('новая', 'case_edit.html');
     $vResult = $vTab->ProduceHTML($vDB, GetPageIdxOrLast(), 20);
     return $vResult;
 }
Exemplo n.º 29
-1
 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'));
 }
Exemplo n.º 30
-1
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vRecords = $vDB->Select($vTable, 'emst_surgeries.*, emst_cases.first_name, emst_cases.last_name, emst_cases.patr_name, emst_cases.is_male, emst_cases.born_date, emst_cases.doc_type_id, emst_cases.doc_series, emst_cases.doc_number, emst_cases.polis_series, emst_cases.polis_number, emst_cases.addr_reg_street, emst_cases.addr_reg_num, emst_cases.addr_reg_subnum, emst_cases.addr_reg_apartment, emst_cases.phone, emst_cases.employment_category_id, emst_cases.employment_place, emst_cases.profession, emst_cases.disability_from_date', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }