/**
  @package    admin::functions
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: lc_cfg_set_countries_pulldown_menu.php v1.0 2013-08-08 datazen $
*/
function lc_cfg_set_countries_pulldown_menu($default, $key = null)
{
    $css_class = 'class="input with-small-padding"';
    $args = func_get_args();
    if (count($args) > 2 && strpos($args[0], 'class') !== false) {
        $css_class = $args[0];
        $default = $args[1];
        $key = $args[2];
    }
    if (isset($_GET['plugins'])) {
        $name = !empty($key) ? 'plugins[' . $key . ']' : 'plugins_value';
    } else {
        $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value';
    }
    $countries_array = array();
    foreach (lC_Address::getCountries() as $country) {
        $countries_array[] = array('id' => $country['id'], 'text' => $country['name']);
    }
    return lc_draw_pull_down_menu($name, $countries_array, $default, $css_class);
}
示例#2
0
 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':
                         $body .= '<span>' . lc_icon_admin('male.png') . '</span>';
                         break;
                     case 'f':
                         $body .= '<span>' . lc_icon_admin('female.png') . '</span>';
                         break;
                     default:
                         $body .= '<span>' . lc_icon_admin('people.png') . '</span>';
                         break;
                 }
             } else {
                 $body .= '<span>' . lc_icon_admin('people.png') . '</span>';
             }
             $body .= '<span class="small-margin-left">' . lC_Address::format($Qaddresses->toArray(), '&nbsp;<br /> ') . '</span>';
             if ($primary == 'true') {
                 $body .= '<small class="tag small-margin-left purple-gradient glossy" style="position:absolute; top:12px; right:88px;">' . $lC_Language->get('primary_address') . '</small>';
             }
             $body .= '<span class="icon-phone icon-blue" style="position:absolute; top:17px; left:200px;">';
             if (!lc_empty($Qaddresses->valueProtected('telephone_number'))) {
                 $body .= $Qaddresses->valueProtected('telephone_number');
             } else {
                 $body .= '<small class="tag silver-gradient glossy"><i>' . $lC_Language->get('no_telephone_number') . '</i></small>';
             }
             $body .= '</span>';
             $body .= '<span class="icon-printer icon-orange" style="position:absolute; top:46px; left:200px;">';
             if (!lc_empty($Qaddresses->valueProtected('fax_number'))) {
                 $body .= $Qaddresses->valueProtected('fax_number');
             } else {
                 $body .= '<small class="tag silver-gradient glossy"><i>' . $lC_Language->get('no_fax_number') . '</i></small>';
             }
             $body .= '</span>';
             $body .= '</li>';
             $cnt++;
         }
         $body .= '</ul>';
         $result['addressBook'] = $body;
         // set default country to store country
         $country_id = STORE_COUNTRY;
         $Qzones = $lC_Database->query('select zone_name from :table_zones where zone_country_id = :zone_country_id order by zone_name');
         $Qzones->bindTable(':table_zones', TABLE_ZONES);
         $Qzones->bindInt(':zone_country_id', $country_id);
         $Qzones->execute();
         $zones_array = array();
         while ($Qzones->next()) {
             $zones_array[] = array('id' => $Qzones->value('zone_name'), 'text' => $Qzones->value('zone_name'));
         }
         $result['abState'] = lc_draw_pull_down_menu('ab_state', $zones_array, null, 'class="input with-small-padding" style="width:73%;"');
     }
     $countries_array = array();
     foreach (lC_Address::getCountries() as $country) {
         $countries_array[$country['id']] = $country['name'];
     }
     $result['countriesArray'] = $countries_array;
     return $result;
 }
示例#3
0
 public static function getEntryFormData($zaid)
 {
     global $lC_Language;
     $lC_Language->loadIniFile('zone_groups.php');
     $result = array();
     $countries_array = array('' => $lC_Language->get('all_countries'));
     foreach (lC_Address::getCountries() as $country) {
         $countries_array[$country['id']] = $country['name'];
     }
     $result['countriesArray'] = $countries_array;
     $result['zonesArray'] = array('0' => $lC_Language->get('all_zones'));
     if (isset($zaid) && $zaid != null) {
         $result['zoneData'] = lC_Zone_groups_Admin::getEntry($zaid);
     }
     return $result;
 }
示例#4
0
 public static function getCountriesDropdownArray()
 {
     global $lC_Language;
     $countries_array = array(array('id' => '', 'text' => $lC_Language->get('pull_down_default')));
     foreach (lC_Address::getCountries() as $country) {
         $countries_array[] = array('id' => $country['id'], 'text' => $country['name']);
     }
     return $countries_array;
 }
示例#5
0
/**
  @package    catalog
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: account.php v1.0 2013-08-08 datazen $
*/
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require 'includes/application_top.php';
if ($lC_Customer->isLoggedOn() === false) {
    if (!empty($_GET)) {
        $first_array = array_slice($_GET, 0, 1);
    }
    if (empty($_GET) || !empty($_GET) && !in_array(lc_sanitize_string(basename(key($first_array))), array('login', 'create', 'password_forgotten'))) {
        $lC_NavigationHistory->setSnapshot();
        lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
    }
}
// VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW
$lC_Language->load('account');
if ($lC_Services->isStarted('breadcrumb')) {
    $lC_Breadcrumb->add($lC_Language->get('breadcrumb_my_account'), lc_href_link(FILENAME_ACCOUNT, null, 'SSL'));
}
$lC_Template = lC_Template::setup('account');
$countries_array = array(array('id' => '', 'text' => $lC_Language->get('pull_down_default')));
foreach (lC_Address::getCountries() as $country) {
    $countries_array[] = array('id' => $country['id'], 'text' => $country['name']);
}
require $lC_Vqmod->modCheck('templates/' . $lC_Template->getCode() . '.php');
require $lC_Vqmod->modCheck('includes/application_bottom.php');