Esempio n. 1
0
 public static function getAllAgentsInZone($zoneId)
 {
     $db = Zend_Registry::get('my_db');
     $agents = array();
     $query = "select azc.agent_id from " . DBConvertor::convertCase('agent_zone_context') . " azc, " . DBConvertor::convertCase('agent') . " a where a.agent_id = azc.agent_id " . " and azc.zone_id = {$zoneId} order by a.agent_name";
     $result = $db->fetchAll($query);
     foreach ($result as $row) {
         switch (DB_TYPE) {
             case 'mysql':
                 $agent_id = $row->agent_id;
                 break;
             case 'oci8':
                 $agent_id = $row->AGENT_ID;
                 break;
         }
         $agent = new Agent($agent_id, $zoneId);
         $agent = agent::getRegisteredAgentsInformation($agent, $zoneId);
         array_push($agents, $agent);
     }
     return $agents;
 }
Esempio n. 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     agent::create($request->all());
     return redirect('admin/agents')->with('success', Lang::get('message.success.create'));
 }