Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function action_placements()
- {
- if($this->user->has('roles', ORM::factory('role', array('name' => 'admin'))))
- {
- $adplacements = ORM::factory('adplacement')
- ->find_all();
- }
- else
- {
- $adplacements = ORM::factory('adplacement')
- ->where('user_id','=',$this->user->id)
- ->find_all();
- }
- $placements = array();
- foreach($adplacements as $ap)
- {
- $adlocation = $ap->adlocation;
- $adunit = $ap->adunit;
- $row = array(
- 'id' => $ap->id,
- 'website' => $ap->website ,
- 'location' => $adlocation->label ,
- 'adunit' => $adunit->label ,
- );
- $placements[] = $row;
- }
- $data = array(
- 'placements' => $placements ,
- );
- $this->template->content = view::factory('admin/publisher/list',$data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement