Пример #1
0
 function arraylist_to_string($array_list, $separator = ',')
 {
     $return_string = '';
     foreach ($array_list as $value) {
         $return_string = $return_string . $value . ' ' . $separator . ' ';
     }
     return RemoveLastComma($return_string);
 }
Пример #2
0
 /**
  * get_branch_supervisor_list
  *
  * Get supervisor list that under this branch
  *
  * @return string
  * */
 public function get_branch_supervisor_list($option_type = NULL)
 {
     $this->trigger_events('get_branch_supervisor_list');
     $this->db->from('users')->where('main_group_id', $this->config->item('group_id_supervisor'))->where('su_branch_id', $option_type)->order_by('username');
     $result = $this->db->get();
     $return = '';
     if ($result->num_rows() > 0) {
         foreach ($result->result_array() as $row) {
             $return .= "<a href='" . base_url() . "merchant/supervisor/edit/" . $row['id'] . "' target='_blank'>" . $row['username'] . "</a>,";
         }
     }
     if ($return == '') {
         $return = "<a href='" . base_url() . "merchant/supervisor/add/" . $option_type . "' target='_blank'>Add Supervisor</a>,";
     }
     return RemoveLastComma($return);
 }