<?php
require("header.php")
?>

<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <!-- <h1>Add User</h1> -->
                </div>
                <div class="col-sm-6">

                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="container-fluid">
            <div class="row">

                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="card card-secondary">
                        <div class="card-header" style="background-color: black;">
                            <h3 class="card-title">Add Affilate</h3>
                            <ol class="breadcrumb float-sm-right" style="background-color: black;">
                                <li class="breadcrumb-item"><a href="dashboad.php">Home</a></li>
                                <li class="breadcrumb-item">User</li>
                                <li class="breadcrumb-item active">Add User</li>
                            </ol>
                        </div>

                        <!-- /.card-header -->
                        <!-- form start -->
                        <form action="add_affilate_code.php" method="post">

                            <div class="card-body">
                                <div class="col-sm-12">
                                    <br>

                                </div>
                                <div class="row">
                                    <div class="col-sm-6">

                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Name <span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <input type="name" name="user_name" class="form-control"
                                                id="exampleInputEmail1" placeholder="Enter name!" required>

                                        </div>
                                    </div>

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Email <span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <input type="email" name="user_email" class="form-control"
                                                id="exampleInputEmail1" placeholder="Enter email" required>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">


                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="country">Country<span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <input type="text" class="form-control" name="country"
                                                placeholder="Enter country" required>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="city">City<span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <input type="text" class="form-control" name="city" placeholder="Enter city"
                                                required>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">


                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">What is your pet name?<span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <input type="text" name="answer" class="form-control"
                                                id="exampleInputEmail1" placeholder="Enter your Answer!" required>

                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Password <span
                                                    style="color:red; font-size:25px;">*<span></label>
                                            <div class="input-group">

                                                <div class="input-group-prepend">

                                                </div>

                                                <input type="text" name="password" class="form-control"
                                                    id="exampleInputEmail1" placeholder="password" required>

                                                <div class="input-group-append">
                                                    <div class="input-group-text"><a type="button"
                                                            id="gnrt_pass">Generate Password</a></div>
                                                </div>
                                            </div>


                                        </div>

                                    </div>
                                </div>


                            </div>
                            <!-- /.card-body -->


                            <div class="card-footer">
                                <button type="submit" name="submit" class="btn btn-dark" style="background-color: black;">Create</button>
                                <button type="reset" class="btn btn-dark" style="font-size: 16px; background:black;">Clear</button>


                            </div>

                        </form>
                    </div>
                    <!-- /.card -->




                </div>

            </div>

            <!-- /.col -->
        </div>
        <!-- /.row -->

        <!-- /.container-fluid -->
    </section>
    <!-- /.content -->
</div>
<!-- for searching -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>

<script>
// Add your SweetAlert2 code here
<?php if (isset($_GET['error'])) { ?>
Swal.fire({
    title: 'Error',
    text: '<?php echo $_GET['error']; ?>',
    icon: 'error',
    confirmButtonText: 'OK',
    confirmButtonClass: 'btn btn-success btn-lg',
});
<?php } ?>
<?php if (isset($_GET['success'])) { ?>
Swal.fire({
    title: 'Success',
    text: '<?php echo $_GET['success']; ?>',
    icon: 'success',
    confirmButtonText: 'OK',
    confirmButtonClass: 'btn btn-success btn-lg',
});
<?php } ?>
</script>
<script>
$().ready(function() {
    $("#gnrt_pass").click(function() {
        var randomstring = Math.random().toString(36).slice(-8);
        $("input[name=password]").val(randomstring);
    })
})
</script>
<!-- searching end -->

<!-- pagination -->

<?php
require("footer.php")
?>