/**
  * generate model files
  */
 public function run()
 {
     foreach ($this->soapClient->__getTypes() as $t) {
         $typeContent = $this->getTypeContent($t);
         if (is_array($typeContent) && isset($typeContent['content'])) {
             $file = SOAP_OUTPUT_BASE_DIR . '/' . SOAP_MODEL_DIR . '/' . $typeContent['class'] . '.class.php';
             if (file_put_contents($file, $typeContent['content']) === false) {
                 $this->logger->err('can not write file ' . $file . ' check if permissions are correct.');
             } else {
                 $this->logger->debug('write new model file: ' . $file);
             }
         }
     }
 }
 /**
  * 首页
  */
 public function index()
 {
     if (!class_exists("SoapClient")) {
         exit("请开启Soap扩展!");
     }
     $ws = "http://www.webservicex.net/globalweather.asmx?wsdl";
     //webservice服务的地址
     $ws = "http://122.224.230.4:18003/newyorkWS/ws/CheckGoodsDecl?wsdl";
     //        $ws = "http://122.224.230.4:18003/newyorkWS/ws/ReceivedDeclare?wsdl";
     $client = new \SoapClient($ws);
     /*
      * 获取SoapClient对象引用的服务所提供的所有方法
      */
     echo "SOAP服务器提供的开放函数:";
     echo '<pre>';
     var_dump($client->__getFunctions());
     //获取服务器上提供的方法
     echo '</pre>';
     echo "SOAP服务器提供的Type:";
     echo '<pre>';
     var_dump($client->__getTypes());
     //获取服务器上数据类型
     echo '</pre>';
     echo "执行GetGUIDNode的结果:";
     //        $result=$client->checkReceived(array('xmlStr'=>'zhengzhou','xmlType'=>'IMPORT_COMPANY','sourceType'=>'1'));//查询中国郑州的天气,返回的是一个结构体
     //        var_dump($result);
     $result = $client->check(array('companyCode' => 'zhengzhou', 'subCarriageNo' => '1'));
     //查询中国郑州的天气,返回的是一个结构体
     dump(simplexml_load_string($result->return));
     //        $this->display();
     //        echo $result->return;
     exit;
 }
Example #3
0
 private function checkSoapClient()
 {
     try {
         $defaultTimeout = ini_get("default_socket_timeout");
         ini_set("default_socket_timeout", 15);
         $soapClient = new \SoapClient($this->getWSDLUrl());
         $this->aMethods = $soapClient->__getFunctions();
         $this->aTypes = $soapClient->__getTypes();
         $this->setEstado(true);
     } catch (SoapFault $f) {
         $mensajeError = '';
         $msg = $f->faultstring;
         if (strstr($msg, 'failed to load external entity')) {
             $mensajeError = 'Error de conexi&oacute;n - ';
         } else {
             if ($f->faultcode == 'HTTP' && strstr(strtolower($f->faultstring), 'error fetching http headers')) {
                 $mensajeError = 'Tiempo de espera superado - ';
             }
         }
         $mensajeError .= $msg;
         $this->setEstado(false);
         $this->setMensaje($mensajeError);
     }
     ini_set("default_socket_timeout", $defaultTimeout);
     return $this->getEstado();
 }
 /**
  * Возвращает экземпляр Resolver на основе переданного SOAP клиента
  *
  * @param \SoapClient $client Клиент
  *
  * @return Resolver
  */
 public static function createFromClient(\SoapClient $client)
 {
     $functions = $client->__getFunctions();
     $types = $client->__getTypes();
     $functionParser = new FunctionParser($functions);
     $typeParser = new TypeParser($types);
     return new Resolver($functionParser->getFunctions(), $typeParser->getTypes());
 }
Example #5
0
 /**
  * Return a list of SOAP types
  *
  * @return array
  * @throws Zend_Soap_Client_Exception
  */
 public function getTypes()
 {
     if ($this->getWsdl() == null) {
         throw new Zend_Soap_Client_Exception('\'getTypes\' method is available only in WSDL mode.');
     }
     if ($this->_soapClient == null) {
         $this->_initSoapClientObject();
     }
     return $this->_soapClient->__getTypes();
 }
 function __construct($wsdlurl)
 {
     $client = new SoapClient($wsdlurl);
     $functions = $client->__getFunctions();
     $typeStrings = $client->__getTypes();
     $types = array();
     foreach ($typeStrings as $t) {
         $types = $types + $this->extractParameterInfo($t);
     }
     $this->types = $types;
     $operations = array();
     foreach ($functions as $f) {
         $operation = $this->extractFunctionInfo($types, $f);
         $key = $operation->toString();
         if (!array_key_exists($key, $operations)) {
             $operations[$key] = $operation;
         }
     }
     $this->operations = $operations;
     // 			var_dump($client->);
     // 			echo "<br />";
 }
 /**
  * @link http://php.net/manual/en/soapclient.gettypes.php
  *
  * @return array
  */
 public function __getTypes()
 {
     return parent::__getTypes();
 }
Example #8
0
 /**
  * figure out what soap functions and types are available
  * @param object $client Soap Client
  * @returns string $Response soap result
  */
 public function fun_NWMLS_getSoapInfo()
 {
     $WSDL = $this->WSDL;
     $client = new SoapClient($WSDL, array('trace' => 1));
     //trace for getLastResponse();
     //debug (and figuring out what to do!)
     //get functions and params
     var_dump($client->__getFunctions());
     var_dump($client->__getTypes());
     $Response = $client->__getLastResponse();
     echo "\n\n\n";
     echo "Response:{$Response}\n";
     echo "\n\n\n";
     //debug
     //echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; //Shows query just sent
     //echo "RESPONSE:\n" . $client->__getLastResponse() . "\n"; //gets the data
     return $Response;
 }
