当前位置: 首页>>代码示例>>PHP>>正文


PHP db::db_Count方法代码示例

本文整理汇总了PHP中db::db_Count方法的典型用法代码示例。如果您正苦于以下问题:PHP db::db_Count方法的具体用法?PHP db::db_Count怎么用?PHP db::db_Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db的用法示例。


在下文中一共展示了db::db_Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DKPraidCount

function DKPraidCount($character_name)
{
    $sql99 = new db();
    $count30_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 30, date('Y')) . "' AND '" . time() . "')");
    $count60_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 60, date('Y')) . "' AND '" . time() . "')");
    $count90_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 90, date('Y')) . "' AND '" . time() . "')");
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 30, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count30_member = $row99['count(*)'];
    }
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 60, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count60_member = $row99['count(*)'];
    }
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 90, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count90_member = $row99['count(*)'];
    }
    $percent30 = $count30_total > 0 ? round($count30_member / $count30_total * 100) : 0;
    $percent60 = $count60_total > 0 ? round($count60_member / $count60_total * 100) : 0;
    $percent90 = $count90_total > 0 ? round($count90_member / $count90_total * 100) : 0;
    $return_array = array();
    array_push($return_array, $percent30, $percent60, $percent90);
    return $return_array;
}
开发者ID:slijm,项目名称:e107dkp,代码行数:25,代码来源:core.php

