<div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <div class="img-profile ml-3 mt-3">

                    </div>
                    <h1 class="m-0 text-dark"><?php echo (isset($course)) ? 'Edit Team' : 'Edit Team' ?>
                    </h1>

                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="<?= base_url(); ?>dashboard/courses">Teams</a></li>
                        <li class="breadcrumb-item active"><?php echo (isset($course)) ? 'Edit Team' : 'Edit Team' ?></li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <form method="post" id="add_driver" class="card" action="<?php echo base_url().'customer/updateteamsdata' ?>" enctype="multipart/form-data">
        <section class="content">
            <div class="container-fluid">
                <div class="card-body">
                  <?php
                //   echo "<pre>";
                //   print_r($teamsData);
                 ///  echo "</pre>";
                  ?>

                    <div class="row">
                        <input type="hidden" name="id" id="id" value="<?php echo $teamId; ?>">
                        
                        <div class="col-sm-6 col-md-12">
                            <label class="form-label">Title<span class="form-required">*</span></label>
                            <div class="form-group">
                                <input type="text" name="name" id="title" class="form-control" placeholder="name" required 
                                value="<?php echo (isset($teamsData)) ? $teamsData['name'] : '' ?>">
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-12">
                            <div class="form-group">
                                <label class="form-label">intro</label>
                                <textarea rows="5" name="intro" id="intro"
                                 placeholder="Description" class="form-control" ><?php echo (isset($teamsData)) ? $teamsData['intro'] : '' ?></textarea>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-6">
                            <div class="form-group">
                                <label class="form-label">Coaches<span class="form-required">*</span></label>
                                <select id="coachIds" name="coachIds[]" class="form-control multiselect"  required="" multiple>
                                  
                                 
                                    <?php
                                      foreach($coachlist as $key => $category){
                                    ?>
                                    <option value="<?=$key?>" 
                                    <?php 
                                    if (in_array($key, $teamsData['coachIds'])) {
                                      echo "selected";
                                  }
                                    ?>
                                    
                                    ><?=$category['name']?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
              
             


                        <div class="col-sm-6 col-md-6">
                        <div class="form-group">
                                <label class="form-label">Member List<span class="form-required">*</span></label>
                                <select id="members" name="members[]" class="form-control multiselect" multiple>
                                    <?php
                                      foreach($memberlist as $key => $team){
                                    ?>
                                    <option value="<?=$key?>"
                                    <?php 
                                    if (in_array($key, $teamsData['members'])) {
                                      echo "selected";
                                  }
                                    ?>
                                    ><?=$team['name']?></option>
                                    <?php } ?>
                                </select>
                        </div>

 
                    </div>

                </div>

            </div>
        </section>
        <section class="content">
            <div class="container-fluid">
                <div class="card-footer text-right">
                    <button type="submit" id="submit" class="btn btn-primary"> <?php echo (isset($vehicledetails) && isset($course)) ? 'Edit Team' : 'Edit Team' ?></button>
                </div>
            </div>
        </section>
    </form>
<script>
    function showRadios() {

$("#teamsSec").hide();
if (document.getElementById('isPro').checked) {
    $("#radiosSec").show();
    $("#specificTeams").prop('checked', false);
    $("#allTeams").prop('checked', true);
} else {
    $("#radiosSec").hide();
}
}

function showTeams() {

if (document.getElementById('specificTeams').checked) {
    $("#teamsSec").show();
} else {
    $("#teamsSec").hide();
}
}

 </script>   