Exemplo n.º 1
0
 public function getIndex()
 {
     $campaign = new Campaign();
     $image = $campaign->getCampaignImage();
     $users = new Users();
     $member = $users->getRecentUsers();
     $this->layout->foot = View::make("landing.foot")->with(array('data' => $image, 'data2' => $member));
     $this->layout->title = "Welcome to Sagip.ph";
     if (Session::has('userid')) {
         $username = Session::get('username');
         $logstatus = true;
         $userid = Session::get('userid');
         $profile = new Profile();
         $pic = "#";
         $result = $profile->getProfile($userid);
         if ($result) {
             $pic = $result->profilepic;
         }
         $data = array('username' => $username, 'logstatus' => $logstatus, 'profilepic' => $pic);
         $campaign = new Campaign();
         $data2 = $campaign->getCampaignHome();
         $this->layout->head = View::make("landing.head")->with($data);
         $this->layout->body = View::make("landing.bodycontributordash")->with($data);
     } else {
         $logstatus = false;
         $data = array('logstatus' => $logstatus);
         $campaign = new Campaign();
         $data2 = $campaign->getCampaignHome();
         $this->layout->head = View::make("landing.head")->with($data);
         $this->layout->body = View::make("landing.bodycontributordash")->with($data);
     }
 }
Exemplo n.º 2
0
 public function getIndex()
 {
     //	Session::put('userid','001');
     //	Session::put('username','jehdeguzman');
     $this->layout->title = "Welcome to Sagip.ph";
     // $campaign = new Campaign;
     // $result = $campaign->getImage();
     $campaign = new Campaign();
     $image = $campaign->getCampaignImage();
     $users = new Users();
     $member = $users->getRecentUsers();
     $this->layout->foot = View::make("landing.foot")->with(array('data' => $image, 'data2' => $member));
     if (Session::has('userid')) {
         $username = Session::get('username');
         $logstatus = true;
         $userid = Session::get('userid');
         $profile = new Profile();
         $pic = "#";
         $result = $profile->getProfile($userid);
         if ($result) {
             $pic = $result->profilepic;
         }
         $data = array('username' => $username, 'logstatus' => $logstatus, 'profilepic' => $pic);
         $campaign = new Campaign();
         $data2 = $campaign->getCampaignHome();
         $donation = new Donations();
         $data3 = $donation->getTopContributorsHome();
         $this->layout->head = View::make("landing.head")->with($data);
         $this->layout->body = View::make("landing.bodyhome")->with(array('data2' => $data2, 'data3' => $data3, 'logstatus' => $logstatus));
         //return View::make('home')->with($data);
     } else {
         $logstatus = false;
         $data = array('logstatus' => $logstatus);
         $campaign = new Campaign();
         $data2 = $campaign->getCampaignHome();
         $donation = new Donations();
         $data3 = $donation->getTopContributorsHome();
         $this->layout->head = View::make("landing.head")->with($data);
         $this->layout->body = View::make("landing.bodyhome")->with(array('data2' => $data2, 'data3' => $data3, 'logstatus' => $logstatus));
     }
 }
Exemplo n.º 3
0
 public function getIndex($usernameurl)
 {
     //$username = Request::segment(1);
     $users = new Users();
     $result = $users->checkUser($usernameurl);
     $this->layout->title = "Welcome to Sagip.ph";
     $campaign = new Campaign();
     $image = $campaign->getCampaignImage();
     $users = new Users();
     $member = $users->getRecentUsers();
     $this->layout->foot = View::make("landing.foot")->with(array('data' => $image, 'data2' => $member));
     if ($result) {
         $useridurl = $result->id;
         $activity = new Activity();
         $recent = $activity->getRecent($useridurl);
         if (!$recent) {
             $recent = false;
         }
         if (Session::has('userid')) {
             $username = Session::get('username');
             $logstatus = true;
             $userid = Session::get('userid');
             $profile = new Profile();
             $firstname = "";
             $lastname = "";
             $age = "";
             $address = "";
             $work = "";
             $website = "";
             $contact = "";
             $pic = "images/users/default.png";
             $result = $profile->getProfile($userid);
             if ($result) {
                 $firstname = $result->firstname;
                 $lastname = $result->lastname;
                 $age = $result->age;
                 if ($age == 0) {
                     $age = "";
                 }
                 $address = $result->address;
                 $work = $result->work;
                 $website = $result->website;
                 $contact = $result->contact;
                 $pic = $result->profilepic;
             }
             $data = array('username' => $username, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
             $this->layout->head = View::make("landing.head")->with($data);
             $this->layout->body = View::make("landing.bodyprofile")->with($data);
             if (Session::get('username') != $usernameurl) {
                 $username = $usernameurl;
                 $logstatus = false;
                 $profile = new Profile();
                 $firstname = "";
                 $lastname = "";
                 $age = "";
                 $address = "";
                 $work = "";
                 $website = "";
                 $contact = "";
                 $pic = "images/users/default.png";
                 $result = $profile->getProfile($useridurl);
                 if ($result) {
                     $firstname = $result->firstname;
                     $lastname = $result->lastname;
                     $age = $result->age;
                     if ($age == 0) {
                         $age = "";
                     }
                     $address = $result->address;
                     $work = $result->work;
                     $website = $result->website;
                     $contact = $result->contact;
                     $pic = $result->profilepic;
                 }
                 $data = array('username' => $username, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
                 $this->layout->body = View::make("landing.bodyprofile")->with($data);
             } else {
             }
             //return View::make('home')->with($data);
         } else {
             $logstatus = false;
             $profile = new Profile();
             $result = $profile->getProfile($useridurl);
             if ($result) {
                 $firstname = $result->firstname;
                 $lastname = $result->lastname;
                 $age = $result->age;
                 if ($age == 0) {
                     $age = "";
                 }
                 $address = $result->address;
                 $work = $result->work;
                 $website = $result->website;
                 $contact = $result->contact;
                 $pic = $result->profilepic;
             }
             $data = array('username' => $usernameurl, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
             $this->layout->head = View::make("landing.head")->with($data);
             $this->layout->body = View::make("landing.bodyprofile")->with($data);
         }
     } else {
         return Redirect::to('/');
     }
 }