Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="id_group" id="select_group" class="form-control" style="text-align-last: center;" required>
- <option value='115'>115</option>
- </select>
- /*Для View-ера*/
- $.ajax({
- url: "<?php echo base_url("panel/ajax_loading_groups") ?>",
- type: "post",
- dataType: "html",
- success:function(data){
- $('#select_group').fadeTo("fast", 0).delay(500).fadeTo('fast',1).html(data);
- $('#select_group').val(" ");
- },
- error: function(xhr, status, error) {
- console.log(xhr)
- console.log(error);
- }
- });
- /*Controller*/
- public function loading_groups(){
- $this->load->helper('form');
- if(logged_in()){
- if(check_rules()){
- if ($groups = R::getAll('select * from students')){
- $result = unique_multidim_array($groups, 'id_course');
- foreach($result as $item){
- $data .= '<option value='.$item['id_course'].'>'.$item['id_course'].'</option>';
- }
- }else{
- $data = '<div class="<div class="alert alert-danger" role="alert">Курсы студентов не найдены!' . '</div>';
- }
- echo $data;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement