本文整理汇总了PHP中Part::build_template_table_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Part::build_template_table_array方法的具体用法?PHP Part::build_template_table_array怎么用?PHP Part::build_template_table_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::build_template_table_array方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Log
$log = new Log($database);
$current_user = new User($database, $current_user, $log, 1);
// admin
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
/********************************************************************************
*
* Generate Table
*
*********************************************************************************/
if (!$fatal_error) {
try {
$parts = Part::get_noprice_parts($database, $current_user, $log);
$table_loop = Part::build_template_table_array($parts, 'noprice_parts');
$html->set_loop('table', $table_loop);
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->use_javascript(array('popup'));
if (!$fatal_error) {
// global stuff
$html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean');
示例2: array
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
/********************************************************************************
*
* Execute actions
*
*********************************************************************************/
if (!$fatal_error) {
switch ($action) {
case 'show_searched_parts':
// show the search results for adding parts to this device
try {
// search parts by name and description
$searched_parts = Part::search_parts($database, $current_user, $log, $new_part_name, '', true, true, false, false, false, false, false, false);
$searched_parts_loop = Part::build_template_table_array($searched_parts, 'searched_device_parts');
$html->set_variable('searched_parts_rowcount', count($searched_parts), 'integer');
$html->set_variable('no_searched_parts_found', count($searched_parts) == 0, 'integer');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
}
break;
case 'assign_by_selected':
// add some parts (which were listed by part search) to this device
for ($i = 0; $i < $searched_parts_rowcount; $i++) {
$part_id = isset($_REQUEST['id_' . $i]) ? (int) $_REQUEST['id_' . $i] : 0;
$quantity = isset($_REQUEST['quantity_' . $i]) ? abs((int) $_REQUEST['quantity_' . $i]) : 0;
$mountname = isset($_REQUEST['mountnames_' . $i]) ? trim((string) $_REQUEST['mountnames_' . $i]) : '';
if ($quantity > 0) {
try {
// if there is already such Part in this Device, the quantity will be increased
示例3: header
$header .= '&search_manufacturer=1';
}
header($header);
}
/********************************************************************************
*
* Generate Table
*
*********************************************************************************/
if (!$fatal_error) {
try {
$category_parts = Part::search_parts($database, $current_user, $log, $keyword, 'categories', $search_name, $search_description, $search_comment, $search_footprint, $search_category, $search_storelocation, $search_supplier, $search_supplierpartnr, $search_manufacturer);
$hits_count = count($category_parts, COUNT_RECURSIVE) - count($category_parts);
$parts_table_loops = array();
foreach ($category_parts as $category_full_path => $parts) {
$parts_table_loops[$category_full_path] = Part::build_template_table_array($parts, 'search_parts');
}
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->use_javascript(array('popup'));
$html->set_variable('keyword', $keyword, 'string');
$html->set_variable('hits_count', isset($hits_count) ? $hits_count : 0, 'integer');
$html->set_variable('search_name', $search_name, 'boolean');
示例4: header
break;
}
}
if (isset($reload_site) && $reload_site && !$config['debug']['request_debugging_enable']) {
// reload the site to avoid multiple actions by manual refreshing
header('Location: show_obsolete_parts.php?show_no_orderdetails_parts=' . ($show_no_orderdetails_parts ? '1' : '0'));
}
/********************************************************************************
*
* Generate Table
*
*********************************************************************************/
if (!$fatal_error) {
try {
$parts = Part::get_obsolete_parts($database, $current_user, $log, $show_no_orderdetails_parts);
$table_loop = Part::build_template_table_array($parts, 'obsolete_parts');
$html->set_loop('table', $table_loop);
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->use_javascript(array('popup'));
if (!$fatal_error) {
// obsolete parts
$html->set_variable('show_no_orderdetails_parts', $show_no_orderdetails_parts, 'boolean');
示例5: build_template_table_array
/**
* @copydoc Part::build_template_table_array()
*/
public static function build_template_table_array($parts, $table_type)
{
return Part::build_template_table_array($parts, $table_type);
}
示例6: array
if (!$fatal_error) {
try {
if ($selected_supplier_id > 0) {
$parts = Part::get_order_parts($database, $current_user, $log, array($selected_supplier_id));
} else {
$parts = Part::get_order_parts($database, $current_user, $log);
}
// parts from ALL suppliers
$sum_price = 0;
foreach ($parts as $part) {
$orderdetails = $part->get_order_orderdetails();
if (is_object($orderdetails)) {
$sum_price += $orderdetails->get_price(false, $part->get_order_quantity());
}
}
$table_loop = Part::build_template_table_array($parts, 'order_parts');
$html->set_loop('table', $table_loop);
$html->set_variable('table_rowcount', count($parts), 'integer');
$html->set_variable('sum_price', float_to_money_string($sum_price), 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate "Devices to order"-Table
*
*********************************************************************************/
if (!$fatal_error) {
try {
示例7: file_get_contents
$html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean');
$html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean');
$html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean');
$html->set_variable('popup_width', $config['popup']['width'], 'integer');
$html->set_variable('popup_height', $config['popup']['height'], 'integer');
// import stuff
$html->set_variable('file_format', $file_format, 'string');
$html->set_variable('separator', $separator, 'string');
$csv_file_example = file_get_contents(BASE . '/documentation/examples/import_parts/import_parts.csv');
$html->set_variable('csv_file_example', $csv_file_example, 'string');
$xml_file_example = file_get_contents(BASE . '/documentation/examples/import_parts/import_parts.xml');
$html->set_variable('xml_file_example', $xml_file_example, 'string');
$html->set_variable('file_content', $file_content, 'string');
try {
if (isset($new_parts)) {
$new_parts_loop = Part::build_template_table_array($new_parts, 'imported_parts');
}
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('upload');
if (isset($import_data)) {
$html->set_loop('table', $table_loop);