Example #1
0
 function show()
 {
     $countryIso = \Yoda\Request::getString('iso');
     $country = new Didww\API2\Country();
     $country->setCountryIso($countryIso);
     $country->loadCities();
     $cities = $country->getCities();
     $this->getView()->setProperties(['cities' => $cities])->display();
 }
Example #2
0
 function index()
 {
     $countryIso = \Yoda\Request::getString('iso');
     $country = new Didww\API2\Country();
     $country->setCountryIso($countryIso);
     $country->loadCities();
     $cities = $country->getCities();
     $result = [];
     foreach ($cities as $city) {
         $o = new stdClass();
         $o->id = $city->getCityId();
         $o->name = $city->getCityName();
         $o->prefix = $city->getCityPrefix();
         $result[] = $o;
     }
     echo json_encode($result);
 }
Example #3
0
 function add()
 {
     $countryIso = \Yoda\Request::getString('country_iso');
     $customer_id = \Yoda\Request::getInt('customer_id');
     $city_id = \Yoda\Request::getInt('city_id');
     $pbxwwForm = \Yoda\Request::getInt('pbxww_form');
     $prepaid_funds = \Yoda\Request::getFloat('prepaid_funds');
     if ($pbxwwForm) {
         $this->layout = 'pbxww';
     }
     $cities = [];
     if ($countryIso) {
         $country = new Didww\API2\Country();
         $country->setCountryIso($countryIso);
         $country->loadCities();
         $cities = $country->getCities();
     }
     $this->getView()->setProperties(['customer_id' => $customer_id, 'country_iso' => $countryIso, 'city_id' => $city_id, 'countries' => Didww\API2\Country::getAll(), 'cities' => $cities, 'pbxww_form' => $pbxwwForm, 'prepaid_funds' => $prepaid_funds])->display($pbxwwForm ? 'pbxww' : 'add');
 }