public function actionSearch() { $persons = new stdClass(); $persons->status = ''; $kbp = (string) filter_input(INPUT_POST, 's'); if ($kbp !== '') { // NGP::GetOFOMSObject() Функция подключается к порталу ОФОМС и возвращает объект с результатом или строку с ошибкой $ofoms_result = NGP::GetOFOMSObject('services/search-uri', '&s=' . $kbp . '&rtype=json'); if (!is_string($ofoms_result)) { $person = new stdClass(); $persons->general = array(); if ($ofoms_result['status'] >= 0) { if (isset($ofoms_result['persons'])) { foreach ($ofoms_result['persons'] as $v1) { foreach (array_keys($v1) as $k1) { $str1 = 'ofoms_' . $k1; $person->{$str1} = $v1[$k1]; } array_push($persons->general, clone $person); } } } else { $persons->status = $ofoms_result['message']; } } else { $persons->status = $ofoms_result; } } else { $persons->status = 'Отправлена пустая строка'; } echo json_encode($persons); }
public function Save() { if ($this->validate()) { $kbp = mb_substr($this->ofoms_fam, 0, 3, 'utf-8') . mb_substr($this->ofoms_im, 0, 1, 'utf-8') . mb_substr($this->ofoms_ot === '' ? ' ' : $this->ofoms_ot, 0, 1, 'utf-8') . mb_substr($this->ofoms_dr, 2, 2, 'utf-8'); // NGP::GetOFOMSObject() Функция подключается к порталу ОФОМС и возвращает объект с результатом или строку с ошибкой $ofoms_result = NGP::GetOFOMSObject('services/attach-person', '&typemp=1&ffio=' . $kbp . '&policy=' . $this->ofoms_enp . '&doctor=' . $this->ofoms_doc_inn . '&rtype=json'); if (!is_string($ofoms_result) && $ofoms_result['status'] !== 1) { throw new CHttpException(500, $ofoms_result['message']); } } else { throw new CHttpException(500, json_encode($this->getErrors())); } }
</table> </div> </div><!-- header --> <div id="mainmenu"> <?php $this->widget('zii.widgets.CMenu', array('id' => 'main-menu', 'htmlOptions' => array('class' => 'sm sm-simple'), 'items' => array(array('label' => 'Главная', 'url' => array('/')), array('label' => 'Администрирование', 'url' => array('/Configurations/Configuration/index'), 'itemOptions' => array('role' => 'AdministrationMenuShow')), array('label' => 'Портал ОФОМС', 'url' => array('/PortalOFOMS/PortalOFOMS/index'), 'itemOptions' => array('role' => 'PortalOfomsMenuShow')), array('label' => 'Система "Фрегат"', 'url' => array('/Fregat/Fregat/index'), 'itemOptions' => array('role' => 'FregatMenuShow'))))); ?> </div><!-- mainmenu --> <?php echo $content; ?> <div class="clear"></div> <div id="footer"> Copyright © <?php echo date('Y'); ?> Карпов Владимир, БУ "Нижневартовская городская поликлиника". <div style="float: right; position: relative;">Версия (1.<?php echo NGP::GetVersion(); ?> )</div> </div><!-- footer --> </div><!-- page --> </body> </html>