/** * Next returns the next object in the collection. * * @access public * @return Preezable */ function Next() { if ($this->UnableToCache) { require_once "verysimple/Util/ExceptionFormatter.php"; $info = ExceptionFormatter::FormatTrace(debug_backtrace()); $this->_phreezer->Observe("(DataSet.Next: unable to cache query with cursor) " . $info . " " . $this->_sql, OBSERVE_DEBUG); // use this line to discover where an uncachable query is coming from // throw new Exception("WTF"); // stop this warning from repeating on every next call for this dataset $this->UnableToCache = false; } $this->_verifyRs(); $this->_current = null; $this->_counter++; if ($this->_eof) { if (!$this->_no_exception) { throw new Exception("EOF: This is a forward-only dataset."); } } if ($row = $this->_phreezer->DataAdapter->Fetch($this->_rs)) { $this->_current = $this->_getObject($row); $this->_last = $this->_current; } else { $this->_eof = true; } return $this->_current; }
* * @package Html2pdf * @author Laurent MINGUET <*****@*****.**> * @copyright 2016 Laurent MINGUET */ // attention au chemin de l'autoload de la librairie html2pdf!!! require_once '/../../../vendor/autoload.php'; try { // get the HTML ob_start(); //chemin du template pour la génération du pdf: C:\xampp\htdocs\ProjetMAJ\app\templates\booking\res include dirname(__FILE__) . '/res/facture_hotel.php'; $content = ob_get_clean(); $html2pdf = new Html2Pdf('P', 'A4', 'fr'); $html2pdf->pdf->SetDisplayMode('fullpage'); $html2pdf->writeHTML($content); //soucis pour écrire le pdf ici: http://stackoverflow.com/questions/28853871/fopen-remote-host-file-access-not-accepted-on-a-local-file //attention au chemin en premier argument! ici on utilise un dossier dédié pour stocker toutes les factures //dabord on affiche le pdf dans le navigateur //on recupère l'id du booking pour le sufixer le nom du pdf... //echo $id_booking ; //die(); $html2pdf->Output(__DIR__ . '\\res\\pdf\\facture_hotel_' . $id_booking . '.pdf'); //ensuite on sauvegarder le fichier dans le dossier 'pdf' du dossier res //$html2pdf->Output(__DIR__ .'\res\pdf\facture_hotel_'.$id_booking.'.pdf','F'); //je sauvegarde dans le dossier pdf dans asset pour etre accessible depuis le framework... $html2pdf->Output(__DIR__ . '\\res\\..\\..\\..\\..\\public\\assets\\pdf\\facture_hotel_' . $id_booking . '.pdf', 'F'); } catch (Html2PdfException $e) { $formatter = new ExceptionFormatter($e); echo $formatter->getHtmlMessage(); }
function carritoPDF($val) { try { //ob_clean(); $content = ""; ob_start(); require_once 'carro_pdf.php'; $content = ob_get_clean(); $html2pdf = new Html2Pdf('P', 'A4', 'fr'); // $content = ob_get_clean(); $html2pdf->writeHTML($content); $html2pdf->Output("../../factura/control/carro" . $val . ".pdf", "F"); ob_get_clean(); // $html2pdf->Output(); } catch (Html2PdfException $e) { $formatter = new ExceptionFormatter($e); echo $formatter->getHtmlMessage(); } }
/** * */ private function retrieveUserByEmail($emailAddr) { try { // get joomla user $user = ExpresslyHelper::get_user_by_email($emailAddr); if (null !== $user) { $customer = new \Expressly\Entity\Customer(); $email = new \Expressly\Entity\Email(); $email->setEmail($emailAddr)->setAlias('primary'); $customer->addEmail($email); if (!empty($user->id)) { $userInfo_ids = JFactory::getDBO()->setQuery('SELECT `virtuemart_userinfo_id` FROM `#__virtuemart_userinfos` WHERE `virtuemart_user_id` = "' . intval($user->id) . '" ORDER BY `address_type` ASC')->loadColumn(0); } else { $userInfo_ids = array(); } foreach ($userInfo_ids as $uid) { $userInfo = VmTable::getInstance('userinfos', 'Table', array('dbo' => JFactory::getDbo())); $userInfo->load($uid); if ('BT' == $userInfo->address_type) { $customer->setFirstName($userInfo->first_name)->setLastName($userInfo->last_name); } $address = new \Expressly\Entity\Address(); $address->setFirstName($userInfo->first_name)->setLastName($userInfo->last_name)->setAddress1($userInfo->address_1)->setAddress2($userInfo->address_2)->setCity($userInfo->city)->setZip($userInfo->zip); $address->setCountry(ExpresslyHelper::get_country_iso3_by_id($userInfo->virtuemart_country_id)); $address->setStateProvince(ExpresslyHelper::get_state_name_by_id($userInfo->virtuemart_state_id)); if (!empty($userInfo->phone_1)) { $phone = new \Expressly\Entity\Phone(); $phone->setType(\Expressly\Entity\Phone::PHONE_TYPE_HOME)->setNumber(strval($userInfo->phone_1)); $customer->addPhone($phone); $address->setPhonePosition(intval($customer->getPhoneIndex($phone))); } if (!empty($userInfo->phone_2)) { $phone = new \Expressly\Entity\Phone(); $phone->setType(\Expressly\Entity\Phone::PHONE_TYPE_MOBILE)->setNumber(strval($userInfo->phone_2)); $customer->addPhone($phone); if (empty($userInfo->phone_1)) { $address->setPhonePosition(intval($customer->getPhoneIndex($phone))); } } $customer->addAddress($address, true, 'BT' == $userInfo->address_type ? \Expressly\Entity\Address::ADDRESS_BILLING : \Expressly\Entity\Address::ADDRESS_SHIPPING); } $merchant = $this->app['merchant.provider']->getMerchant(); $response = new \Expressly\Presenter\CustomerMigratePresenter($merchant, $customer, $emailAddr, $user->id); ExpresslyHelper::send_json($response->toArray()); } } catch (\Exception $e) { $this->app['logger']->error(ExceptionFormatter::format($e)); ExpresslyHelper::send_json([]); } }