本文整理汇总了PHP中get_category_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_category_name函数的具体用法?PHP get_category_name怎么用?PHP get_category_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_category_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_purchases_cost
function print_purchases_cost()
{
global $path_to_root;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$destination = $_POST['PARAM_2'];
$orientation = $_POST['PARAM_3'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$dec = user_price_dec();
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
$cols = array(0, 20, 55, 85, 125, 200, 230, 260, 290, 325, 350, 375, 425, 475);
//14 headers + 1 lagi dapat for cols
//todo: format date paid to 2 digits representation only i.e. 12/12/12
$headers = array(_('CV#'), _('Date Paid'), _('OR #'), _('Supplier'), _('Title of Book'), _('Quantity'), _('Unit Cost'), _('Amount'), _('With Tax'), _('Net'), _('PO #'), _('Stock Supplied'), _('Stock Amount'), _('Total Amount'));
//todo: Date Paid, OR(official receipt number) Amount, w/tax, net, Stock supplied, stock amount and total amount
// Possible tables to read on: grn_batch and grn_items
$aligns = array('left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'left');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''));
$rep = new FrontReport(_('Summary of Purchases at Cost Report'), "SummaryPurchasesCostReport", user_pagesize(), 8, 'L');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($from, $to);
$total = $grandtotal = 0.0;
$total1 = $grandtotal1 = 0.0;
$total2 = $grandtotal2 = 0.0;
$catt = '';
while ($trans = db_fetch($res)) {
$rep->NewLine();
$rep->fontSize -= 2;
$rep->TextCol(3, 4, $trans['supp_name']);
$rep->TextCol(4, 5, $trans['description']);
$rep->AmountCol(5, 6, $trans['quantity_ordered']);
$rep->AmountCol(6, 7, $trans['unit_price']);
$rep->AmountCol(10, 11, $trans['order_no']);
}
$rep->NewLine(2, 3);
$rep->TextCol(0, 4, _('Total'));
$rep->AmountCol(4, 5, $total, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$rep->NewLine(2, 1);
$rep->TextCol(0, 4, _('Grand Total'));
$rep->AmountCol(4, 5, $grandtotal, $dec);
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
示例2: print_inventory_sales
function print_inventory_sales()
{
global $path_to_root;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$destination = $_POST['PARAM_2'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$dec = user_price_dec();
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
$cols = array(0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200);
$headers = array(_('DATE'), _('PAYEES'), _('PARTICULARS'), _('GV NO'), _('CHECK NO'), _('CASH IN'), _('PURCHASES'), _('SALARIES &'), _('SUPPLIES'), _('GASOLINE &'), _('LIGHT &'), _('TELECOMS'), _('REPAIRS'), _('REPRESENTATION'), _('TRANSPORTATION'), _('POSTAGE'), _('AD &'), _('PROF.'), _('INSURANCE'), _('CASH'), _('SUNDRY'), _('DEBIT'), _('CREDIT'));
$header2 = array(_(''), '', '', '', _(''), _('BANK'), _(''), _('WAGES'), _(''), _('OIL'), _('WATER'), _(''), _('& MAINT.'), _('EXPENSE'), _('EXPENSE'), _('& COURIER'), _('PROMO'), _('FEES'), _(''), _('ADVANCE'), _('ACCOUNTS'));
$aligns = array('left', 'center', 'center', 'center', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''));
$rep = new FrontReport(_('Cash Disbursement Summary'), "CashDisbursementSummary", user_pagesize(), 8, 'L');
$rep->Font();
$rep->Info($params, $cols, $header2, $aligns, $cols, $headers, $aligns);
$rep->NewPage();
$salary = '6-1010';
$purchase = '5-1010';
$supplies = '6-1175';
$gas_oil = '6-1110';
$light_water = '6-1075';
$tel = '6-1080';
$repair = '6-1085';
$representation = '6-1055';
$transport = '6-1070';
$postage = '6-1155';
$ad_promo = '6-1230';
$prof_fee = '6-1185';
$insurance = '6-1105';
$cash_advance = '1-2045';
$petty_cash = '1-1010';
$res = getTransactions($from, $to);
$previous = '';
$var = array($salary, $purchase, $gas_oil, $light_water, $tel, $repair, $representation, $transport, $postage, $ad_promo, $prof_fee, $insurance, $cash_advance);
$total = 0;
$purchase_total = 0;
$sal_total = 0;
$sup_total = 0;
$gas_total = 0;
$light_total = 0;
$tel_total = 0;
$repair_total = 0;
$rep_total = 0;
$trans_total = 0;
$post_total = 0;
$ad_total = 0;
$prof_total = 0;
$ins_total = 0;
$adv_total = 0;
$dr = 0;
$cr = 0;
$sun_bank_name = '';
$sun_bank_amount = '';
while ($myrow = db_fetch($res)) {
$check = $myrow['customized_no'];
$current = $check;
$name = payment_person_name($myrow["person_type_id"], $myrow["person_id"]);
$comment = get_comments_string($myrow['type'], $myrow['type_no']);
$account_name = get_gl_account_name($myrow['account']);
//$rep->NewLine();
if ($current != '') {
if ($previous == $current) {
if ($myrow['type'] == '') {
if (is_bank_account($myrow['account'])) {
if ($myrow['account'] != $petty_cash) {
$rep->AmountCol(5, 6, abs($myrow['amount']), 2);
$total += abs($myrow['amount']);
}
}
if ($myrow['account'] == $purchase) {
if ($myrow['amount'] > 0) {
$rep->AmountCol(6, 7, abs($myrow['amount']), 2);
$purchase_total += abs($myrow['amount']);
}
}
if ($myrow['account'] == $salary) {
if ($myrow['amount'] > 0) {
$rep->AmountCol(7, 8, abs($myrow['amount']), 2);
$sal_total += abs($myrow['amount']);
}
}
if ($myrow['account'] == $supplies) {
if ($myrow['amount'] > 0) {
$rep->AmountCol(8, 9, abs($myrow['amount']), 2);
$sup_total += abs($myrow['amount']);
}
}
//.........这里部分代码省略.........
示例3: inventory_movements
function inventory_movements()
{
global $path_to_root;
$from_date = $_POST['PARAM_0'];
$to_date = $_POST['PARAM_1'];
$category = $_POST['PARAM_2'];
$location = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
$destination = $_POST['PARAM_6'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($location == '') {
$loc = _('All');
} else {
$loc = get_location_name($location);
}
$cols = array(0, 60, 130, 160, 185, 215, 250, 275, 305, 340, 365, 395, 430, 455, 485, 520);
$headers = array(_('Category'), _('Description'), _('UOM'), '', '', _('OpeningStock'), '', '', _('StockIn'), '', '', _('Delivery'), '', '', _('ClosingStock'));
$headers2 = array("", "", "", _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from_date, 'to' => $to_date), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => _('Location'), 'from' => $loc, 'to' => ''));
$rep = new FrontReport(_('Costed Inventory Movements'), "CostedInventoryMovements", user_pagesize(), 8, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers2, $aligns, $cols, $headers, $aligns);
$rep->NewPage();
$totval_open = $totval_in = $totval_out = $totval_close = 0;
$result = fetch_items($category);
$dec = user_price_dec();
$catgor = '';
while ($myrow = db_fetch($result)) {
if ($catgor != $myrow['description']) {
$rep->NewLine(2);
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['category_id'] . " - " . $myrow['description']);
$catgor = $myrow['description'];
$rep->fontSize -= 2;
$rep->NewLine();
}
$rep->NewLine();
$rep->TextCol(0, 1, $myrow['stock_id']);
$rep->TextCol(1, 2, $myrow['name']);
$rep->TextCol(2, 3, $myrow['units']);
$qoh_start = get_qoh_on_date($myrow['stock_id'], $location, add_days($from_date, -1));
$qoh_end = get_qoh_on_date($myrow['stock_id'], $location, $to_date);
$inward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date);
$outward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date, false);
$openCost = avg_unit_cost($myrow['stock_id'], $location, $from_date);
$unitCost = avg_unit_cost($myrow['stock_id'], $location, add_days($to_date, 1));
$rep->AmountCol(3, 4, $qoh_start, get_qty_dec($myrow['stock_id']));
$rep->AmountCol(4, 5, $openCost, $dec);
$openCost *= $qoh_start;
$totval_open += $openCost;
$rep->AmountCol(5, 6, $openCost);
if ($inward > 0) {
$rep->AmountCol(6, 7, $inward, get_qty_dec($myrow['stock_id']));
$unitCost_in = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date);
$rep->AmountCol(7, 8, $unitCost_in, $dec);
$unitCost_in *= $inward;
$totval_in += $unitCost_in;
$rep->AmountCol(8, 9, $unitCost_in);
}
if ($outward > 0) {
$rep->AmountCol(9, 10, $outward, get_qty_dec($myrow['stock_id']));
$unitCost_out = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date, false);
$rep->AmountCol(10, 11, $unitCost_out, $dec);
$unitCost_out *= $outward;
$totval_out += $unitCost_out;
$rep->AmountCol(11, 12, $unitCost_out);
}
$rep->AmountCol(12, 13, $qoh_end, get_qty_dec($myrow['stock_id']));
$rep->AmountCol(13, 14, $unitCost, $dec);
$unitCost *= $qoh_end;
$totval_close += $unitCost;
$rep->AmountCol(14, 15, $unitCost);
$rep->NewLine(0, 1);
}
$rep->Line($rep->row - 4);
$rep->NewLine(2);
$rep->TextCol(0, 1, _("Total"));
$rep->AmountCol(5, 6, $totval_open);
$rep->AmountCol(8, 9, $totval_in);
$rep->AmountCol(11, 12, $totval_out);
$rep->AmountCol(14, 15, $totval_close);
$rep->Line($rep->row - 4);
//.........这里部分代码省略.........
示例4: print_stock_check
function print_stock_check()
{
global $path_to_root, $pic_height;
$category = $_POST['PARAM_0'];
$location = $_POST['PARAM_1'];
$pictures = $_POST['PARAM_2'];
$check = $_POST['PARAM_3'];
$shortage = $_POST['PARAM_4'];
$no_zeros = $_POST['PARAM_5'];
$like = $_POST['PARAM_6'];
$comments = $_POST['PARAM_7'];
$orientation = $_POST['PARAM_8'];
$destination = $_POST['PARAM_9'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($location == ALL_TEXT) {
$location = 'all';
}
if ($location == 'all') {
$loc = _('All');
} else {
$loc = get_location_name($location);
}
if ($shortage) {
$short = _('Yes');
$available = _('Shortage');
} else {
$short = _('No');
$available = _('Available');
}
if ($no_zeros) {
$nozeros = _('Yes');
} else {
$nozeros = _('No');
}
if ($check) {
$cols = array(0, 75, 225, 250, 295, 345, 390, 445, 515);
$headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Check'), _('Demand'), $available, _('On Order'));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
} else {
$cols = array(0, 75, 225, 250, 315, 380, 445, 515);
$headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Demand'), $available, _('On Order'));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right');
}
$params = array(0 => $comments, 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''), 3 => array('text' => _('Only Shortage'), 'from' => $short, 'to' => ''), 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
if ($pictures) {
$user_comp = user_company();
} else {
$user_comp = "";
}
$rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($category, $location, $like);
$catt = '';
while ($trans = db_fetch($res)) {
if ($location == 'all') {
$loc_code = "";
} else {
$loc_code = $location;
}
$demandqty = get_demand_qty($trans['stock_id'], $loc_code);
$demandqty += get_demand_asm_qty($trans['stock_id'], $loc_code);
$onorder = get_on_porder_qty($trans['stock_id'], $loc_code);
$flag = get_mb_flag($trans['stock_id']);
if ($flag == 'M') {
$onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
}
if ($no_zeros && $trans['QtyOnHand'] == 0 && $demandqty == 0 && $onorder == 0) {
continue;
}
if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0) {
continue;
}
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 2, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
//.........这里部分代码省略.........
示例5: switch
$action = 'list_products';
// $action = strtolower(filter_input(INPUT_POST, 'action'));
// if ($action == NULL) {
// $action = strtolower(filter_input(INPUT_GET, 'action'));
// if ($action == NULL) {
// $action = 'list_categories';
// }
// }
switch ($action) {
case 'list_products':
$category_id = filter_input(INPUT_GET, 'category_id', FILTER_VALIDATE_INT);
if ($category_id == NULL || $category_id == FALSE) {
$category_id = 1;
}
$categories = get_categories();
$category_name = get_category_name($category_id);
include 'category_list.php';
break;
case 'delete_category':
$category_id = filter_input(INPUT_POST, 'category_id', FILTER_VALIDATE_INT);
delete_category($category_id);
header("Location: .");
break;
case 'add_category':
$name = filter_input(INPUT_POST, 'name');
// Validate inputs
if (empty($name)) {
display_error('You must include a name for the category.
Please try again.');
} else {
$category_id = add_category($name);
示例6: foreach
if ($top_item == null || empty($top_item)) {
} else {
$primary_id = (int) $top_item[0]['fk_i_item_id'];
$item = Item::newInstance()->findByPrimaryKey($primary_id);
View::newInstance()->_exportVariableToView('item', $item);
}
}
?>
<?php
foreach ($sliced_array as $sa) {
?>
<?php
$top_item = select_top_item($sa['cat_id']);
if ($top_item == null || empty($top_item)) {
$no_item = false;
$category_name = get_category_name($sa['cat_id']);
} else {
$no_item = true;
$primary_id = (int) $top_item[0]['fk_i_item_id'];
$item = Item::newInstance()->findByPrimaryKey($primary_id);
View::newInstance()->_exportVariableToView('item', $item);
$category_name = get_parent_category_name(osc_item_category_id());
}
?>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="automobile">
<h5 class="auto"><?php
echo $category_name;
?>
</h5>
<?php
示例7: clean
$catid = 0;
if (isset($_GET['cat']) && ctype_digit($_GET['cat'])) {
$catid = clean($_GET['cat']);
} else {
if (isset($show)) {
$catid = $show;
}
}
if ($ancestors = array_reverse(get_ancestors($catid))) {
// get ancestors
$text = '';
foreach ($ancestors as $a) {
$text .= get_category_name($a) . ' > ';
}
} else {
$text = get_category_name($catid);
}
echo '<p class="show_owned_where_you_are">Showing fanlistings ' . 'under the <i>' . str_replace('>', '»', rtrim($text, ' > ')) . '</i> category...</p>';
if ($status == 'pending') {
$ids = get_owned_by_category($catid, '0');
} else {
if ($status == 'upcoming') {
$ids = get_owned_by_category($catid, 1);
} else {
$ids = get_owned_by_category($catid, 2);
}
}
}
}
if ((!isset($show_subcats_in_main_list) || !$show_subcats_in_main_list) && isset($_GET['cat'])) {
// we then have to show the children of this category, if there are
示例8: print_inventory_sales
function print_inventory_sales()
{
global $path_to_root;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$category = $_POST['PARAM_2'];
$location = $_POST['PARAM_3'];
$fromcust = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$destination = $_POST['PARAM_7'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($location == '') {
$loc = _('All');
} else {
$loc = get_location_name($location);
}
if ($fromcust == '') {
$fromc = _('All');
} else {
$fromc = get_customer_name($fromcust);
}
$cols = array(0, 75, 175, 250, 300, 375, 450, 515);
$headers = array(_('Category'), _('Description'), _('Customer'), _('Qty'), _('Sales'), _('Cost'), _('Contribution'));
if ($fromcust != '') {
$headers[2] = '';
}
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => _('Location'), 'from' => $loc, 'to' => ''), 4 => array('text' => _('Customer'), 'from' => $fromc, 'to' => ''));
$rep = new FrontReport(_('Inventory Sales Report'), "InventorySalesReport", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($category, $location, $fromcust, $from, $to);
$total = $grandtotal = 0.0;
$total1 = $grandtotal1 = 0.0;
$total2 = $grandtotal2 = 0.0;
$catt = '';
while ($trans = db_fetch($res)) {
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->NewLine(2, 3);
$rep->TextCol(0, 4, _('Total'));
$rep->AmountCol(4, 5, $total, $dec);
$rep->AmountCol(5, 6, $total1, $dec);
$rep->AmountCol(6, 7, $total2, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$rep->NewLine();
$total = $total1 = $total2 = 0.0;
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 6, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
$curr = get_customer_currency($trans['debtor_no']);
$rate = get_exchange_rate_from_home_currency($curr, sql2date($trans['tran_date']));
$trans['amt'] *= $rate;
$cb = $trans['amt'] - $trans['cost'];
$rep->NewLine();
$rep->fontSize -= 2;
$rep->TextCol(0, 1, $trans['stock_id']);
if ($fromcust == ALL_TEXT) {
$rep->TextCol(1, 2, $trans['description'] . ($trans['inactive'] == 1 ? " (" . _("Inactive") . ")" : ""), -1);
$rep->TextCol(2, 3, $trans['debtor_name']);
} else {
$rep->TextCol(1, 3, $trans['description'] . ($trans['inactive'] == 1 ? " (" . _("Inactive") . ")" : ""), -1);
}
$rep->AmountCol(3, 4, $trans['qty'], get_qty_dec($trans['stock_id']));
$rep->AmountCol(4, 5, $trans['amt'], $dec);
$rep->AmountCol(5, 6, $trans['cost'], $dec);
$rep->AmountCol(6, 7, $cb, $dec);
$rep->fontSize += 2;
$total += $trans['amt'];
$total1 += $trans['cost'];
$total2 += $cb;
$grandtotal += $trans['amt'];
$grandtotal1 += $trans['cost'];
$grandtotal2 += $cb;
}
$rep->NewLine(2, 3);
$rep->TextCol(0, 4, _('Total'));
//.........这里部分代码省略.........
示例9: clean
}
// show listings
if (isset($_GET['cat']) && $_GET['cat'] != '') {
// "where you are" text
if ($_GET['cat'] == 'all' || $_GET['cat'] == 'pending') {
echo '<p class="show_joined_where_you_are">Showing ' . clean($_GET['cat']) . ' listings...</p>';
} else {
$getcat = clean($_GET['cat']);
if ($ancestors = array_reverse(get_ancestors($getcat))) {
// get ancestors
$text = '';
foreach ($ancestors as $a) {
$text .= get_category_name($a) . ' > ';
}
} else {
$text = get_category_name($getcat);
}
echo '<p class="show_joined_where_you_are">Showing listings ' . 'under the <i>' . str_replace('>', '»', rtrim($text, ' > ')) . '</i> category...</p>';
}
if (!isset($show_subcats_in_main_list) || !$show_subcats_in_main_list) {
// we then have to show the children of this category, if there are
$children = get_enth_category_children(clean($_GET['cat']));
$cats = array();
foreach ($children as $cat) {
$cats[] = array('catid' => $cat['catid'], 'text' => $cat['catname'], 'parent' => get_category_parent($cat['catid']), 'qty' => count(get_joined_by_category($cat['catid'])));
}
// check for empty categories!
foreach ($cats as $index => $cat) {
if ($cat['qty'] == 0) {
unset($cats[$index]);
}
示例10: session_start
<?php
// include function files for this application
require_once 'book_sc_fns.php';
session_start();
do_html_header("Edit category");
if (check_admin_user()) {
if ($catname = get_category_name($_GET['catid'])) {
$catid = $_GET['catid'];
$cat = compact('catname', 'catid');
display_category_form($cat);
} else {
echo "<p>Could not retrieve category details.</p>";
}
do_html_url("admin.php", "Back to administration menu");
} else {
echo "<p>You are not authorized to enter the administration area.</p>";
}
do_html_footer();
示例11: session_start
<?php
// include function files for this application
require_once 'book_sc_fns.php';
session_start();
do_html_header('Edit category');
if (check_admin_user()) {
if ($catname = get_category_name($HTTP_GET_VARS['catid'])) {
$catid = $HTTP_GET_VARS['catid'];
$cat = compact('catname', 'catid');
display_category_form($cat);
} else {
echo 'Could not retrieve category details.<br />';
}
do_html_url('admin.php', 'Back to administration menu');
} else {
echo 'You are not authorized to enter the administration area.';
}
do_html_footer();
示例12: foreach
<?php
$shade = false;
foreach ($cats as $cat) {
$class = $shade ? ' class="rowshade"' : '';
$shade = !$shade;
echo "<tr{$class}><td>" . $cat['catid'] . '</td><td>';
$catstring = '';
if ($ancestors = array_reverse(get_ancestors($cat['catid']))) {
// get ancestors
$text = '';
foreach ($ancestors as $a) {
$text .= strlen($text) > 0 ? ' » ' . get_category_name($a) : get_category_name($a);
}
$catstring .= $text;
} else {
$catstring = get_category_name($cat['catid']);
}
echo $catstring . '</td><td class="center">';
echo '<a href="?action=edit&id=' . $cat['catid'] . '">' . '<img src="edit.gif" width="42" height="19" alt=" edit" />' . '</a><a href="?action=delete&id=' . $cat['catid'] . '" onclick="go=confirm( \'Are you sure you want to delete category ' . $catstring . '?\' ); return go;"><img src="delete.gif" ' . 'width="42" height="19" alt=" delete" /></a></td></tr>';
}
echo '</table>';
$page_qty = $total / get_setting('per_page');
$url = $_SERVER['REQUEST_URI'];
$url = 'categories.php';
$connector = '?';
foreach ($_GET as $key => $value) {
if ($key != 'start' && $key != 'PHPSESSID') {
$url .= $connector . $key . '=' . $value;
$connector = '&';
}
}
示例13: print_inventory_sales
function print_inventory_sales()
{
global $path_to_root;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$destination = $_POST['PARAM_2'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$dec = user_price_dec();
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
$cols = array(0, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1750, 1800);
$headers = array(_('Account'), _('JANUARY'), _(''), _('FEBRUARY'), _(''), _('MARCH'), _(''), _('APRIL'), _(''), _('MAY'), _(''), _('JUNE'), _(''), _('JULY'), _(''), _('AUGUST'), _(''), _('SEPTEMBER'), _(''), _('OCTOBER'), _(''), _('NOVEMBER'), _(''), _('DECEMBER'));
$headers2 = array(_(''), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'), _('DR'), _('CR'));
$aligns = array('left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''));
$rep = new FrontReport(_('Recapitulation'), "CashDisbursementSummary", user_pagesize(), 8, 'L');
$rep->Font();
$rep->Info($params, $cols, $headers2, $aligns, $cols, $headers, $aligns);
$rep->NewPage();
$acc = getExpenseAccount();
$account = array();
while ($accs = db_fetch($acc)) {
array_push($account, $accs['account_code']);
}
$year = substr(date2sql($from), 0, 4);
//$res = getTransactions($from, $to);
$previous = '';
$dr = 0;
$cr = 0;
// $monthfr = date("n",strtotime($from));
// $monthto = date("n",strtotime($to));
$date_from = date2sql($from);
$date_to = date2sql($to);
$monthfr = date("n", strtotime($date_from));
$monthto = date("n", strtotime($date_to));
//$myrow = 0;
//$row = 0;
$row = getTransactions($monthfr, $monthto, $year, $account);
// $myrow = db_fetch($row);
foreach ($row as $myrow) {
$acc_name = get_gl_account_name($myrow[0]);
$rep->TextCol(0, 1, $acc_name);
$rep->AmountCol(1, 2, $myrow[1], 2);
$rep->AmountCol(2, 3, abs($myrow[2]), 2);
$rep->AmountCol(3, 4, $myrow[3], 2);
$rep->AmountCol(4, 5, abs($myrow[4]), 2);
$rep->AmountCol(5, 6, $myrow[5], 2);
$rep->AmountCol(6, 7, abs($myrow[6]), 2);
$rep->AmountCol(7, 8, $myrow[7], 2);
$rep->AmountCol(8, 9, abs($myrow[8]), 2);
$rep->AmountCol(9, 10, $myrow[9], 2);
$rep->AmountCol(10, 11, abs($myrow[10]), 2);
$rep->AmountCol(11, 12, $myrow[11], 2);
$rep->AmountCol(12, 13, abs($myrow[12]), 2);
$rep->AmountCol(13, 14, $myrow[13], 2);
$rep->AmountCol(14, 15, abs($myrow[14]), 2);
$rep->AmountCol(15, 16, $myrow[15], 2);
$rep->AmountCol(16, 17, abs($myrow[16]), 2);
$rep->AmountCol(17, 18, $myrow[17], 2);
$rep->AmountCol(18, 19, abs($myrow[18]), 2);
$rep->AmountCol(19, 20, $myrow[19], 2);
$rep->AmountCol(20, 21, abs($myrow[20]), 2);
$rep->AmountCol(21, 22, $myrow[21], 2);
$rep->AmountCol(22, 23, abs($myrow[22]), 2);
$rep->AmountCol(23, 24, $myrow[23], 2);
$rep->AmountCol(24, 25, abs($myrow[24]), 2);
$rep->NewLine();
}
$rep->End();
}
示例14: print_price_listing
function print_price_listing()
{
global $comp_path, $path_to_root, $pic_height, $pic_width;
include_once $path_to_root . "reporting/includes/pdf_report.inc";
$category = $_REQUEST['PARAM_0'];
$salestype = $_REQUEST['PARAM_1'];
$pictures = $_REQUEST['PARAM_2'];
$showGP = $_REQUEST['PARAM_3'];
$comments = $_REQUEST['PARAM_4'];
$dec = user_price_dec();
if ($category == reserved_words::get_all_numeric()) {
$category = 0;
}
if ($salestype == reserved_words::get_all_numeric()) {
$salestype = 0;
}
if ($category == 0) {
$cat = tr('All');
} else {
$cat = get_category_name($category);
}
if ($salestype == 0) {
$stype = tr('All');
} else {
$stype = get_sales_type_name($salestype);
}
if ($showGP == 0) {
$GP = tr('No');
} else {
$GP = tr('Yes');
}
$cols = array(0, 100, 385, 450, 515);
$headers = array(tr('Category/Items'), tr('Description'), tr('Price'), tr('GP %'));
$aligns = array('left', 'left', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => tr('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => tr('Sales Type'), 'from' => $stype, 'to' => ''), 3 => array('text' => tr('Show GP %'), 'from' => $GP, 'to' => ''));
if ($pictures) {
$user_comp = user_company();
} else {
$user_comp = "";
}
$rep = new FrontReport(tr('Price Listing'), "PriceListing.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->Header();
$result = fetch_prices($category, $salestype);
$currcode = '';
$catgor = '';
while ($myrow = db_fetch($result)) {
if ($currcode != $myrow['curr_abrev']) {
$rep->NewLine(2);
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['curr_abrev'] . " " . tr('Prices'));
$currcode = $myrow['curr_abrev'];
$rep->fontSize -= 2;
$rep->NewLine();
}
if ($catgor != $myrow['description']) {
$rep->Line($rep->row - $rep->lineHeight);
$rep->NewLine(2);
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['category_id'] . " - " . $myrow['description']);
$catgor = $myrow['description'];
$rep->fontSize -= 2;
$rep->NewLine();
}
$rep->NewLine();
$rep->TextCol(0, 1, $myrow['stock_id']);
$rep->TextCol(1, 2, $myrow['name']);
$rep->TextCol(2, 3, number_format2($myrow['price'], $dec));
if ($showGP) {
if ($myrow['price'] != 0.0) {
$disp = ($myrow['price'] - $myrow['Standardcost']) * 100 / $myrow['price'];
} else {
$disp = 0.0;
}
$rep->TextCol(3, 4, number_format2($disp, user_percent_dec()) . " %");
}
if ($pictures) {
$image = $comp_path . '/' . $user_comp . "/images/" . $myrow['stock_id'] . ".jpg";
if (file_exists($image)) {
$rep->NewLine();
if ($rep->row - $pic_height < $rep->bottomMargin) {
$rep->Header();
}
$rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, $pic_width, $pic_height);
$rep->row -= $pic_height;
$rep->NewLine();
}
} else {
$rep->NewLine(0, 1);
}
}
$rep->Line($rep->row - 4);
$rep->End();
}
示例15: url_rewrite
echo $link2;
?>
<?php
}
?>
</td>
<td><?php
echo '<a href="' . url_rewrite('bounce.php?course=' . $row['course_id']) . '"> ' . htmlentities_utf8($row['title']) . '</a>';
?>
<br /><small><?php
echo _AT('category');
?>
: <?php
echo get_category_name($row['cat_id']);
?>
</small>
</td>
<td><small><?php
echo '<a href="' . AT_BASE_HREF . 'inbox/send_message.php?id=' . $row['member_id'] . '">' . get_display_name($row['member_id']) . '</a>';
?>
</small></td>
<td><small>
<?php
if ($_SESSION['member_id'] == $row['member_id']) {
//if instructor
echo _AT('instructor');
} else {
if ($row['approved'] == 'a') {
//if alumni