示例2: db

 if ($row['main_category_image'] == '') {
     $text .= "\r\n\t\t\t\t\t\t\t\t\t\t\t ";
 } else {
     $text .= "\r\n\t\t\t\t\t\t\t\t\t\t\t<img src='{$store_image_path}" . $row['main_category_image'] . "' alt='" . $row['main_category_image'] . "' title='" . $row['main_category_image'] . "' />\r\n\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t";
     // .$row['main_category_image'];
 }
 $text .= "\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>";
 // Show link to product inventory for the specific category only if there are products in the category
 // if ($prod_cat_count > 0) { $text .= "<a href='admin_config.php?mcat.".$row['main_category_id']."'>"; }
 $text .= $row['main_category_name'];
 // End tag of the conditional link
 // if ($prod_cat_count > 0) { $text .= "</a>"; }
 $text .= "\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>\r\n\t\t\t\t\t\t\t\t\t\t\t<div style='text-align:center;'>\r\n\t\t\t\t\t\t                        <select class='tbox' name='main_category_order[]'>";
 // Third query: Build the selection list with order numbers
 $sql3 = new db();
 $num_rows = $sql3->db_Count(DB_TABLE_SHOP_MAIN_CATEGORIES, "(*)");
 $count = 1;
 while ($count <= $num_rows) {
     if ($row['main_category_order'] == $count) {
         $text .= "\r\n\t\t\t\t\t\t                                <option value='" . $row['main_category_id'] . "~" . $count . "' selected='selected'>" . $count . "</option>";
     } else {
         $text .= "\r\n\t\t\t\t\t\t                                <option value='" . $row['main_category_id'] . "~" . $count . "'>" . $count . "</option>";
     }
     $count++;
 }
 $text .= "\r\n\t\t\t\t\t\t                        </select>";
 $text .= "\r\n\t\t\t\t\t\t                    </div>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>\r\n\t\t\t\t\t\t\t\t\t\t\t<div style='text-align:center;'>";
 // Display the check box for active status (active = 2)
 if ($row['main_category_active_status'] == 2) {
     $text .= "\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='checkbox' name='main_category_active_status[]' value='" . $row['main_category_id'] . "' checked='checked' />";
 } else {
开发者ID:laiello,项目名称:e107-easyshop,代码行数:31,代码来源:admin_main_categories.php

示例3: unset

$text = "";
$main_convert = "";
//main convert
$newcontent = $sql->db_Count($plugintable, "(*)", "");
if ($newcontent == 0) {
    unset($text);
    //possible database values
    //content page:		$content_parent == "1" && $content_type == "1"	//added at 20051031
    //content page:		$content_parent == "0" && $content_type == "1"
    //review category:	$content_parent == "0" && $content_type == "10"
    //article category:	$content_parent == "0" && $content_type == "6"
    //review:			$content_type == "3" || $content_type == "16"
    //article:			$content_type == "0" || $content_type == "15"
    // ##### STAGE 1 : ANALYSE OLD CONTENT --------------------------------------------------------
    $sql = new db();
    $totaloldcontentrows = $sql->db_Count("content");
    $totaloldrowscat_article = $sql->db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '6'");
    $totaloldrowscat_review = $sql->db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '10'");
    $totaloldrowsitem_content = $sql->db_Count("content", "(*)", "WHERE (content_parent = '0' || content_parent = '1') AND content_type = '1'");
    $totaloldrowsitem_review = $sql->db_Count("content", "(*)", "WHERE content_type = '3' || content_type = '16'");
    $totaloldrowsitem_article = $sql->db_Count("content", "(*)", "WHERE content_type = '0' || content_type = '15'");
    if ($totaloldrowsitem_content == 0 && $totaloldrowsitem_article == 0 && $totaloldrowsitem_review == 0) {
        $totaloldrowsitem_content = "1";
        $totaloldrowsitem_article = "1";
        $totaloldrowsitem_review = "1";
        //if no old records exist, create a few default categories
        $main_convert = create_defaults();
    } else {
        //analyse unknown rows
        $unknown_array = $ac->analyse_unknown();
        if ($totaloldcontentrows == 0) {
开发者ID:Jimmi08,项目名称:content,代码行数:31,代码来源:content_update.php

示例4: countCatItems

 function countCatItems($id)
 {
     global $sqlcountitemsincat, $plugintable, $datequery;
     //$id	:	category content_id
     if (!is_object($sqlcountitemsincat)) {
         $sqlcountitemsincat = new db();
     }
     $n = $sqlcountitemsincat->db_Count($plugintable, "(*)", "WHERE content_class REGEXP '" . e_CLASS_REGEXP . "' AND content_parent='" . intval($id) . "' AND content_refer != 'sa' " . $datequery . " ");
     return $n;
 }
开发者ID:Jimmi08,项目名称:content,代码行数:10,代码来源:content_class.php

示例5: while

 $count_rows = 0;
 $sql->db_Select(DB_TABLE_SHOP_ITEM_CATEGORIES, "*", "category_active_status=2 ORDER BY category_order LIMIT {$category_offset}, {$categories_per_page}");
 while ($row = $sql->db_Fetch()) {
     $text .= "\n\t\t\t\t\t\t\t\t\t<td width='{$column_width}'>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t<div style='text-align:center;'>\n\t\t\t\t\t\t\t\t\t\t\t<a href='" . e_SELF . "?cat." . $row['category_id'] . "'><b>" . $row['category_name'] . "</b></a>\n\t\t\t\t\t\t\t\t\t\t\t<br />";
     if ($row['category_image'] == '') {
         $text .= "\n\t\t\t\t\t\t\t\t\t\t\t\t&nbsp;";
     } else {
         $text .= "\n\t\t\t\t\t\t\t\t\t\t\t\t<a href='" . e_SELF . "?cat." . $row['category_id'] . "'><img src='{$store_image_path}" . $row['category_image'] . "' /> <!-- height='100' width='80' /> --></a>\n\t\t\t\t\t\t\t\t\t\t\t\t";
     }
     $text .= "\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t" . $tp->toHTML($row['category_description'], true) . "\n\t\t\t\t\t\t\t\t\t\t\t<br /> ";
     // Second query: Count the number of products in the category
     $sql2 = new db();
     $prod_cat_count = $sql2->db_Count(DB_TABLE_SHOP_ITEMS, "(*)", "WHERE category_id='" . $row['category_id'] . "'");
     // Third query: Count the number of inactive products in the category
     $sql3 = new db();
     $prod_inact_cat_count = $sql3->db_Count(DB_TABLE_SHOP_ITEMS, "(*)", "WHERE category_id='" . $row['category_id'] . "' AND item_active_status='1'");
     // Present total number of products
     $text .= "\n\t\t\t\t\t\t\t\t\t\t " . EASYSHOP_CONF_CAT_04 . " " . $prod_cat_count . " <br />";
     // Present total of inactive products if there are any
     if ($prod_inact_cat_count > 0) {
         $text .= "\n\t\t\t\t  " . EASYSHOP_CONF_CAT_05 . " " . $prod_inact_cat_count . "\n\t\t\t\t\t\t\t\t\t\t";
     } else {
         $text .= "&nbsp;";
     }
     $text .= "\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</td>";
     $count_rows++;
     if ($count_rows == $num_category_columns) {
         $text .= "\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>";
         $count_rows = 0;
     }
 }
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:admin_config.php

示例6: while

        $edit_text .= "<td><input class='tbox' size='25' type='text' name='prop_prices[]' value='" . number_format($price_array[$i], 2, '.', '') . "'/></td></tr>";
    }
    // Add a blank input field on top of the current list
    $j = $arrayLength + 1;
    $edit_text .= "<tr><td></td><td><input class='tbox' size='25' type='text' name='prop_list[]' value='" . $prop_array[$j] . "'/></td>";
    $edit_text .= "<td><input class='tbox' size='25' type='text' name='prop_prices[]' value='" . $price_array[$j] . "'/></td></tr>";
    $edit_text .= "\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t<br />\r\n\t\t\t\t<center>\r\n          <input type='hidden' name='update_prop' value='1'/>\r\n          <input type='hidden' name='prop_array_length' value ='" . $arrayLength . "'/>\r\n          <input type='hidden' name='property_id' value='" . $property_id . "'/>\r\n\t\t\t\t\t<input class='button' type='submit' value='" . EASYSHOP_ADMIN_PROP_13 . "'/>\r\n\t\t\t\t\t&nbsp;<a href='admin_properties.php'>" . EASYSHOP_ADMIN_PROP_21 . "</a>\r\n\t\t\t\t</center>\r\n\t\t\t\t<br />\r\n\t\t\t\t</fieldset>\r\n\t\t\t</div>\r\n\t\t</center>\r\n\t</form>";
    // Render the value of $edit_text in a table.
    $title = EASYSHOP_ADMIN_PROP_12;
    $ns->tablerender($title, $edit_text);
} else {
    // --------------------------------------------------------------------------+
    // ----------------------- Overview Properties ------------------------------+
    // --------------------------------------------------------------------------+
    // Determine if there are no properties
    if ($sql->db_Count(easyshop_properties) > 0) {
        $no_properties = 1;
    }
    $text .= "\r\n  <form name='overview_prop' method='POST' action='" . e_SELF . "'>\r\n\t\t<center>\r\n\t\t\t\t<fieldset>\r\n\t\t\t\t\t<legend>\r\n\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_01 . "\r\n\t\t\t\t\t</legend>";
    // Show a message if there are no properties to display
    if ($no_properties == null) {
        $text .= "\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t\t<span class='smalltext'>\r\n\t\t\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_02 . "\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t</center>\r\n\t\t\t\t\t\t<br />";
    } else {
        $text .= "\r\n\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t  <table style='" . ADMIN_WIDTH . "' class='fborder'>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_PROP_04 . "</b></td>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_PROP_05 . "</b></td>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><center><b>" . EASYSHOP_ADMIN_PROP_09 . "</b></center></td>\r\n\t\t\t\t\t\t\t\t</tr>";
        // Select the properties in the alphabetical order
        $sql->db_Select(easyshop_properties, "*", "ORDER BY prop_display_name", "no-where");
        // While there are records available; fill the rows
        while ($row = $sql->db_Fetch()) {
            $text .= "\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>" . $row['prop_display_name'] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>" . $row['prop_list'] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t";
            // Show the edit and delete icons
            $text .= "\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>\r\n\t\t\t\t\t\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t\t\t\t\t\t<a href='admin_properties.php?edit." . $row['property_id'] . "' alt='" . EASYSHOP_ADMIN_PROP_10 . "'>" . ADMIN_EDIT_ICON . "</a>\r\n                      &nbsp;\r\n\t\t\t\t\t\t\t\t\t\t\t<a href='admin_properties.php?delete." . $row['property_id'] . "' alt='" . EASYSHOP_ADMIN_PROP_11 . "'>" . ADMIN_DELETE_ICON . "</a>";
开发者ID:laiello,项目名称:e107-easyshop,代码行数:31,代码来源:admin_properties.php

示例7: db

 function convert_rating()
 {
     global $plugintable;
     $plugintable = "pcontent";
     if (!is_object($sqlcr)) {
         $sqlcr = new db();
     }
     $numr = $sqlcr->db_Count("rate", "(*)", "WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') ");
     if ($numr > 0) {
         $sqlcr->db_Update("rate", "rate_table = '" . $plugintable . "' WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') ");
     }
 }
开发者ID:Jimmi08,项目名称:content,代码行数:12,代码来源:content_convert_class.php

示例8: cachevars

     cachevars('easyshop_mcat_descr', $easyshop_mcat_descr);
     $count_rows++;
     if ($count_rows == $num_main_category_columns) {
         cachevars('easyshop_mcat_conditionalbreak', "&nbsp;");
         $count_rows = 0;
     } else {
         cachevars('easyshop_mcat_conditionalbreak', "");
         // Clear the easyshop_mcat_conditionalbreak variable!
     }
     $easyshop_all_mcat_container .= $tp->parseTemplate($ES_ALL_MCAT_CONTAINER, FALSE, $easyshop_shortcodes);
 }
 // End of while of fetching all main categories in use
 cachevars('easyshop_all_mcat_container', $easyshop_all_mcat_container);
 // Count active Product Categories without Main Category and show them additionally on last page
 $sql7 = new db();
 $cat_without_main = $sql7->db_Count(DB_TABLE_SHOP_ITEM_CATEGORIES, "(*)", "WHERE category_active_status=2 AND category_main_id='' AND (category_class IN (" . USERCLASS_LIST . ")) ");
 if ($cat_without_main > 0) {
     cachevars('easyshop_mcat_loose_title', $cat_without_main);
     $count_rows++;
     $easyshop_all_mcat_loose_container = $tp->parseTemplate($ES_ALL_MCAT_LOOSE_CONTAINER, FALSE, $easyshop_shortcodes);
     cachevars('easyshop_all_mcat_loose_container', $easyshop_all_mcat_loose_container);
 }
 // End of if $cat_without_main
 $sql6 = new db();
 // Only display main category records in use
 $arg6 = "SELECT DISTINCT category_main_id, main_category_id, main_category_name, main_category_image, main_category_description\n\t\tFROM #easyshop_item_categories, #easyshop_main_categories\n\t\tWHERE category_main_id=main_category_id AND main_category_active_status=2";
 $sql6->db_Select_gen($arg6, false);
 while ($row6 = $sql6->db_Fetch()) {
     $count_total_categories++;
 }
 $total_categories = $count_total_categories;
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:easyshop.php

示例9: header

        }
        $sql->db_Update(DB_TABLE_SHOP_CURRENCY, "currency_active='1'");
        $sql->db_Update(DB_TABLE_SHOP_CURRENCY, "currency_active='2' WHERE currency_id=" . $tp->toDB($_POST['currency_id']));
    } else {
        // Insert record 1; for some 1.21 users the predefined record in easyshop_preferences was not created on install
        $arg = "ALTER TABLE #easyshop_preferences AUTO_INCREMENT = 1";
        // Autoincrement will make this record number 1... // Bugfix of 1.3 where I tried to fill in value '1' hardcoded, which MySQL doesn't like
        $sql->db_Select_gen($arg, false);
        $sql->db_Insert(DB_TABLE_SHOP_PREFERENCES, "", $tp->toDB($_POST['store_name']), $tp->toDB($_POST['support_email']), $tp->toDB($_POST['store_address_1']), $tp->toDB($_POST['store_address_2']), $tp->toDB($_POST['store_city']), $tp->toDB($_POST['store_state']), $tp->toDB($_POST['store_zip']), $tp->toDB($_POST['store_country']), $tp->toDB($_POST['store_welcome_message']), $tp->toDB($_POST['store_info']), $tp->toDB($_POST['store_image_path']), $tp->toDB(intval($_POST['num_category_columns'])), $tp->toDB(intval($_POST['categories_per_page'])), $tp->toDB(intval($_POST['num_item_columns'])), $tp->toDB(intval($_POST['items_per_page'])), $tp->toDB($_POST['paypal_email']), $tp->toDB($_POST['popup_window_height']), $tp->toDB($_POST['popup_window_width']), $tp->toDB($_POST['cart_background_color']), $tp->toDB($_POST['thank_you_page_title']), $tp->toDB($_POST['thank_you_page_text']), $tp->toDB($_POST['thank_you_page_email']), $tp->toDB($_POST['payment_page_style']), $tp->toDB($_POST['payment_page_image']), "", "", 1, $tp->toDB($_POST['set_currency_behind']), $tp->toDB(intval($_POST['minimum_amount'])), $tp->toDB($_POST['always_show_checkout']), $tp->toDB($_POST['email_order']), $tp->toDB($_POST['product_sorting']), $tp->toDB($_POST['page_devide_char']), $tp->toDB(intval($_POST['icon_width'])), $tp->toDB($_POST['cancel_page_title']), $tp->toDB($_POST['cancel_page_text']), $tp->toDB($_POST['enable_comments']), $tp->toDB($_POST['show_shopping_bag']), $tp->toDB($_POST['print_shop_address']), $tp->toDB($_POST['print_shop_top_bottom']), $tp->toDB($_POST['print_discount_icons']), $tp->toDB(intval($_POST['shopping_bag_color'])), $tp->toDB(intval($_POST['enable_ipn'])), $tp->toDB(intval($_POST['enable_number_input'])), $tp->toDB(intval($_POST['print_special_instr'])), $tp->toDB(intval($_POST['email_info_level'])), $tp->toDB($_POST['email_additional_text']), $tp->toDB(intval($_POST['monitor_clean_shop_days'])), $tp->toDB(intval($_POST['monitor_clean_check_days'])), $tp->toDB(intval($_POST['num_main_category_columns'])), $tp->toDB(intval($_POST['main_categories_per_page'])), $tp->toDB($_POST['paypal_primary_email']));
    }
    header("Location: " . e_SELF);
    exit;
}
// Creation of currencies can be skipped if there are 16 currencies
$sql = new db();
if ($sql->db_Count(DB_TABLE_SHOP_CURRENCY) < 16) {
    // Check for each PayPal currency if it is missing and add it to the currency file
    /*
    Supported PayPal currencies:
    01. AUD Australian Dollar
    02. CAD Canadian Dollar
    03. CHF Swiss Franc
    04. CZK Czech Koruna
    05. DKK Danish Krone
    06. EUR Euro
    07. GBP Pound Sterling
    08. HKD Hong Kong Dollar
    09. HUF Hungarian Forint
    10. JPY Japanese Yen
    11. NOK Norwegian Krone
    12. NZD New Zealand Dollar
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:admin_general_preferences.php

示例10: displayCategoryLinks

function displayCategoryLinks($mode = '')
{
    global $sql2, $ns, $lc, $tp, $cobj, $rowl, $qs, $linkspage_pref, $from, $link_shortcodes, $link_category_total;
    global $LINK_TABLE_START, $linkbutton_count, $LINK_TABLE, $link_category_total, $LINK_TABLE_CAPTION, $LINK_TABLE_END, $LINK_APPEND;
    $order = $lc->getOrder();
    $number = $linkspage_pref["link_nextprev_number"] ? $linkspage_pref["link_nextprev_number"] : "20";
    $nextprevquery = $mode && $linkspage_pref["link_nextprev"] ? "LIMIT " . intval($from) . "," . intval($number) : "";
    $cat = $mode ? " AND l.link_category='" . intval($mode) . "' " : "";
    $qry = "\n\tSELECT l.*, lc.*, COUNT(c.comment_id) AS link_comment\n\tFROM #links_page AS l\n\tLEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category\n\tLEFT JOIN #comments as c ON c.comment_item_id=l.link_id AND comment_type='links_page'\n\tWHERE l.link_class REGEXP '" . e_CLASS_REGEXP . "' AND lc.link_category_class REGEXP '" . e_CLASS_REGEXP . "' " . $cat . "\n\tGROUP BY l.link_id\n\t" . $order . "\n\t" . $nextprevquery . "\n\t";
    $link_table_string = "";
    if (!is_object($sql2)) {
        $sql2 = new db();
    }
    $link_total = $sql2->db_Count("links_page as l", "(*)", "WHERE l.link_class REGEXP '" . e_CLASS_REGEXP . "' " . $cat . " ");
    if (!$sql2->db_Select_gen($qry)) {
        $lc->show_message(LAN_LINKS_34, LAN_LINKS_39);
    } else {
        $linkbutton_count = 0;
        $list = $sql2->db_getList();
        foreach ($list as $rowl) {
            $linkbutton_count = $rowl['link_button'] ? $linkbutton_count + 1 : $linkbutton_count;
            if ($mode) {
                $cat_name = $rowl['link_category_name'];
                $cat_desc = $rowl['link_category_description'];
                $LINK_APPEND = $lc->parse_link_append($rowl);
                $link_table_string .= $tp->parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);
            } else {
                $arr[$rowl['link_category_id']][] = $rowl;
            }
        }
        if ($mode) {
            $link_category_total = $link_total;
            $link_table_start = $tp->parseTemplate($LINK_TABLE_START, FALSE, $link_shortcodes);
            $link_table_end = $tp->parseTemplate($LINK_TABLE_END, FALSE, $link_shortcodes);
            $text = $link_table_start . $link_table_string . $link_table_end;
            $caption = LAN_LINKS_32 . " " . $cat_name . " " . ($cat_desc ? " <i>[" . $cat_desc . "]</i>" : "");
            //number of links
            $caption .= " (<b title='" . (ADMIN ? LAN_LINKS_2 : LAN_LINKS_1) . "' >" . $link_total . "</b>" . (ADMIN ? "/<b title='" . (ADMIN ? LAN_LINKS_1 : "") . "' >" . $link_total . "</b>" : "") . ") ";
            $ns->tablerender($caption, $text);
            if (is_numeric($mode)) {
                $lc->ShowNextPrev($from, $number, $link_total);
            }
        } else {
            $text = '';
            foreach ($arr as $key => $value) {
                $link_table_string = "";
                $linkbutton_count = 0;
                $i = 0;
                for ($i = 0; $i < count($value); $i++) {
                    $rowl = $value[$i];
                    $linkbutton_count = $rowl['link_button'] ? $linkbutton_count + 1 : $linkbutton_count;
                    $cat_name = $rowl['link_category_name'];
                    $cat_desc = $rowl['link_category_description'];
                    $LINK_APPEND = $lc->parse_link_append($rowl);
                    $link_table_string .= $tp->parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);
                }
                $link_category_total = count($value);
                $link_table_caption = $tp->parseTemplate($LINK_TABLE_CAPTION, FALSE, $link_shortcodes);
                $link_table_start = $tp->parseTemplate($LINK_TABLE_START, FALSE, $link_shortcodes);
                $link_table_end = $tp->parseTemplate($LINK_TABLE_END, FALSE, $link_shortcodes);
                $text .= $link_table_start . $link_table_string . $link_table_end;
            }
            //			$nav = $tp->parseTemplate("{NAVIGATOR}", FALSE, $link_shortcodes);		Navigator now positioned in template
            //			$ns->tablerender($link_table_caption, $nav.$text);
            $ns->tablerender($link_table_caption, $text);
        }
    }
    return;
}
开发者ID:notzen,项目名称:e107,代码行数:69,代码来源:links.php

示例11: report

function report($action = "all", $limit = 5, $from = NULL, $to = NULL, $phpsessionid = NULL, $txn_id = NULL, $payer_email = NULL)
{
    $shop_pref = shop_pref();
    $set_currency_behind = $shop_pref['set_currency_behind'];
    // Define actual currency and position of currency character once
    $sql_rep = new db();
    $sql_rep->db_Select(DB_TABLE_SHOP_CURRENCY, "*", "currency_active=2");
    if ($row = $sql_rep->db_Fetch()) {
        $unicode_character = $row['unicode_character'];
        $paypal_currency_code = $row['paypal_currency_code'];
    }
    // Determine currency before or after amount
    if ($set_currency_behind == 1) {
        // Print currency after amount
        $unicode_character_before = "";
        $unicode_character_after = "&nbsp;" . $unicode_character;
    } else {
        $unicode_character_before = "&nbsp;" . $unicode_character . "&nbsp;";
        $unicode_character_after = "";
        // Print currency before amount in all other cases
    }
    //!isset($action)      ? $action = "all" : $action = "";
    $action == "all" ? $action = "" : ($action = " payer_status = '" . $action . " '");
    isset($from) ? $from = " (phptimestamp >= '" . $from . "' " : ($from = "");
    isset($to) ? $to = " AND phptimestamp <= '" . $to . "') " : ($to = "");
    isset($phpsessionid) ? $phpsessionid = " phpsessionid = '" . $phpsessionid . "' " : ($phpsessionid = "");
    isset($txn_id) ? $txn_id = " txn_id = '" . $txn_id . "' " : ($txn_id = "");
    isset($payer_email) ? $payer_email = " payer_email = '" . $payer_email . " '" : ($payer_email = "");
    $completed = $processing = $shopping = $escheck = $totals = $rxemail = $dupltxn = $various = 0;
    $arg = "1 " . $action . $phpsessionid . $txn_id . $payer_email . $from . $to . " ORDER BY phptimestamp DESC";
    $count_ipn_rows = $sql_rep->db_Count("easyshop_ipn_orders");
    if ($count_ipn_rows > 0) {
        $sql_rep->db_Select("easyshop_ipn_orders", "*", $arg);
        while ($row = $sql_rep->db_Fetch()) {
            $row['items'] = unserialize($row['all_items']);
            if (preg_match("/^EScheck_totals_/", $row['payment_status'])) {
                $thiscase = "totals";
            } elseif (preg_match("/^EScheck_rxemail_/", $row['payment_status'])) {
                $thiscase = "rxemail";
            } elseif (preg_match("/^EScheck_dupltxn_/", $row['payment_status'])) {
                $thiscase = "dupltxn";
            } elseif (preg_match("/^EScheck_/", $row['payment_status'])) {
                $thiscase = "EScheck";
            } else {
                $thiscase = $row['payment_status'];
            }
            $text = "";
            isset($row['phpsessionid']) ? $trans_sessionid = $row['phpsessionid'] : ($trans_sessionid = $row['custom']);
            $text .= "<tr><td class='forumheader'>\r\n                <b>" . EASYSHOP_IPN_01 . "</b>: " . $row['first_name'] . " " . $row['last_name'] . " (" . $row['payer_status'] . ")<br />\r\n                <b>" . EASYSHOP_IPN_02 . "</b>: " . $row['address_name'] . "  (" . $row['address_status'] . ") <br />\r\n                         " . $row['address_street'] . "     <br />\r\n                         " . $row['address_zip'] . "        <br />\r\n                         " . $row['address_city'] . "       <br />\r\n                         " . $row['address_state'] . "      <br />\r\n                         " . $row['address_country'] . "    <br />\r\n                <b>" . EASYSHOP_IPN_03 . "</b>: <a href='mailto:" . $row['payer_email'] . "'>" . $row['payer_email'] . "</a><br />\r\n                <br />\r\n                <b>" . EASYSHOP_IPN_04 . "</b><br />\r\n                " . EASYSHOP_IPN_05 . " : " . $row['payment_status'] . "<br />\r\n                " . EASYSHOP_IPN_06 . " : " . $row['reason_code'] . "<br />\r\n                " . EASYSHOP_IPN_07 . " : " . $row['pending_reason'] . "<br />\r\n                " . EASYSHOP_IPN_08 . " : " . $row['txn_id'] . "<br />\r\n                " . EASYSHOP_IPN_09 . " : " . $trans_sessionid . "<br />\r\n                " . EASYSHOP_IPN_10 . " : " . $row['payment_date'] . "<br />\r\n                " . EASYSHOP_IPN_11 . " : " . date("M d Y H:i:s", $row['phptimestamp']) . "<br />\r\n                " . EASYSHOP_IPN_12 . " : " . $unicode_character_before . $row['mc_gross'] . $unicode_character_after . "<br /></td>\r\n                ";
            $text .= "<td class='forumheader2' style='vertical-align: top;'><table style='border:0;cellspacing:15;width:100%;'>\r\n               <tr><td class='forumheader2'><b> " . EASYSHOP_IPN_13 . " </b></td>\r\n                   <td class='forumheader2'><b> " . EASYSHOP_IPN_14 . " </b></td>\r\n                   <td class='forumheader2'><b> " . EASYSHOP_IPN_15 . " </b></td>\r\n                   <td class='forumheader2'><b> " . EASYSHOP_IPN_16 . " </b></td>\r\n                   <td class='forumheader2'><b> " . EASYSHOP_IPN_17 . " </b></td>\r\n                   <td class='forumheader2'><b> " . EASYSHOP_IPN_18 . " </b></td></tr>  ";
            $itemcount = 1;
            $item = $row['items'];
            //preg_match("/^ES_/",$row['payment_status']) ? $paypalfix = "_" : $paypalfix = ""; // Paypal is inconsistent in it's variable naming
            $paypalfix = "_";
            // Paypal Completed order changes; not necessary anymore to make this flexible
            $paypalfix == "" ? $notpaypalfix = "_" : ($notpaypalfix = "_");
            // mc_gross_n exists when other variables are item_number(n)
            while (isset($item["item_name" . $paypalfix . $itemcount]) || isset($item["item_number" . $paypalfix . $itemcount])) {
                $text .= "<tr><td>" . $itemcount . "</td>\r\n               <td>" . $item["item_name" . $paypalfix . $itemcount] . "</td>\r\n               <td>" . $item["item_number" . $paypalfix . $itemcount] . "</td>\r\n               <td>" . $unicode_character_before . ($item["mc_handling" . $paypalfix . $itemcount] + $item["mc_shipping" . $paypalfix . $itemcount]) . $unicode_character_after . "</td>\r\n               <td>" . $item["quantity" . $paypalfix . $itemcount] . "</td>\r\n               <td>" . $unicode_character_before . $item["amount" . $paypalfix . $itemcount] . $unicode_character_after . "</td></tr>";
                $itemcount++;
            }
            $text .= "</table></td><br />";
            switch ($thiscase) {
                case "Completed":
                    $completed++;
                    $report['Completed'][$completed]['report_array'] = $row;
                    $report['Completed']['report_count'] = $completed;
                    $full_text = "<table class='fborder' width='90%'>\r\n                     <tr><td>\r\n                     <div style='text-align:left;'> <b>" . EASYSHOP_IPN_19 . ": '" . $thiscase . "'  " . EASYSHOP_IPN_20 . ": " . $completed . " </b></div>\r\n                     " . $text . "</tr></table>";
                    $report['Completed'][$completed]['report_table'] = $full_text;
                    break;
                case "ES_processing":
                    $processing++;
                    $report['ES_processing'][$processing]['report_array'] = $row;
                    $report['ES_processing']['report_count'] = $processing;
                    $full_text = "<table border='1'  style='border: 1px thin;' cellspacing='5' width='100%'>\r\n                     <tr><td>\r\n                     <div style='text-align:left;'> <b>" . EASYSHOP_IPN_19 . ": '" . $thiscase . "'  " . EASYSHOP_IPN_20 . ": " . $processing . " </b></div>\r\n                     " . $text . "</tr></table>";
                    $report['ES_processing'][$processing]['report_table'] = $full_text;
                    break;
                case "ES_shopping":
                    $shopping++;
                    $report['ES_shopping'][$shopping]['report_array'] = $row;
                    $report['ES_shopping']['report_count'] = $shopping;
                    $full_text = "<table border='1'  style='border: 1px thin;' cellspacing='5' width='100%'>\r\n                     <tr><td>\r\n                     <div style='text-align:left;'> <b>" . EASYSHOP_IPN_19 . ": '" . $thiscase . "'  " . EASYSHOP_IPN_20 . ": " . $shopping . " </b></div>\r\n                     " . $text . "</tr></table>";
                    $report['ES_shopping'][$shopping]['report_table'] = $full_text;
                    break;
                case "EScheck":
                    $escheck++;
                    $report['EScheck'][$escheck]['report_array'] = $row;
                    $report['EScheck']['report_count'] = $escheck;
                    $full_text = "<table border='1'  style='border: 1px thin;' cellspacing='5' width='100%'>\r\n                     <tr><td>\r\n                     <div style='text-align:left;'> <b>" . EASYSHOP_IPN_19 . ": '" . $thiscase . "'  " . EASYSHOP_IPN_20 . ": " . $escheck . " </b></div>\r\n                     " . $text . "</tr></table>";
                    $report['EScheck'][$escheck]['report_table'] = $full_text;
                    break;
                case "totals":
                    $totals++;
                    $report['totals'][$totals]['report_array'] = $row;
                    $report['totals']['report_count'] = $totals;
                    $full_text = "<table border='1'  style='border: 1px thin;' cellspacing='5' width='100%'>\r\n                     <tr><td>\r\n                     <div style='text-align:left;'> <b>" . EASYSHOP_IPN_19 . ": '" . $thiscase . "'  " . EASYSHOP_IPN_20 . ": " . $totals . " </b></div>\r\n                     " . $text . "</tr></table>";
                    $report['totals'][$totals]['report_table'] = $full_text;
                    break;
                case "rxemail":
                    $rxemail++;
//.........这里部分代码省略.........
开发者ID:laiello,项目名称:e107-easyshop,代码行数:101,代码来源:ipn_functions.php

示例12: header

 function show_order()
 {
     global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer;
     if (!getperms("0")) {
         header("location:" . e_SELF);
         exit;
     }
     $catarray = $aa->getCategoryTree("", "", FALSE);
     $array = array_keys($catarray);
     //number of main parents
     $mp = $sql->db_Count($plugintable, "(*)", "WHERE content_parent='0' AND content_refer != 'sa' ");
     if (!is_array($array)) {
         $text = "<div style='text-align:center;'>" . CONTENT_ADMIN_CAT_LAN_9 . "</div>";
     } else {
         $text = "\n\t\t\t\t<div class='text-left'>\n\t\t\t\t" . $rs->form_open("post", e_SELF . "?order", "orderform") . "\n\t\t\t\t<table class='table adminform' id='show_order_02'>\n\t\t\t\t<tr class='panel panel-primary'>\n\t\t\t\t\t<td class='panel-heading' style='width:5%'>" . CONTENT_ADMIN_CAT_LAN_24 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:5%'>" . CONTENT_ADMIN_CAT_LAN_25 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:15%'>" . CONTENT_ADMIN_CAT_LAN_18 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:50%'>" . CONTENT_ADMIN_CAT_LAN_19 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:5%; text-align:center; white-space:nowrap;'>" . CONTENT_ADMIN_ITEM_LAN_58 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:5%; text-align:center; white-space:nowrap;'>" . CONTENT_ADMIN_ITEM_LAN_59 . "</td>\n\t\t\t\t\t<td class='panel-heading' style='width:5%; text-align:center; white-space:nowrap;'>" . CONTENT_ADMIN_ITEM_LAN_60 . "</td>\n\t\t\t\t</tr>";
         if (!is_object($sql)) {
             $sql = new db();
         }
         foreach ($array as $catid) {
             if (!($category_total = $sql->db_Select($plugintable, "*", "content_id='" . intval($catid) . "' "))) {
                 $text .= "<div style='text-align:center;'>" . CONTENT_ADMIN_CAT_LAN_9 . "</div>";
             } else {
                 $row = $sql->db_Fetch();
                 $content_pref = $aa->getContentPref($catarray[$catid][0]);
                 $content_cat_icon_path_large = $tp->replaceConstants($content_pref["content_cat_icon_path_large"]);
                 $content_cat_icon_path_small = $tp->replaceConstants($content_pref["content_cat_icon_path_small"]);
                 $authordetails = $aa->getAuthor($row['content_author']);
                 $caticon = $content_cat_icon_path_large . $row['content_icon'];
                 $pre = "";
                 if ($row['content_parent'] == "0") {
                     //main parent level
                     $class = "forumheader";
                 } else {
                     //sub level
                     $class = "forumheader3";
                     for ($b = 0; $b < count($catarray[$catid]) / 2 - 1; $b++) {
                         $pre .= "_";
                     }
                 }
                 //count subcategories for a main parent
                 if ($row['content_parent'] == 0) {
                     $ordermax = $mp;
                 } else {
                     $mainparent = $aa->getMainParent($row['content_id']);
                     $subs = $aa->getCategoryTree("", $mainparent, FALSE);
                     $ordermax = count($subs) - 1;
                 }
                 //count items in category
                 $ordercat = "";
                 $ordercatall = "";
                 $up = "";
                 $down = "";
                 $selectorder = "";
                 $sqlc = new db();
                 $n = $sqlc->db_Count($plugintable, "(*)", "WHERE content_parent='" . intval($catid) . "' AND content_refer != 'sa' ");
                 if ($n > 1) {
                     $ordercat = "<a href='" . e_SELF . "?order." . $catarray[$catid][0] . "." . $catid . "'>" . CONTENT_ICON_ORDERCAT . "</a>";
                     $ordercatall = $row['content_parent'] == 0 ? "<a href='" . e_SELF . "?order." . $catid . "'>" . CONTENT_ICON_ORDERALL . "</a>" : "";
                 }
                 $amount = "(" . ($n == 1 ? $n . " " . CONTENT_ADMIN_CAT_LAN_56 : $n . " " . CONTENT_ADMIN_CAT_LAN_57) . ")";
                 //if($ordermax > 1){
                 //up arrow
                 if ($row['content_order'] != 1 && $row['content_order'] != 0) {
                     $up = "<a href='" . e_SELF . "?order.inc." . $catid . "-" . $row['content_order'] . "'>" . CONTENT_ICON_ORDER_UP . "</a> ";
                 } else {
                     $up = "&nbsp;&nbsp;&nbsp;";
                 }
                 //down arrow
                 if ($row['content_order'] != $ordermax) {
                     $down = "<a href='" . e_SELF . "?order.dec." . $catid . "-" . $row['content_order'] . "'>" . CONTENT_ICON_ORDER_DOWN . "</a>";
                 } else {
                     $down = "&nbsp;&nbsp;&nbsp;";
                 }
                 //select box
                 //if($ordermax > 1){
                 $selectorder = "\n\t\t\t\t\t\t\t\t<select name='order[]' class='tbox'>";
                 for ($k = 1; $k <= $ordermax; $k++) {
                     $selectorder .= $rs->form_option($k, $row['content_order'] == $k ? "1" : "0", $catid . "." . $k . ".cat");
                 }
                 $selectorder .= "</select>";
                 //}
                 //}
                 $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, "");
                 $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, "");
                 //<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
                 $caticon = $aa->geticon("catsmall", $row['content_icon'], $content_icon_path, "", "", "");
                 $row['url_content_id'] = $row['content_id'];
                 $text .= "\n\t\t\t\t\t\t" . ($row['content_parent'] == 0 ? "<tr><td colspan='5' {$stylespacer}></td></tr>" : "") . "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:5%; text-align:left'>" . $catid . "</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:5%; text-align:center'>" . ($row['content_icon'] ? $caticon : "&nbsp;") . "</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:15%'>" . ($authordetails[0] != "0" ? "<a href='" . e_BASE . "user.php?id." . $authordetails[0] . "'>" . CONTENT_ICON_USER . "</a>" : "") . " " . $authordetails[1] . "</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:50%;'>\n\t\t\t\t\t\t\t\t<a href='" . e107::url("content", "cat", $row, "full") . "'>" . CONTENT_ICON_LINK . "</a>\n\t\t\t\t\t\t\t\t" . $pre . $row['content_heading'] . " " . ($row['content_subheading'] ? "[" . $row['content_subheading'] . "]" : "") . " " . $amount . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:5%; text-align:left; white-space:nowrap;'>\n\t\t\t\t\t\t\t\t" . $ordercat . "\n\t\t\t\t\t\t\t\t" . $ordercatall . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:5%; text-align:center; white-space:nowrap;'>\n\t\t\t\t\t\t\t\t" . $up . "\n\t\t\t\t\t\t\t\t" . $down . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class='" . $class . "' style='width:5%; text-align:center; white-space:nowrap;'>\n\t\t\t\t\t\t\t\t" . $selectorder . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>";
             }
         }
         $text .= "\n\t\t\t\t<tr><td colspan='7' {$stylespacer}></td></tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='fcaption' colspan='5'>&nbsp;</td>\n\t\t\t\t\t<td class='fcaption' colspan='2' style='text-align:center'>\n\t\t\t\t\t\t" . $rs->form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t" . $rs->form_close() . "\n\t\t\t\t</div>";
     }
     $ns->tablerender(CONTENT_ADMIN_ITEM_LAN_62, $text);
 }
开发者ID:Jimmi08,项目名称:content,代码行数:94,代码来源:content_form_class.php

示例13: ebGetCommentTotal

/**
* Get number of comments for an item.
* <p>This method returns the number of comments for the supplied plugin/item id.</p>
* @param   string   a unique ID for this plugin, maximum of 10 character
* @param   int      id of the item comments are allowed for
* @return  int      number of comments for the supplied parameters
*/
function ebGetCommentTotal($pluginid, $id)
{
    global $pref, $e107cache, $tp;
    $query = "where comment_item_id='{$id}' AND comment_type='{$pluginid}'";
    $mysql = new db();
    return $mysql->db_Count("comments", "(*)", $query);
}
开发者ID:testt98,项目名称:ebattles,代码行数:14,代码来源:main.php

示例14: isset

        $text .= "<br />";
    } else {
        $text .= $cap . "<br />";
        $text .= $mains . "<br />";
    }
}
//categories ------------------------
if (isset($linkspage_pref['link_menu_category']) && $linkspage_pref['link_menu_category']) {
    $mains = "";
    $cap = isset($linkspage_pref['link_menu_category_caption']) && $linkspage_pref['link_menu_category_caption'] ? $linkspage_pref['link_menu_category_caption'] : LCLAN_OPT_83;
    $sqlc = new db();
    $sql2 = new db();
    if ($sqlc->db_Select("links_page_cat", "link_category_id, link_category_name", "link_category_class REGEXP '" . e_CLASS_REGEXP . "' ORDER BY link_category_name")) {
        while ($rowc = $sqlc->db_Fetch()) {
            if (isset($linkspage_pref['link_menu_category_amount']) && $linkspage_pref['link_menu_category_amount']) {
                $amount = $sql2->db_Count("links_page", "(*)", "WHERE link_category = '" . $rowc['link_category_id'] . "' AND link_class REGEXP '" . e_CLASS_REGEXP . "' ");
                $amount = "(" . $amount . ")";
            } else {
                $amount = "";
            }
            if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") {
                $mains .= $rs->form_option($rowc['link_category_name'] . " " . $amount, "0", $baseurl . "?cat." . $rowc['link_category_id'], "");
            } else {
                $mains .= $bullet . " <a href='" . $baseurl . "?cat." . $rowc['link_category_id'] . "'>" . $rowc['link_category_name'] . "</a> " . $amount . "<br />";
            }
        }
        if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") {
            $selectjs = "style='width:100%;' onchange=\"if(this.options[this.selectedIndex].value != ''){ return document.location=this.options[this.selectedIndex].value; }\" ";
            $text .= $rs->form_select_open("category", $selectjs);
            $text .= $rs->form_option($cap, "0", "", "");
            $text .= $mains;
开发者ID:notzen,项目名称:e107,代码行数:31,代码来源:link_menu.php

示例15: while

        $discount_amount = $discount_price;
    } else {
        $discount_amount = $discount_percentage;
    }
    $text .= "\n\t<form name='update_disc' method='POST' action='" . e_SELF . "'>\n\t\t<center>\n\t\t\t<div style='width:80%'>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t" . EASYSHOP_ADMIN_DISC_17 . "\n\t\t\t\t\t</legend>";
    $text .= table_discounts($discount_id, $discount_name, $discount_class, $discount_flag, $discount_amount, $discount_valid_from, $discount_valid_till, $discount_code, $cal);
    $text .= "\n\t\t\t\t<br />\n\t\t\t\t<center>\n          <input type='hidden' name='update_disc' value='1'/>\n          <input type='hidden' name='discount_id' value='" . $discount_id . "'/>\n\t\t\t\t\t<input class='button' type='submit' value='" . EASYSHOP_ADMIN_DISC_18 . "'/>\n\t\t\t\t\t&nbsp;<a href='admin_discounts.php'>" . EASYSHOP_ADMIN_DISC_26 . "</a>\n\t\t\t\t</center>\n\t\t\t\t<br />\n\t\t\t\t</fieldset>\n\t\t\t</div>\n\t\t</center>\n\t</form>";
    // Render the value of $edit_text in a table.
    $title = EASYSHOP_ADMIN_DISC_17;
    $ns->tablerender($title, $text);
} else {
    // --------------------------------------------------------------------------+
    // ----------------------- Overview Discounts -------------------------------+
    // --------------------------------------------------------------------------+
    // Determine if there are no discounts
    if ($sql->db_Count(easyshop_discount) > 0) {
        $no_discounts = 1;
    }
    $text .= "\n  <form name='overview_disc' method='POST' action='" . e_SELF . "'>\n\t\t<center>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t" . EASYSHOP_ADMIN_DISC_01 . "\n\t\t\t\t\t</legend>";
    // Show a message if there are no discounts to display
    if ($no_discounts == null) {
        $text .= "\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t<span class='smalltext'>\n\t\t\t\t\t\t\t\t" . EASYSHOP_ADMIN_DISC_02 . "\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</center>\n\t\t\t\t\t\t<br />";
    } else {
        $text .= "\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t  <table style='" . ADMIN_WIDTH . "' class='fborder'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_04 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_05 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_06 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_32 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_33 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_DISC_34 . "</b></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><center><b>" . EASYSHOP_ADMIN_DISC_11 . "</b></center></td>\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><center><b>" . EASYSHOP_ADMIN_DISC_14 . "</b></center></td>\n\t\t\t\t\t\t\t\t</tr>";
        // Select the discounts in the alphabetical order
        $sql->db_Select(easyshop_discount, "*", "ORDER BY discount_name", "no-where");
        // While there are records available; fill the rows
        while ($row = $sql->db_Fetch()) {
            // Hide date integer values 0
            $discount_valid_from = $row['discount_valid_from'] > 0 ? date("Y/m/d", $row['discount_valid_from']) : "";
            $discount_valid_till = $row['discount_valid_till'] > 0 ? date("Y/m/d", $row['discount_valid_till']) : "";
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:admin_discounts.php


注:本文中的db::db_Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。