本文整理汇总了PHP中Zone类的典型用法代码示例。如果您正苦于以下问题:PHP Zone类的具体用法?PHP Zone怎么用?PHP Zone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: renderCabinetProps
/**
* Render cabinet properties into this view.
*
* The cabinet properties zone, row, model, maximum weight and installation date
* are rendered to be for this page. It checks if the user is allowed to see the
* content of the cabinet and only if the user does the information is provided.
*
* @param Cabinet $cab
* @param CabinetAudit $audit
* @param string $AuditorName
*/
function renderCabinetProps($cab, $audit, $AuditorName)
{
$tmpDC = new DataCenter();
$tmpDC->DataCenterID = $cab->DataCenterID;
$tmpDC->GetDataCenter();
$AuditorName = $AuditorName != '' ? "<br>{$AuditorName}" : "";
$renderedHTML = "\t\t<table id=\"cabprop\">\n\t\t\t<tr><td>" . __("Last Audit") . ":</td><td id=\"lastaudit\">{$audit->AuditStamp}{$AuditorName}</td></tr>\n\t\t\t<tr><td>" . __("Model") . ":</td><td>{$cab->Model}</td></tr>\n\t\t\t<tr><td>" . __("Data Center") . ":</td><td>{$tmpDC->Name}</td></tr>\n\t\t\t<tr><td>" . __("Install Date") . ":</td><td>{$cab->InstallationDate}</td></tr>\n";
if ($cab->ZoneID) {
$zone = new Zone();
$zone->ZoneID = $cab->ZoneID;
$zone->GetZone();
$renderedHTML .= "\t\t\t<tr><td>" . __("Zone") . ":</td><td>{$zone->Description}</td></tr>\n";
}
if ($cab->CabRowID) {
$cabrow = new CabRow();
$cabrow->CabRowID = $cab->CabRowID;
$cabrow->GetCabRow();
$renderedHTML .= "\t\t\t<tr><td>" . __("Row") . ":</td><td>{$cabrow->Name}</td></tr>\n";
}
$renderedHTML .= "\t\t\t<tr><td>" . __("Tags") . ":</td><td>" . renderTagsToString($cab) . "</td></tr>\n";
// This is out of context here and makes the information confusing.
// $renderedHTML .= ' <tr><td class="left">' . __('Front Edge') . ':</td>';
// $renderedHTML .= "<td class=\"right\">$cab->FrontEdge </td></tr>\n";
$renderedHTML .= "\t\t</table>\n";
return $renderedHTML;
}
开发者ID:olivierbeytrison,项目名称:openDCIM,代码行数:37,代码来源:cabnavigator.php
示例2: port
function port($type = 0, $_pays = false, $_cpostal = "")
{
if ($_SESSION['navig']->commande->transport == "" && !$type) {
return -1;
}
if ($_SESSION['navig']->adresse != 0) {
$chadr = 1;
} else {
$chadr = 0;
}
$modules = new Modules();
if (!$type) {
$modules->charger_id($_SESSION['navig']->commande->transport);
} else {
$modules->charger_id($type);
}
if ($modules->type != Modules::TRANSPORT || !$modules->actif) {
return -1;
}
$p = new Pays();
if ($chadr) {
$adr = new adresse();
$adr->charger($_SESSION['navig']->adresse);
$p->charger($adr->pays);
$cpostal = $adr->cpostal;
} else {
$p->charger($_SESSION['navig']->client->pays);
$cpostal = $_SESSION['navig']->client->cpostal;
}
// Prise en compte des infos passée, si aucune des infos précédentes n'est pertinente.
if (empty($p->id) && $_pays) {
$p->charger($_pays);
}
if (empty($cpostal) && $_cpostal != "") {
$cpostal = $_cpostal;
}
$zone = new Zone();
$zone->charger($p->zone);
try {
$port = ActionsModules::instance()->instancier($modules->nom);
$port->nbart = $_SESSION['navig']->panier->nbart();
$port->poids = $_SESSION['navig']->panier->poids();
$port->total = $_SESSION['navig']->panier->total();
$port->zone = $p->zone;
$port->pays = $p->id;
$port->unitetr = $zone->unite;
$port->cpostal = $cpostal;
$frais = $port->calcule();
ActionsModules::instance()->appel_module("port", $frais);
return $frais;
} catch (exception $e) {
return -1;
}
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:54,代码来源:port.php
示例3: run
public function run($request)
{
$zone = new Zone();
$zone->Name = "International";
$zone->Description = "All countries";
$zone->write();
$countries = ShopConfig::current()->getCountriesList();
foreach ($countries as $code => $country) {
$zoneregion = new ZoneRegion(array('ZoneID' => $zone->ID, 'Country' => $code));
$zoneregion->write();
echo ".";
}
}
开发者ID:helpfulrobot,项目名称:silvershop-core,代码行数:13,代码来源:CreateInternationalZoneTask.php
示例4: destroy
public function destroy($id)
{
if (Auth::user()->is_admin) {
$count = 0;
$zone = Zone::find($id);
$clients = Client::select('zone_id')->get();
foreach ($clients as $key => $client) {
$u = $client->zone_id;
$uarray = explode(',', $u);
if (in_array($id, $uarray, true)) {
$count = $count + 1;
}
}
if ($count > 0) {
$field = $count == 1 ? ' ' : 's';
$field2 = $count == 1 ? ' pertenece' : ' pertenecen';
$message = $count . " Cliente" . $field . $field2 . " a la zona " . $zone->name;
Session::flash('error', $message);
return Redirect::to('zonas/' . $id);
} else {
$zone->delete();
$message = "Zona Eliminada con éxito";
Session::flash('message', $message);
return Redirect::to('zonas');
}
}
}
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:27,代码来源:ZoneController.php
示例5: check
public function check(Discount $discount)
{
$zones = $discount->Zones();
if (!$zones->exists()) {
return true;
}
$address = $this->order->getShippingAddress();
if (!$address) {
$this->error(_t("OrderCouponModifier.NOTINZONE", "This coupon can only be used for a specific shipping location."));
return false;
}
$currentzones = Zone::get_zones_for_address($address);
if (!$currentzones || !$currentzones->exists()) {
$this->error(_t("OrderCouponModifier.NOTINZONE", "This discount can only be used for a specific shipping location."));
return false;
}
//check if any of currentzones is in zones
$inzone = false;
foreach ($currentzones as $zone) {
if ($zones->find('ID', $zone->ID)) {
$inzone = true;
break;
}
}
if (!$inzone) {
$this->error(_t("OrderCouponModifier.NOTINZONE", "This discount can only be used for a specific shipping location."));
return false;
}
return true;
}
开发者ID:helpfulrobot,项目名称:silvershop-discounts,代码行数:30,代码来源:ZonesDiscountConstraint.php
示例6: state
public function state($country_id)
{
if (!empty($country_id)) {
//$cid = explode(",",$_POST[])
return Zone::find_by_sql("SELECT * FROM zone WHERE country_id={$country_id}");
}
}
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:7,代码来源:general_model.php
示例7: zone_fork
public function zone_fork($disposition_id, $disposition, $url, $theme, $page, $zone)
{
$url = str_replace(url(), '', $url);
if (!$url || preg_match('#^index(?:\\.|/)#', $url)) {
$url = '/';
}
if (extension($url) == 'html') {
$url = substr($url, 0, -5) . '/*';
}
$url = explode('/', $url);
if (!empty($url[0]) && ($module = $this->load->module($url[0])) && !empty($module->routes) && ($method = $module->get_method(array_slice($url, 1, -1), TRUE))) {
$url = array($url[0], $method, '*');
}
$url = implode('/', $url);
if ($page == '*' || !$this->db->select('1')->from('nf_dispositions')->where('page', $url)->row()) {
foreach ($disposition as &$rows) {
foreach ($rows->cols as &$col) {
foreach ($col->widgets as &$w) {
$widget = $this->db->select('widget', 'type', 'title', 'settings')->from('nf_widgets')->where('widget_id', $w->widget_id)->row();
$w->widget_id = $this->db->insert('nf_widgets', array('widget' => $widget['widget'], 'type' => $widget['type'], 'title' => $widget['title'], 'settings' => $widget['settings']));
}
}
}
return Zone::display($this->db->insert('nf_dispositions', array('theme' => $theme, 'page' => $url, 'zone' => $zone, 'disposition' => serialize($disposition))), $disposition, $url, $zone, TRUE);
} else {
$this->model()->delete_disposition($disposition);
$this->db->where('disposition_id', $disposition_id)->delete('nf_dispositions');
$disposition = $this->db->select('disposition_id', 'disposition')->from('nf_dispositions')->where('theme', $theme)->where('page', '*')->where('zone', $zone)->row();
return Zone::display($disposition['disposition_id'], unserialize($disposition['disposition']), '*', $zone, TRUE);
}
}
开发者ID:agreements,项目名称:neofrag-cms,代码行数:31,代码来源:ajax.php
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index($id)
{
$site = Site::find($id);
$zones = Zone::all();
$data = array('page' => 'sites', 'tab' => 'manage', 'site' => $site, 'zones' => $zones);
return View::make('site_zone.index', $data);
}
开发者ID:atefth,项目名称:remote_access_system,代码行数:12,代码来源:SiteZoneController.php
示例9: actionCreate
public function actionCreate()
{
$model = new Zone();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Zone'])) {
$model->attributes = $_POST['Zone'];
if ($model->save()) {
Flashes::addInfoFlash(Yii::t('amo', 'Zone created successfully'));
$this->redirect(array('view', 'id' => $model->zid));
} else {
Flashes::addErrorFlash(Yii::t('amo', 'Could not create the zone.') . ' ' . Yii::t('amo', 'Please, try again later.'));
}
}
$this->render('create', array('model' => $model));
}
开发者ID:CHILMEX,项目名称:amocasion,代码行数:16,代码来源:ZoneController.php
示例10: renderForm
public function renderForm()
{
if (!($obj = $this->loadObject(true))) {
return;
}
$address_layout = AddressFormat::getAddressCountryFormat($obj->id);
if ($value = Tools::getValue('address_layout')) {
$address_layout = $value;
}
$default_layout = '';
$default_layout_tab = array(array('firstname', 'lastname'), array('company'), array('vat_number'), array('address1'), array('address2'), array('postcode', 'city'), array('Country:name'), array('phone'), array('phone_mobile'));
foreach ($default_layout_tab as $line) {
$default_layout .= implode(' ', $line) . "\r\n";
}
$this->fields_form = array('legend' => array('title' => $this->l('Countries'), 'image' => '../img/admin/world.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Country:'), 'name' => 'name', 'lang' => true, 'size' => 30, 'required' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'desc' => $this->l('Country name')), array('type' => 'text', 'label' => $this->l('ISO code:'), 'name' => 'iso_code', 'size' => 4, 'maxlength' => 3, 'class' => 'uppercase', 'required' => true, 'desc' => $this->l('Two -- or three -- letter ISO code (e.g. U.S. for United States)') . '.
<a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm" target="_blank">' . $this->l('Official list here') . '
</a>.'), array('type' => 'text', 'label' => $this->l('Call prefix:'), 'name' => 'call_prefix', 'size' => 4, 'maxlength' => 3, 'class' => 'uppercase', 'required' => true, 'desc' => $this->l('International call prefix, (e.g. 1 for United States)')), array('type' => 'select', 'label' => $this->l('Default currency:'), 'name' => 'id_currency', 'options' => array('query' => Currency::getCurrencies(), 'id' => 'id_currency', 'name' => 'name', 'default' => array('label' => $this->l('Default store currency'), 'value' => 0))), array('type' => 'select', 'label' => $this->l('Zone:'), 'name' => 'id_zone', 'options' => array('query' => Zone::getZones(), 'id' => 'id_zone', 'name' => 'name'), 'desc' => $this->l('Geographical region')), array('type' => 'radio', 'label' => $this->l('Need zip/postal code:'), 'name' => 'need_zip_code', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'need_zip_code_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'need_zip_code_off', 'value' => 0, 'label' => $this->l('No')))), array('type' => 'text', 'label' => $this->l('Zip/post code format:'), 'name' => 'zip_code_format', 'class' => 'uppercase', 'required' => true, 'desc' => $this->l('Zip Code format (L for a letter, N for a number and C for the ISO code). For example, NNNNN for the United States. No verification if undefined.')), array('type' => 'address_layout', 'label' => $this->l('Address format:'), 'name' => 'address_layout', 'address_layout' => $address_layout, 'encoding_address_layout' => urlencode($address_layout), 'encoding_default_layout' => urlencode($default_layout), 'display_valid_fields' => $this->displayValidFields()), array('type' => 'radio', 'label' => $this->l('Address Standardization:'), 'name' => 'standardization', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'standardization_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'standardization_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Active:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'desc' => $this->l('Display this country to your customers (the selected country will always be displayed in the Back Office)')), array('type' => 'radio', 'label' => $this->l('Contains following states:'), 'name' => 'contains_states', 'required' => false, 'class' => 't', 'values' => array(array('id' => 'contains_states_on', 'value' => 1, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" />' . $this->l('Yes')), array('id' => 'contains_states_off', 'value' => 0, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" />' . $this->l('No')))), array('type' => 'radio', 'label' => $this->l('Do you need a tax identification number?'), 'name' => 'need_identification_number', 'required' => false, 'class' => 't', 'values' => array(array('id' => 'need_identification_number_on', 'value' => 1, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" />' . $this->l('Yes')), array('id' => 'need_identification_number_off', 'value' => 0, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" />' . $this->l('No')))), array('type' => 'radio', 'label' => $this->l('Display tax label (e.g. "Tax incl."):'), 'name' => 'display_tax_label', 'required' => false, 'class' => 't', 'values' => array(array('id' => 'display_tax_label_on', 'value' => 1, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" />' . $this->l('Yes')), array('id' => 'display_tax_label_off', 'value' => 0, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" />' . $this->l('No'))))));
if (Shop::isFeatureActive()) {
$this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso');
}
$this->fields_form['submit'] = array('title' => $this->l('Save '), 'class' => 'button');
if ($this->object->iso_code == 'US') {
$this->object->standardization = Configuration::get('PS_TAASC');
}
return parent::renderForm();
}
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:26,代码来源:AdminCountriesController.php
示例11: add
public function add($nom)
{
$this->nom = $nom;
$this->unite = 0;
$this->id = parent::add();
redirige("zone.php?id=" . $this->id . "&action=showZone#zone");
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:7,代码来源:ZoneAdmin.class.php
示例12: calculateRate
function calculateRate(ShippingPackage $package, $address)
{
$rate = null;
$ids = Zone::get_zones_for_address($address);
if (!$ids) {
return $rate;
}
$ids = $ids->map('ID', 'ID');
$packageconstraints = array("Weight" => 'weight', "Volume" => 'volume', "Value" => 'value', "Quantity" => 'quantity');
$constraintfilters = array();
foreach ($packageconstraints as $db => $pakval) {
$mincol = "\"ZonedShippingRate\".\"{$db}Min\"";
$maxcol = "\"ZonedShippingRate\".\"{$db}Max\"";
$constraintfilters[] = "(" . "{$mincol} >= 0" . " AND {$mincol} <= " . $package->{$pakval}() . " AND {$maxcol} > 0" . " AND {$maxcol} >= " . $package->{$pakval}() . " AND {$mincol} < {$maxcol}" . ")";
}
$filter = "(" . implode(") AND (", array("\"ZonedShippingMethodID\" = " . $this->ID, "\"ZoneID\" IN(" . implode(",", $ids) . ")", implode(" OR ", $constraintfilters))) . ")";
//order by zone specificity
$orderby = "";
if (count($ids) > 1) {
$orderby = "CASE \"ZonedShippingRate\".\"ZoneID\"";
$count = 1;
foreach ($ids as $id) {
$orderby .= " WHEN {$id} THEN {$count} ";
$count++;
}
$orderby .= "ELSE {$count} END ASC,";
}
$orderby .= "\"ZonedShippingRate\".\"Rate\" ASC";
if ($sr = DataObject::get_one("ZonedShippingRate", $filter, true, $orderby)) {
$rate = $sr->Rate;
}
$this->CalculatedRate = $rate;
return $rate;
}
开发者ID:tylerkidd,项目名称:silverstripe-shop-shippingframework,代码行数:34,代码来源:ZonedShippingMethod.php
示例13: getContent
function getContent()
{
$configKeys = array('EBAY_SECURITY_TOKEN', 'PS_LANG_DEFAULT');
// Load prestashop ebay's configuration
$configs = Configuration::getMultiple($configKeys);
$profile_configs = $this->ebay_profile->getMultiple(array('EBAY_DELIVERY_TIME', 'EBAY_ZONE_NATIONAL', 'EBAY_ZONE_INTERNATIONAL'));
// Check if the module is configured
if (!$this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')) {
$template_vars = array('error_form_shipping' => 'true');
return $this->display('error_paypal_email.tpl', $template_vars);
}
$nb_shipping_zones_excluded = DB::getInstance()->getValue('SELECT COUNT(*)
FROM ' . _DB_PREFIX_ . 'ebay_shipping_zone_excluded
WHERE `id_ebay_profile` = ' . (int) $this->ebay_profile->id);
if (!$nb_shipping_zones_excluded) {
EbayShippingZoneExcluded::loadEbayExcludedLocations($this->ebay_profile->id);
}
$module_filters = version_compare(_PS_VERSION_, '1.4.5', '>=') ? Carrier::CARRIERS_MODULE : 2;
//INITIALIZE CACHE
$psCarrierModule = $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT'], false, false, false, null, $module_filters);
$url_vars = array('id_tab' => '3', 'section' => 'shipping');
if (version_compare(_PS_VERSION_, '1.5', '>')) {
$url_vars['controller'] = Tools::getValue('controller');
} else {
$url_vars['tab'] = Tools::getValue('tab');
}
$zones = Zone::getZones(true);
foreach ($zones as &$zone) {
$zone['carriers'] = Carrier::getCarriers($this->context->language->id, false, false, $zone['id_zone']);
}
$template_vars = array('eBayCarrier' => EbayShippingService::getCarriers($this->ebay_profile->ebay_site_id), 'psCarrier' => $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT']), 'psCarrierModule' => $psCarrierModule, 'existingNationalCarrier' => EbayShipping::getNationalShippings($this->ebay_profile->id), 'existingInternationalCarrier' => EbayShippingInternationalZone::getExistingInternationalCarrier($this->ebay_profile->id), 'deliveryTime' => $profile_configs['EBAY_DELIVERY_TIME'], 'prestashopZone' => Zone::getZones(), 'excludeShippingLocation' => EbayShippingZoneExcluded::cacheEbayExcludedLocation($this->ebay_profile->id), 'internationalShippingLocations' => EbayShippingLocation::getInternationalShippingLocations(), 'deliveryTimeOptions' => EbayDeliveryTimeOptions::getDeliveryTimeOptions(), 'formUrl' => $this->_getUrl($url_vars), 'ebayZoneNational' => isset($profile_configs['EBAY_ZONE_NATIONAL']) ? $profile_configs['EBAY_ZONE_NATIONAL'] : false, 'ebayZoneInternational' => isset($profile_configs['EBAY_ZONE_INTERNATIONAL']) ? $profile_configs['EBAY_ZONE_INTERNATIONAL'] : false, 'ebay_token' => $configs['EBAY_SECURITY_TOKEN'], 'id_ebay_profile' => $this->ebay_profile->id, 'newPrestashopZone' => $zones);
return $this->display('shipping.tpl', $template_vars);
}
开发者ID:kevindesousa,项目名称:ebay,代码行数:33,代码来源:EbayFormShippingTab.php
示例14: actionUpdate
public function actionUpdate($id)
{
$model = new SettingsForm();
if (isset($_POST['SettingsForm'])) {
$model->attributes = $_POST['SettingsForm'];
if ($model->validate() && $model->save()) {
$this->redirect(array('index'));
}
} else {
$model->loadDataFromStore($id);
}
$directories = glob(Yii::getPathOfAlias('webroot.themes') . "/*", GLOB_ONLYDIR);
$themes = array();
foreach ($directories as $directory) {
$themes[] = basename($directory);
}
$layouts = CHtml::listData(Layout::model()->findAll(), 'layout_id', 'name');
$countries = CHtml::listData(Country::model()->findAll(), 'country_id', 'name');
$zones = CHtml::listData(Zone::model()->findAllByAttributes(array('country_id' => $model->country)), 'zone_id', 'name');
$languages = CHtml::listData(Language::model()->findAll(), 'language_id', 'name');
$currencies = CHtml::listData(Currency::model()->findAll(), 'currency_id', 'title');
$yesNoOptions = array(0 => Yii::t('settings', 'No'), 1 => Yii::t('settings', 'Yes'));
$lengthClasses = CHtml::listData(LengthClassDescription::model()->findAll(), 'length_class_id', 'title');
$weightClasses = CHtml::listData(WeightClassDescription::model()->findAll(), 'weight_class_id', 'title');
$taxesOptions = array("" => Yii::t("settings", "--- None ---"), "shipping" => Yii::t("settings", "Shipping Address"), "payment" => Yii::t("settings", "Payment Address"));
$customerGroups = CHtml::listData(CustomerGroupDescription::model()->findAll(), 'customer_group_id', 'name');
$informations = array_merge(array(0 => Yii::t("settings", "--- None ---")), CHtml::listData(InformationDescription::model()->findAll(), 'information_id', 'title'));
// TODO: localisation
$orderStatuses = CHtml::listData(OrderStatus::model()->findAllByAttributes(array('language_id' => 1)), 'order_status_id', 'name');
// TODO: localisation
$returnStatuses = CHtml::listData(ReturnStatus::model()->findAllByAttributes(array('language_id' => 1)), 'return_status_id', 'name');
$mailProtocols = array("mail" => Yii::t("settings", "Mail"), "smtp" => Yii::t("settings", "SMTP"));
$this->render('update', array('model' => $model, 'themes' => $themes, 'layouts' => $layouts, 'countries' => $countries, 'zones' => $zones, 'languages' => $languages, 'currencies' => $currencies, 'yesNoOptions' => $yesNoOptions, 'lengthClasses' => $lengthClasses, 'weightClasses' => $weightClasses, 'taxesOptions' => $taxesOptions, 'customerGroups' => $customerGroups, 'informations' => $informations, 'orderStatuses' => $orderStatuses, 'returnStatuses' => $returnStatuses, 'mailProtocols' => $mailProtocols));
}
开发者ID:damnpoet,项目名称:yiicart,代码行数:34,代码来源:SettingsController.php
示例15: getcomboboxesAction
public function getcomboboxesAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
if (!$this->getRequest()->isXmlHttpRequest()) {
$this->view->msg = 'Not Ajax Request';
$this->_forward('error', 'error');
} else {
$zones = Zone::getAllZones();
$contexts = Context::getAllContexts();
$agents = Agent::getAllAgents();
$this->view->zones = $zones;
$this->view->agents = $agents;
$this->view->contexts = $contexts;
$this->render('aclcomboboxes');
}
} else {
if (!$this->getRequest()->isXmlHttpRequest()) {
$this->view->msg = 'Not Ajax Request';
$this->_forward('error', 'error');
} else {
$this->view->msg = 'Invalid User';
$this->_forward('error', 'error');
}
}
}
开发者ID:Koulio,项目名称:OpenZIS,代码行数:26,代码来源:AgentaccessController.php
示例16: xdInstall
public function xdInstall()
{
foreach ($this->Options->getValue('carrierList') as $carrier_key => $carrier_name) {
$carrierId = \Configuration::get($carrier_key);
$deleted = false;
if ($carrierId > 0) {
$carrier = new \Carrier($carrierId);
$deleted = $carrier->deleted;
}
if ($carrierId < 1 || $deleted) {
// Create carrier
$carrier = new \Carrier();
$carrier->name = $carrier_name;
$carrier->id_tax_rules_group = 0;
$carrier->active = 1;
$carrier->deleted = 0;
foreach (\Language::getLanguages(true) as $language) {
// TODO Carrier delay
$carrier->delay[(int) $language['id_lang']] = ' ';
}
$carrier->shipping_handling = 0;
$carrier->range_behavior = 1;
$carrier->is_module = 1;
$carrier->shipping_external = 1;
$carrier->external_module_name = $this->moduleInstance->name;
$carrier->need_range = 1;
if (!$carrier->add()) {
return false;
}
// Associate carrier to all groups
$groups = \Group::getGroups(true);
foreach ($groups as $group) {
\Db::getInstance()->insert('carrier_group', array('id_carrier' => (int) $carrier->id, 'id_group' => (int) $group['id_group']));
}
// Create price range
$rangePrice = new \RangePrice();
$rangePrice->id_carrier = $carrier->id;
$rangePrice->delimiter1 = '0';
$rangePrice->delimiter2 = '10000';
$rangePrice->add();
// Create weight range
$rangeWeight = new \RangeWeight();
$rangeWeight->id_carrier = $carrier->id;
$rangeWeight->delimiter1 = '0';
$rangeWeight->delimiter2 = '10000';
$rangeWeight->add();
// Associate carrier to all zones
$zones = \Zone::getZones(true);
foreach ($zones as $zone) {
\Db::getInstance()->insert('carrier_zone', array('id_carrier' => (int) $carrier->id, 'id_zone' => (int) $zone['id_zone']));
\Db::getInstance()->insert('delivery', array('id_carrier' => (int) $carrier->id, 'id_range_price' => (int) $rangePrice->id, 'id_range_weight' => null, 'id_zone' => (int) $zone['id_zone'], 'price' => '0'));
\Db::getInstance()->insert('delivery', array('id_carrier' => (int) $carrier->id, 'id_range_price' => null, 'id_range_weight' => (int) $rangeWeight->id, 'id_zone' => (int) $zone['id_zone'], 'price' => '0'));
}
copy(self::$instanceBaseDir . '/img/logo.jpg', _PS_SHIP_IMG_DIR_ . '/' . (int) $carrier->id . '.jpg');
\Configuration::updateValue($carrier_key, $carrier->id);
}
}
return true;
}
开发者ID:panvagenas,项目名称:elta-courier-for-prestashop,代码行数:59,代码来源:Installer.php
示例17: __construct
public function __construct(Zone $z = null)
{
if ($z === null) {
$z = Zone::zone0();
}
$this->upHost = $z->upHost;
$this->upHostBackup = $z->upHostBackup;
}
开发者ID:itliuchang,项目名称:test,代码行数:8,代码来源:Config.php
示例18: __construct
public function __construct($model = null)
{
$this->name = "pda eShop";
$this->owner = "pda";
$this->country = Country::whereName("Greece")->first();
if ($this->country != null) {
$this->zone = Zone::where('country_id', $this->country->id)->where('name', 'Attica')->first();
}
}
开发者ID:pda-code,项目名称:eshop-angular-laravel,代码行数:9,代码来源:StoreConfiguration.php
示例19: run
public function run()
{
DB::table('zones')->delete();
Zone::create(array('name' => 'Gulshan'));
Zone::create(array('name' => 'Baridhara'));
Zone::create(array('name' => 'Uttara'));
Zone::create(array('name' => 'Motijheel'));
Zone::create(array('name' => 'Mirpur'));
}
开发者ID:atefth,项目名称:remote_access_system,代码行数:9,代码来源:ZoneSeeder.php
示例20: testLocalRates
function testLocalRates()
{
$address_loc = $this->objFromFixture("Address", "wnz6022");
//New Zealand address
Zone::cache_zone_ids($address_loc);
//weight based
$type = "weight";
$this->assertMatch($type, $this->p0, $address_loc, 4);
//weight = 0kg
$this->assertMatch($type, $this->p1, $address_loc, 4);
//weight = 2.34kg
$this->assertMatch($type, $this->p2, $address_loc, 48);
//weight= 17kg,
$this->assertMatch($type, $this->p3, $address_loc, 58);
//weight = 100kg
$this->assertNoMatch($type, $this->p4, $address_loc);
//weight = 1000kg
//volume based
$type = "volume";
$this->assertMatch($type, $this->p0, $address_loc, 1);
//volume = 0cm3
$this->assertMatch($type, $this->p1, $address_loc, 1);
//volume = 1cm3
$this->assertMatch($type, $this->p2, $address_loc, 3);
//volume = 6cm3
$this->assertMatch($type, $this->p3, $address_loc, 520);
//volume = 18927.783cm3
$this->assertNoMatch($type, $this->p4, $address_loc);
//volume = 2000000cm3
//value based
$type = "value";
$this->assertMatch($type, $this->p0, $address_loc, 1);
//value = $0
$this->assertMatch($type, $this->p1, $address_loc, 1);
//value = $2
$this->assertMatch($type, $this->p2, $address_loc, 3);
//value = $6
$this->assertNoMatch($type, $this->p3, $address_loc);
//value = $1000
$this->assertNoMatch($type, $this->p4, $address_loc);
//value = $1,000,000
//quantity based
$type = "quantity";
$this->assertNoMatch($type, $this->p0, $address_loc);
//quantity = 0
$this->assertMatch($type, $this->p1, $address_loc, 5.5);
//quantity = 3
$this->assertMatch($type, $this->p2, $address_loc, 9.300000000000001);
//quantity = 10
$this->assertNoMatch($type, $this->p3, $address_loc);
//quantity = 155
$this->assertNoMatch($type, $this->p4, $address_loc);
//quantity = 12412
}
开发者ID:nimeso,项目名称:silverstripe-shop-shippingframework,代码行数:54,代码来源:ZonedShippingMethodTest.php
注:本文中的Zone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论