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


PHP Params::GetLong方法代码示例

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


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

示例1: __Construct

 function __Construct($user, $dictionary)
 {
     parent::__Construct(get_class());
     $success = false;
     $message = '';
     if (HTTP::IsPost()) {
         //inputs
         $subscriptionId = Params::GetLong('subscriptionId');
         $name = Params::Get('name');
         //load subscription
         $subscription = new Subscription($subscriptionId);
         $subscription->setName($name);
         $subscription->save();
         $success = true;
     } else {
         $message = "NO DATA POSTED";
     }
     //done
     $this->jsonData = array('success' => $success, 'message' => $message);
 }
开发者ID:TreatNOW,项目名称:TNfrontend,代码行数:20,代码来源:SubscriptionNameResponse.inc.php

示例2: __Construct

 function __Construct($user, $dictionary)
 {
     parent::__Construct(get_class());
     $success = false;
     $message = '';
     if (HTTP::IsPost()) {
         $siteContact = new SiteContact();
         $siteContact->setUserId($user->getId());
         $siteContact->setTypeId(Params::GetLong('typeId'));
         $siteContact->setContactName(Params::Get('contactName'));
         $siteContact->setContactEmailAddress(Params::Get('contactEmailAddress'));
         $siteContact->setContactPhone(Params::Get('contactPhone'));
         $siteContact->setDictionaryCode($dictionary->getCode());
         $siteContact->setContent(Params::Get('content'));
         if ($siteContact->validate()) {
             $siteContact->save();
             $success = true;
             //notify partner by email
             $partner = new Partner(Application::PARTNER_CODE);
             $recipientAddress = $partner->getConfigValue(PartnerConfig::COMMS_NOTIFY_EMAIL);
             $content = "\n";
             $content .= "A new site contact has been submitted on treatnow.co.\n\n";
             $content .= '---------------------------------------------------------------------' . "\n";
             $content .= "Type: " . $siteContact->getTypeName() . "\n";
             $content .= "Contact Name: " . $siteContact->getContactName() . "\n";
             $content .= "Contact Email: " . $siteContact->getContactEmailAddress() . "\n";
             $content .= "Contact Phone: " . $siteContact->getContactPhone() . "\n";
             $content .= '---------------------------------------------------------------------' . "\n\n";
             $content .= $siteContact->getContent() . "\n";
             $content .= '---------------------------------------------------------------------' . "\n\n";
             $content .= "You can manage the contact here: http://manage.zidmi.com/operations/contacts/";
             Application::SendEmail('notifications@zidmi.com', 'Zidmi', null, $recipientAddress, 'Site Contact', $content);
         } else {
             $message = $siteContact->getValidationError();
         }
     } else {
         $message = "NO DATA POSTED";
     }
     //done
     $this->jsonData = array('success' => $success, 'message' => $message);
 }
开发者ID:TreatNOW,项目名称:TNfrontend,代码行数:41,代码来源:ContactResponse.inc.php

示例3: __Construct

 function __Construct()
 {
     parent::__Construct(get_class());
     $this->db = Database::GetInstance(Database::ZIDMI);
     //get input params
     //TODO: could do with some more validation
     $latLong = Params::Get('ll');
     $latLong1 = Params::Get('ll1');
     $latLong2 = Params::Get('ll2');
     if ($latLong) {
         $this->lat1 = explode(',', $latLong)[0];
         $this->lng1 = explode(',', $latLong)[1];
         $this->locMode = self::LOCMODE_RADIAL;
     } else {
         if ($latLong1 && $latLong2) {
             $this->lat1 = explode(',', $latLong1)[0];
             $this->lng1 = explode(',', $latLong1)[1];
             $this->lat2 = explode(',', $latLong2)[0];
             $this->lng2 = explode(',', $latLong2)[1];
             $this->locMode = self::LOCMODE_BOUNDS;
         }
     }
     $this->categoryId = Params::GetLong('categoryId');
     $this->langCode = Params::Get('lang');
     //get providers/counters
     $providers = array();
     $requestableCount = 0;
     $totalCount = 0;
     foreach ($this->getProvidersRs() as $row) {
         //update counters
         $requestable = false;
         if (!is_null($row['online_provider_id'])) {
             $requestableCount++;
             $requestable = true;
         }
         $totalCount++;
         //compile address
         $address = '';
         if (!is_null($row['address_1'])) {
             $address .= ($address == '' ? '' : ', ') . $row['address_1'];
         }
         if (!is_null($row['address_2'])) {
             $address .= ($address == '' ? '' : ', ') . $row['address_2'];
         }
         if (!is_null($row['address_3'])) {
             $address .= ($address == '' ? '' : ', ') . $row['address_3'];
         }
         if (!is_null($row['address_postref'])) {
             $address .= ($address == '' ? '' : ', ') . $row['address_postref'];
         }
         //add to main array
         $providers[] = array('id' => $row['id'], 'reference' => $row['partner_reference'], 'name' => $row['name'], 'address1' => $row['address_1'], 'address' => $address, 'latitude' => $row['latitude'], 'longitude' => $row['longitude'], 'distance' => $row['distance'], 'requestable' => $requestable, 'categories' => $this->getProviderCategories($row['id']));
     }
     //if no providers then get closest
     $nearestProvider = array();
     if ($totalCount == 0) {
         $distance = null;
         $provider = $this->getNearestProvider($this->lat1, $this->lng1, $distance);
         if (!is_null($provider)) {
             //set provider image
             $imageUri = '/images/generic-venue.png';
             if (!is_null($provider->getPrimaryImageId())) {
                 $image = new Image($provider->getPrimaryImageId());
                 $imageUri = Application::GetCdnUri($image, 100, 100);
             }
             $nearestProvider = array('id' => $provider->getId(), 'reference' => $provider->getPartnerReference(), 'name' => $provider->getName(), 'address' => $provider->getAddress(), 'latitude' => $provider->getLatitude(), 'longitude' => $provider->getLongitude(), 'imageUri' => $imageUri, 'distance' => $distance, 'categories' => $this->getProviderCategories($provider->getId()));
         }
     }
     //done
     $this->jsonData = array('requestableCount' => $requestableCount, 'totalCount' => $totalCount, 'providers' => $providers, 'nearestProvider' => $nearestProvider);
 }
开发者ID:TreatNOW,项目名称:TNfrontend,代码行数:71,代码来源:ProvidersResponse.inc.php


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