Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

340
Visualizações
How to fetch specific schedule in fullcalendar-codeigniter?

I've been bugging by this problem for like 2 weeks already, and I can't seem to find the reason why it is not working.

In my database, I have a table called 'course' where the user can add courses with schedule.

Problem: The problem is the calendar in my "edit course" page shows all the schedule of the courses stored in the table. What I want is when I want to edit the info of a specific course, the calendar should only display the schedule of that course.

My calendar shows all the schedule of all courses

enter image description here

Here is my controller function:

public function load()
{
  $event_data = $this->crud_model->fetch_all_event();

  foreach($event_data->result_array() as $row)
  {
   $data[] = array(
    'id' => $row['id'],
    'title' => $row['sched_desc'],
    'start' => $row['start'],
    'end' => $row['end']
   );
  }
  echo json_encode($data);
}

Model function:

public function fetch_all_event($course_id = "")
{
    $this->db->order_by('id');
    $this->db->select("*");
    return $this->db->get('course');
}

Script:

<script>
    $(document).ready(function(){
        var calendar = $('#calendar').fullCalendar({
            editable:false,
            header:{
                left:'prev,next today',
                center:'title',
                right:'month,agendaWeek,agendaDay'
            },
            events:"<?php echo base_url(); ?>user/load"  
        });
    });
</script>

Here is my attempt but failed to work:

public function fetch_all_event($course_id)
{
    $course_details = $this->get_course_by_id($course_id)->row_array();
    $id = $course_details['id'];

    $this->db->order_by('id');
    $this->db->select("*");
    $this->db->where('id', $id);
    return $this->db->get('course');
}

public function get_course_by_id($course_id = "")
{
    return $this->db->get_where('course', array('id' => $course_id));
}

I hope someone here can help me, thank you.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda