public function getStreets() { $list = array(); foreach (self::getCityZone()->getZones() as $zone) { if ($zone->getAttribute("Type")->get() == "Street") { $list[$zone->getName()] = new CityStreet(parent::getRootZone(), parent::getCountryZone()->getName(), parent::getStateZone()->getName(), self::getCityZone()->getName(), $zone->getName()); } } return $list; }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // $countries = \CountryState::getCountries(); $states = \CountryState::getStates('US'); $contact = User::find($id); $types = UserType::lists('name', 'id'); empty($contact->country) ? $contact->country = 'US' : $contact->country; return view('contacts.edit', [' title' => 'Edit Contact: ' . $contact->fullname, 'contact' => $contact, 'states' => $states, 'countries' => $countries, 'types' => $types]); }
/** * Run the database seeds. * * @return void */ public function run() { // User::create(['firstname' => 'Tim', 'lastname' => 'Bradshaw', 'email' => '*****@*****.**', 'password' => Hash::make('jackass'), 'phone' => '3076904269'])->types()->sync([3, 1]); User::create(['firstname' => 'Chris', 'lastname' => 'Rundlett', 'email' => '*****@*****.**', 'password' => Hash::make('secret'), 'phone' => '2069727245'])->types()->sync([3]); User::create(['firstname' => 'Chrystal', 'lastname' => 'Young', 'email' => '*****@*****.**', 'password' => Hash::make('secret'), 'phone' => '2069727245'])->types()->sync([3]); $faker = Faker::create(); foreach (range(1, 100) as $index) { User::create(['firstname' => $faker->firstname, 'lastname' => $faker->lastname, 'email' => $faker->email, 'phone' => $faker->phoneNumber, 'city' => $faker->city, 'state' => $faker->stateAbbr, 'country' => array_search($faker->country, \CountryState::getCountries())])->types()->sync([1, rand(2, 6)]); } }
<?php include S_SECTIONS . "/member/memberaccess.php"; if (!isset($countryObj)) { include_once SITE_CLASS_APPLICATION . "class.Country.php"; $countryObj = new Country(); } if (!isset($stateObj)) { include_once SITE_CLASS_APPLICATION . "class.State.php"; $stateObj = new State(); } if (!isset($cntstObj)) { include_once SITE_CLASS_GEN . "class.countrystate.php"; $cntstObj = new CountryState(); } if (!isset($orgObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Organization.php"; $orgObj = new Organization(); } if (!isset($pohObj)) { include_once SITE_CLASS_APPLICATION . "user/class.PurchaseOrderHeading.php"; $pohObj = new PurchaseOrderHeading(); } if (!isset($asocObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.OrganizationAssociation.php"; $asocObj = new OrganizationAssociation(); } if (!isset($statusmasterObj)) { include_once SITE_CLASS_APPLICATION . "class.StatusMaster.php"; $statusmasterObj = new StatusMaster(); }
} if (!isset($orgObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Organization.php"; $orgObj = new Organization(); } if (!isset($countryObj)) { include_once SITE_CLASS_APPLICATION . "class.Country.php"; $countryObj = new Country(); } if (!isset($stateObj)) { include_once SITE_CLASS_APPLICATION . "class.State.php"; $stateObj = new State(); } if (!isset($cntstObj)) { include_once SITE_CLASS_GEN . "class.countrystate.php"; $cntstObj = new CountryState(); } if (!isset($orgUserPerObj)) { require_once SITE_CLASS_APPLICATION . "user/class.OrganizationUserPermission.php"; $orgUserPerObj = new OrganizationUserPermission(); } if (!isset($orgUserPermVerifyObj)) { include_once SITE_CLASS_APPLICATION . "user/class.OrganizationUserPermissionToVerify.php"; $orgUserPermVerifyObj = new OrganizationUserPermissionToVerify(); } $uprmts = array(); if ($iUserID != '') { $view = 'verify'; $OuserData = $userData = $orgUserObj->select($iUserID); if ($sess_usertype_short == 'OA' && $userData[0]['iOrganizationID'] != $curORGID) { header("Location: " . SITE_URL_DUM . "organizationuserlist");
public function testGetStateName() { $stateName = CountryState::getStateName('MB', 'CA'); $this->assertEquals("Manitoba", $stateName); }