• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP lc_empty函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中lc_empty函数的典型用法代码示例。如果您正苦于以下问题:PHP lc_empty函数的具体用法?PHP lc_empty怎么用?PHP lc_empty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getData

 public static function getData($id)
 {
     global $lC_Database, $lC_Language, $lC_Vqmod;
     $result = array();
     include $lC_Vqmod->modCheck('includes/modules/order_total/' . $id . '.php');
     $lC_Language->injectDefinitions('modules/order_total/' . $id . '.xml');
     $module = 'lC_OrderTotal_' . $id;
     $module = new $module();
     $cnt = 0;
     $keys = '';
     foreach ($module->getKeys() as $key) {
         $Qkey = $lC_Database->query('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
         $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
         $Qkey->bindValue(':configuration_key', $key);
         $Qkey->execute();
         $keys .= '<label for="' . $Qkey->value('configuration_title') . '" class="label"><strong>' . $Qkey->value('configuration_title') . '</strong>&nbsp;<span class="icon-info-round icon-blue with-tooltip with-small-padding" style="cursor:pointer;" title="' . $Qkey->value('configuration_description') . '" data-tooltip-options=\'{"classes":["anthracite-gradient"]}\'></span>';
         if (!lc_empty($Qkey->value('set_function'))) {
             $keys .= lc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
         } else {
             $keys .= lc_draw_input_field('configuration[' . $key . ']', $Qkey->value('configuration_value'), 'class="input full-width"');
         }
         $keys .= '</label><br /><br />';
         $cnt++;
     }
     $result['keys'] = substr($keys, 0, strrpos($keys, '<br /><br />'));
     $result['totalKeys'] = $cnt;
     return $result;
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:28,代码来源:modules_order_total.php


示例2: getData

 public static function getData($id)
 {
     global $lC_Database, $lC_Vqmod;
     include $lC_Vqmod->modCheck('includes/modules/services/' . $_GET['module'] . '.php');
     $module = 'lC_Services_' . $_GET['module'] . '_Admin';
     $module = new $module();
     $cnt = 0;
     $keys = '';
     $result = array();
     foreach ($module->keys() as $key) {
         $Qkey = $lC_Database->query('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
         $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
         $Qkey->bindValue(':configuration_key', $key);
         $Qkey->execute();
         $keys .= '<label for="' . $Qkey->value('configuration_title') . '" class="label"><strong>' . $Qkey->value('configuration_title') . '</strong></label>';
         if (!lc_empty($Qkey->value('set_function'))) {
             $keys .= lc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
         } else {
             $keys .= lc_draw_input_field('configuration[' . $key . ']', $Qkey->value('configuration_value'), 'class="input" onfocus="this.select();" style="width:28%;"');
         }
         $keys .= '<span class="margin-left">' . lc_show_info_bubble($Qkey->value('configuration_description'), null, 'on-left grey') . '</span><br /><br />';
         $cnt++;
     }
     $result['keys'] = substr($keys, 0, strrpos($keys, '<br /><br />'));
     $result['totalKeys'] = $cnt;
     $result['title'] = $module->title;
     return $result;
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:28,代码来源:services.php


示例3: getData

 public static function getData($id)
 {
     global $lC_Database, $lC_Language, $lC_Vqmod;
     include $lC_Vqmod->modCheck('../includes/classes/modules.php');
     $lC_Language->load('modules-' . $_GET['set']);
     include $lC_Vqmod->modCheck('../includes/modules/' . $_GET['set'] . '/' . $id . '.php');
     $module = 'lC_' . ucfirst($_GET['set']) . '_' . $id;
     $lC_Language->injectDefinitions('modules/' . $_GET['set'] . '/' . $id . '.xml');
     $module = new $module();
     $cnt = 0;
     $keys = '';
     $result = array();
     foreach ($module->getKeys() as $key) {
         $Qkey = $lC_Database->query('select configuration_title, configuration_key, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
         $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
         $Qkey->bindValue(':configuration_key', $key);
         $Qkey->execute();
         $keys .= '<b>' . $Qkey->value('configuration_title') . '</b><br />' . $Qkey->value('configuration_description') . '<br />';
         if (!lc_empty($Qkey->value('set_function'))) {
             $keys .= lc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
         } else {
             $keys .= lc_draw_input_field('configuration[' . $key . ']', $Qkey->value('configuration_value'));
         }
         $keys .= '<br /><br />';
         $cnt++;
     }
     $result['keys'] = substr($keys, 0, strrpos($keys, '<br /><br />'));
     $result['totalKeys'] = $cnt;
     $result['title'] = $module->getTitle();
     $result['author'] = $module->getAuthorName();
     return $result;
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:32,代码来源:templates_modules.php


示例4: stop

 function stop()
 {
     global $lC_MessageStack, $lC_Template, $lC_Language, $lC_Database;
     $time_start = explode(' ', PAGE_PARSE_START_TIME);
     $time_end = explode(' ', microtime());
     $parse_time = number_format($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0]), 3);
     if (!lc_empty(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
         if (!@error_log(strftime('%c') . ' - ' . $_SERVER['REQUEST_URI'] . ' (' . $parse_time . 's)' . "\n", 3, SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
             if (!file_exists(SERVICE_DEBUG_EXECUTION_TIME_LOG) || !is_writable(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
                 $lC_MessageStack->add('debug', sprintf($lC_Language->get('debug_exection_time'), SERVICE_DEBUG_EXECUTION_TIME_LOG), 'error');
             }
         }
     }
     // additional info
     if (isset($_SESSION['lC_Customer_data'])) {
         $lC_MessageStack->add('debug', sprintf($lC_Language->get('debug_exection_time'), $_SESSION['lC_Customer_data']['customers_group_id'], $_SESSION['lC_Customer_data']['customers_group_name']), 'warning');
     }
     $lC_MessageStack->add('debug', sprintf($lC_Language->get('debug_current_template'), $_SESSION['template']['code']), 'info');
     if (SERVICE_DEBUG_EXECUTION_DISPLAY == '1') {
         $lC_MessageStack->add('debug', sprintf($lC_Language->get('debug_exection_time'), $parse_time), 'info');
     }
     $lC_MessageStack->add('debug', $lC_Language->get('debug_notice'), 'info');
     if ($lC_Template->showDebugMessages() && $lC_MessageStack->size('debug') > 0) {
         $_SESSION['debugStack'] = json_encode($lC_MessageStack->get('debug'));
     }
     return true;
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:27,代码来源:debug.php


示例5: load

 public function load()
 {
     global $lC_Language, $lC_Vqmod;
     if (defined('MODULE_DEFAULT_GEOIP') && !lc_empty(MODULE_DEFAULT_GEOIP) && file_exists('includes/modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php')) {
         $lC_Language->loadIniFile('modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php');
         include $lC_Vqmod->modCheck('includes/modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php');
         $module = 'lC_GeoIP_' . MODULE_DEFAULT_GEOIP;
         return new $module();
     } else {
         return new lC_GeoIP_Admin();
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:12,代码来源:geoip.php


示例6: resize

 public function resize($image, $group_id)
 {
     if (lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT) || utility::execEnabled() === false) {
         return $this->resizeWithGD($image, $group_id);
     }
     if (!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'])) {
         mkdir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code']);
         @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'], 0777);
     }
     exec(escapeshellarg(CFG_APP_IMAGEMAGICK_CONVERT) . ' -resize ' . (int) $this->_groups[$group_id]['size_width'] . 'x' . (int) $this->_groups[$group_id]['size_height'] . ($this->_groups[$group_id]['force_size'] == '1' ? '!' : '') . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[1]['code'] . '/' . $image) . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image));
     @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, 0777);
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:12,代码来源:image.php


示例7: simpleQuery

 public function simpleQuery($query, $debug = false)
 {
     global $lC_MessageStack, $lC_Services;
     if ($this->isConnected()) {
         $this->number_of_queries++;
         if ($debug === false && $this->debug === true) {
             $debug = true;
         }
         if (isset($lC_Services) && $lC_Services->isStarted('debug')) {
             if ($debug === false && SERVICE_DEBUG_OUTPUT_DB_QUERIES == '1') {
                 $debug = true;
             }
             if (!lc_empty(SERVICE_DEBUG_EXECUTION_TIME_LOG) && SERVICE_DEBUG_LOG_DB_QUERIES == '1') {
                 @error_log('QUERY ' . $query . "\n", 3, SERVICE_DEBUG_EXECUTION_TIME_LOG);
             }
         } elseif ($debug === true) {
             $debug = false;
         }
         if ($debug === true) {
             $time_start = $this->getMicroTime();
         }
         $resource = @mysqli_query($this->link, $query);
         if ($debug === true) {
             $time_end = $this->getMicroTime();
             $query_time = number_format($time_end - $time_start, 5);
             if ($this->debug === true) {
                 $this->time_of_queries += $query_time;
             }
             echo '<div style="font-family: Verdana, Arial, sans-serif; font-size: 7px; font-weight: bold;">[<a href="#query' . $this->number_of_queries . '">#' . $this->number_of_queries . '</a>]</div>';
             $lC_MessageStack->add('debug', '<a name=\'query' . $this->number_of_queries . '\'></a>[#' . $this->number_of_queries . ' - ' . $query_time . 's] ' . $query, 'warning');
         }
         if ($resource !== false) {
             $this->error = false;
             $this->error_number = null;
             $this->error_query = null;
             if (mysqli_warning_count($this->link) > 0) {
                 $warning_query = @mysqli_query($this->link, 'show warnings');
                 while ($warning = @mysqli_fetch_row($warning_query)) {
                     @trigger_error(sprintf('[MYSQL] %s (%d): %s [QUERY] ' . $query, $warning[0], $warning[1], $warning[2]), E_USER_WARNING);
                 }
                 mysqli_free_result($warning_query);
             }
             return $resource;
         } else {
             $this->setError(mysqli_error($this->link), mysqli_errno($this->link), $query);
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:51,代码来源:mysqli.php


示例8: lC_Account_Login

 public function lC_Account_Login()
 {
     global $lC_Language, $lC_Services, $lC_Breadcrumb;
     // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
     if (lc_empty(session_id())) {
         lc_redirect(lc_href_link(FILENAME_INFO, 'cookie', 'AUTO'));
     }
     $this->_page_title = $lC_Language->get('sign_in_heading');
     if ($lC_Services->isStarted('breadcrumb')) {
         $lC_Breadcrumb->add($lC_Language->get('breadcrumb_sign_in'), lc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
     }
     if ($_GET[$this->_module] == 'process') {
         $this->_process();
     }
 }
开发者ID:rajeshb001,项目名称:loaded7,代码行数:15,代码来源:login.php


示例9: getValue

 public static function getValue($value)
 {
     global $lC_Database, $lC_Language;
     $string = '';
     $Qstatus = $lC_Database->query('select title, css_key from :table_shipping_availability where id = :id and languages_id = :languages_id');
     $Qstatus->bindTable(':table_shipping_availability');
     $Qstatus->bindInt(':id', $value);
     $Qstatus->bindInt(':languages_id', $lC_Language->getID());
     $Qstatus->execute();
     if ($Qstatus->numberOfRows() === 1) {
         $string = $Qstatus->value('title');
         if (!lc_empty($Qstatus->value('css_key'))) {
             $string = '<span class="' . $Qstatus->value('css_key') . '">' . $string . '</span>';
         }
     }
     return $string;
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:17,代码来源:shipping_availability.php


示例10: lc_href_link_admin

/**
 * Generate an internal URL address for the administration side
 *
 * @param string $page The page to link to
 * @param string $parameters The parameters to pass to the page (in the GET scope)
 * @access public
 */
function lc_href_link_admin($page = null, $parameters = null)
{
    if (ENABLE_SSL === true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . DIR_WS_ADMIN;
    } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_ADMIN;
    }
    $link .= $page;
    if (empty($parameters) && !lc_empty(SID)) {
        $link .= '?' . SID;
    } else {
        $link .= '?' . $parameters;
        if (!lc_empty(SID)) {
            $link .= '&' . SID;
        }
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    return $link;
}
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:28,代码来源:html_output.php


示例11: initialize

 public function initialize()
 {
     global $lC_Database, $lC_Language, $lC_Product;
     if (isset($lC_Product) && is_a($lC_Product, 'lC_Product')) {
         $Qmanufacturer = $lC_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p  where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
         $Qmanufacturer->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
         $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
         $Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
         $Qmanufacturer->bindInt(':languages_id', $lC_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $lC_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!lc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<li class="box-manufacturers-info-image">' . lc_link_object(lc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), lc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</li>' . "\n";
             }
             if (!lc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li class="box-manufacturers-info-url">' . lc_link_object(lc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($lC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>' . "\n";
             }
             $this->_content .= '<li class="box-manufacturers-info-link">' . lc_link_object(lc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $lC_Language->get('box_manufacturer_info_products')) . '</li>' . "\n";
         }
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:23,代码来源:manufacturer_info.php


示例12: lc_draw_hidden_session_id_field

 function lc_draw_hidden_session_id_field()
 {
     global $lC_Session;
     if ($lC_Session->hasStarted() && !lc_empty(SID)) {
         return lc_draw_hidden_field($lC_Session->getName(), $lC_Session->getID());
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:7,代码来源:html_output.php


示例13: delete

 public static function delete($id, $delete_image = false)
 {
     global $lC_Database;
     $error = false;
     $lC_Database->startTransaction();
     if ($delete_image === true) {
         $Qimage = $lC_Database->query('select banners_image from :table_banners where banners_id = :banners_id');
         $Qimage->bindTable(':table_banners', TABLE_BANNERS);
         $Qimage->bindInt(':banners_id', $id);
         $Qimage->execute();
     }
     $Qdelete = $lC_Database->query('delete from :table_banners where banners_id = :banners_id');
     $Qdelete->bindTable(':table_banners', TABLE_BANNERS);
     $Qdelete->bindInt(':banners_id', $id);
     $Qdelete->setLogging($_SESSION['module'], $id);
     $Qdelete->execute();
     if ($lC_Database->isError()) {
         $error = true;
     }
     if ($error === false) {
         $Qdelete = $lC_Database->query('delete from :table_banners_history where banners_id = :banners_id');
         $Qdelete->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY);
         $Qdelete->bindInt(':banners_id', $id);
         $Qdelete->execute();
         if ($lC_Database->isError()) {
             $error = true;
         }
     }
     if ($error === false) {
         if ($delete_image === true) {
             if (!lc_empty($Qimage->value('banners_image'))) {
                 if (is_file('../images/' . $Qimage->value('banners_image')) && is_writeable('../images/' . $Qimage->value('banners_image'))) {
                     @unlink('../images/' . $Qimage->value('banners_image'));
                 }
             }
         }
         $image_extension = lc_dynamic_image_extension();
         if (!empty($image_extension)) {
             if (is_file('images/graphs/banner_yearly-' . $id . '.' . $image_extension) && is_writeable('images/graphs/banner_yearly-' . $id . '.' . $image_extension)) {
                 @unlink('images/graphs/banner_yearly-' . $id . '.' . $image_extension);
             }
             if (is_file('images/graphs/banner_monthly-' . $id . '.' . $image_extension) && is_writeable('images/graphs/banner_monthly-' . $id . '.' . $image_extension)) {
                 @unlink('images/graphs/banner_monthly-' . $id . '.' . $image_extension);
             }
             if (is_file('images/graphs/banner_daily-' . $id . '.' . $image_extension) && is_writeable('images/graphs/banner_daily-' . $id . '.' . $image_extension)) {
                 unlink('images/graphs/banner_daily-' . $id . '.' . $image_extension);
             }
         }
         $lC_Database->commitTransaction();
         return true;
     }
     $lC_Database->rollbackTransaction();
     return false;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:54,代码来源:banner_manager.php


示例14: delete

 public static function delete($id)
 {
     global $lC_Database;
     $lC_CategoryTree = new lC_CategoryTree_Admin();
     if (is_numeric($id)) {
         $lC_CategoryTree->setBreadcrumbUsage(false);
         $categories = array_merge(array(array('id' => $id, 'text' => '')), $lC_CategoryTree->getArray($id));
         $products = array();
         $products_delete = array();
         foreach ($categories as $category) {
             $Qproducts = $lC_Database->query('select products_id from :table_products_to_categories where categories_id = :categories_id');
             $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
             $Qproducts->bindInt(':categories_id', $category['id']);
             $Qproducts->execute();
             while ($Qproducts->next()) {
                 $products[$Qproducts->valueInt('products_id')]['categories'][] = $category['id'];
             }
         }
         foreach ($products as $key => $value) {
             $Qcheck = $lC_Database->query('select categories_id from :table_products_to_categories where products_id = :products_id and categories_id not in :categories_id limit 1');
             $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
             $Qcheck->bindInt(':products_id', $key);
             $Qcheck->bindRaw(':categories_id', '("' . implode('", "', $value['categories']) . '")');
             $Qcheck->execute();
             if ($Qcheck->numberOfRows() === 0) {
                 $products_delete[$key] = $key;
             }
         }
         lc_set_time_limit(0);
         foreach ($categories as $category) {
             $lC_Database->startTransaction();
             $Qimage = $lC_Database->query('select categories_image from :table_categories where categories_id = :categories_id');
             $Qimage->bindTable(':table_categories', TABLE_CATEGORIES);
             $Qimage->bindInt(':categories_id', $category['id']);
             $Qimage->execute();
             $Qc = $lC_Database->query('delete from :table_categories where categories_id = :categories_id');
             $Qc->bindTable(':table_categories', TABLE_CATEGORIES);
             $Qc->bindInt(':categories_id', $category['id']);
             $Qc->setLogging($_SESSION['module'], $id);
             $Qc->execute();
             if (!$lC_Database->isError()) {
                 $Qcd = $lC_Database->query('delete from :table_categories_description where categories_id = :categories_id');
                 $Qcd->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
                 $Qcd->bindInt(':categories_id', $category['id']);
                 $Qcd->setLogging($_SESSION['module'], $id);
                 $Qcd->execute();
                 if (!$lC_Database->isError()) {
                     $Qp2c = $lC_Database->query('delete from :table_products_to_categories where categories_id = :categories_id');
                     $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
                     $Qp2c->bindInt(':categories_id', $category['id']);
                     $Qp2c->setLogging($_SESSION['module'], $id);
                     $Qp2c->execute();
                     if (!$lC_Database->isError()) {
                         // permalink
                         $Qpb = $lC_Database->query('delete from :table_permalinks where item_id = :item_id');
                         $Qpb->bindTable(':table_permalinks', TABLE_PERMALINKS);
                         $Qpb->bindInt(':item_id', $category['id']);
                         $Qpb->execute();
                         if (!$lC_Database->isError()) {
                             $lC_Database->commitTransaction();
                             lC_Cache::clear('categories');
                             lC_Cache::clear('category_tree');
                             lC_Cache::clear('also_purchased');
                             if (!lc_empty($Qimage->value('categories_image'))) {
                                 $Qcheck = $lC_Database->query('select count(*) as total from :table_categories where categories_image = :categories_image');
                                 $Qcheck->bindTable(':table_categories', TABLE_CATEGORIES);
                                 $Qcheck->bindValue(':categories_image', $Qimage->value('categories_image'));
                                 $Qcheck->execute();
                                 if ($Qcheck->numberOfRows() === 0) {
                                     if (file_exists(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image')))) {
                                         @unlink(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image')));
                                     }
                                 }
                             }
                         } else {
                             $lC_Database->rollbackTransaction();
                         }
                     } else {
                         $lC_Database->rollbackTransaction();
                     }
                 } else {
                     $lC_Database->rollbackTransaction();
                 }
             } else {
                 $lC_Database->rollbackTransaction();
             }
         }
         foreach ($products_delete as $id) {
             lC_Products_Admin::remove($id);
         }
         lC_Cache::clear('categories');
         lC_Cache::clear('category_tree');
         lC_Cache::clear('also_purchased');
         return true;
     }
     return false;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:97,代码来源:categories.php


示例15: preview

 public static function preview($id)
 {
     global $lC_Database, $lC_Language, $lC_Currencies;
     $lC_Image = new lC_Image_Admin();
     $lC_Language->loadIniFile('products.php');
     $result = array();
     $Qp = $lC_Database->query('select p.products_id, p.products_quantity, p.products_cost, p.products_price, p.products_msrp, p.products_model, p.products_sku, p.products_weight, p.products_weight_class, p.products_date_added, p.products_last_modified, p.products_status, p.products_tax_class_id, p.manufacturers_id, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and default_flag = :default_flag) where p.products_id = :products_id');
     $Qp->bindTable(':table_products', TABLE_PRODUCTS);
     $Qp->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qp->bindInt(':products_id', $id);
     $Qp->bindInt(':default_flag', 1);
     $Qp->execute();
     $Qpd = $lC_Database->query('select products_name, products_blurb, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
     $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qpd->bindInt(':products_id', $id);
     $Qpd->execute();
     $pd_extra = array();
     while ($Qpd->next()) {
         $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_name');
         $pd_extra['products_blurb'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_blurb');
         $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
         $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_url');
     }
     $lC_ObjectInfo = new lC_ObjectInfo(array_merge($Qp->toArray(), $pd_extra));
     $products_name = $lC_ObjectInfo->get('products_name');
     $products_blurb = $lC_ObjectInfo->get('products_blurb');
     $products_description = $lC_ObjectInfo->get('products_description');
     $products_url = $lC_ObjectInfo->get('products_url');
     $result['previewHtml'] = '<div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<span id="lang_' . $l['code'] . '"' . ($l['code'] == $lC_Language->getCode() ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l['code'] . '\', \'highlight\', \'span\');">' . $lC_Language->showImage($l['code']) . '</a></span>&nbsp;&nbsp;';
     }
     $result['previewHtml'] .= '</div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<div id="pName_' . $l['code'] . '" ' . ($l['code'] != $lC_Language->getCode() ? ' style="display: none;"' : '') . '>';
         $result['previewHtml'] .= '  <table border="0" width="100%" cellspacing="0" cellpadding="2">';
         $result['previewHtml'] .= '    <tr>';
         $result['previewHtml'] .= '      <td><h1>' . lc_output_string_protected($products_name[$l['id']]) . (!lc_empty($lC_ObjectInfo->get('products_model')) ? '<br /><span>' . $lC_ObjectInfo->getProtected('products_model') . '</span>' : '') . '</h1></td>';
         $result['previewHtml'] .= '      <td align="right"><h1>' . $lC_Currencies->format($lC_ObjectInfo->get('products_price')) . '</h1></td>';
         $result['previewHtml'] .= '    </tr>';
         $result['previewHtml'] .= '  </table>';
         $result['previewHtml'] .= '  <p>' . $lC_Image->show($lC_ObjectInfo->get('image'), $products_name[$l['id']], 'align="right" hspace="5" vspace="5"', 'product_info') . $products_description[$l['id']] . '</p>';
         if (!empty($products_url[$l['id']])) {
             $result['previewHtml'] .= '<p>' . sprintf($lC_Language->get('text_more_product_information'), lc_output_string_protected($products_url[$l['id']])) . '</p>';
         }
         $result['previewHtml'] .= '<p align="center">' . sprintf($lC_Language->get('text_product_date_added'), lC_DateTime::getLong($lC_ObjectInfo->get('products_date_added'))) . '</p>';
         $result['previewHtml'] .= '</div>';
     }
     return $result;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:50,代码来源:products.php


示例16: backup

 public static function backup($compression = null, $download_only = false)
 {
     global $lC_Database;
     if (lc_empty(DIR_FS_BACKUP) || !@is_dir(DIR_FS_BACKUP) || !@is_writeable(DIR_FS_BACKUP)) {
         return false;
     }
     lc_set_time_limit(0);
     $backup_file = 'db_' . DB_DATABASE . '-' . @date('YmdHis') . '.sql';
     $fp = @fopen(DIR_FS_BACKUP . $backup_file, 'w');
     $schema = '# LoadedCommerce, Innovative eCommerce Solutions' . "\n" . '# http://www.loadedcommerce.com' . "\n" . '#' . "\n" . '# Database Backup For ' . STORE_NAME . "\n" . '# Copyright (c) ' . @date('Y') . ' ' . STORE_OWNER . "\n" . '#' . "\n" . '# Database: ' . DB_DATABASE . "\n" . '# Database Server: ' . DB_SERVER . "\n" . '#' . "\n" . '# Backup Date: ' . lC_DateTime::getShort(null, true) . "\n\n";
     @fputs($fp, $schema);
     $Qtables = $lC_Database->query('show tables');
     while ($Qtables->next()) {
         $table = $Qtables->value('Tables_in_' . DB_DATABASE);
         $schema = 'drop table if exists ' . $table . ';' . "\n" . 'create table ' . $table . ' (' . "\n";
         $table_list = array();
         $Qfields = $lC_Database->query('show fields from :table');
         $Qfields->bindTable(':table', $table);
         $Qfields->execute();
         while ($Qfields->next()) {
             $table_list[] = $Qfields->value('Field');
             $schema .= '  ' . $Qfields->value('Field') . ' ' . $Qfields->value('Type');
             if (!lc_empty($Qfields->value('Default'))) {
                 $schema .= ' default \'' . $Qfields->value('Default') . '\'';
             }
             if ($Qfields->value('Null') != 'YES') {
                 $schema .= ' not null';
             }
             if (!lc_empty($Qfields->value('Extra'))) {
                 $schema .= ' ' . $Qfields->value('Extra');
             }
             $schema .= ',' . "\n";
         }
         $schema = substr($schema, 0, -2);
         // add the keys
         $Qkeys = $lC_Database->query('show keys from :table');
         $Qkeys->bindTable(':table', $table);
         $Qkeys->execute();
         $index = array();
         while ($Qkeys->next()) {
             $kname = $Qkeys->value('Key_name');
             if (!isset($index[$kname])) {
                 $index[$kname] = array('unique' => !$Qkeys->value('Non_unique'), 'fulltext' => $Qkeys->value('Index_type') == 'FULLTEXT' ? true : false, 'columns' => array());
             }
             $index[$kname]['columns'][] = $Qkeys->value('Column_name');
         }
         foreach ($index as $kname => $info) {
             $schema .= ',' . "\n";
             $columns = implode($info['columns'], ', ');
             if ($kname == 'PRIMARY') {
                 $schema .= '  PRIMARY KEY (' . $columns . ')';
             } elseif ($info['fulltext'] === true) {
                 $schema .= '  FULLTEXT ' . $kname . ' (' . $columns . ')';
             } elseif ($info['unique']) {
                 $schema .= '  UNIQUE ' . $kname . ' (' . $columns . ')';
             } else {
                 $schema .= '  KEY ' . $kname . ' (' . $columns . ')';
             }
         }
         $schema .= "\n" . ');' . "\n\n";
         @fputs($fp, $schema);
         // dump the data from the tables except from the sessions table and the who's online table
         if ($table != TABLE_SESSIONS && $table != TABLE_WHOS_ONLINE) {
             $Qrows = $lC_Database->query('select :columns from :table');
             $Qrows->bindRaw(':columns', implode(', ', $table_list));
             $Qrows->bindTable(':table', $table);
             $Qrows->execute();
             while ($Qrows->next()) {
                 $rows = $Qrows->toArray();
                 $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values (';
                 foreach ($table_list as $i) {
                     if (!isset($rows[$i])) {
                         $schema .= 'NULL, ';
                     } elseif (strlen($rows[$i]) > 0) {
                         $row = addslashes($rows[$i]);
                         $row = str_replace("\n#", "\n" . '\\#', $row);
                         $schema .= '\'' . $row . '\', ';
                     } else {
                         $schema .= '\'\', ';
                     }
                 }
                 $schema = substr($schema, 0, -2) . ');' . "\n";
                 fputs($fp, $schema);
             }
         }
     }
     fclose($fp);
     unset($schema);
     switch ($compression) {
         case 'gzip':
             exec(CFG_APP_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
             $backup_file .= '.gz';
             break;
         case 'zip':
             exec(CFG_APP_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
             if (file_exists(DIR_FS_BACKUP . $backup_file)) {
                 unlink(DIR_FS_BACKUP . $backup_file);
             }
             $backup_file .= '.zip';
             break;
//.........这里部分代码省略.........
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:101,代码来源:backup.php


示例17: delete

 public static function delete($id, $delete_image = false, $delete_products = false)
 {
     global $lC_Database;
     if ($delete_image === true) {
         $Qimage = $lC_Database->query('select manufacturers_image from :table_manufacturers where manufacturers_id = :manufacturers_id');
         $Qimage->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
         $Qimage->bindInt(':manufacturers_id', $id);
         $Qimage->execute();
         if ($Qimage->numberOfRows() && !lc_empty($Qimage->value('manufacturers_image'))) {
             if (file_exists(realpath('../' . DIR_WS_IMAGES . 'manufacturers/' . $Qimage->value('manufacturers_image')))) {
                 @unlink(realpath('../' . DIR_WS_IMAGES . 'manufacturers/' . $Qimage->value('manufacturers_image')));
             }
         }
     }
     $Qm = $lC_Database->query('delete from :table_manufacturers where manufacturers_id = :manufacturers_id');
     $Qm->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
     $Qm->bindInt(':manufacturers_id', $id);
     $Qm->setLogging($_SESSION['module'], $id);
     $Qm->execute();
     $Qmi = $lC_Database->query('delete from :table_manufacturers_info where manufacturers_id = :manufacturers_id');
     $Qmi->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
     $Qmi->bindInt(':manufacturers_id', $id);
     $Qmi->setLogging($_SESSION['module'], $id);
     $Qmi->execute();
     if ($delete_products === true) {
         $Qproducts = $lC_Database->query('select products_id from :table_products where manufacturers_id = :manufacturers_id');
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':manufacturers_id', $id);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             lC_Products_Admin::delete($Qproducts->valueInt('products_id'));
         }
     } else {
         $Qupdate = $lC_Database->query('update :table_products set manufacturers_id = null where manufacturers_id = :manufacturers_id');
         $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
         $Qupdate->bindInt(':manufacturers_id', $id);
         $Qupdate->setLogging($_SESSION['module'], $id);
         $Qupdate->execute();
     }
     lC_Cache::clear('manufacturers');
     return true;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:42,代码来源:manufacturers.php


示例18: formData

 public static function formData($id = null)
 {
     global $lC_Database, $lC_Language, $_module;
     $lC_Language->loadIniFile('customers.php');
     $result = array();
     $Qgroups = $lC_Database->query('select customers_group_id, customers_group_name from :table_customers_groups where language_id = :language_id order by customers_group_name');
     $Qgroups->bindTable(':table_customers_groups', TABLE_CUSTOMERS_GROUPS);
     $Qgroups->bindInt(':language_id', $lC_Language->getID());
     $Qgroups->execute();
     $groups_array = array();
     while ($Qgroups->next()) {
         $groups_array[$Qgroups->value('customers_group_id')] = $Qgroups->value('customers_group_name');
     }
     $result['groupsArray'] = $groups_array;
     if ($id != null) {
         $result['customerData'] = lC_Customers_Admin::getData($id);
         $Qaddresses = lC_Customers_Admin::getAddressBookData($id);
         $cnt = 0;
         $result['addressBook'] = '';
         $body .= '<ul class="list spaced">';
         while ($Qaddresses->next()) {
             $primary = $result['customerData']['customers_default_address_id'] == $Qaddresses->valueInt('address_book_id') ? 'true' : 'false';
             $body .= '<li class="">';
             $body .= '<span class="button-group compact float-right">' . '  <a href="' . ((int) ($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://" onclick="editAddress(\'' . $Qaddresses->valueInt('address_book_id') . '\', \'' . $primary . '\')') . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access'][$_module] < 3) ? ' disabled' : NULL) . '">' . $lC_Language->get('icon_edit') . '</a>' . '  <a href="' . ((int) ($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://" onclick="deleteAddress(\'' . $Qaddresses->valueInt('address_book_id') . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>' . '</span>';
             if (ACCOUNT_GENDER > -1) {
                 switch ($Qaddresses->value('gender')) {
                     case 'm':
            

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP lc_href_link函数代码示例发布时间:2022-05-15
下一篇:
PHP lc_draw_pull_down_menu函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap