<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/tcp-ip-settings/edit?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>
                                <option value="<?= TCPIP_SERVER ?>" <?= ( true == isset( $arrmixTcpIpSettingsDetails ) && ( $arrmixTcpIpSettingsDetails['mode'] == TCPIP_SERVER ) ) ? 'selected="selected"' : set_select( 'mode', TCPIP_SERVER ); ?>> TCP-IP Server </option>
                                <option value="<?= TCPIP_CLIENT ?>" <?= ( true == isset( $arrmixTcpIpSettingsDetails ) && ( $arrmixTcpIpSettingsDetails['mode'] == TCPIP_CLIENT ) ) ? 'selected="selected"' : set_select( 'mode', TCPIP_CLIENT ); ?>> TCP-IP Client </option>
                            </select>
                            <?= getValidationError( 'mode' ) ?>                            
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-ip-address">Ip Address</label>
                            <input type="text" class="form-control" id="js-ip-address" name="ip_address" placeholder="Ip Address" data-inputmask="'alias': 'ip'" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['ip_address'] : set_value( 'ip_address' ) ?>" readonly>
                            <?= getValidationError( 'ip_address' ) ?>
                        </div>

                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-subnet-mask">Subnet Mask</label>
                            <input type="text" class="form-control" id="js-subnet-mask" name="subnet_mask" placeholder="Subnet Mask" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['subnet_mask'] : set_value( 'subnet_mask' ) ?>" readonly>
                            <?= getValidationError( 'subnet_mask' ) ?>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-default-gateway">Default Gateway</label>
                            <input type="text" class="form-control" id="js-default-gateway" name="default_gateway" placeholder="Default Gateway" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['default_gateway'] : set_value( 'default_gateway' ) ?>" readonly>
                            <?= getValidationError( 'default_gateway' ) ?>
                        </div>

                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-port">Port</label>
                            <input type="text" class="form-control" id="js-port" name="port" placeholder="Port" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['port'] : \App\Models\TcpIpSettingsModel::DEFAULT_PORT ?>">
                            <?= getValidationError( 'port' ) ?>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-connection-timeout">Connection Timeout</label>
                            <input type="text" class="form-control" id="js-connection-timeout" name="connection_timeout" placeholder="Connection Timeout" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['connection_timeout'] : \App\Models\TcpIpSettingsModel::DEFAULT_CONNECTION_TIMEOUT ?>">
                            <?= getValidationError( 'connection_timeout' ) ?>
                        </div>

                        <div class="col-4 form-group">
                            <label class="control-label label-required" for="js-response-timeout">Response Timeout</label>
                            <input type="text" class="form-control" id="js-response-timeout" name="response_timeout" placeholder="Response Timeout" value="<?= ( true == isset( $arrmixTcpIpSettingsDetails ) ) ? $arrmixTcpIpSettingsDetails['response_timeout'] : \App\Models\TcpIpSettingsModel::DEFAULT_RESPONSE_TIMEOUT ?>">
                            <?= getValidationError( 'response_timeout' ) ?>
                        </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/tcp-ip-settings/view" class="btn btn-outline-danger"> Cancel</a>
                </div>
            </form>
        </div>
            
    </div><!-- /.container-fluid -->
</section>

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

</script>