public static function GetRegZavod() { $debug = false; $wsdl_url = dirname(__FILE__) . '/RegZavodServicePort.wsdl'; if (!file_exists($wsdl_url)) { echo 'Missing WSDL shema for RegZavodServicePort.wsdl', "\n"; echo 'WSDL PATH: ', $wsdl_url, "\n"; die; } $client = new SoapClient($wsdl_url, array('exceptions' => 0, 'trace' => 1, 'user_agent' => 'Bober')); $result = $client->__soapCall('getRegZavod', array()); if ($debug) { var_dump($client->__getFunctions()); echo 'REQUEST HEADERS:', "\n", $client->__getLastRequestHeaders(), "\n"; echo 'REQUEST:', "\n", $client->__getLastRequest(), "\n"; var_dump($result); if (is_soap_fault($result)) { trigger_error('SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})', E_USER_ERROR); } print_r($result); } if ($result != '' && !is_soap_fault($result)) { $result = json_decode(json_encode($result), true); return $result; } else { return array(); } }
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ó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(); }
/** * Loads the service class * * @access private */ private function loadService() { $name = $this->dom->getElementsByTagNameNS('*', 'service')->item(0)->getAttribute('name'); $this->log($this->display('Starting to load service ') . $name); $this->service = new Service($name, $this->types, $this->documentation->getServiceDescription()); $functions = $this->client->__getFunctions(); foreach ($functions as $function) { $matches = array(); if (preg_match('/^(\\w[\\w\\d_]*) (\\w[\\w\\d_]*)\\(([\\w\\$\\d,_ ]*)\\)$/', $function, $matches)) { $returns = $matches[1]; $function = $matches[2]; $params = $matches[3]; } else { if (preg_match('/^(list\\([\\w\\$\\d,_ ]*\\)) (\\w[\\w\\d_]*)\\(([\\w\\$\\d,_ ]*)\\)$/', $function, $matches)) { $returns = $matches[1]; $function = $matches[2]; $params = $matches[3]; } else { // invalid function call throw new Exception('Invalid function call: ' . $function); } } $this->log($this->display('Loading function ') . $function); $this->service->addOperation($function, $params, $this->documentation->getFunctionDescription($function)); } $this->log($this->display('Done loading service ') . $name); }
/** * 首页 */ 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; }
/** * Возвращает экземпляр 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()); }
/** * * @return string */ private function getControllerFunctions() { $result = ''; foreach ($this->soapClient->__getFunctions() as $f) { $result .= $this->getFunction($f); } return $result; }
/** * Return a list of available functions * * @return array * @throws Zend_Soap_Client_Exception */ public function getFunctions() { if ($this->getWsdl() == null) { throw new Zend_Soap_Client_Exception('\'getFunctions\' method is available only in WSDL mode.'); } if ($this->_soapClient == null) { $this->_initSoapClientObject(); } return $this->_soapClient->__getFunctions(); }
public function generate_xend_waybill_no($ordernumber) { error_reporting(E_ALL); //require_once('lib/nusoap.php'); // declare variables $exceptionFlag = false; // initialize SOAP clients $wsdl = 'https://www.xend.com.ph/api/ShipmentService.asmx?wsdl'; $client = new SoapClient($wsdl, array()); $funcs = $client->__getFunctions(); // initialize SOAP header /*$headerbody = array('UserToken' => '92c14d24-bebb-49a8-a7b5-8a8358fb137e');*/ //test waybill //http://www.xend.com.ph/GetWaybill.aspx?no=736345530 $headerbody = array('UserToken' => '92c14d24-bebb-49a8-a7b5-8a8358fb137e'); $header = new SoapHeader('https://www.xend.com.ph/api/', 'AuthHeader', $headerbody); $client->__setSoapHeaders($header); // prepare parameters // all orders $this->load->model('xend_model'); //print_r($this->xend_model->get_orders_by_number($ordernumber)); foreach ($this->xend_model->get_orders_by_number($ordernumber) as $order) { // if($order->ship_zone=="Metro Manila"){ // $shipping_fee=79; // } else { // $shipping_fee=150; // } $shipping_fee = $order->shipping; $param = array('ServiceTypeValue' => 'MetroManilaExpress', 'ShipmentTypeValue' => 'Parcel', 'Weight' => 0.5, 'DimensionL' => 0.0, 'DimensionW' => 0.0, 'DimensionH' => 0.0, 'DeclaredValue' => $order->total, 'RecipientName' => $order->ship_firstname . ' ' . $order->ship_lastname, 'RecipientCompanyName' => $order->ship_company, 'RecipientAddress1' => $order->ship_address1, 'RecipientAddress2' => $order->ship_address2, 'RecipientCity' => $order->ship_city, 'RecipientProvince' => $order->ship_zone, 'RecipientCountry' => $order->ship_country, 'IsInsured' => 0, 'SpecialInstructions' => 'Fragile', 'Description' => 'DESCRIPTION', 'ClientReference' => $order->order_number, 'PurposeOfExportValue' => 'None', 'DateCreated' => date('Y-m-d\\TH\\:i\\:s\\.u', time()), 'DatePrinted' => date('Y-m-d\\TH\\:i\\:s\\.u', time()), 'ShippingFee' => $shipping_fee, 'InsuranceFee' => 0); } // execute SOAP method try { $result = $client->Create(array('shipment' => $param)); //$result = $client->__soapCall("Create", array("shipment" => $param)); } catch (SoapFault $soapfault) { $exceptionFlag = true; $exception = $soapfault->getMessage(); preg_match_all('/: (.*?). at/s', $exception, $error, PREG_SET_ORDER); echo "<b> Error : </b> " . $error[0][1]; //echo $soapfault->faultcode; } if (!$exceptionFlag) { return $result->CreateResult; } }
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 />"; }
/** * Retrieving tracking information given the waybill number of the * shipment. * * @return array */ public function getTracking() { // initialize SOAP client $client = new SoapClient(self::TRACKING_WSDL, array()); $funcs = $client->__getFunctions(); // initialize SOAP header $headerbody = array(self::USER_TOKEN => $this->_userToken); $header = new SoapHeader(self::HEADER, self::AUTH_HEADER, $headerbody); $client->__setSoapHeaders($header); // prepare parameters $query = array(self::WAY_BILL_NO => $this->_wayBillNo); // execute SOAP method try { $result = $client->GetList($query); //catch soap fault } catch (SoapFault $soapfault) { $this->_exceptionFlag = true; $exception = $soapfault->getMessage(); preg_match_all('/: (.*?). at/s', $exception, $error, PREG_SET_ORDER); //Print error return $error[0][1]; } return $result; }
/** * Retrieves the calculated rate based on the shipment information. * * @return integer|float */ public function getResponse() { // initialize SOAP client $client = new SoapClient(self::RATE_WSDL); $funcs = $client->__getFunctions(); // initialize SOAP header $headerbody = array(self::USER_TOKEN => $this->_userToken); $header = new SoapHeader(self::HEADER, self::AUTH_HEADER, $headerbody); $client->__setSoapHeaders($header); // prepare parameters $query = array(self::SERVICE_TYPE => $this->_serviceType, self::SHIPMENT_TYPE => $this->_shipmentType, self::DESTINATION_VALUE => $this->_destinationValue, self::WEIGHT => $this->_weight, self::LENGTH => $this->_length, self::WIDTH => $this->_width, self::HEIGHT => $this->_height, self::VALUE => $this->_declaredValue, self::INSURANCE => true); // execute SOAP method try { $result = $client->Calculate($query); //catch soap fault } catch (SoapFault $soapfault) { $this->_exceptionFlag = true; $exception = $soapfault->getMessage(); preg_match_all('/: (.*?). at/s', $exception, $error, PREG_SET_ORDER); //Print error return $error[0][1]; } return $result->CalculateResult; }
<?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);
<?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); }
/** * @param string $wsdlFile * @param string $className * @param array $methods * @param array $options * * @return string * @throws PHPUnit_Framework_MockObject_RuntimeException */ public function generateClassFromWsdl($wsdlFile, $className, array $methods = array(), array $options = array()) { if ($this->soapLoaded === null) { $this->soapLoaded = extension_loaded('soap'); } if ($this->soapLoaded) { $options = array_merge($options, array('cache_wsdl' => WSDL_CACHE_NONE)); $client = new SoapClient($wsdlFile, $options); $_methods = array_unique($client->__getFunctions()); unset($client); sort($_methods); $templateDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR; $methodTemplate = new Text_Template($templateDir . 'wsdl_method.tpl'); $methodsBuffer = ''; foreach ($_methods as $method) { $nameStart = strpos($method, ' ') + 1; $nameEnd = strpos($method, '('); $name = substr($method, $nameStart, $nameEnd - $nameStart); if (empty($methods) || in_array($name, $methods)) { $args = explode(',', substr($method, $nameEnd + 1, strpos($method, ')') - $nameEnd - 1)); $numArgs = count($args); for ($i = 0; $i < $numArgs; $i++) { $args[$i] = substr($args[$i], strpos($args[$i], '$')); } $methodTemplate->setVar(array('method_name' => $name, 'arguments' => join(', ', $args))); $methodsBuffer .= $methodTemplate->render(); } } $optionsBuffer = 'array('; foreach ($options as $key => $value) { $optionsBuffer .= $key . ' => ' . $value; } $optionsBuffer .= ')'; $classTemplate = new Text_Template($templateDir . 'wsdl_class.tpl'); $namespace = ''; if (strpos($className, '\\') !== false) { $parts = explode('\\', $className); $className = array_pop($parts); $namespace = 'namespace ' . join('\\', $parts) . ';' . "\n\n"; } $classTemplate->setVar(array('namespace' => $namespace, 'class_name' => $className, 'wsdl' => $wsdlFile, 'options' => $optionsBuffer, 'methods' => $methodsBuffer)); return $classTemplate->render(); } else { throw new PHPUnit_Framework_MockObject_RuntimeException('The SOAP extension is required to generate a mock object ' . 'from WSDL.'); } }
$order = array('Title' => 'asc'); try { $client = new SoapClient(HKGMEDIALIB_WSDL_BASEDIR . '/Auth.wsdl'); //$client = new SoapClient('http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_Authentication.wsdl'); echo "we call getSession('user', 'pwd', 'domain') - Returns a new session id:\n"; echo "*******************************************\n\n"; $session = $client->getSession('user', 'pwd', 'domain'); var_export($session); echo "\n"; echo "\n"; echo HKGMEDIALIB_WSDL_BASEDIR . 'Read.wsdl'; $client = new SoapClient(HKGMEDIALIB_WSDL_BASEDIR . 'Read.wsdl'); //$client = new SoapClient('http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_Reading.wsdl'); echo "Functions available:\n"; echo "********************\n"; var_export($client->__getFunctions()); echo "\n\n"; echo "we get the following server:\n"; echo "****************************\n\n"; var_export($client); echo "\n\n"; echo "we call the getSuggestions():\n"; echo "*****************************\n\n"; $result = $client->getSuggestions($session, "title"); var_export($result); echo "\n\n"; echo "we call the findByTitle():\n"; echo "**************************\n\n"; $result = $client->find($session, $clause, $order, 20, 'de'); var_export($result); echo "\n\n";
/** * Returns the available SOAP methods * * @return array List of SOAP methods */ public function listSources($data = null) { return $this->client->__getFunctions(); }
/** * Creates a booking for pickup with specific * pickup address. * * return array */ public function getSpecific() { // initialize SOAP client $client = new SoapClient($this->_url, array()); $funcs = $client->__getFunctions(); // initialize SOAP header $headerbody = array(self::USER_TOKEN => $this->_userToken); $header = new SoapHeader($this->_header, self::AUTH_HEADER, $headerbody); $client->__setSoapHeaders($header); // prepare parameters $param = array(self::BOOKING_DATE => $this->_date, self::REMARKS => $this->_remarks, self::FIRST_NAME => $this->_firstName, self::LAST_NAME => $this->_lastName, self::STREET1 => $this->_street1, self::STREET2 => $this->_street2, self::CITY => $this->_city, self::PROVINCE => $this->_province, self::POSTAL_CODE => $this->_postalCode, self::LANDMARK => $this->_landmark); //shippers landmark // execute SOAP method try { $result = $client->ScheduleDev($param); } catch (SoapFault $soapfault) { $this->_exceptionFlag = true; $exception = $soapfault->getMessage(); preg_match_all('/: (.*?). at/s', $exception, $error, PREG_SET_ORDER); //print error return $error[0][1]; } return $result; }
/* $url = "https://orbitalvar1.paymentech.net/authorize/"; $client = new SoapClient(null, array( 'soap_version'=>'SOAP_1_2', 'Content-type'=> 'application/PTI54', 'version'=>'2', 'location' => $url, 'uri'=>'Authorize', 'trace' => 1)); */ $ret = ""; try { $ret = $client->__getFunctions(); echo "<pre>"; print_r($ret); echo "</pre>"; //$ret = $client->__call("NewOrder", array( $soapstuff)); $foo = new GetProductBySKU(); $foo->sku = '100XLG'; //$ret = $client->GetProductBySKU($foo); //100XLG $ret = new getOfflineOrderSummary(); $ret->CustomerId = "0111693"; $ret = $client->GetOfflineOrderSummary($ret); //$ret= $client->newOrder($soapstuff);
// ensure legal class name (I don't think using . and whitespaces is allowed in terms of the SOAP standard, should check this out and may throw and exception instead...) $service['class'] = str_replace(' ', '_', $service['class']); $service['class'] = str_replace('.', '_', $service['class']); $service['class'] = str_replace('-', '_', $service['class']); if (in_array(strtolower($service['class']), $reserved_keywords)) { $service['class'] .= 'Service'; } // verify that the name of the service is named as a defined class if (class_exists($service['class'])) { throw new Exception("Class '" . $service['class'] . "' already exists"); } /*if(function_exists($service['class'])) { throw new Exception("Class '".$service['class']."' can't be used, a function with that name already exists"); }*/ // get operations $operations = $client->__getFunctions(); foreach ($operations as $operation) { /* This is broken, need to handle GetAllByBGName_Response_t GetAllByBGName(string $Name) list(int $pcode, string $city, string $area, string $adm_center) GetByBGName(string $Name) finding the last '(' should be ok */ //list($call, $params) = explode('(', $operation); // broken //if($call == 'list') { // a list is returned //} /*$call = array(); preg_match('/^(list\(.*\)) (.*)\((.*)\)$/', $operation, $call); if(sizeof($call) == 3) { // found list()
exit; $client = new SoapClient("http://203.113.145.197:8181/axis/test/acbTCBS.jws?wsdl", array("login" => "pnhdt", "password" => "1234567", "trace" => 1, "exceptions" => 0)); $client->setCredentials("pnhdt", "1234567"); /*$client = new SoapClient("http://*****:*****@203.113.145.197:8181/axis/test/acbTCBS.jws?wsdl", array( "login" => "pnhdt", "password" => "123456", "trace" => 1, "exceptions" => 0)); $client->setHeaders("<AuthHeader xmlns=\"203.113.145.197:8181\"> <UserName>$username</UserName> <Password>$password</Password> </AuthHeader>");*/ $client->yourFunction(); print "<pre>\n"; print "Request: \n" . htmlspecialchars($client->__getLastRequest()) . "\n"; print "Function: \n" . var_dump($client->__getFunctions()) . "\n"; print "Response: \n" . htmlspecialchars($client->__getLastResponse()) . "\n"; print "</pre>"; var_dump($client); echo $client->call("sayHello", $params = array('userID' => 'pnhdt', 'message' => 'e10adc3949ba59abbe56e057f20f883e'), '', ''); exit; $soap = new SOAP_Client('http://203.113.145.197:8181/axis/test/acbTCBS.jws?wsdl'); $username = '******'; $password = '******'; $soap->setHeaders("<AuthHeader xmlns=\"lokad.com/ws\">\r\n <UserName>{$username}</UserName>\r\n <Password>{$password}</Password>\r\n </AuthHeader>"); $ret = $soap->call('sayHello', $params = array('AuthenUser' => 'ba.nd', 'AuthenPass' => 'e10adc3949ba59abbe56e057f20f883e'), $options); echo "---------------sayHello-------------"; echo "<pre>"; print_r($ret); echo "</pre>"; exit;
/** * @return \stdClass JSON encoded array containing Available QAS methods */ public function getSoapActions() { $functions = $this->client->__getFunctions(); return $functions; }
$headers[] = new SoapHeader('http://www.topcall.com/2005/solution.wsdl', 'SendSimpleMessage', array('Service'=>'', 'Number' => '1234', 'Subject'=>'', 'Text' => '121212')); */ try { $result = $client->SendSimpleMessage(array('Service'=>"test string",'Number'=> "1234",'Subject'=>"234234",'Text'=>"dfgdfgdfg")); //$result = $client->__soapCall("SendSimpleMessage", array('bbb', '12345','aaa' ,'tresctresce')); echo "Response:\n" . $client->__getLastRequest() . "\n"; echo "Response:\n" . $client->__getLastRequestHeaders() . "\n"; echo "Response:\n" . $client->__getLastResponseHeaders() . "\n"; echo "Response:\n" . $client->__getLastResponse(); print_r($result); } catch (SoapFault $soapFault) { var_dump($soapFault); echo "Response:\n" . $client->__getLastRequest() . "\n"; echo "Response:\n" . $client->__getLastRequestHeaders() . "\n"; echo "Response:\n" . $client->__getLastResponseHeaders() . "\n"; var_dump($client->__getFunctions()); } echo "\n</pre>\n"; ?>
protected function setOverloadedWsdlFunctions() { //this method will grab a list of wsdl defined functions that we will be overloading using the magic __call() method $functions = parent::__getFunctions(); foreach ($functions as $fname) { //strip the actual function name out for our uses $start = strpos($fname, ' '); $end = strpos($fname, '('); //append the name of the function to our internal list, which we check in every __call() $this->overloadedWsdlFunctions[] = trim(substr($fname, $start, ($end - $start))); } }
<!DOCTYPE html> <!-- 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. --> <?php ////URL del WS //$url = "http://beta.akademeia.ufm.edu/cerebro/service.php?wsdl"; $url = "http://localhost/ceta/cerebro/service.php?wsdl"; ///Inicializamos el cliente SOAP $client = new SoapClient($url); ///Lista las funciones disponibles $fcs = $client->__getFunctions(); echo "<pre>"; print_r($fcs); echo "</pre>"; ////Creación del HASH es un md5 de la contatenación de client_id+|+client_email $test_ = $client->testconection("Mensaje de prueba"); $test2_ = $client->listaproyectores(); $test3_ = $client->infoproyector("2"); $test4_ = $client->infoproyector("10"); $test5_ = $client->getimagen("proyector1"); $test = json_decode($test_); $test2 = json_decode($test2_); $test3 = json_decode($test3_); $test5 = json_decode($test5_); ?> <html>
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(); }
<?php require 'stuff.php'; ini_set('memory_limit', -1); $config = parse_ini_file($argv[1]); if (!$config) { echo "Couldn't parse the config file."; exit(1); } $soap = new SoapClient('http://sildes0217.procergs.reders:6780/geows/geows?wsdl', array('trace' => true)); $ha = $soap->__getFunctions(); $ha1 = $soap->listaTabelas(); //$result1 = $soap->listaDados(array('arg0' => 'paismundo4326')); //$result2 = $soap->listaDados(array('arg0' => 'estadomundo4326')); //$result3 = $soap->listaDados(array('arg0' => 'estadomundo4326')); $result4 = $soap->listaDados(array('arg0' => 'municipiobr4326')); echo 'oi';
/** * baidu ping test */ public function actionPing() { $result = BetaBase::ping('贝塔资讯', 'http://www.waduanzi.com/', 'http://www.24beta.com/archives/406', 'http://www.24beta.com/'); print_r($result); exit; $client = new SoapClient(BAIDU_PING_URL); $functions = $client->__getFunctions(); var_dump($functions); exit; $arguments = array('贝塔IT资讯', 'http://www.24beta.com', 'http://www.24beta.com/archives/406', 'http://www.24beta.com'); $result = $client->__soapCall('weblogUpdates.extendedPing', $arguments); var_dump($result); }
} $clauses = array(array('connector' => '', 'subject' => 'Titel', 'predicate' => '~', 'object' => 'Mord')); $sort_order = array('Titel' => 'asc'); $limit = ''; $lang = 'de'; } 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); } // $result_array = new cFoundInformation; /* search for entries in hgkmedialib db */ $read_wsdl_loc = "http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_Reading.wsdl"; $read_client = new SoapClient($read_wsdl_loc); $function_list = $read_client->__getFunctions(); $result_array = $read_client->find($session_id, $clauses, $sort_order, $limit, $lang); echo showHTMLHeader(); echo showObject($result_array, 0); echo showHTMLFooter(); /* echo '<pre>result:'; echo 'Result Array:<br/>'; print_r($result_array); $result_array = $read_client->getInformation($session_id, 4545, "de"); print_r($result_array); echo '</pre>'; */
if (!$result) { throw new Exception($this->_db->lastErrorMsg()); } return $result; } catch (Exception $e) { throw new SoapFault('getNewsCount', $e->getMessage()); } } /* Метод считает количество новостей в указанной категории */ function getNewsCountByCat($cat_id) { try { $sql = "SELECT count(*) FROM msgs WHERE category={$cat_id}"; $result = $this->_db->querySingle($sql); if (!$result) { throw new Exception($this->_db->lastErrorMsg()); } return $result; } catch (Exception $e) { throw new SoapFault('getNewsCountByCat', $e->getMessage()); } } } // Создание сервера $client = new SoapClient("stock.wsdl"); // Вызов удалённой процедуры $amount = $server->getStock("b"); echo "Товаров на полке: {$amount}"; // Посмотреть список доступных операций print_r($client->__getFunctions());
<?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(); } */