I need to create a dropdown menu

Good day!
Can someone give me a help?
I need to create a dropdown menu to select a column according to the desired item.
The column is named “Obras Sociales”.
Attached a screenshot for clarity. Thank you very much and excuse my english.

Hi Luis Cardenas
You Can follow these steps for adding new dropdown in appoitments report

  1. obras_sociales=> [dropdown post name]
    add this line before fetchAppointments function in file name interface\reports\appointments_report.php
if (isset($_POST['obras_sociales'])) {
    $obras_sociales = $_POST['obras_sociales'];
  1. pass $obras_sociales varible to fetchAppointments function.

    $appointments = fetchAppointments($from_date, $to_date, $patient, $provider, $facility, $form_apptstatus, $with_out_provider, $with_out_facility, $form_apptcat,$obras_sociales);

3.add $obras_sociales parameter to fetchAppointments function in library\appointments.inc.php. refer appoitments function below

function fetchAppointments($from_date, $to_date, $patient_id = null, $provider_id = null, $facility_id = null, $pc_appstatus = null, $with_out_provider = null, $with_out_facility = null, $pc_catid = null, $tracker_board = false, $nextX = 0, $group_id = null, $patient_name = null,$obras_sociales=’’){…}

if($obras_sociales!=''){$where .= " AND e.obras_sociales = ?";array_push($sqlBindArray,$obras_sociales);  }

*i used obras_sociales colum name in openemr_postcalendar_events table

4.Select obras_sociales colum name in fetchEvents function below like this

5.add th and td colums in interface\reports\appointments_report.php

I hope its useful for you.


Thank you very much for his help. If you could help me a bit more please. The dropdown does not work. I enclose you two modified files. Thank you.
Also create the obras_sociales column in the openemr_postcalendar_events table. Creating a new appointment does not save Obras Sociales there.

appointments_report_os.php (24.1 KB)
appointments.inc.php (26.4 KB)

Its Working fine to me.I attached code given below. You can Refer this.
appointments_report_os.php (24.1 KB)
appointments.inc.php (26.2 KB)