<?

//echo $provider_combo;

?>
<form>
    <div class="panel-heading">
        <h6 class="panel-title"><span class="display-block text-muted">
            Note: When you assigned a transporter. The transporter will still have to confirm or be confirmed.                
            </span> </h6>                   
    </div>
    <div class="table-responsive">
        <table class="table text-stripped">
            <tbody>
                <tr>
                    <td style="width: 120px">
                        <b>Assign Transporter :</b>
                    </td>
                    <td> 
                        <table class="table text-stripped">
                            <tr>
                                <td style="width: 20px;"></td>
                                <td>
                                    <?= $provider_combo ?>
                                </td>
                                <td style="width: 80px;">
                                  <div id ='but_detail'>  <button type="button" name="buttonassignDriverFromConfirmed" class="btn btn-info btn-xs" onclick="return assignDriverFromConfirmed(this);">Assign Driver</button> </div>
                                </td>
                            </tr>

                           
                            <tr>
                                <td colspan="3"> 
                                    MSG
                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>   

        
  

          



            </tbody>
        </table>
    </div>
</form>


<script type="text/javascript">
<!--
   

    function assignDriverFromConfirmed(button) {
        var service_id = '<?= $rect["id"] ?>';
        var driver_id = button.form.providers.value;
        if (driver_id < 1) {
            alert('Please select driver');
            return false;
        }
                
        $('#but_detail').html('Processing...');
        button.disabled = true;
        $.ajax({
            url: "/service/assignDriver?service_id=" + service_id + "&driver_id=" + driver_id
        }).done(function (data) {
            button.disabled = false;
            if (data == '0') {
                alert('Driver was set');
               // processPendTransp(transport_id);
            }
            $('#but_detail').html(data);         
        });
        return false;
    }
   
   
// -->
</script>
<!--
vi:ts=2
-->
