Sådan benyttes komponenten EngineBasketInvoice klassen
Først skal du inkludere den fil der beskriver komponenten, som en klasse fil
<? require_once(HTML_PACKAGE_PATH.'/EngineBasketInvoice.php'); ?>
Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):
<? EngineBasketInvoice::display($param1, $param2, $param3, ...); ?>
eller du kan lave en instance af komponenten og benytte metoderne direkte:
<? $object = new EngineBasketInvoice($param1, $param2, $param3, ...); print $object->getHtml(); ?>
Sådan vises komponenten EngineBasketInvoice klassen
Dato TODO
Levering efter aftale, normalt inden for 1-2 dage, men i højsæson kan der være en smule ventetid. Ring på tlf. (+45) 40 50 60 69 og hør nærmere.
Den fulde PHP kildekode for EngineBasketInvoice klassen
<?php/** * @package db-basket * @see HTML_DB_BASKET_CONTROLLER_PATH.'/EngineBasketInvoice.php' * @copyright (c) http://Finn-Rasmussen.com * @license http://Finn-Rasmussen.com/license/ myPHP License conditions * @author http://Finn-Rasmussen.com * @version 1.11 * @since 27-nov-2009 *//** * The required files */require_once(HTML_BASE_COMMON_PATH.'/Html.php');require_once(HTML_DB_BASKET_VIEW_PATH.'/ViewBasketInvoice.php');require_once(HTML_DB_BASKET_QUERY_PATH.'/QueryBasket.php');require_once(HTML_DB_CUSTOMER_QUERY_PATH.'/QueryCustomer.php');require_once(HTML_DTO_UTIL_PATH.'/DataReaderFactory.php');require_once(HTML_DB_DATABASE_PATH.'/Command.php');/** * The Engine Basket Invioce parsing engine * This is the controller for a Basket Invoice * <code> * Usage: * $sid = 'the current sid for this user'; * $engine = new EngineBasketInvoice($sid); * print $engine->getHtml(); * Or * EngineBasketInvoice::display($sid); * </code> * @package db-basket */class EngineBasketInvoice extends Html { /** * @var String $sid The SID to use */ protected $sid = ''; /** * Constructor * @param String $sid The SID to use */ function __construct($sid) { parent::__construct(); $this->sid = $sid; } /** * Returns the DataReader object for the Customer Info * @return DataReader The DataReader object for the Customer Info */ function newCustomerInfo() { $id = ""; $translate = false; $sql = QueryCustomer::get(DATABASE_PREFIX.TABLE_NAME_CUSTOMER, $id, $this->sid, $translate); return Command::newDataReader($sql); } /** * Returns the DataReader object for the Basket Info * @return DataReader The DataReader object for the Basket Info */ function newBasketInfo() { /** * Ignore any $id from the POST/GET request */ $table = DATABASE_PREFIX.TABLE_NAME_BASKET; $id = IGNORE_REQUEST_ID; $translate = true; $orderby = ""; $sort = ""; $skip = LIMIT_NAME_SKIP_NONE; // Get all the order lines $sql = QueryBasket::get($table, $id, $this->sid, $translate, $orderby, $sort, $skip); return Command::newDataReader($sql); } /** * Returns the DataReader object for the Company Info * @return DataReader The DataReader object for the Company Info */ function newCompanyInfo() { $rows = DefaultRowsCompany::get(); $header = ''; // The header meta data $default = ''; // The default meta data array $limit = ''; // The limit to use for the array $sort = true; return DataReaderFactory::newDataReader($rows, $header, $default, $limit, $sort); } /** * Returns the html for the Engine Basket Invioce controller * @return String the complete html */ function getHtml() { $html = $this->html; // DataReader objects $customerInfo = $this->newCustomerInfo(); $basketInfo = $this->newBasketInfo(); $companyInfo = $this->newCompanyInfo(); // The view $view = new ViewBasketInvoice(); $view->setCustomerInfo( $customerInfo ); $view->setBasketInfo ( $basketInfo ); $view->setCompanyInfo ( $companyInfo ); $html .= $view->getHtml(); return $html; } /** * Display html * <code> * Usage: * EngineBasketInvoice::display($sid); * </code> * @static * @param String $sid The SID to use */ public static function display($sid) { $html = new EngineBasketInvoice($sid); $html->addHtml(); }}?>
Den fulde HTML kildekode for EngineBasketInvoice klassen
<? <!-- DEBUG: EngineBasketInvoice --> <!-- DEBUG: ViewBasketInvoice --> <table id="ViewBasketInvoiceId" width="650px" class="NONE" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" width="1px" title="ctl"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ctl.gif" width="9" height="19" alt="ctl.gif" class="baseFloatLeft" border="0" /> </td> <td valign="top" width="1px" title="ctc"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ctc.gif" width="100%" height="19" alt="ctc.gif" class="baseFloatLeft" border="0" /> </td> <td valign="top" width="1px" title="ctr"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ctr.gif" width="9" height="19" alt="ctr.gif" class="baseFloatLeft" border="0" /> </td> </tr> <tr> <td class=" tableCornerView" valign="top" width="1px" title="ccl"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ccl.gif" width="9" height="100%" alt="ccl.gif" class="baseFloatLeft" border="0" /> </td> <td class=" tableCornerView" valign="top" width="1px" title="ccc"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ccc.gif" width="1" height="1" alt="ccc.gif" class="baseFloatLeft" border="0" /> <!-- DEBUG: Table --> <!-- DEBUG: TableHeader --> <!-- No text in TableHeader --> <table width="650px" class="tableBasketInvoiceView baseBorder" border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><!-- DEBUG: ViewCustomerInfo --> <table id="ViewCustomerInfoId" width="400" class="NONE" border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="top">1<br /> 5cb3a39002cf9566f2ba763dbce8ef96<br /> <!-- DEBUG: EmailLink --> <!-- finn@hvepse-eksperten.dk --><a class="baseLinkColor" href="mailto:finn@hvepse-eksperten.dk" title="finn@hvepse-eksperten.dk">finn@hvepse-eksperten.dk</a> <br /> Finn Rasmussen<br /> HvepseEksperten.dk ApS<br /> Kongens Vænge 79<br /> 3400 Hillerød<br /> Privat telefon: 48246037<br /> Mobil telefon: 40506069<br /> Firma telefon: 48246030<br /> EAN: 9876543210123<br /> </td> </tr> </table> </td> <td valign="top"><div class="baseAlignRight"><!-- DEBUG: ViewCompanyInfo --> <table id="ViewCompanyInfoId" width="400" class="NONE" border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="top">HvepseEksperten.dk ApS<br /> Finn Rasmussen<br /> Kongens Vænge 79<br /> 3400 Hillerød<br /> Privat telefon: 48 24 60 37<br /> Mobil telefon: 40 50 60 69<br /> Firma telefon: 48 24 60 30<br /> Cvr nr.: 10142865 <br /> <!-- DEBUG: EmailLink --> <!-- http://hvepseeksperten.dk/FormMail/ --><a class="baseLinkColor" href="http://hvepseeksperten.dk/FormMail/" title="http://hvepseeksperten.dk/FormMail/">http://hvepseeksperten.dk/FormMail/</a> <br /> </td> </tr> </table> </div> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"><!-- DEBUG: ViewPaymentInfo --> <h1>ViewPaymentInfo->getHtml() TODO</h1> <p>Dato TODO</p> </td> </tr> <tr> <td valign="top" colspan="2"><!-- DEBUG: ViewBasketInfo --> <!-- DEBUG: TableHeader --> <table width="650px" class="tableBasketView baseBorder" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="baseArrowHeader" valign="middle"><!-- DEBUG: Link --> <a class="baseLinkColor" href="/source-code/db-basket/EngineBasketInvoice/index.php" title="Klik her for at Minimere ... TableHeader"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/arrow-headline.gif" width="4" height="7" alt="arrow-headline.gif" /> </a> </td> <th class="baseColorHeader" valign="top" align="left">Indkøbskurv (3) </th> </tr> </table> <table id="ViewBasketInfoId" width="650px" class="tableBasketView baseBorder" border="0" cellpadding="2" cellspacing="0"> <tr> <th class="baseColorHeader" valign="top"><!-- DEBUG: Style --> <style type="text/css"> .widthHeader{width:47px}</style> <div class="widthHeader"><!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorHeader" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=05dc0c5f6ee78feac35b0fb4159651a0" title="CRUD_VIEW_FORM_CREATE Indsæt ny"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/new.gif" width="13" height="13" alt="CRUD_VIEW_FORM_CREATE Indsæt ny" class="baseColorHeader" /> </a> <!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorHeader" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=4cf67d4dbd3b698d92d1554ed53d94c8" title="CRUD_VIEW_FORM_MULTIPLE Opdater flere informationer"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/multiple.gif" width="13" height="13" alt="CRUD_VIEW_FORM_MULTIPLE Opdater flere informationer" class="baseColorHeader" /> </a> <!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorHeader" href="#" title="CRUD_VIEW_FORM_REMOVE Slet det hele" onclick="if (confirm('Slet det hele? ()')) {location.href='/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=28d7757d7e61c9c340fc714d6077a767';}"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/remove.gif" width="13" height="13" alt="CRUD_VIEW_FORM_REMOVE Slet det hele" class="baseColorHeader" /> </a> </div> </th> <th class="baseColorHeader baseNoWrap" valign="top"> <!-- Link 100 string demo_basket --> Link </th> <th class="baseColorHeader baseNoWrap" valign="top"> <!-- Tekst 100 string demo_basket not_null --> Tekst </th> <th class="baseColorHeader baseNoWrap" valign="top"> <!-- Beskrivelse 255 string demo_basket --> Beskrivelse </th> <th class="baseColorHeader baseNoWrap baseAlignRight" valign="top" align="right"> <!-- Antal 11 int demo_basket not_null --> Antal </th> <th class="baseColorHeader baseNoWrap baseAlignRight" valign="top" align="right"> <!-- Pris 12 real demo_basket not_null --> Pris </th> <th class="baseColorHeader baseNoWrap baseAlignRight" valign="top" align="right"> <!-- Beløb 22 real not_null binary --> Beløb </th> </tr> <tr> <td class="baseColorDark" valign="top"><!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorDark" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=dbec4b60abeb38e24fa03fc93c627b3b&utilID=QVo2NVpB" title="CRUD_VIEW_FORM_DETAIL Vis"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/detail.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DETAIL Vis" class="baseColorDark" /> </a> <!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorDark" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=6b65666eed0eabec518783233ed1465b&utilID=QVo2NVpB" title="CRUD_VIEW_FORM_DELETE Slet denne"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/delete.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DELETE Slet denne" class="baseColorDark" /> </a> </td> <td class="baseColorDark" valign="top"> </td> <td class="baseColorDark" valign="top">Standard Hvepsebo bekæmpelse </td> <td class="baseColorDark" valign="top">Et standard hvepsebo sidder i nå-højde, og man behøver hverken at kravle op på loftet eller ned i krybekælderen </td> <td class="baseColorDark baseAlignRight" valign="top">1 </td> <td class="baseColorDark baseAlignRight" valign="top">680,00 </td> <td class="baseColorDark baseAlignRight" valign="top">680,00 </td> </tr> <tr> <td class="baseColorLight" valign="top"><!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorLight" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=dbec4b60abeb38e24fa03fc93c627b3b&utilID=QVo2NlpB" title="CRUD_VIEW_FORM_DETAIL Vis"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/detail.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DETAIL Vis" class="baseColorLight" /> </a> <!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorLight" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=6b65666eed0eabec518783233ed1465b&utilID=QVo2NlpB" title="CRUD_VIEW_FORM_DELETE Slet denne"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/delete.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DELETE Slet denne" class="baseColorLight" /> </a> </td> <td class="baseColorLight" valign="top"> </td> <td class="baseColorLight" valign="top">Kørsel </td> <td class="baseColorLight" valign="top"> </td> <td class="baseColorLight baseAlignRight" valign="top">1 </td> <td class="baseColorLight baseAlignRight" valign="top">150,00 </td> <td class="baseColorLight baseAlignRight" valign="top">150,00 </td> </tr> <tr> <td class="baseColorDark" valign="top"><!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorDark" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=dbec4b60abeb38e24fa03fc93c627b3b&utilID=QVo2N1pB" title="CRUD_VIEW_FORM_DETAIL Vis"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/detail.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DETAIL Vis" class="baseColorDark" /> </a> <!-- DEBUG: ImageLink --> <!-- DEBUG: Link --> <a class="baseColorDark" href="/source-code/db-basket/EngineBasketInvoice/index.php?baseCOMMAND=6b65666eed0eabec518783233ed1465b&utilID=QVo2N1pB" title="CRUD_VIEW_FORM_DELETE Slet denne"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/delete.gif" width="13" height="13" alt="CRUD_VIEW_FORM_DELETE Slet denne" class="baseColorDark" /> </a> </td> <td class="baseColorDark" valign="top"> </td> <td class="baseColorDark" valign="top">Rabat ved online betaling </td> <td class="baseColorDark" valign="top"> </td> <td class="baseColorDark baseAlignRight" valign="top">1 </td> <td class="baseColorDark baseAlignRight" valign="top">÷150,00 </td> <td class="baseColorDark baseAlignRight" valign="top">÷150,00 </td> </tr> <tr> <td class="tableBorderTop baseColorDark" valign="top">Beløb </td> <td class="tableBorderTop baseColorDark baseAlignRight" valign="top" colspan="8">680,00 </td> </tr> <tr> <td class="baseColorDark" valign="top">Moms </td> <td class="baseColorDark baseAlignRight" valign="top" colspan="8">170,00 </td> </tr> <tr> <td class="tableBorderTop baseColorLight" valign="top">Ialt </td> <td class="tableBorderTop baseColorLight baseAlignRight" valign="top" colspan="8"> DKK 850,00 </td> </tr> </table> </td> </tr> <tr> <td valign="top" colspan="2"><!-- DEBUG: ViewDeliveryInfo --> <h1>Leverings betingelser</h1> <p>Levering efter aftale, normalt inden for 1-2 dage, men i højsæson kan der være en smule ventetid.<br /> Ring på tlf. (+45) 40 50 60 69 og hør nærmere.</p> </td> </tr> <tr> <td valign="top" colspan="2"><!-- DEBUG: ViewWarrantyInfo --> <h1>ViewWarrantyInfo->getHtml() TODO</h1> </td> </tr> </table> </td> <td class=" tableCornerView" valign="top" width="1px" title="ccr"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/ccr.gif" width="9" height="100%" alt="ccr.gif" class="baseFloatLeft" border="0" /> </td> </tr> <tr> <td valign="top" width="1px" title="cbl"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/cbl.gif" width="9" height="19" alt="cbl.gif" class="baseFloatLeft" border="0" /> </td> <td valign="top" width="1px" title="cbc"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/cbc.gif" width="100%" height="19" alt="cbc.gif" class="baseFloatLeft" border="0" /> </td> <td valign="top" width="1px" title="cbr"><!-- DEBUG: Images --> <img src="http://borebiller.info/images/cbr.gif" width="9" height="19" alt="cbr.gif" class="baseFloatLeft" border="0" /> </td> </tr> </table> ?>
Her er 'klasse metoderne' for EngineBasketInvoice klassen:
Her er 'objekt variable' for EngineBasketInvoice klassen: