コード例 #1
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $services = new WebServices();
     $servicesListed = $services->getValidServices();
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('socialweb');
     $username = new Zend_Form_Element_Text('account');
     $username->setLabel('Account username: '******'StringTrim', 'StripTags'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid username!')->setDecorators($decorators);
     $service = new Zend_Form_Element_Select('accountName');
     $service->setLabel('Social services: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => 'Choose a service', 'Valid services' => $servicesListed))->addValidator('InArray', false, array(array_keys($servicesListed)))->setDecorators($decorators);
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel('Show this to public users?: ')->addFilters(array('StringTrim', 'StripTags'))->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must set the status of this account');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElements(array($service, $hash, $username, $public, $submit));
     $this->addDisplayGroup(array('accountName', 'account', 'public'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
コード例 #2
0
 public function VerWebServices()
 {
     $webs = WebServices::all();
     foreach ($webs as $ws) {
         $ws->AutorWS = $ws->Autor->NombreUsuario;
     }
     return View::make('WebServices.listawebservices', array('datos' => $webs));
 }
コード例 #3
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $services = new WebServices();
     $servicesListed = $services->getValidServices();
     $this->setName('socialweb');
     $username = new Zend_Form_Element_Text('account');
     $username->setLabel('Account username: '******'StringTrim', 'StripTags'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid username!');
     $service = new Zend_Form_Element_Select('accountName');
     $service->setLabel('Social media services: ')->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a service', 'Valid services' => $servicesListed))->addValidator('InArray', false, array(array_keys($servicesListed)));
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel('Show this to public users?: ')->addFilters(array('StringTrim', 'StripTags'))->setRequired(true)->addErrorMessage('You must set the status of this account');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($service, $hash, $username, $public, $submit));
     $this->addDisplayGroup(array('accountName', 'account', 'public'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
コード例 #4
0
 /**
  * Metodo para instanciar el servicio web 
  */
 public function webServices($url, $login = null, $password = null, $header = null, $nameSpace = null)
 {
     try {
         $socketTime = 15;
         if (!is_null($login) && !is_null($password)) {
             $this->webServices = new Soapclient($url, array('login' => $login, 'password' => $password, 'trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_DISK, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'default_socket_timeout' => $socketTime));
         } else {
             $this->webServices = new Soapclient($url, array('trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_DISK, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'default_socket_timeout' => $socketTime));
         }
         //Creacion de cabeceras para webServices
         if (is_object($header) && !is_null($header)) {
             $authVals = new SoapVar($header, SOAP_ENC_OBJECT);
             $header = new SOAPHeader($nameSpace, 'authenticate', $authVals);
             $this->webServices->__setSoapHeaders($header);
         }
         return true;
     } catch (SoapFault $exc) {
         throw new Exception($exc->getMessage());
     }
     return false;
 }
コード例 #5
0
 public function actionReloadphoto($id)
 {
     $model = $this->loadModel($id);
     WebServices::getPersonPhotoByCodeU($model->codeU);
     $this->renderPartial('_photo', array('model' => $model));
 }
コード例 #6
0
 public function actionAtestatvalue()
 {
     $pk = $_POST["pk"];
     $value = $_POST["value"];
     if (!is_numeric($value)) {
         throw new CHttpException(404, "Помилковий формат!");
     }
     $model = $this->loadModel($pk);
     $model->scenario = "FULLINPUT";
     $old_value = $model->AtestatValue;
     $model->AtestatValue = $value;
     if (empty($model->edboID)) {
         throw new CHttpException(404, "Необхідно синхронізувати документ!");
     }
     try {
         if ($model->save()) {
             try {
                 $res = WebServices::updateDocumentBall($model->idDocuments);
             } catch (Exception $we) {
                 $model->AtestatValue = $old_value;
                 $model->save();
                 throw $we;
             }
         } else {
             throw new CHttpException(404, print_r($model->getErrors(), 1));
         }
     } catch (Exception $e) {
         throw new CHttpException(404, $e->getMessage());
     }
     echo $res;
 }
コード例 #7
0
 public function actionDocsendproc()
 {
     if (isset($_REQUEST["idPerson"])) {
         try {
             $res = WebServices::updatePersonDoc($_REQUEST["idPerson"]);
             $msg = "<ul>";
             $res = CJSON::decode($res);
             foreach ($res as $item) {
                 $item = (object) $item;
                 $doc = PersonDocumentTypes::model()->find("idPersonDocumentTypes = " . $item->idType);
                 $msg .= "<li>" . $doc->PersonDocumentTypesName . " - ";
                 if ($item->editStatus == 1) {
                     $msg .= "ок!";
                 } else {
                     $msg .= "error! - " . $item->message;
                 }
                 $msg .= "</li>";
             }
             $msg .= "</ul>";
             echo $msg;
         } catch (Exception $ex) {
             echo $ex->getMessage();
         }
     } else {
         echo "Необхыдно вказати ідентифікатор персони.";
     }
 }
コード例 #8
0
 /**
  * Ajax photoreloader
  * @param integer $id
  */
 public function actionReloadphoto($id)
 {
     try {
         $temp_dir = sys_get_temp_dir();
         $model = $this->loadModel($id);
         //$model = new Person;
         //$model->scenario = "PHOTO";
         $edbeo_file = WebServices::getPersonPhotoByCodeU($model->codeU);
         if (!empty($edbeo_file)) {
             $oldPhoto = $model->PhotoName;
             $tfio = Transliteration::translit2010($model->FirstName) . "_" . Transliteration::translit2010($model->LastName) . "_" . Transliteration::translit2010($model->MiddleName);
             $model->PhotoName = "person_{$id}" . "_{$tfio}.jpg";
             $path = Yii::app()->basePath . "/.." . Yii::app()->params['photosPath'];
             $bigpath = Yii::app()->basePath . "/.." . Yii::app()->params['photosBigPath'];
             $img = EWideImage::loadFromString(base64_decode($edbeo_file));
             if ($img->getWidth() < $img->getHeight()) {
                 $img->resize(120, null)->crop("center", "middle", 120, 150)->saveToFile($path . "person_{$id}" . "_{$tfio}.jpg");
                 $img->resize(180, null)->crop("center", "middle", 180, 225)->saveToFile($bigpath . "person_{$id}" . "_{$tfio}.jpg");
             } else {
                 $img->resize(null, 150)->crop("center", "middle", 120, 150)->saveToFile($path . "person_{$id}" . "_{$tfio}.jpg");
                 $img->resize(null, 225)->crop("center", "middle", 180, 225)->saveToFile($bigpath . "person_{$id}" . "_{$tfio}.jpg");
             }
             if ($model->save()) {
                 //PC::debug($model->PhotoName);
             } else {
                 //PC::debug(print_r($model->getErrors()));
             }
             echo CJSON::encode(array("result" => "SUCCESS", "data" => Yii::app()->request->baseUrl . Yii::app()->params['photosPath'] . $model->PhotoName));
         } else {
             echo CJSON::encode(array("result" => "ERROR", "data" => "Фото відсутнє!"));
         }
     } catch (Exception $e) {
         if (defined('YII_DEBUG')) {
             Yii::log($e->getMessage(), CLogger::LEVEL_INFO, 'actionReloadphoto');
         }
         echo CJSON::encode(array("result" => "ERROR", "data" => $e->getMessage()));
     }
 }
コード例 #9
0
ファイル: ECservices.php プロジェクト: watsocd/EnergyChaser2
<?php

/**
 * Created by PhpStorm.
 * User: Chuck
 * Date: 5/5/2015
 * Time: 10:27 AM
 */
include 'WebServices/WebServices.php';
$ws = new WebServices();
$ws->ws();
コード例 #10
0
ファイル: quotes_result.php プロジェクト: juanfdp/pagina-smi
<?php

include 'logic/parametros.php';
include 'logic/cotizador.php';
include 'logic/functions.php';
include 'logic/WebServices.php';
//INSTANCIA DE LA CLASE ENCARGADA DE LOS PARAMETROS
//////////ATRIBUTOS
$func = new functions();
$cotizador = new cotizador();
$productosEnLista = array();
$productosTemp = array();
$pasajerosCotizacion = array();
//GUARDAMOS REFERENCIA A LOS PASAJEROS QUE SE ESTAN COTIZANDO
$param = new parametros();
$ws = new WebServices();
////////// FIN ATRIBUTOS
////////// PAGINADOR
//LIMITAMOS EL TAMAÑO DE LA PAGINA
$TAMANO_PAGINA = 10;
//examino la p�gina a mostrar y el inicio del registro a mostrar
$pagina = $_GET["st"];
$estado = $_GET["estado"];
if (!$pagina) {
    $inicio = 0;
    $pagina = 1;
} else {
    $inicio = ($pagina - 1) * $TAMANO_PAGINA;
}
//////////  FIN PAGINADOR
?>
コード例 #11
0
 public function actionEducationsinfo($idperson)
 {
     $msg = "";
     $type = "info";
     $count = 0;
     $model = Person::model()->findByPk($idperson);
     if (!empty($model) && !empty($model->codeU)) {
         try {
             $res = WebServices::getPersonBaseEducations($model->codeU);
             $res = CJSON::decode($res);
             if (is_array($res)) {
                 $msg .= "<ul>";
                 foreach ($res as $item) {
                     $item = (object) $item;
                     if ($item->qualificationName == "Бакалавр") {
                         $type = "info";
                         $msg .= "<li>";
                         $msg .= $item->personEducationFormName . " : " . $item->personEducationPaymentTypeName . " : " . $item->qualificationName . " : " . $item->specDirectionName . " : " . $item->universityFullName;
                         $msg .= "</li>";
                         $count++;
                     } else {
                         $tmp = "<li>";
                         $tmp .= $item->personEducationFormName . " : " . $item->personEducationPaymentTypeName . " : " . $item->qualificationName . " : " . $item->specDirectionName . " : " . $item->universityFullName;
                         $tmp .= "</li>";
                         Yii::log($tmp);
                         Yii::log(print_r($item, 1));
                     }
                 }
                 $msg .= "</ul>";
             }
             if ($count == 0) {
                 $msg = "Попередня освіта відсутня або не зареестровано у базі ЄДБО";
                 $type = "success";
             } else {
                 $type = "warning";
                 $msg .= "<h3>Заявки даної персони може приймати тільки оператор 116 аудиторії!</h3>";
             }
         } catch (Exception $e) {
             $msg = $e->getMessage();
             $type = "error";
         }
     } else {
         $msg .= "Необхідно синхронізувати персону!";
         $type = "warning";
     }
     Yii::app()->user->setFlash($type, $msg);
 }
コード例 #12
0
        width: 500px;
    }
</style>
<?php 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$requests = Personspeciality::model()->findAll("SepcialityID = {$specid}");
echo "<div> Обрано " . count($requests) . " заявок. </div>";
$i = 0;
foreach ($requests as $item) {
    $msg = "";
    try {
        $res = WebServices::getPersonBaseEducations($item->person->codeU);
        $res = CJSON::decode($res);
        if (is_array($res)) {
            $msg .= "";
            foreach ($res as $obj) {
                $obj = (object) $obj;
                if (!(strpos($obj->universityFullName, "Запорізький національний університет") > 0)) {
                    $msg .= $obj->personEducationFormName . " : " . $obj->personEducationPaymentTypeName . " : " . $obj->qualificationName . " : " . $obj->specDirectionName . " : " . $obj->universityFullName;
                } else {
                    $msg = " немає ";
                }
            }
        }
    } catch (Exception $e) {
        $msg = $e->getMessage();
    }
コード例 #13
0
ファイル: _photo.php プロジェクト: upmunspel/abiturient
        <?php 
$url = Yii::app()->createUrl("photoloader/reloadphoto", array('id' => $model->idPerson));
$this->widget('bootstrap.widgets.TbButton', array('label' => '', 'type' => 'primary', 'size' => null, 'icon' => 'arrow-left', 'loadingText' => '...', 'htmlOptions' => array('id' => 'addSpec', 'onclick' => "PSN.reloadPersonPhote(this,'{$url}');", 'title' => "Замінити існуюче фотографію")));
?>
        <?php 
$url = Yii::app()->createUrl("person/reloadphoto", array('id' => $model->idPerson));
$this->widget('bootstrap.widgets.TbButton', array('label' => '', 'icon' => 'refresh', 'type' => 'primary', 'size' => null, 'loadingText' => '...', 'htmlOptions' => array('id' => 'addSpec', 'onclick' => "PSN.updatePersonPhote(this,'{$url}');", 'title' => "Оновити", 'style' => "margin-top: 10px;")));
?>
    </div>
    <div class="span5" >
        <b>У ЄДБО</b>
        <a href="#" style="width: 120px;" class="thumbnail" rel="tooltip" data-title="Фото абітурієнта">
            <?php 
$photo_exist = Yii::app()->cache->get($model->codeU);
if (!empty($model->codeU) && !empty($photo_exist)) {
    $photo = WebServices::getPersonPhotoByCodeU($model->codeU);
    if (!empty($photo)) {
        echo '<img src="data:image/gif;base64,' . $photo . '" />';
    } else {
        $path = Yii::app()->baseUrl . Yii::app()->params['photosPath'] . Yii::app()->params['defaultPersonPhotoSmall'];
        echo CHtml::image($path, 'Фото абітурієнта');
    }
} else {
    $path = Yii::app()->baseUrl . Yii::app()->params['photosPath'] . Yii::app()->params['defaultPersonPhotoSmall'];
    echo CHtml::image($path, 'Фото абітурієнта');
}
?>
        </a>
    </div>
    <?php 
if (Yii::app()->user->hasFlash("photomessage")) {