Example #9
0
    echo "<td>";
    echo "<pre>" . print_r($client->__getFunctions(), true) . "</pre>";
    echo "</td>";
    echo "</tr>";
    echo "</tbody>";
    echo "</table>";
    echo "<table>";
    echo "<thead>";
    echo "<tr align='left'>";
    echo "<th>__getTypes()</th>";
    echo "</tr>";
    echo "</thead>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td>";
    echo "<pre>" . print_r($client->__getTypes(), true) . "</pre>";
    echo "</td>";
    echo "</tr>";
    echo "</tbody>";
    echo "</table>";
} catch (SoapFault $fault) {
    echo "<table>";
    echo "<thead>";
    echo "<tr>";
    echo "<th>SOAP Fault</th>";
    echo "</tr>";
    echo "</thead>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td>";
    echo "<pre>";
Example #10
0
<?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.
 */
ini_set('soap.wsdl_cache_enabled', '0');
//关闭缓存
$soap = new SoapClient('http://wl.com/api.php/soap/op/api');
echo "提供的方法\n";
print_r($soap->__getFunctions());
echo "相关的数据结构\n";
print_r($soap->__getTypes());
var_dump($soap->receive(array('arg0' => file_get_contents(SITE_ROOT . 'YUN.xml')))->return);
Example #11
0
<?php

ini_set("soap.wsdl_cache_enabled", "0");
$myClient = new SoapClient("http://rtls.gg/ws/wsdl.php");
foreach ($myClient->__getFunctions() as $item) {
    echo $item . "<br>";
}
echo "<hr>";
foreach ($myClient->__getTypes() as $item) {
    echo $item . "<br>";
}
echo "<hr>";
echo var_dump($myClient->getPeople());
/*
foreach($myClient->getPeople() as $item) {
	echo $item->getFullName();
}
*/
Example #12
0
<?php

//load the wsdl file
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//functions are now available to be called
$result = $client->soapFunc("hello");
$result = $client->anotherSoapFunc(34234);
//SOAP Information
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//list of SOAP types
print_r($client->__getTypes());
//list if SOAP Functions
print_r($client->__getFunctions());
    /**
     * Instantiate service, set SOAP header with credentials
     *
     * @param string $wsdl      Path to WSDL
     * @param string $username  Username
     * @param string $password  Password 
     */
    public function __construct($wsdl, $username, $password)
    {
        $params = array('encoding' => 'utf-8', 'trace' => 1, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP);
        $client = new SoapClient($wsdl, $params);
        $classmap = array();
        // at a high level, the following code takes a SOAP struct definition and
        // translates it to valid PHP, which then gets eval()ed, so we can pass
        // the resulting classes as the classmap param to the SoapClient ctor,
        // which means we'll return the correct type of obj instead of stdClass.
        foreach ($client->__getTypes() as $type) {
            $tokens = SoapTypeTokenizer::tokenize($type);
            $len = count($tokens);
            $properties['classes'] = array();
            $properties['other'] = array();
            if ($tokens[0]['token'] !== SOAP_TYPE_STRUCT) {
                continue;
            }
            // ignore types that aren't structs
            for ($i = 0; $i < $len; ++$i) {
                $code = $tokens[$i]['code'];
                $token = $tokens[$i]['token'];
                if ($code === SOAP_NATIVE_TYPE) {
                    if ($token === SOAP_TYPE_STRUCT) {
                        $classCode = 'class ';
                        $i += 2;
                        // skip whitespace token
                        $code = $tokens[$i]['code'];
                        $token = $tokens[$i]['token'];
                        // token is now the name of the struct
                        // add to classmap
                        $classmap[$token] = $token;
                        // if class exists (classes can be user-defined if add'l functionality is desired)
                        // we still want it in the classmap (above), but we don't want to re-declare it.
                        if (class_exists($token)) {
                            continue 2;
                        }
                        $classCode .= $token . ' {';
                        $i += 3;
                        // skip whitespace, semicolon tokens
                    } else {
                        // some sort of SOAP type for a property, like dateTime
                        // we don't care about it, we just want the name
                        $i += 2;
                        // skip whitespace token
                        $name = $tokens[$i]['token'];
                        $properties['other'][] = $name;
                    }
                } elseif ($code === SOAP_USER_TYPE) {
                    // user-defined class
                    $i += 2;
                    // skip whitespace token
                    $name = $tokens[$i]['token'];
                    $properties['classes'][$name] = $token;
                }
            }
            // property definition section
            foreach ($properties['classes'] as $key => $class) {
                $classCode .= 'public $' . $key . ';';
            }
            foreach ($properties['other'] as $class) {
                $classCode .= 'public $' . $class . ';';
            }
            // create ctor
            $classCode .= 'public function __construct(';
            // populate ctor args
            foreach ($properties['other'] as $key => $class) {
                $classCode .= '$' . $class . ' = null,';
            }
            // remove extraneous trailing ',' if there
            if (substr($classCode, -1, 1) === ',') {
                $classCode = substr($classCode, 0, -1);
            }
            // close args
            $classCode .= ')';
            // open ctor
            $classCode .= '{';
            // store ctor args as class properties
            foreach ($properties['other'] as $key => $class) {
                $classCode .= '$this->' . $class . ' = $' . $class . ';';
            }
            // instantiate member properties that are classes
            foreach ($properties['classes'] as $key => $class) {
                $classCode .= '$this->' . $key . ' = new ' . $class . '();';
            }
            // close ctor
            $classCode .= '}';
            // close class
            $classCode .= '}';
            eval($classCode);
        }
        // create another instance of the SoapClient, this time using the classmap
        $params['classmap'] = $classmap;
        $this->_instance = new SoapClient($wsdl, $params);
        // no way to do this without creating a SoapVar or patching __doRequest (by extending SoapClient)
        $authXML = <<<EOT
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>{$username}</wsse:Username>
            <wsse:Password>{$password}</wsse:Password>
         </wsse:UsernameToken>
    </wsse:Security>
EOT;
        $authVar = new SoapVar($authXML, XSD_ANYXML);
        $authHeader = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $authVar);
        $this->_instance->__setSoapHeaders($authHeader);
    }
