<?php
// *************************************************************************
// *                                                                       *
// * DEPRIXA PRO -  Integrated Web Shipping System                         *
// * Copyright (c) JAOMWEB. All Rights Reserved                            *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * Email: support@jaom.info                                              *
// * Website: http://www.jaom.info                                         *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * This software is furnished under a license and may be used and copied *
// * only  in  accordance  with  the  terms  of such  license and with the *
// * inclusion of the above copyright notice.                              *
// * If you Purchased from Codecanyon, Please read the full License from   *
// * here- http://codecanyon.net/licenses/standard                         *
// *                                                                       *
// *************************************************************************



if (!$user->cdp_is_Admin())
    cdp_redirect_to("login.php");
$userData = $user->cdp_getUserData();


require_once('helpers/querys.php');

if (isset($_GET['id'])) {
    $data = cdp_getCountry($_GET['id']);
}

if (!isset($_GET['id']) or $data['rowCount'] != 1) {
    cdp_redirect_to("countries_list.php");
}

$row_off = $data['data'];

?>
<!DOCTYPE html>
<html dir="<?php echo $direction_layout; ?>" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/<?php echo $core->favicon ?>">
    <title><?php echo $lang['leftorder315'] ?> | <?php echo $core->site_name ?></title>
    <?php include 'views/inc/head_scripts.php'; ?>

    <link href="assets/template/assets/libs/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet">
    <link href="assets/template/dist/css/custom_swicth.css" rel="stylesheet">


</head>

<body>
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->


    <?php include 'views/inc/preloader.php'; ?>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <div id="main-wrapper">
        <!-- ============================================================== -->
        <!-- Topbar header - style you can find in pages.scss -->
        <!-- ============================================================== -->

        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->

        <?php include 'views/inc/topbar.php'; ?>

        <!-- End Topbar header -->


        <!-- Left Sidebar - style you can find in sidebar.scss  -->

        <?php include 'views/inc/left_sidebar.php'; ?>


        <!-- End Left Sidebar - style you can find in sidebar.scss  -->

        <!-- Page wrapper  -->
        <!-- ============================================================== -->
        <div class="page-wrapper">

            <!-- Action part -->
            <!-- Button group part -->
            <div class="bg-light">
                <div class="row justify-content-center">
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-12">
                                <!-- <div id="loader" style="display:none"></div> -->
                                <div id="resultados_ajax"></div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Action part -->


            <div class="container-fluid mb-4">

                <div class="row">
                    <!-- Column -->

                    <div class="col-lg-12 col-xl-12 col-md-12">

                        <div class="card">
                            <div class="card-body">

                                <div id="msgholder"></div>
                                <form class="form-horizontal form-material" id="update_data" name="update_data" method="post">
                                    <header>
                                        <span> <?php echo $lang['leftorder315'] ?></span>
                                    </header>
                                    <section>
                                        <div class="row">

                                            <div class="col-md-6 mt-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder303'] ?></label>
                                                    <input value="<?php echo $row_off->name; ?>" type="text" class="form-control" name="country_name" id="country_name" placeholder="<?php echo $lang['leftorder303'] ?>">
                                                </div>
                                            </div>

                                            <div class="col-md-3 mt-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder304'] ?></label>
                                                    <input value="<?php echo $row_off->iso3; ?>" type="text" class="form-control" name="iso3" id="iso3" placeholder="<?php echo $lang['leftorder304'] ?>">
                                                </div>
                                            </div>

                                            <div class="col-md-3 mt-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder305'] ?></label>
                                                    <input value="<?php echo $row_off->region; ?>" type="text" class="form-control" name="region" id="region" placeholder="<?php echo $lang['leftorder305'] ?>">
                                                </div>
                                            </div>

                                        </div>

                                        <div class="row">
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder312'] ?></label>
                                                    <input value="<?php echo $row_off->capital; ?>" type="text" class="form-control" name="capital" id="capital" placeholder="<?php echo $lang['leftorder312'] ?>">
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder313'] ?></label>
                                                    <input value="<?php echo $row_off->phone_code; ?>" type="text" class="form-control" name="phone_code" id="phone_code" placeholder="<?php echo $lang['leftorder313'] ?>">
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder306'] ?></label>
                                                    <input value="<?php echo $row_off->currency_name; ?>" type="text" class="form-control" name="currency" id="currency" placeholder="<?php echo $lang['leftorder306'] ?>">
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder307'] ?></label>
                                                    <input value="<?php echo $row_off->currency_symbol; ?>" type="text" class="form-control" name="currency_symbol" id="currency_symbol" placeholder="<?php echo $lang['leftorder307'] ?>">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label for="firstName1"><?php echo $lang['leftorder316'] ?></label>
                                                    <label class="custom-control custom-checkbox" style="font-size: 18px;">
                                                        <input type="checkbox" class="custom-control-input" name="is_active" id="is_active" value="1" 
                                                        <?php if ($row_off->is_active == 1) {
                                                            echo 'checked';
                                                        } ?>>

                                                        <span class="custom-control-indicator"></span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                    </section>
                                    <br><br>
                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <button class="btn btn-outline-primary btn-confirmation" name="dosubmit" type="submit"><?php echo $lang['leftorder315'] ?></i></span></button>
                                            <a href="countries_list.php" class="btn btn-outline-secondary btn-confirmation"><span><i class="ti-share-alt"></i></span> <?php echo $lang['global-buttons-3'] ?></a>
                                        </div>
                                    </div>

                                    <input name="id" id="id" type="hidden" value="<?php echo $_GET['id']; ?>" />
                                </form>

                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                </div>
            </div>

            <?php include 'views/inc/footer.php'; ?>

        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->

    <script src="assets/template/dist/js/app-style-switcher.js"></script>
    <script src="assets/template/assets/libs/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>

    <script src="dataJs/countries.js"></script>
</body>

</html>