本文整理汇总了PHP中Supplier::build_html_tree方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::build_html_tree方法的具体用法?PHP Supplier::build_html_tree怎么用?PHP Supplier::build_html_tree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::build_html_tree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
if (is_object($selected_supplier)) {
$parent_id = $selected_supplier->get_parent_id();
$html->set_variable('id', $selected_supplier->get_id(), 'integer');
$html->set_variable('name', $selected_supplier->get_name(), 'string');
$html->set_variable('address', $selected_supplier->get_address(), 'string');
$html->set_variable('phone_number', $selected_supplier->get_phone_number(), 'string');
$html->set_variable('fax_number', $selected_supplier->get_fax_number(), 'string');
$html->set_variable('email_address', $selected_supplier->get_email_address(), 'string');
$html->set_variable('website', $selected_supplier->get_website(), 'string');
$html->set_variable('auto_product_url', $selected_supplier->get_auto_product_url(NULL), 'string');
} elseif ($action == 'add') {
$parent_id = $new_parent_id;
} else {
$parent_id = 0;
}
$supplier_list = $root_supplier->build_html_tree($selected_id, true, false);
$html->set_variable('supplier_list', $supplier_list, 'string');
$parent_supplier_list = $root_supplier->build_html_tree($parent_id, true, true);
$html->set_variable('parent_supplier_list', $parent_supplier_list, 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'edit_suppliers.php' : '';
// an empty string means that the...
示例2: array
$html->set_variable('name', $part->get_name(), 'string');
$html->set_variable('description', $part->get_description(), 'string');
$html->set_variable('instock', $part->get_instock(), 'integer');
$html->set_variable('mininstock', $part->get_mininstock(), 'integer');
$html->set_variable('visible', $part->get_visible(), 'boolean');
$html->set_variable('comment', $part->get_comment(), 'string');
// dropdown lists -> get IDs
$category_id = is_object($part->get_category()) ? $part->get_category()->get_id() : 0;
$footprint_id = is_object($part->get_footprint()) ? $part->get_footprint()->get_id() : 0;
$storelocation_id = is_object($part->get_storelocation()) ? $part->get_storelocation()->get_id() : 0;
$manufacturer_id = is_object($part->get_manufacturer()) ? $part->get_manufacturer()->get_id() : 0;
// build orderdetails loop
$orderdetails_loop = array();
$row_odd = true;
foreach ($part->get_orderdetails() as $orderdetails) {
$supplier_list = $root_supplier->build_html_tree($orderdetails->get_supplier()->get_id(), true, false);
$pricedetails_loop = array();
foreach ($orderdetails->get_pricedetails() as $pricedetails) {
$pricedetails_loop[] = array('row_odd' => !$row_odd, 'orderdetails_id' => $orderdetails->get_id(), 'pricedetails_id' => $pricedetails->get_id(), 'min_discount_quantity' => $pricedetails->get_min_discount_quantity(), 'price' => $pricedetails->get_price(false, $pricedetails->get_price_related_quantity()), 'price_related_quantity' => $pricedetails->get_price_related_quantity());
}
if (count($pricedetails_loop) > 0) {
$next_min_discount_quantity = $pricedetails_loop[count($pricedetails_loop) - 1]['min_discount_quantity'] * 10;
} else {
$next_min_discount_quantity = 1;
}
$pricedetails_loop[] = array('orderdetails_id' => $orderdetails->get_id(), 'pricedetails_id' => 'new', 'min_discount_quantity' => $next_min_discount_quantity, 'price' => 0, 'price_related_quantity' => 1);
$orderdetails_loop[] = array('row_odd' => $row_odd, 'orderdetails_id' => $orderdetails->get_id(), 'supplier_list' => $supplier_list, 'supplierpartnr' => $orderdetails->get_supplierpartnr(), 'obsolete' => $orderdetails->get_obsolete(), 'pricedetails' => $pricedetails_loop);
$row_odd = !$row_odd;
}
// add one additional row -> with this row you can add more orderdetails
$supplier_list = $root_supplier->build_html_tree(0, true, false);