本文整理汇总了PHP中Supplier::get_count方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::get_count方法的具体用法?PHP Supplier::get_count怎么用?PHP Supplier::get_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::get_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
}
}
/********************************************************************************
*
* Show a warning if there are empty tables
* (categories, storelocations, footprints, suppliers)
*
*********************************************************************************/
if (!$fatal_error && !$database->is_update_required()) {
$good = "✔ ";
$bad = "✘ ";
try {
$missing_category = Category::get_count($database) == 0 ? $bad : $good;
$missing_storelocation = Storelocation::get_count($database) == 0 ? $bad : $good;
$missing_footprint = Footprint::get_count($database) == 0 ? $bad : $good;
$missing_supplier = Supplier::get_count($database) == 0 ? $bad : $good;
$display_warning = $missing_category == $bad || $missing_storelocation == $bad || $missing_footprint == $bad || $missing_supplier == $bad;
$html->set_variable('missing_category', $missing_category);
$html->set_variable('missing_storeloc', $missing_storelocation);
$html->set_variable('missing_footprint', $missing_footprint);
$html->set_variable('missing_supplier', $missing_supplier);
$html->set_variable('display_warning', $display_warning, 'boolean');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
}
}
/********************************************************************************
*
* Show a warning if there are footprints with broken filenames
*
*********************************************************************************/
示例2: count
* Set all HTML variables
*
*********************************************************************************/
if (!$fatal_error) {
try {
$noprice_parts = Part::get_noprice_parts($database, $current_user, $log);
$count_of_parts_with_price = Part::get_count($database) - count($noprice_parts);
// :-)
$html->set_variable('parts_count_with_prices', $count_of_parts_with_price, 'integer');
$html->set_variable('parts_count_sum_value', Part::get_sum_price_instock($database, $current_user, $log, true), 'string');
$html->set_variable('parts_count', Part::get_count($database), 'integer');
$html->set_variable('parts_count_sum_instock', Part::get_sum_count_instock($database), 'integer');
$html->set_variable('categories_count', Category::get_count($database), 'integer');
$html->set_variable('footprint_count', Footprint::get_count($database), 'integer');
$html->set_variable('location_count', Storelocation::get_count($database), 'integer');
$html->set_variable('suppliers_count', Supplier::get_count($database), 'integer');
$html->set_variable('manufacturers_count', Manufacturer::get_count($database), 'integer');
$html->set_variable('devices_count', Device::get_count($database), 'integer');
$html->set_variable('attachements_count', Attachement::get_count($database), 'integer');
$html->set_variable('footprint_picture_count', count(find_all_files(BASE . '/img/footprints/', true)), 'integer');
$html->set_variable('iclogos_picture_count', count(find_all_files(BASE . '/img/iclogos/', true)), 'integer');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/