public function index() { if (!Owner::isAuthenticated() && !Agent::isAuthenticated()) { $this->redirect('/'); } else { $this->view('dashboard/index'); } }
public function addtenant($propertyId) { if (!Owner::isAuthenticated()) { $this->redirect('/'); } else { if ($_SERVER['REQUEST_METHOD'] === 'POST') { } else { $this->view('templates/interfaceStart'); $this->view('owner/addtenant'); $this->view('templates/interfaceEnd'); } } }
public function index() { $_SESSION['sidebar'] = 'dashboard'; if (Owner::isAuthenticated()) { // if owner is authenticated // TODO: display owner dashboard $this->redirect('/propertyowner/index'); } elseif (Tenant::isAuthenticated()) { // if tenant is authenticated // TODO: display tenant dashboard $this->redirect('/propertytenant/index'); } elseif (Agent::isAuthenticated()) { // if agent is authenticated // TODO: display agent dashboard $this->redirect('/propertyagent/index'); } elseif (Real_Estate::isAuthenticated()) { // if real estate is authenticated // TODO: display real estate dashboard $this->redirect('/realest/index'); } else { // if no one is authenticated // display landing page $this->setJavascriptDependencies([WEBDIR . '/js/jquery.js', WEBDIR . '/js/bootstrap.min.js', 'http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js', WEBDIR . '/js/classie.js', WEBDIR . '/js/cbpAnimatedHeader.js', WEBDIR . '/js/wallfly.js', 'http://cdn.jsdelivr.net/jquery.validation/1.14.0/jquery.validate.js', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/additional-methods.js', WEBDIR . '/js/index.js']); $this->view('home/index'); } // TEST // $owner = Owner::create([ // 'email' => '*****@*****.**', // 'password' => 'password', // 'firstname' => 'John', // 'lastname' => 'Doe', // 'phone' => '12345123', // 'photo' => NULL // ]); // $agent = Agent::create([ // 'email' => '*****@*****.**', // 'password' => 'password', // 'firstname' => 'Jane', // 'lastname' => 'Doe', // 'phone' => '12345123', // 'photo' => NULL, // 'real_estate_id' => 2 // ]); // $realestate = Real_Estate::create([ // 'name' => 'Ray White', // 'password' => 'password', // 'address' => 'address', // 'email' => '*****@*****.**', // 'phone' => '12345123', // 'photo' => NULL // ]); // $property = Property::create([ // 'address' => 'address', // 'payment_schedule' => 'payment_schedule', // 'rent_amount' => 'rent_amount', // 'photo' => NULL, // 'real_estate_id' => NULL, // 'agent_id' => NULL, // 'owner_id' => NULL // ]); }