Beispiel #1
0
 public function agentSelectList($category_id, $ticket_id)
 {
     $agents = ['auto' => 'Auto Select'] + Models\Agent::agentsLists($category_id);
     $selected_Agent = Models\Ticket::find($ticket_id)->agent->id;
     $select = '<select class="form-control" id="agent_id" name="agent_id">';
     foreach ($agents as $id => $name) {
         $selected = $id == $selected_Agent ? "selected" : "";
         $select .= '<option value="' . $id . '" ' . $selected . '>' . $name . '</option>';
     }
     $select .= '</select>';
     return $select;
 }