0

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.

hakre
  • 184,866
  • 48
  • 414
  • 792
Ben
  • 1
  • 1
  • 1
    Welcome to Stackoverflow! This question is unfortunately too vague and unfocused. We're glad to help you sort out specific issues you might run into with your existing implementation attempt, which means that you need to do the [appropriate amount of research](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) and make some proper attempts yourself first. To help with that I took the liberty to close against a reference question that should give at least some starting pointers for your research on Stackoverflow. – hakre Oct 01 '21 at 22:57

0 Answers0