Example #14
0
echo '<br/>';
$client = new SoapClient("https://webportal.gtldc.net/InmatePin/InmateService.svc?wsdl");
//$client->__setLocation("https://webportal.gtldc.net/InmatePin/InmateService.svc/basic");
//$response = $client->MethodName(array( "paramName" => "paramValue" ... ));
echo 'Connection made';
echo '<br/>';
echo 'setting up security';
echo '<br/>';
try {
    $availFunctions = $client->__getFunctions();
    foreach ($availFunctions as $value) {
        //echo $value;
        //echo '<br/>';
    }
    echo '<br/>';
    $availClass = $client->__getTypes();
    foreach ($availClass as $value) {
        //echo $value;
        //echo '<br/>';
    }
    echo '<br/>';
    $securityID = '';
    $transID = '';
    //$SOAPsecurityID = new SoapVar("Guid", "{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
    //$securityID = $client->guid("{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
    $subID = "CI01";
    //$transID = $client->Guid->NewGuid();
    echo 'Security setting created';
    echo '<br/>';
    $params = array('transID' => $transID, 'securityID' => '{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}', 'inmateid' => "111111", 'subID' => $subID, 'comment' => "Test Search");
    $getInfo = $client->InmateGetInfo($params);
<?php

if (!isset($_GET['wsdl'])) {
    die("Invalid parameters");
}
// $wsdl = 'http://www.sxzkc.cn/Tools/SwfUpload/SwfUploadService.asmx?wsdl';
header('Content-Type: application/json');
try {
    $wsdl = $_GET['wsdl'];
    $xmldata = @file_get_contents($wsdl);
    $client = new SoapClient($wsdl);
    $result = array();
    $data = array('init' => true);
    foreach ($client->__getTypes() as $type) {
        foreach (explode("\n", $type) as $line) {
            if (preg_match('/struct ([^\\s]+)\\s+{/', $line, $matches)) {
                if (!isset($data['init']) && !preg_match('/Response$/', $data['name'])) {
                    $result[] = $data;
                }
                $data = array('param' => array(), 'name' => $matches[1]);
            } else {
                if (preg_match('/\\s+([^\\s]+)\\s+([^\\s]+);/', $line, $matches)) {
                    $data['param'][$matches[2]] = $matches[1];
                }
            }
        }
    }
    echo json_encode($result, null, 4);
} catch (Exception $e) {
    echo json_encode(array());
}
Example #16
0
 /**
  * Loads all type classes
  *
  * @access private
  */
 private function loadTypes()
 {
     $this->log($this->display('Loading types'));
     $types = $this->client->__getTypes();
     foreach ($types as $typeStr) {
         $wsdlNewline = strpos($typeStr, "\r\n") ? "\r\n" : "\n";
         $parts = explode($wsdlNewline, $typeStr);
         $tArr = explode(" ", $parts[0]);
         $restriction = $tArr[0];
         $className = $tArr[1];
         if (substr($className, -2, 2) == '[]' || substr($className, 0, 7) == 'ArrayOf') {
             // skip arrays
             continue;
         }
         $arrayVars = $this->findArrayElements($className);
         $type = null;
         $numParts = count($parts);
         // ComplexType
         if ($numParts > 1) {
             $type = new ComplexType($className);
             $this->log($this->display('Loading type ') . $type->getPhpIdentifier());
             for ($i = 1; $i < $numParts - 1; $i++) {
                 $parts[$i] = trim($parts[$i]);
                 list($typename, $name) = explode(" ", substr($parts[$i], 0, strlen($parts[$i]) - 1));
                 $name = $this->cleanNamespace($name);
                 if (array_key_exists($name, $arrayVars)) {
                     $typename .= '[]';
                 }
                 $nillable = false;
                 foreach ($this->schema as $schema) {
                     $tmp = $schema->xpath('//xs:complexType[@name = "' . $className . '"]/descendant::xs:element[@name = "' . $name . '"]/@nillable');
                     if (!empty($tmp) && (string) $tmp[0] == 'true') {
                         $nillable = true;
                         break;
                     }
                 }
                 $type->addMember($typename, $name, $nillable);
             }
         } else {
             // Enum or Pattern
             $typenode = $this->findTypenode($className);
             if ($typenode) {
                 // If enum
                 $enumerationList = $typenode->getElementsByTagName('enumeration');
                 $patternList = $typenode->getElementsByTagName('pattern');
                 if ($enumerationList->length > 0) {
                     $type = new Enum($className, $restriction);
                     $this->log($this->display('Loading enum ') . $type->getPhpIdentifier());
                     foreach ($enumerationList as $enum) {
                         $type->addValue($enum->attributes->getNamedItem('value')->nodeValue);
                     }
                 } elseif ($patternList->length > 0) {
                     // If pattern
                     $type = new Pattern($className, $restriction);
                     $this->log($this->display('Loading pattern ') . $type->getPhpIdentifier());
                     $type->setValue($patternList->item(0)->attributes->getNamedItem('value')->nodeValue);
                 } else {
                     continue;
                     // Don't load the type if we don't know what it is
                 }
             }
         }
         if ($type != null) {
             $already_registered = false;
             if ($this->config->getSharedTypes()) {
                 foreach ($this->types as $registered_types) {
                     if ($registered_types->getIdentifier() == $type->getIdentifier()) {
                         $already_registered = true;
                         break;
                     }
                 }
             }
             if (!$already_registered) {
                 $this->types[] = $type;
             }
         }
     }
     $this->log($this->display('Done loading types'));
 }
Example #17
0
    exit(0);
}
if (isset($_GET['lon'])) {
    $start_lon = $_GET['lon'];
} else {
    exit(0);
}
$map_app = array('CME' => 2, 'SEP' => 4, 'CIR' => 5);
if (!isset($map_app[$modele])) {
    exit(0);
}
$soapClient1 = new SoapClient("http://cagnode58.cs.tcd.ie:8080/helio-hps-server/hpsService?wsdl", array("trace" => 1, "exceptions" => 1));
// Create PHP class from wsdl type definition
$clientName = "hpsclient";
$types = array();
foreach ($soapClient1->__getTypes() as $type) {
    /* match the type information  using a regualr expession */
    preg_match("/([a-z0-9_]+)\\s+([a-z0-9_]+(\\[\\])?)(.*)?/si", $type, $matches);
    $type = $matches[1];
    //var_dump($matches);print "<BR><BR>\n";
    switch ($type) {
        /* if the data type is struct, we create a class with this name */
        case 'struct':
            $name = $matches[2];
            /* the PHP class name will be ClientName_WebServiceName */
            $className = $clientName . '_' . $name;
            /* store the data type information in an array for later use in the classmap */
            $types[$name] = $className;
            /* check the class does not exsits before creating it */
            if (!class_exists($className)) {
                eval("class {$className} {}");
Example #18
0
 /**
  * получения методов SOAP
  */
 public function getTypes()
 {
     $client = new SoapClient("https://test.pvbki.com/reverse-service/Default.asmx?WSDL", array("trace" => 1, "exceptions" => 0));
     echo '<pre>';
     echo '<h2>Types:</h2>';
     $types = $client->__getTypes();
     foreach ($types as $type) {
         $type = preg_replace(array('/(\\w+) ([a-zA-Z0-9]+)/', '/\\n /'), array('<font color="green">${1}</font> <font color="blue">${2}</font>', "\n\t"), $type);
         echo $type;
         echo "\n\n";
     }
     echo '</pre>';
 }
 public function actionPio()
 {
     echo "  falta copmpraer " . Desolpe::model()->findByPk(730)->cuantofaltacomprar();
     yii::app()->end();
     echo "  del material azufre <br>";
     echo "   una caja   vale :  " . Alconversiones::convierte('18004728', '190') . "     unidades <br>";
     echo "   un KG  vale :  " . Alconversiones::convierte('18004728', '123') . "     unidades <br>";
     echo "   unA caja  vale :  " . Alconversiones::convierte('18004728', '190', '120') . "     unidades <br>";
     echo "   unA UNIDAD  vale :  " . Alconversiones::convierte('18004728', '120', '190') . "    CAJAS <br>";
     echo "   un KG  vale :  " . Alconversiones::convierte('18004728', '123', '120') . "     unidades <br>";
     echo "   unA UNIDAD  vale :  " . Alconversiones::convierte('18004728', '120', '123') . "    KILOGRAMOS <br>";
     echo "   un KG  vale :  " . Alconversiones::convierte('18004728', '123', '190') . "    CAJAS <br>";
     echo "   unA CAJA  vale :  " . Alconversiones::convierte('18004728', '190', '123') . "    KILOGRAMOS <br>";
     yii::app()->end();
     $model = new Noticias();
     var_dump(get_class($model));
     yii::app()->end();
     var_dump(count(Peticion::model()->search()->getdata()));
     yii::app()->end();
     ini_set('soap.wsdl_cache_enable', 0);
     ini_set('soap.wsdl_cache_ttl', 0);
     $wsdlURL = 'https://www.sunat.gob.pe/ol-ti-itcpgem-beta/billService?wsdl';
     $client = new SoapClient($wsdlURL);
     var_dump($client->__getFunctions());
     echo "<BR>";
     echo "<BR>";
     var_dump($client->__getTypes());
     //var_dump($client);
     yii::app()->end();
     //$result=$client->giveTimestamp();
     //echo $result;
     var_dump(yii::app()->user);
     echo "<br>";
     echo "<br>";
     echo "<br>";
     $elusuario = Yii::app()->user->um->LoadUserById(yii::app()->user->id);
     var_dump($elusuario);
     $sesion_activa = Yii::app()->user->um->findSession($elusuario);
     echo "<br>";
     echo " LA DURACION MAXIMA DE LA SESION " . Yii::app()->user->um->getDefaultSystem()->getn('sessionmaxdurationmins') . "   Minutos";
     echo "<br>";
     echo " la sesion expira  " . date("Y-m-d H:i:s", $sesion_activa->expire);
     echo "<br>";
     echo " la sesion inicio en " . date(" H:i:s", $sesion_activa->created);
     echo "<br>";
     echo " Ultimo uso  " . date("H:i:s", $sesion_activa->lastusage);
     echo "<br>";
     echo " la hora actual  " . date("H:i:s");
     echo "<br>";
     echo " Han pasado :   " . (time() - $sesion_activa->created) / 60 . "   minutos       con  ";
     echo "<br>";
     echo "  Sesion expirada? :\n\t\t        ->             " . var_dump($sesion_activa->isSessionExpired());
     echo "<br>";
     echo "  Sesion name  : " . $sesion_activa->getSessionName();
     echo "<br>";
     echo "  Sesion valida : " . $sesion_activa->validateSession();
     //	$sesion_activa->getSessionFilter();
     echo "<br>";
     //print_r($sesion_activa);
     yii::app()->end();
     echo yii::getPathOfAlias('webroot.materiales');
     //echo yii::app()->baseUrl;
     YII::APP()->END();
     /*var_dump(yii::app()->request);
     		echo "<br>";
     		print_r(yii::app()->request->baseUrl);*/
     echo yii::app()->getBaseUrl(true);
     echo "<br>";
     var_dump(is_dir(yii::app()->getBaseUrl(true)));
     YII::APP()->END();
     $images = glob(yii::getPathOfAlias('webroot.materiales') . DIRECTORY_SEPARATOR . "{*.JPG,*.PNG,*.JPEG,*.GIF,*.BMP}", GLOB_BRACE);
     //echo yii::getPathOfAlias('webroot.materiales.gallery').DIRECTORY_SEPARATOR;
     //echo "<br>";
     //imprime el nombre de cada archivo
     foreach ($images as $image) {
         echo $image . '<br />';
     }
     print_r($images);
     yii::app()->end();
     var_dump(is_dir("/public_html/recurso/materiales/"));
     YII::APP()->END();
     var_dump(yii::app()->estadisticas->linear_regression(array(2, 3, 3.5, 5), array(2, 3, 4, 6)));
     $this->render('//alinventario/vw_loginventario', array());
     yii::app()->end();
     $modelinv = Alinventario::model()->findByPk(343569);
     $modelinv->actualiza_stock('77', 1, null);
     yii::app()->end();
     echo Yii::app()->baseUrl;
     yii::app()->end();
     $criterio = new CDbcriteria();
     $criterio->addcondition("hidsolpe=:vid");
     $criterio->params = array(":vid" => 387);
     $objeto = new Miproveedor('Desolpe', array('criteria' => $criterio));
     //var_dump($objeto->getdata());
     $objeto->camposasumar = array("TOTAL CANTIDAD" => 'cant', 'SUBTOTAL PLANEADO' => "punitplan", 'SUBTOTAL REAL' => "punitreal");
     $subtotales = $objeto->Total();
     var_dump($subtotales);
     yii::app()->end();
     $nuevoarray = array();
     $nuevoarray['uno'] = 1;
     $nuevoarray['dos'] = 2;
     var_dump($nuevoarray);
     yii::app()->end();
     $criterio = new CDbcriteria();
     $objeto = new CActiveDataProvider('Impuestos');
     // $dataProvider->getData() will return a list of Post objects
     var_dump($objeto->getdata());
     yii::app()->end();
     //echo Almacendocs::model()->findByPk(709)->almacendocs_almacenmovimientos->eventos->estadofinal;
     var_dump(Almacendocs::model()->findByPk(709)->almacendocs_almacenmovimientos);
     yii::app()->end();
     $criterio = new CDbCriteria();
     $criterio->addCondition("hidguia=:xdet");
     $criterio->params = array(':xdet' => 59);
     //var_dump($criterio->condition);
     print_r(MiFactoria::arrayColumnaSQL(Docompra::model()->tableName(), 'id', $criterio));
     yii::app()->end();
     $images = glob(yii::getPathOfAlias('webroot.materiales') . DIRECTORY_SEPARATOR . "{*.JPG,*.PNG,*.JPEG,*.GIF,*.BMP}", GLOB_BRACE);
     //echo yii::getPathOfAlias('webroot.materiales.gallery').DIRECTORY_SEPARATOR;
     //echo "<br>";
     //imprime el nombre de cada archivo
     foreach ($images as $image) {
         echo $image . '<br />';
     }
     print_r($images);
     yii::app()->end();
     $modelito = new Ocompra();
     $modelito->codocu = $this->documento;
     echo $modelito->correlativo('numcot');
     yii::app()->end();
     echo dirname(__FILE__) . '/css/estilogrid.css';
     var_dump(is_file($_SERVER['SCRIPT_NAME'] . '/css/estilogrid.css'));
     //ECHO "..//".(strlen(dirname($_SERVER['SCRIPT_NAME']))>1 ? dirname($_SERVER['SCRIPT_NAME']) : '' ) . '/css/estilogrid.css';
     yii::app()->end();
     // una ffraccion de la forma   1/2 , 3/4 , 45/3, 1 /2 , 7./3 , 1/ 3, 234/567,  4/.5 ,
     $cadena1 = "PERNO  11/45 INOXIDABLE  7/8 HF   1/2 x 3/4  1/12 * 5/16 ";
     $cadena2 = "PERNO   12./. 56  3 1/2 INOXIDABLE  17/8 HF ";
     $cadena3 = "PERNO  45/ 34 INOXIDABLE  7./ 8 HF ";
     $cadena4 = "PERNO  1/2 4 5/34 INOXIDABLE  7 /8  HF ";
     $cadena5 = " PERNO   4/.63 INOXIDABLE  756/458 HF ";
     $cadena6 = "3/4 PERNO  1 / 3 INOXIDABLE  17/8*1 HF ";
     $cadena7 = "PERNO INOXIDABLE  3*41 25/16 1781 HF ";
     $patron = "/^(\\s)[0-9]{1,}[\\.|\\s]?[\\/]{1}[\\.|\\s]?[0-9]{1,}(\\s)\$/";
     $patron2 = '/[1-9]{0,}+[\\s|*|x|X]{1}[0-9]{1,}[\\.|\\s]{0,1}[\\/]{1}[\\.|\\s]{0,1}[0-9]{1,}[\\s|*|x|X]{1}/';
     echo $cadena1 . "    " . preg_match_all($patron2, $cadena1, $resultado1) . "<br>";
     print_r($resultado1);
     echo "<br>";
     echo "<br>";
     echo $cadena2 . "    " . preg_match_all($patron2, $cadena2, $resultado2) . "<br>";
     print_r($resultado2);
     echo "<br>";
     echo "<br>";
     echo $cadena3 . "    " . preg_match_all($patron2, $cadena3, $resultado3) . "<br>";
     print_r($resultado3);
     echo "<br>";
     echo "<br>";
     echo $cadena4 . "    " . preg_match_all($patron2, $cadena4, $resultado4) . "<br>";
     print_r($resultado4);
     echo "<br>";
     echo "<br>";
     echo $cadena5 . "    " . preg_match_all($patron2, $cadena5, $resultado5) . "<br>";
     print_r($resultado5);
     echo "<br>";
     echo "<br>";
     echo $cadena6 . "    " . preg_match_all($patron2, $cadena6, $resultado6) . "<br>";
     print_r($resultado6);
     echo "<br>";
     echo "<br>";
     echo $cadena7 . "    " . preg_match_all($patron2, $cadena7, $resultado7) . "<br>";
     print_r($resultado7);
     echo "<br>";
     echo "<br>";
     //echo $cadena8. "    ". preg_match('/^(\s)[0-9]{1,}[\.|\s]?[\/]{1}[\.|\s]?[0-9]{1,}(\s)$/',$cadena1) ."<br>";
     yii::app()->end();
     print_r(Yii::app()->user->rbac->getMenu());
     yii::app()->end();
     //$model=new Impuestos;
     yii::app()->crugemailer->mail_con_archivo('*****@*****.**', '*****@*****.**', 'hi', '130165');
     //	var_dump(mail('*****@*****.**','holas','holas'));
     yii::app()->end();
     echo Valorimpuestos::getimpuesto('200');
     $model->codocumento = '1';
     echo Valorimpuestos::model()->getimpuesto('100');
     yii::app()->end();
     $model->codocumento = '130';
     echo $model->Correlativo('numero');
     yii::app()->end();
     $modelin = CactiveRecord::model('Alkardex');
     print_r($modelin->getTableSchema());
     yii::app()->end();
     echo get_include_path();
     yii::app()->end();
     echo " la sesion expira  " . date("Y-m-d,H-i:s");
     yii::app()->end();
     echo MiFactoria::decimal(47 / 3);
     yii::app()->end();
     print_r(MiFactoria::opcionestoolbar(345, '130', '20'));
     yii::app()->end();
     $model = new Inventario();
     $objeto = $model->getMetaData();
     foreach ($objeto->columns as $columna) {
         echo "campo  " . $columna->name . "    ancho " . $columna->size . "  el tipo  : " . $columna->dbType . "<br>";
     }
     print_r($objeto->columns);
     //$model->rucpro='121212121212121';
     //$model->save();
     //print_r($model->getMetaData());
     yii::app()->end();
     $movimientoauxiliar = '45';
     $filakardexoriginal = Alkardex::model()->findByPk(1691);
     $filakardexoriginal->alkardex_alinventario->actualiza_stock($movimientoauxiliar, abs(3), null);
     yii::app()->end();
     $modeloreserva = Alreserva::model()->findByPk(255);
     var_dump($modeloreserva->alreserva_cantidadatendida);
     yii::app()->end();
     var_dump($kardex = Alkardex::model()->findByPk(1514)->alkardex_despacho);
     yii::app()->end();
     //tag(string $tag, array $htmlOptions=array ( ), mixed $content=false, boolean $closeTag=true)
     $arrayes = Almacendocs::model()->findAll("numvale=:nimi", array("nimi" => trim('130200000129')));
     echo count($arrayes);
     yii::app()->end();
     if (is_dir('assets')) {
         echo " si es un directrio";
     }
     yii::app()->end();
     Yii::app()->crugemailer->prueba();
     //echo CHtml::tag("div",array("style"=>"font:23px;fotn-size:445;"),"AQUI",true);
     $calse = new Cc();
     echo $calse::BELONGS_TO;
     //	var_dump($calse);
     //phpinfo(INFO_MODULES);
     yii::app()->end();
     //tag(string $tag, array $htmlOptions=array ( ), mixed $content=false, boolean $closeTag=true)
     $arrayes = Almacendocs::model()->findAll("numvale=:nimi", array("nimi" => trim('130200000129')));
     echo count($arrayes);
     yii::app()->end();
     echo strpos("manicomo", "c");
     Yii::app()->user->setFlash('error', "MENSAJE ERRO1");
     Yii::app()->user->setFlash('error2', "MENSAJE ERR2");
     Yii::app()->user->setFlash('error3', "MENSAJE ERR3");
     Yii::app()->user->setFlash('notice', "MENSAJE NORICE1");
     Yii::app()->user->setFlash('notice2', "MENSAJE NOTICE2");
     Yii::app()->user->setFlash('notice3', "MENSAJE NOTICE3");
     Yii::app()->user->setFlash('success', "SUCCESS ERRO1");
     Yii::app()->user->setFlash('success2', "SUCCESS ERR2");
     Yii::app()->user->setFlash('success3', "SUCCESS ERR3");
     // PRINT_R(Yii::app()->user->getFlashes());
     yii::app()->end();
     //$this->ConfirmaBuffer($id);
     $kardexhijos = MiFactoria::DevuelveKardexHijos($id);
     echo count($kardexhijos);
     /*foreach ( $kardexhijos as $filakardex ) {
     			//$filakardex->preciounit=$filakardex->getMonto();
     			//$filakardex->VerificaCantAtenReservas();
     			//$filakardex->InsertaAtencionReserva($filakardex->id);
     			echo "   id del kardex ".$filakardex->id."<br>";
     			//$filakardex->alkardex_alinventario->actualiza_stock($filakardex->codmov,abs($filakardex->cantidadbase()),null);
     
     			//$filakardex->InsertaCcGastos();
     		}
     	*/
     yii::app()->end();
     $id = 160;
     $modeloreserva = Alreserva::model()->findByPk($id);
     $modeloreserva->anular();
     PRINT_R(Yii::app()->user->getFlashes());
     yii::app()->end();
     $id = 490;
     $kardexhijos = MiFactoria::DevuelveKardexHijos($id);
     //var_dump($kardexhijos);
     foreach ($kardexhijos as $filakardex) {
         //calculando el precio unitario
         $filakardex->preciounit = $filakardex->getMonto();
         if ($filakardex->VerificaCantAtenReservas()) {
             PRINT_R($filakardex->mensajes);
         }
         //ECHO " GRABA  ".$filakardex->InsertaAtencionReserva($filakardex->id);
         $filakardex->alkardex_alinventario->actualiza_stock($filakardex->codmov, abs($filakardex->cantidadbase()), null);
         print_r($filakardex->alkardex_alinventario->mensajes);
         //verificandso si hay errrores recoger los mensajes
         /*if(!$filakardex->VerificaCantAtenReservas() or
                     !$filakardex->InsertaAtencionReserva() or
                     !$filakardex->alkardex_alinventario->actualiza_stock($filakardex->codmovimiento,$filakardex->cant,null)
                    )
                  $this->mensajes=array_merge($this->mensajes,$filakardex->mensajes,$filakardex->alkardex_alinventario->mensajes);
           */
         $filakardex->InsertaCcGastos();
     }
     yii::app()->end();
     //$nuevo=new MiFactoria();
     //Mifactoria::InsertaAtencionReserva(1357);
     $row = Alkardex::model()->findByPk(NULL);
     $matrix = Alreserva::model()->findAll("hidesolpe=:vhidsolpe AND codocu='450' ", array(":vhidsolpe" => $row->idref));
     $model = new Atencionreserva();
     $model->cant = $row->cant;
     $model->hidkardex = $row->id;
     $model->hidreserva = $matrix[0]['id'];
     $model->estadoatencion = Atencionreserva::ESTADO_CREADO;
     if (!$model->save()) {
         throw new CHttpException(500, "NO se Pudo insertar el registro de atenciones reservas ");
     }
     unset($model);
     unset($matrix);
     unset($row);
     yii::app()->end();
     $mimo = new ModeloGeneral();
     $mimo->insertamensaje('success', 'primermamesaje');
     $mimo->insertamensaje('success1', 'segundo mensaje');
     $mimo->insertamensaje('error', 'tercer mensaje');
     $mimox = new ModeloGeneral();
     $mimox->insertamensaje('successx', 'primermamesaje');
     $mimox->insertamensaje('success1x', 'segundo mensaje');
     $mimox->insertamensaje('errorx', 'tercer mensaje');
     /*$gg= new Alinventario();*/
     print_r($mimo->mensajes);
     echo "<br><br>";
     print_r($mimox->mensajes);
     $mensaj = array();
     $mensaj = array_merge($mensaj, $mimo->mensajes);
     $mensaj = array_merge($mensaj, $mimox->mensajes);
     //array_merge($mensaj,$mimox->mensajes);
     //$mensaj[]=$mimo->mensajes;
     //$mensaj[]=$mimox->mensajes+$mimo->mensajes;
     //array_push($mensaj,$mimox->mensajes);
     echo "<br><br>";
     print_r($mensaj);
     yii::app()->end();
     var_dump(Almacenmovimientos::model()->findByPk('10')->signo);
     //echo "total   ".Alinventario::getStockTotal('11000004');
     yii::app()->end();
     /*if(Yii::app()->periodo->getModel()->HoyDentroPeriodo()){
     			echo "ESTAMOS DENTRO DEL PERIODO";
     		} else {
     			echo "no  ESTAMOS DENTRO DEL PERIODO";
     		}
     
     		yii::app()->end();*/
     if (Yii::app()->periodo->verificaFechas('2015-03-5', '2015-03-4')) {
         echo "ESTAMOS DENTRO DEL PERIODO";
     } else {
         echo "no ESTAMOS DENTRO DEL PERIODO";
     }
     yii::app()->end();
     $gg = new Alkardex();
     //$gg=Alkardex::model()->findByPk(1236);
     //var_dump($gg->oldAttributes);
     echo "<BR><BR> ESCENARIO :" . $gg->getScenario() . "<BR>";
     $gg->save();
     var_dump($gg->errors);
     $ggt = new Tempalkardex();
     //$gg=Alkardex::model()->findByPk(1236);
     //var_dump($gg->oldAttributes);
     echo "<BR><BR> ESCENARIO :" . $ggt->getScenario() . "<BR>";
     $ggt->save();
     var_dump($ggt->errors);
     yii::app()->end();
     $matriz = $gg->relations();
     $nuevoarr = array();
     //print_r($matriz);
     foreach ($matriz as $clave => $matricita) {
         if ($matricita[0] == 'CHasManyRelation') {
             $nuevoarr[$matricita[2]] = $matricita[1];
         }
     }
     print_r($nuevoarr);
     //$hallo=array_search('CHasManyRelation',$matriz);
     // echo var_dump($hallo);
     yii::app()->end();
     $arreglo = array();
     /*$arreglo1=array('uno'=>1);
     		$arreglo2=array('dos'=>2);
     		$arreglo3=array('tres'=>3);*/
     $arreglo['uno'] = 1;
     $arreglo['dos'] = 2;
     print_r($arreglo);
     yii::app()->end();
     /***********************************************
      * Prueba de la propieda mensajes ARRAY() de
      * la clase MODELOGENERAL
      *
      * *******************       */
     $modelo = new ModeloGeneral();
     $modelo->insertamensaje('error', 'MENSAJE 1');
     $modelo->insertamensaje('error', 'MENSAJE 2');
     $modelo->insertamensaje('error', 'MENSAJE 3');
     $modelo->insertamensaje('notice', 'notice 1');
     $modelo->insertamensaje('notice', 'notice 2');
     $modelo->insertamensaje('success', 'succes 3');
     echo $modelo->parsemensajes('error');
     echo $modelo->parsemensajes('notice');
     echo $modelo->parsemensajes('success');
     //PRINT_R($modelo->mensajes);
     yii::app()->end();
     foreach ($arreglo as $registro) {
         echo $registro->cant;
         echo " <br><br>";
     }
     //var_dump($modelo->desolpe_alreserva);
     yii::app()->end();
     /***********************************************************
      *
      */
     /***********************************************
      * Prueba de que los registros hijos pueden ser
      * llmados desde la relacion
      *  HAS:MANY                                   */
     $modelo = Desolpe::model()->findByPk(168);
     $arreglo = $modelo->desolpe_alreserva;
     ///LLAMA A LA RELACION Y RETORNA OBJETOS HIJOS
     PRINT_R($arreglo);
     foreach ($arreglo as $registro) {
         echo $registro->cant;
         echo " <br><br>";
     }
     //var_dump($modelo->desolpe_alreserva);
     yii::app()->end();
     /***********************************************************
      *
      */
     echo Alconversiones::convierte('18005239', '120');
     yii::app()->end();
     $petri = new Peticion();
     print_r($petri->behaviors());
     if (array_key_exists('ActiveRecordLogableBehavior', $petri->behaviors())) {
         echo "salio";
     }
     yii::app()->end();
     /*print_r(MiFactoria::ExisteRegistroTemporal('Tempdpeticion',127));
     		yii::app()->end();*/
     /*print_r(Peticion::relations());
     		$campoenlace=Peticion::getFieldLink(Peticion::relations(),'Peticion','Tempdpeticion');
     		echo "<br>";
     		echo "campo enl ace   :   ".$campoenlace;
     		yii::app()->end();*/
     $id = 127;
     $con = $this->IniciaBuffer($id);
     foreach ($con as $grupo) {
         echo "<br>";
         foreach ($grupo as $objeto) {
             echo "<br>";
             foreach ($objeto as $row) {
                 echo "======================================================<br>";
                 print_r($row);
                 echo "======================================================<br>";
                 echo "<br>";
             }
         }
         echo "<br>";
     }
     $nombremodelocabecera = 'Peticion';
     foreach ($con as $registroshijos) {
         // foreach ($grupo as $registroshijos)
         //{
         // $campoenlace=$nombremodelocabecera::getFieldLink($nombremodelocabecera::relations(), $nombremodelocabecera,$nombremodelohijo);
         // $registroshijos=MiFactoria::getRegistrosHijos($nombremodelohijo,$campoenlace,$id);
         foreach ($registroshijos as $row) {
             if (is_null(MiFactoria::ExisteRegistro('Tempdpeticion', $id))) {
                 if ($row->save()) {
                     echo " <br>";
                     echo " *********************************";
                     echo " <br>";
                     echo "grabo     " . $row->getTableAlias();
                     echo " <br>";
                     echo " *********************************";
                     echo " <br>";
                 }
             }
         }
     }
     yii::app()->end();
     print_r($con);
     yii::app()->end();
     //	$lalo=null;
     $modeloant = Solpe::model()->findByPk(239);
     $matriz = $modeloant->relations();
     $palo = $this->recorro($matriz);
     //echo Solpe::HAS_MANY;
     print_r($palo);
     yii::app()->end();
     $modeloant = Solpe::model()->findByPk(239);
     print_r($modeloant->relations());
     //echo $modeloant->codart;
     yii::app()->end();
     $modelo = "Dpeticion";
     $s = new $modelo();
     print_r($s);
     yii::app()->end();
     $clasetemporal = "Alinventario";
     $valor = $clasetemporal::model()->hasAttribute('codart');
     echo "   gfgfgf " . $valor;
     yii::app()->end();
     $registroshijos = $modelo::model()->findAllBySql(" select *from\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . Yii::app()->params['prefijo'] . "dpeticion\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t where\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t hidpeticion=54 ");
     print_r($registroshijos);
     yii::app()->end();
     $inv = 'Alinventario';
     $arraymodelos = array();
     $modelo = $inv::model()->findByPk(343563);
     $modelo2 = $inv::model()->findByPk(343564);
     array_push($arraymodelos, $modelo);
     array_push($arraymodelos, $modelo2);
     //$nuevomod=Bloqueos::prueba();
     echo $arraymodelos[0]->codart;
     //print_r($modelo);
     yii::app()->end();
     // $modelo=new ModInventario();
     $modelo = ModInventario::loadModel(343563);
     $modeloant = ModInventario::loadModel(343563);
     //echo " hola  ".gettype($modelo->codart);
     //$modelo->actualizaprecio($cantmov,1.23,$this->CAMPO_STOCK_LIBRE);
     $nuevoprecio = 500;
     $cantmov = 100;
     if ($modelo->actualizaprecio($cantmov, $nuevoprecio, ModInventario::CAMPO_STOCK_LIBRE)) {
         echo "ok se relaizo el proceso :<br>";
         echo "cant libre :  " . $modelo->cantlibre . "                 anterior : " . $modeloant->cantlibre . "<br>";
         echo "cant reserva :  " . $modelo->cantres . "                  anterior : " . $modeloant->cantres . "<br>";
         echo "cant reserva :  " . $modelo->canttran . "                    anterior : " . $modeloant->canttran . "<br>";
         echo "Precio unitario :" . $modelo->punit . "                      anterior : " . round($modeloant->punit, 3) . "<br>";
         echo "dif de precio unitario :  " . $modelo->punitdif . "                 anterior : " . $modeloant->punitdif . "<br>";
         echo "cant stock afectado por el ambio de precio  :  " . $modelo->getStockCamposAfectadosPrecio() . "<br>";
         echo "cant movida  :   " . $cantmov . "<br>";
         echo "precio unitario nuevo  :   " . $nuevoprecio . "<br>";
         echo "-------<br><br>";
     } else {
         $matriz = $modelo->getMensajes();
         echo " HAY  " . COUNT($matriz) . "     Elementos";
         print_r($matriz);
         foreach ($matriz as $arreglo) {
             // echo   "  ".$arregloclave."  :   ".$valor."<br>";
         }
         echo "hu,,-------<br><r>";
     }
     yii::app()->end();
     $am = new MyCrugeAuthManager();
     $am->init();
     foreach ($am->autoDetect() as $itemName) {
         printf("%s\n", $itemName);
     }
     echo "  la direccion IP:  " . CrugeUtil::hash("julian");
     echo " es una instancia de " . gettype(Yii::app()->crugemailer);
     /*if (Yii::app()->CrugeMailer instanceof CrugeMailer) {
     			echo 'Crugemailer';
     		} else  {
     			echo "que carajo sera";
     		}*/
     yii::app()->end();
     $id = 54;
     $difiere = false;
     ///Asumismos que no ha variado
     $registrosactuales = Tempdpeticion::model()->findAllBySql(" select *from\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . Yii::app()->params['prefijo'] . "tempdpeticion\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t where\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t hidpeticion=" . $id . " and idusertemp = " . Yii::app()->user->id . " ");
     $registrosviejos = Dpeticion::model()->findAllBySql(" select *from\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . Yii::app()->params['prefijo'] . "dpeticion\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t where\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t hidpeticion=" . $id . " ");
     foreach ($registrosactuales as $row) {
         $newattributes = $row->getAttributes();
         ///Los valores de este instante
         foreach ($registrosviejos as $rowviejo) {
             $oldattributes = $rowviejo->getAttributes();
             echo " Emparewjando : " . $oldattributes['id'] . "  con  " . $newattributes['id'] . " <br>";
             if ($oldattributes['id'] == $newattributes['id']) {
                 echo " En la fila " . $oldattributes['id'] . "  : <br>";
                 foreach ($oldattributes as $clave => $valor) {
                     echo "Comparando  :<br>";
                     echo " original  :  " . $clave . "                               original=" . $valor . "   actual=" . $newattributes[$clave] . "<br>";
                     if ($valor != $newattributes[$clave] and $clave != 'idtemp' and $clave != 'idusertemp') {
                         echo " DIFERENTE <br><br> ";
                         $difiere = true;
                         break;
                     }
                 }
                 echo "  <br><br><br><br>";
             }
             /* print_r($newattributes );
                 echo "<br>";
                  print_r($atributos);
                echo "<br><br><br>";*/
             if ($difiere) {
                 break;
             }
         }
         /*print_r($this->bufferdetalle);
         		echo "<br>";
         		        if($difiere)
         			   break;*/
         if ($difiere) {
             break;
         }
     }
     echo "<br><br>   total    " . $difiere;
     yii::app()->end();
     $registrostemporalesdpeticion = array();
     $datosdebuffer = array();
     ///Estos datos
     $datosbufferdefila = array();
     $registroshijos = Dpeticion::model()->findAllBySql(" select *from\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . Yii::app()->params['prefijo'] . "dpeticion\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t where\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t hidpeticion=" . $hidpeticion . "  ");
     foreach ($registroshijos as $row) {
         ///Evitamos levantar items duplicados
         $existeregistro = Tempdpeticion::model()->find("id= " . $row->id . " AND idusertemp=" . Yii::app()->user->id . " ");
         if (is_null($existeregistro)) {
             ///Solo si no existe
             $modelotempdpeticion = new Tempdpeticion();
             $modelotempdpeticion->attributes = $row->attributes;
             $modelotempdpeticion->idusertemp = Yii::app()->user->id;
             array_push($registrostemporalesdpeticion, $modelotempdpeticion);
             $datosbufferdefila = $row->attributes;
             //array_push($datosbufferdefila,array('micalve'=>$row->id));
             array_push($datosdebuffer, $datosbufferdefila);
         }
     }
     //print_r($datosdebuffer);
     foreach ($datosdebuffer as $clave => $atributos) {
         print_r($atributos);
         echo "<br><br>";
     }
     //$this->bufferdetalle=$registrostemporalesdpeticion; ///Guarda el bu¡ffer de datos
     //return $registrostemporalesdpeticion;
     yii::app()->end();
     $arreglo = array();
     $arreglo1 = array('uno' => 1);
     $arreglo2 = array('dos' => 2);
     $arreglo3 = array('tres' => 3);
     array_push($arreglo, array('uno' => 1));
     array_push($arreglo, array('dos' => 2));
     print_r($arreglo);
     yii::app()->end();
     $id = 34;
     if ($id) {
         echo "dsdsdsds eco ";
     }
     yii::app()->end();
     $me = Yii::app()->user->id;
     $cadena = " select distinct idusertemp from " . Yii::app()->params['prefijo'] . "temppeticion WHERE id=" . $id . " and idusertemp <> " . $me . " ";
     $quien = Yii::app()->db->createCommand($cadena)->queryScalar();
     echo $cadena;
     echo " El tipo de quien " . gettype($quien) . "    -----    " . $quien;
     //yii::app()->end();
     if ($quien) {
         /// Quiere decir que hay otros que estan ediotnado el documento
         ///PARA VER SIS ES CIERTO DEEBMOS VERIFICAR Q ESTE USUARIO NO HA DEJADO LA VENTANA ABANDONADA CON E DOMCUENTO EN EDICION
         $elusuario = Yii::app()->user->um->LoadUserById($quien);
         ///hallando la sesion activa de este usuario
         $sesion_activa = Yii::app()->user->um->findSession($elusuario);
         if (is_null($sesion_activa)) {
             echo "  NO esta cupado man ";
             //No esta ocupado por que estaba editando pero ya temrino sus sesion, alo mejor dejo la ventana abierta
         } else {
             echo "  Estaa cupado por el usuario " . $elusuario->username;
             ///Si esta ocupado por que el usuario tiene sesion activa, y eszta editando
         }
     } else {
         echo "  NO esta cupado , estas solo mano  ";
     }
     yii::app()->end();
     $usuariojesus = Yii::app()->user->um->loadUser('admin', false);
     print_r($usuariojesus);
     echo "<br><br><br><br>";
     $modelo = Yii::app()->user->um->findSession($usuariojesus);
     echo " el tipo retoranado es " . gettype($modelo);
     print_r($modelo);
     echo "<br><br><br><br>El  modelo de sesion de Jesus";
     $modelo = Yii::app()->user->um->findSession(Yii::app()->user->um->loadUser('jesus', false));
     echo " el tipo retoranado es " . gettype($modelo);
     print_r($modelo);
     yii::app()->end();
     $modelo->isSessionExpired();
     if ($expiro) {
         echo "   Ya expiro ";
     } else {
         echo "   Todavia esta vignte la sesion  ";
     }
     yii::app()->end();
     $this->layout = '//layouts/iframe';
     $this->render('carachita');
     yii::app()->end();
     // $modelosolpe=Desolpe::model()->findByPk(79);
     $modelokardex = Alkardex::model()->findByPk(1236);
     $clonado = $modelokardex->clonaregistro();
     //echo $clonado->cant;
     print_r($clonado);
     yii::app()->end();
     echo " numeor reservar compras " . $modelosolpe->numero_reservascompras;
     echo " modelo cant " . $modelosolpe->cant;
     yii::app()->end();
     if ($cantidadatendidaacumulada + $modelokardex->cant == $modeloreserva->cant) {
         $modeloreserva->estadoreserva = '20';
         ///Completo...!
         ///Veriifcar primero si DESOLPE tiene partido RESERVA +RESERVA PARA COMPRA
         if ($modelodesolpe->numero_reservascompras == 0) {
             ///Si no tiene solicitudes de compra
             $modelodesolpe->est == '40';
         }
         ///Completo...!
     }
     $kardex = Alkardex::model()->findByPk(1125);
     echo "  la sumatoria de las cantidades :  " . $kardex->alkardex_alkardextraslado_emisor_cant;
     echo "  la cantidad  :  " . $kardex->cant;
     yii::app()->end();
     $modelo = new Alkardex();
     $centro = $modelo->alkardex_alinventario->cantlibre;
     echo "  el cento es  " . $centro;
     yii::app()->end();
     $modelo = Desolpe::model()->findByPk(74)->desolpe_alinventario;
     $modelo->cantlibre = 1234;
     $modelo->setScenario('modificacantidad');
     $modelo->save();
     echo "  ES " . $modelo->codart;
     yii::app()->end();
     //$modelo->Actualizar($movimiento,$cantidad,$unidad,$punitario=null);
     $mensaje = $modelo->Actualizar('80', 0.03, '140', null);
     //echo " El almacen : ".$modelo->desolpe_alinventario->codalm."  \n";
     if (strlen($mensaje) == 0) {
         echo " cantidad  libre : " . $modelo->cantlibre . "  \n";
         echo " cantidad  libre : " . $modelo->cantlibre . "  \n";
         echo " cantidad reservada : " . $modelo->cantres . "  \n";
         echo " cantidad  transito : " . $modelo->canttran . "  \n";
         echo " precio unitario : " . $modelo->punit . "  \n";
         echo " cantidad  movida : " . $modelo->cantidadmovida . "  \n";
         echo " monto movido : " . $modelo->montomovido . "  \n";
         // echo " La conversion  : ".Alconversiones::model()->convierte($modelo->codart,$modelo->um)."  \n";
         //echo " catidad reservada  : ".$modelo->desolpe_alinventario->cantres."  \n";
     } else {
         echo "  " . $mensaje;
     }
     yii::app()->end();
 }
Example #20
0
 /**
  * Loads all type classes
  *
  * @access private
  */
 private function loadTypes()
 {
     $this->log($this->display('Loading types'));
     $types = $this->client->__getTypes();
     foreach ($types as $typeStr) {
         $wsdlNewline = strpos($typeStr, "\r\n") ? "\r\n" : "\n";
         $parts = explode($wsdlNewline, $typeStr);
         $tArr = explode(" ", $parts[0]);
         $restriction = $tArr[0];
         $className = $tArr[1];
         if (substr($className, -2, 2) == '[]' || substr($className, 0, 7) == 'ArrayOf') {
             // skip arrays
             continue;
         }
         $type = null;
         $numParts = count($parts);
         // ComplexType
         if ($numParts > 1) {
             $type = new ComplexType($className);
             $this->log($this->display('Loading type ') . $type->getPhpIdentifier());
             for ($i = 1; $i < $numParts - 1; $i++) {
                 $parts[$i] = trim($parts[$i]);
                 list($typename, $name) = explode(" ", substr($parts[$i], 0, strlen($parts[$i]) - 1));
                 $name = $this->cleanNamespace($name);
                 $type->addMember($typename, $name);
             }
         } else {
             $typenode = $this->findTypenode($className);
             if ($typenode) {
                 // If enum
                 $enumerationList = $typenode->getElementsByTagName('enumeration');
                 $patternList = $typenode->getElementsByTagName('pattern');
                 if ($enumerationList->length > 0) {
                     $type = new Enum($className, $restriction);
                     $this->log($this->display('Loading enum ') . $type->getPhpIdentifier());
                     foreach ($enumerationList as $enum) {
                         $type->addValue($enum->attributes->getNamedItem('value')->nodeValue);
                     }
                 } else {
                     if ($patternList->length > 0) {
                         $type = new Pattern($className, $restriction);
                         $this->log($this->display('Loading pattern ') . $type->getPhpIdentifier());
                         $type->setValue($patternList->item(0)->attributes->getNamedItem('value')->nodeValue);
                     } else {
                         continue;
                         // Don't load the type if we don't know what it is
                     }
                 }
             }
         }
         if ($type != null) {
             $already_registered = FALSE;
             if ($this->config->getSharedTypes()) {
                 foreach ($this->types as $registered_types) {
                     if ($registered_types->getIdentifier() == $type->getIdentifier()) {
                         $already_registered = TRUE;
                         break;
                     }
                 }
             }
             if (!$already_registered) {
                 $this->types[] = $type;
             }
         }
     }
     $this->log($this->display('Done loading types'));
 }
    <operation name="getEmployee">
      <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/>
      <input>
        <soap:body use="literal" namespace="http://foo.bar/testserver"/>
      </input>
      <output>
        <soap:body use="literal" namespace="http://foo.bar/testserver"/>
      </output>
    </operation>
    <operation name="getUser">
      <soap:operation soapAction="http://foo.bar/testserver/#getUser"/>
      <input>
        <soap:body use="literal" namespace="http://foo.bar/testserver"/>
      </input>
      <output>
        <soap:body use="literal" namespace="http://foo.bar/testserver"/>
      </output>
    </operation>
  </binding>
  <service name="TestServerService">
    <port name="TestServerPort" binding="tns:TestServerBinding">
      <soap:address location="http://localhost/wsdl-creator/TestClass.php"/>
    </port>
  </service>
</definitions>
XML;
file_put_contents(__DIR__ . "/bug68361.xml", $xml);
$client = new SoapClient(__DIR__ . "/bug68361.xml");
$res = $client->__getTypes();
// Segmentation fault here
print_r($res);
Example #22
0
<?php

include '../kernel.php';
require_once '../class/nusoap.php';
$cl = new SoapClient("http://91.98.31.190/Moghim24Scripts/Moghim24Services.svc?wsdl");
$param = array('rep' => &$rep, 'netlog' => &$netlog, 'rwaitlog' => &$rwaitlog, 'totalprice' => &$totalprice, 'adlprice' => &$adlprice, 'chdprice' => &$chdprice, 'infprice' => &$infprice, 'selrate' => &$selrate, 'subflid' => 13941, 'AgencyCode' => 120, 'adl' => 1, 'chd' => 0, 'inf' => 0, 'cust' => '1005', 'pass' => '123');
try {
    //$res = moghim_class::checkselection(23392, 146, 1, 0, 0);
    //$res = $cl->checkselection($param);
    //var_dump($res);
    //var_dump($res->adlprice);
    var_dump($cl->__getFunctions());
    var_dump($cl->__getTypes());
    //var_dump($res);
} catch (Exception $exc) {
    echo $exc->getTraceAsString();
}
<?php

ini_set('soap.wsdl_cache_enabled', '0');
include_once '../global/customize.php';
try {
    //     $wsdl_loc = "http://media2.hgkz.ch/hgkmedialib-backend/soap/inc/auth.wsdl";
    $wsdl_loc = "http://localhost/winet-backend/soap/wsdl/HgkMediaLib_Authentication.wsdl";
    echo $wsdl_loc . '<br>';
    $feed_client = new SoapClient($wsdl_loc);
    $func = $feed_client->__getFunctions();
    echo '<pre>';
    print_r($func);
    echo '</pre>';
    $feed_client = new SoapClient($wsdl_loc);
    $types = $feed_client->__getTypes();
    echo '<pre>';
    print_r($types);
    echo '</pre>';
} catch (SoapFault $f) {
    $fault = "SOAP Fehler:<br>faultcode: {$f->faultcode}<br>";
    $fault .= "faultstring: {$f->faultstring}<br>";
    $fault .= "faultactor: {$f->faultactor}<br>";
    $fault .= "faultdetail: {$f->detail}<br>";
    die($fault);
}
 protected function getMethodParameters(\SoapClient $soap, $method)
 {
     foreach ($soap->__getTypes() as $type) {
         $this->parseTypeDefinition($type);
     }
     foreach ($soap->__getFunctions() as $call) {
         $this->parseCallDefinition($call);
     }
     if (isset($this->calls[$method])) {
         return $this->resolveTypes($this->calls[$method]);
     }
     return array();
 }