Esempio n. 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @return Response
  */
 public function index()
 {
     $setting = setting();
     $currencies = Country::distinct()->where('currency', '<>', '')->groupBy('currency')->lists('currency')->toArray();
     $languages = $this->getLanguages();
     return view_backend('setting.index', compact('setting', 'currencies', 'languages'));
 }
Esempio n. 2
0
 /**
  * Get maps by status.
  *
  * @param $status
  *
  * @return array
  */
 public function getByStatus($status)
 {
     $maps = [];
     $enabled = Country::enabled()->lists('code')->toArray();
     foreach ($this->all() as $code => $map) {
         if (in_array($code, $enabled) === $status) {
             $maps[$code] = $map;
         }
     }
     return $maps;
 }
Esempio n. 3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $gateways = Gateway::paginate(10);
     $currencies = Country::distinct()->where('currency', '<>', '')->groupBy('currency')->lists('currency')->toArray();
     return view_backend('gateway.index', compact('gateways', 'currencies'));
 }
Esempio n. 4
0
 /**
  * Update country currency symbole.
  *
  * @param CountryUpdateSymboleRequest $request
  * @param Country                     $country
  *
  * @return Response
  */
 public function updateSymbole(CountryUpdateSymboleRequest $request, Country $country)
 {
     $country->currency_symbole = $request->symbole;
     $country->save();
 }
Esempio n. 5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $countries = $this->getCountries();
     Country::insert($countries);
 }
Esempio n. 6
0
File: Map.php Progetto: zedx/core
 /**
  * Determine whether the given status same with the current module status.
  *
  * @param $status
  *
  * @return bool
  */
 public function isStatus($status)
 {
     return (bool) Country::whereCode($this->getCode())->whereIsActivate($status)->count();
 }
Esempio n. 7
0
 /**
  * Get ad currency.
  *
  * @param Ad     $ad
  * @param string $unit
  *
  * @return string
  */
 function getAdCurrency($ad, $unit)
 {
     if ($unit != '{currency}') {
         return $unit;
     }
     $default = setting('default_ad_currency');
     $countryCode = $ad->geolocation->country;
     if (!$countryCode) {
         return $default;
     }
     $country = Country::whereCode($countryCode)->first();
     if ($country) {
         return $country->currency_symbole ?: $country->currency;
     }
     return $default;
 }