示例#1
0
 /**
  * 
  */
 public function getActivitiesAction()
 {
     $activity_model = new manage_model_activity();
     /** @var manage_model_activity_collection $ac */
     $ac = $activity_model->getCollection()->activityReferenceForMobile();
     $ac->load();
     $ftmp = fopen('php://output', 'w');
     $activities = $ac->toArray();
     foreach ($activities as $id => $activity) {
         fputs($ftmp, "{:{$id}:}{$activity['name']}\n");
     }
     fclose($ftmp);
 }
示例#2
0
 protected function _initVars()
 {
     parent::_initVars();
     $activity = new manage_model_activity();
     $this->setVar('activities', $activity->getCollection());
     $city = new manage_model_city();
     $this->setVar('cities', $city->getCollection());
     $user = new manage_model_user();
     $traders_collection = $user->getCollection();
     $traders_collection->addRoleFilter(manage_model_role::ROLE_AGENT);
     $this->setVar('traders', $traders_collection);
     $filter = $this->getVar('filter');
     if (!isset($filter['date'])) {
         $dateFrom = date('U') - 60 * 60 * 24 * 7;
         $dateTo = (int) date('U');
         $this->setFilterVar('date', array('from' => $dateFrom, 'to' => $dateTo));
     }
 }