/**
  *
  * This function return the data of the supplier
  * @param $idProduct
  * @param $language
  */
 function getProductSupplier($idSupplier, $language)
 {
     $objConection = new DataConection();
     $sql = "CALL GetSupplier('" . $language . "'," . $idSupplier . ")";
     $objConection->setQuery($sql);
     $supplier = $objConection->loadObject();
     return $supplier;
 }
Exemple #2
0
 /**
  *
  * This function find the avaible cities with rates
  * @param $requestXML
  * @param $xmlHeader
  */
 function findByCity($requestXML, $xmlHeader)
 {
     //Establece la lisa de monedas
     $this->setCurrencyList($requestXML->language);
     //Instancia la conexion
     $objConection = new DataConection();
     //Establece los datos de la busqueda en la etiqueta search
     $seach = $requestXML->search;
     //set the agency code
     $this->codeAgency = $requestXML->agency_code;
     //Valido si existe el parametro destacado
     if (!isset($seach->related) || $seach->related == "") {
         $seach->related = "2";
     }
     //Valido si existe el parametro total de items, si no establesco el configurado
     if (!isset($seach->total_items) || $seach->total_items == "") {
         $seach->total_items = $this->serviceConfig->totalItems;
     }
     //Llama al procedimiento almacenado enviandole los parametros
     $sql = "CALL FindCarCities(\n\t\t\t\t\t\t" . $this->serviceConfig->applyMarkup . ",\t\t\t\t\t\t \n\t\t\t\t\t\t'" . $seach->checkin_date . "',\n\t\t\t\t\t\t'" . $this->addDays($seach->checkout_date, 1) . "',\t\t\t\t\t\t\n\t\t\t\t\t\t" . ($this->diffDate($seach->checkin_date, $seach->checkout_date) - 1) . ",\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t" . $this->agency->idagency_group . ",\n\t\t\t\t\t\t" . $this->userAccess . ",\n\t\t\t\t\t\t" . $seach->related . ",\n\t\t\t\t\t\t" . $seach->total_items . "\n\t\t\t\t\t);";
     //se envia la consulta a la clase conexion
     $objConection->setQuery($sql);
     //Se ejecuta la consulta
     $result = $objConection->loadObjectList();
     if (!isset($seach->currency) || $seach->currency == "") {
         $seach->currency = 0;
     }
     if (count($result) > 0) {
         //Obtiene el xml organizado para enviarlo a la peticion
         $xmlObject = $this->objectToXmlFindCities($xmlHeader, $result, $seach->currency);
         return $xmlObject;
     } else {
         return $this->_objError->handleObjectError(5);
     }
 }
 /**
  *
  * This function return the list of supplier
  * @param $requestXML
  * @param $xmlHeader
  */
 function getSupplier($requestXML, $xmlHeader)
 {
     $objConection = new DataConection();
     $nameProduct = (string) $requestXML->product->name;
     $sql = "CALL GetSupplierList('" . (string) $requestXML->language . "', 3)";
     $objConection->setQuery($sql);
     $listTourismType = $objConection->loadObjectList();
     $xmlObject = $this->objectToXml($xmlHeader, $listTourismType, "supplier");
     return $xmlObject;
 }