<script src="<?= getBaseUrl() ?>assets/plugins/jquery/jquery.min.js"></script>

<!-- Content Header (Page header) -->
<?php App\Controllers\BackendController::createService()->showBreadCrumbs( $arrmixBreadCrumbData ) ?>
<!-- /.content-header -->

<!-- Main content -->
<section class="content">
    <div class="container-fluid">
        <div class="js-show-alert-message">
            <?php App\Controllers\BackendController::createService()->showAlertMessage( $arrmixFlashData ) ?>
        </div>

        <div class="card card-info">
            <div class="card-header">
                <h3 class="card-title"><?= $strCardTitle; ?></h3>
            </div>
            <form role="form" method="post" name="form" id="js-form-user-profile" action="<?= getBaseUrl() ?>device-settings/com-settings/edit-com-settings?used_config_file=<?= $intUsedConfigFile ?>">
                <div class="card-body">
                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-mode">Mode</label>
                            <select class="form-control" name="mode">
                                <option selected="selected" disabled="disabled">Select Option</option>
                                <?php 
                                    foreach( \App\Models\ComSettingsModel::$s_arrstrModes as $strModeKey => $strModeValue ) { 
                                        
                                        $strSelected = '';
                                        if( true == isset( $arrmixComSettingsDetails ) && $arrmixComSettingsDetails['mode'] == $strModeKey ) {
                                            $strSelected = 'selected="selected"';
                                        }
                                ?>
                                            <option value="<?= $strModeKey ?>" <?= $strSelected?> <?= set_select( 'mode', $strModeKey ); ?>><?= $strModeValue; ?></option>    
                                <?php } ?>
                            </select>
                            <?= getValidationError( 'mode' ) ?>
                        </div>
                    </div> 
                    <br>
                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label" for="js-baud">Baud Rate: &nbsp;</label>
                            <span><?= $arrmixComSettingsDetails['baud_rate'] ?></span>
                        </div>

                        <div class="col-4 form-group">
                            <label class="control-label" for="js-data-bits">Data Bits: &nbsp;</label>
                            <span><?= $arrmixComSettingsDetails['data_bits'] ?></span>
                        </div> 

                        <div class="col-4 form-group">
                            <label class="control-label" for="js-flow_control">Flow Control: &nbsp;</label>
                            <span class="badge badge-danger">OFF</span>
                        </div>   
                    </div>

                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label" for="js-parity-bits">Parity Bits: &nbsp;</label>
                            <span><?= getParityBitsName( $arrmixComSettingsDetails['parity_bits'] ) ?></span>
                        </div>

                        <div class="col-4 form-group">
                            <label class="control-label" for="js-stop-bits">Stop Bits: &nbsp;</label>
                            <span><?= $arrmixComSettingsDetails['stop_bits'] ?></span>
                        </div>
                    </div>
                    <!-- /.card-body -->
                </div>    
                <!-- /.card-body -->

                <div class="card-footer">
                    <button type="submit" class="btn btn-outline-success">Submit</button>
                    <a href="<?= getBaseUrl() ?>device-settings/com-settings/view" class="btn btn-outline-danger"> Cancel</a>
                </div>
            </form>
        </div>
            
    </div><!-- /.container-fluid -->
</section>

<script>
    $(document).ready(function() {
    });

</script>