コード例 #1
0
ファイル: details.php プロジェクト: BackupTheBerlios/molecms
$tbl->addRow(array($lang->translate('website'), $row->product_url));
$tbl->setColAttributes(0, 'width="100"');
$tbl->setColAttributes(1, 'width="300"');
$row1Style = array('class' => 'overview');
$row2Style = array('class' => 'overviewalternate');
$tbl->altRowAttributes(0, $row1Style, $row2Style);
$tpl->setVariable("UEBERSCHRIFT", $row->product_name);
$tpl->SetVariable("TABELLE_UEBERSCHRIFT", $row->product_name . " (" . $link_back . ")");
/** BEGIN Vertrieb **/
$query = "select *,t_reseller.name as reseller\n        from {$table['product']},{$table['company']} as t_reseller, {$table['reseller']}\n        where {$table['product']}.id={$id}\n        AND {$table['product']}.id={$table['reseller']}.id_produkt\n        AND {$table['reseller']}.id_firma=t_reseller.id";
require_once 'mms_tablepager.php';
$tabpage = new PageTable($cfg['database']['dsn'], "overview");
$tabpage->fields = array('name', 'land');
$tabpage->make_url = false;
$tabpage->add_extra = false;
$tabpage->col_view = 'name';
$tabpage->url_view = url(array('module' => 'company', 'action' => 'details'));
$res_vertrieb = '<h2>' . $lang->translate('reseller') . '</h2>' . $tabpage->get($query, $from, 'overview') . '<br>';
/** END Vertrieb **/
/** BEGIN Beispielmischungen **/
$query = "select *,{$table['compound']}.id as mixid, {$table['compound']}.name_" . LC_LANG . " as mischname from {$table['product']},{$table['compound_details']},{$table['compound']} where {$table['compound_details']}.id_produkt={$table['product']}.id AND {$table['compound']}.id = {$table['compound_details']}.id_mischung AND {$table['product']}.id={$id}";
$tabpage = new PageTable($cfg['database']['dsn'], "overview");
$tabpage->fields = array('mischname');
$tabpage->map_cols = array('mischname' => $lang->translate('compound'));
$tabpage->url_view = url(array('module' => 'compound', 'action' => 'details'));
$tabpage->setEmptyString($lang->translate('no compounds available for this product'));
$res_compound = '<h2>' . $lang->translate('compound') . '</h2>' . $tabpage->get($query, $from, 'overview');
/** END Beispielmischungen  **/
$tpl->setCurrentBlock("TABELLEBLOCK");
$tpl->setVariable("TABELLE", $tbl->toHTML() . $res_vertrieb . $res_compound);
$tpl->parseCurrentBlock();