Пример #1
0
 public function Save()
 {
     if ($this->validate()) {
         $model = Generalsettings::model()->findbypk(1);
         $model->attributes = $this->attributes;
         $model->save();
     } else {
         throw new CHttpException(500, json_encode($this->getErrors()));
     }
 }
Пример #2
0
 public static function GetVersion()
 {
     $version = Generalsettings::model()->findbyPk(1);
     return $version->version_base . '.' . $version->version_db . '.' . $version->version_portalofoms . '.' . $version->version_fregat;
 }
 public function actionLoadOfomsConnectContent()
 {
     $OfomsConnect = new OfomsConnect();
     $OfomsConnect->attributes = Generalsettings::model()->findbyPk(1)->attributes;
     $this->renderpartial('/Configuration/OfomsConnectContentDialog', ['OfomsConnect' => $OfomsConnect], false, true);
 }
Пример #4
0
 public function actionTest()
 {
     $model = Generalsettings::model()->findbypk(1);
     var_dump($model->attributes);
     //  $model->ofoms_login = '******';
     // $model->ofoms_password = '******';
     $curl = curl_init();
     curl_setopt_array($curl, array(CURLOPT_URL => 'http://' . $model['ofoms_host'] . ':' . $model['ofoms_port'] . '/services/attach-person', CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => ['Host: ' . $model['ofoms_remotehost'], 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'Accept: */*'], CURLOPT_POST => 1, CURLOPT_POSTFIELDS => 'username='******'ofoms_login'] . '&password='******'ofoms_password'] . '&typemp=1&ffio=КАРВВ86&policy=8148310825000432&doctor=056210397475&rtype=json', CURLOPT_CONNECTTIMEOUT => 10));
     $output = curl_exec($curl);
     curl_close($curl);
     var_dump($output === false ? 'Отсутствует связь с ОФОМС' : $output);
 }