I'm working on the Hospital Management plugin and trying to find some solution to change the code. I'm not so experienced in plugin modification and try to change some select options into a multiple select dropdown.
Here is the code:
<div class="form-group">
<div class="mb-3 row">
<label class="col-sm-2 control-label form-label" for="doctor"><?php esc_html_e('Assign Doctor','hospital_mgt');?></label>
<div class="col-sm-3 margin_bottom_5px">
<?php if($edit){ if(!empty($doctor->ID)){ $doctorid=$doctor->ID;}else{ $doctorid=''; } }elseif(isset($_POST['doctor'])){$doctorid=$_POST['doctor'];}else{$doctorid='';}?>
<select name="doctor" id="doctors" class="form-control">
<option ><?php esc_html_e('Select Doctor','hospital_mgt');?></option>
<?php $get_doctor = array('role' => 'doctor');
$doctordata=get_users($get_doctor);
if(!empty($doctordata))
{
foreach($doctordata as $retrieved_data)
{
?>
<option value="<?php echo esc_attr($retrieved_data->ID); ?>" <?php selected($doctorid,$retrieved_data->ID);?>><?php echo esc_html($retrieved_data->display_name);?> - <?php echo MJ_hmgt_doctor_specialization_title($retrieved_data->ID); ?></option>
<?php
}
}?>
</select>
</div>
<!-- Adddoctor Button -->
<div class="col-sm-2">
<button type="button" class="btn btn-default" data-bs-toggle="modal" data-bs-target="#myModal_add_doctor"> <?php esc_html_e('Add Doctor','hospital_mgt');?></button>
</div>
</div>
</div>
It is needed to have multiple select. Any help would be welcome. Thank you.