Beispiel #1
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $AParams);
     $this->BegDate = Date2ReadableLong($AParams['beg_date']);
     $this->EndDate = Date2ReadableLong($AParams['end_date']);
     $this->AddPage();
     $vCaseID = 'not an id';
     $vSurgeries = array();
     $vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
     while ($vRecord = $vRecords->Fetch()) {
         $vRecCaseID = $vRecord['case_id'];
         if ($vCaseID !== $vRecCaseID) {
             if (count($vSurgeries) > 0) {
                 $this->OutCard($vCaseID, $vSurgeries);
                 $vSurgeries = array();
             }
             $vCaseID = $vRecCaseID;
         }
         $vSurgeries[] = $vRecord;
     }
     if (count($vSurgeries) > 0) {
         $this->OutCard($vCaseID, $vSurgeries);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #3
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $_GET);
     $vTab =& new TTable($vTable, 'emst_cases.id, emst_cases.last_name, emst_cases.first_name, emst_cases.patr_name, rb_vistit_targets.name as vistit_target', $vFilter, $vOrder);
     //            $vTab->AddDateColumn('date',              'Дата');
     $vTab->AddColumn('id', '№', array('align' => 'right'));
     $vTab->AddColumn('id', 'Фамилия Имя Отчество', array('align' => 'left', 'fmt' => 'tcfName'));
     $vTab->AddColumn('vistit_target', 'Кабинет');
     //            $vTab->AddColumn('date',                  'Дата рождения, полных лет', array('align'=>'left', 'fmt'=>'tcfBornDate'));
     //            $vTab->AddColumn('is_male',               'Пол',           array('align'=>'center', 'fmt'=>'tcfSex'));
     //            $vTab->AddColumn('area',                  'Область');
     //            $vTab->AddBoolColumn('done',              'Выполнено');
     //            $vTab->AddLimTextColumn('description',    'Описание');
     //            $vTab->AddRowAction('изменить',           '/doc/rg_dir_edit.html?id=');
     $vResult = $vTab->ProduceHTML($vDB, @$_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Beispiel #4
0
 function GetTable()
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $_GET);
     $vTab =& new TTable($vTable, 'emst_rg.*, emst_cases.last_name, emst_cases.first_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male', $vFilter, $vOrder);
     $vTab->AddDateColumn('date', 'Дата');
     $vTab->AddColumn('case_id', '№', array('align' => 'right'));
     $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->AddColumn('area', 'Область');
     $vTab->AddBoolColumn('done', 'Выполнено');
     $vTab->AddLimTextColumn('description', 'Описание');
     $vTab->AddRowAction('изменить', '/doc/rg_dir_edit.html?id=');
     $vFilter = array();
     CopyRecordDateValue($vFilter, $_GET, 'beg_date');
     CopyRecordDateValue($vFilter, $_GET, 'end_date');
     $vTab->AddTableAction('печать', CompoundURL('rgs_list.pdf', $vFilter));
     $vResult = $vTab->ProduceHTML($vDB, @$_GET['PageIdx'] + 0, 20);
     return $vResult;
 }
Beispiel #5
0
    $vService = defautService;
}
if (!array_key_exists('paytype', $_GET)) {
    $_GET['paytype'] = 0;
}
// creation
$DBFName = tempnam('/tmp', 'stats');
rename($DBFName, $DBFName . '.dbf');
$DBFName = $DBFName . '.dbf';
$DBFDef = array(array('SURNAME', 'C', 18), array('NAME1', 'C', 15), array('NAME2', 'C', 15), array('BIRTHDAY', 'D'), array('SEX', 'C', 1), array('ORDER', 'C', 1), array('POLIS_S', 'C', 10), array('POLIS_N', 'C', 20), array('POLIS_W', 'C', 5), array('PAYER', 'C', 5), array('STREET', 'C', 45), array('STREETYPE', 'C', 2), array('AREA', 'C', 3), array('HOUSE', 'C', 7), array('KORP', 'C', 2), array('FLAT', 'C', 15), array('PROFILE', 'C', 6), array('PROFILENET', 'C', 1), array('DATEIN', 'D'), array('DATEOUT', 'D'), array('AMOUNT', 'N', 15, 5), array('DIAGNOSIS', 'C', 5), array('SEND', 'L'), array('ERROR', 'C', 25), array('TYPEDOC', 'C', 1), array('SER1', 'C', 10), array('SER2', 'C', 10), array('NPASP', 'C', 10), array('LONGADDR', 'C', 120), array('MYCASEID', 'C', 8), array('CASE_CAST', 'N', 2, 0), array('AMOUNT_D', 'N', 3, 0), array('ID_EXITUS', 'N', 2, 0), array('ILLHISTORY', 'C', 20), array('ID_PRMP', 'N', 3, 0), array('ID_PRMP_C', 'N', 3, 0), array('DIAG_C', 'C', 5), array('DIAG_S_C', 'C', 5), array('DIAG_P_C', 'C', 5), array('QRESULT', 'N', 3, 0), array('ID_PRVS', 'N', 10, 0), array('ID_PRVS_C', 'N', 10, 0), array('ID_SP_PAY', 'N', 2, 0), array('ID_ED_PAY', 'N', 5, 2), array('ID_VMP', 'N', 2, 0), array('ID_DOC', 'C', 20), array('ID_DOC_C', 'C', 20), array('ID_DEPT', 'C', 20), array('ID_DEPT_C', 'C', 20), array('ID_LPU_D', 'N', 20, 0), array('IDSERVDATA', 'N', 10, 0), array('IDSERVMADE', 'N', 1, 0), array('IDSERVLPU', 'N', 10, 0), array('ID_GOAL', 'N', 5, 0), array('ID_GOAL_C', 'N', 5, 0), array('ID_GOSP', 'N', 5, 0), array('IDVIDVME', 'N', 2, 0), array('IDFORPOM', 'N', 2, 0), array('IDVIDHMP', 'N', 2, 0), array('IDMETHMP', 'N', 2, 0), array('ID_PRVS_D', 'N', 10, 0), array('ID_GOAL_D', 'N', 5, 0));
if (!($vDBF = dbase_create($DBFName, $DBFDef))) {
    print "<strong>can't create {$DBFName}!</strong>";
    exit;
}
$vDB = GetDB();
list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $_GET);
$vCaseID = 'not an id';
$vCase = array();
$vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
while ($vRecord = $vRecords->Fetch()) {
    $vRecCaseID = $vRecord['case_id'];
    if ($vCaseID !== $vRecCaseID) {
        $vCaseID = $vRecCaseID;
        $vCase = $vDB->GetById('emst_cases', $vCaseID);
    }
    if ($vCase['paytype'] == $_GET['paytype']) {
        OutSurgery($vDBF, $vCase, $vRecord, $vService);
    }
}
dbase_close($vDBF);
$vHandle = fopen($DBFName, 'rb');