<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin : Add Leads</title>
    <?php include("headerlink.php")?>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">

        <div class="preloader flex-column justify-content-center align-items-center">
            <img class="animation__shake" src="dist/img/AdminLTELogo.png" alt="AdminLTELogo" height="60" width="60">
        </div>

        <?php include("navbar.php")?>
        <?php include("sidebar.php")?>
        <div class="content-wrapper">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6">
                            <h1 class="m-0 fw-bold text-uppercase">Leads</h1>
                        </div>
                        <div class="col-sm-6">
                            <ol class="breadcrumb float-sm-right">
                                <li class="breadcrumb-item"><a href="#">Home</a></li>
                                <li class="breadcrumb-item active">Leads</li>
                                <li class="breadcrumb-item active">Add New</li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
            <section class="content">
                <div class="container-fluid">
                    <div class="row">

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

                            <div class="card card-primary">
                                <div class="card-header" style="background: #343a40;">
                                    <h3 class="card-title text-white fw-bold text-uppercase">Add Lead</h3>
                                </div>

                                <form action="add_leads_code.php" method="POST">
                                    <div class="card-body">
                                        <div class="row">
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Name</label>
                                                    <input type="text" class="form-control" placeholder="Name"
                                                        name="name">
                                                </div>
                                            </div>
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputPurpose">Compnay Name</label>
                                                    <input type="text" class="form-control" placeholder="Compnay Name"
                                                        name="company_name">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact1">Contact 1</label>
                                                    <!-- <input type="number" class="form-control"
                                                        placeholder="Contact Number" name="contact1"> -->
                                                    <input type="text" class="form-control" id="exampleInputName"
                                                        placeholder="Contact Number" name="contact1"
                                                        oninput="this.value = this.value.replace(/[^0-9]/g, '');">
                                                </div>
                                            </div>
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Contact 2</label>
                                                    <!-- <input type="number" class="form-control"
                                                        placeholder="Contact Number" name="contact2"> -->
                                                    <input type="text" class="form-control" id="exampleInputName"
                                                        placeholder="Contact Number" name="contact2"
                                                        oninput="this.value = this.value.replace(/[^0-9]/g, '');">
                                                </div>
                                            </div>


                                        </div>
                                        <div class="row">
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact1">Contact Email 1</label>
                                                    <input type="email" class="form-control" placeholder="Contact Email"
                                                        name="email1">
                                                </div>
                                            </div>
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Contact Email 2</label>
                                                    <input type="email" class="form-control" placeholder="Contact Email"
                                                        name="email2">
                                                </div>
                                            </div>


                                        </div>
                                        <div class="row">
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact1">Company Website 1</label>
                                                    <input type="text" class="form-control"
                                                        placeholder="Company Website" name="website1">
                                                </div>
                                            </div>
                                            <div class="col-6">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Company Website 2</label>
                                                    <input type="text" class="form-control"
                                                        placeholder="Company Website" name="website2">
                                                </div>
                                            </div>


                                        </div>
                                        <div class="row">
                                            <div class="col-4">
                                                <div class="form-group">
                                                    <label for="exampleInputContact3">Linkedin Page</label>
                                                    <div class="input-group mb-3">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i
                                                                    class="fab fa-linkedin"></i></span>
                                                        </div>
                                                        <input type="text" class="form-control" name="linkedin_username"
                                                            placeholder="Linkedin Page">
                                                        <input type="hidden" name="linkedin"
                                                            value="https://www.linkedin.com/in/">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-2">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Followers</label>
                                                    <input type="text" class="form-control" placeholder="Followers"
                                                        name="linkedin_followers">
                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="form-group">
                                                    <label for="exampleInputContact3">GMB Page</label>
                                                    <div class="input-group mb-3">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i
                                                                    class="fab fa-google"></i></span>
                                                        </div>
                                                        <input type="text" name="gmb_page_username" class="form-control"
                                                            placeholder="GMB Page Username">
                                                        <input type="hidden" name="gmb_page"
                                                            value="https://www.google.com/">

                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-2">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Reviews</label>
                                                    <input type="text" name="gmb_review" class="form-control"
                                                        placeholder="Reviews">
                                                </div>
                                            </div>
                                        </div>

                                        <label for="exampleInputEmail1">Social Handels</label>
                                        <div class="row">
                                            <div class="col-8">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                        <span class="input-group-text"><i
                                                                class="fab fa-facebook"></i></span>
                                                    </div>
                                                    <input type="text" name="facebook_username" class="form-control"
                                                        placeholder="Facebook Username" required>
                                                    <input type="hidden" name="facebook"
                                                        value="https://www.facebook.com/">

                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                    </div>
                                                    <input type="text" class="form-control"
                                                        placeholder="Rating & Reviews" name="fb_review">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-8">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                        <span class="input-group-text"><i
                                                                class="fab fa-instagram"></i></span>
                                                    </div>
                                                    <input type="text" name="instagram_username" class="form-control"
                                                        placeholder="Instagram Username">
                                                    <input type="hidden" name="instagram"
                                                        value="https://www.instagram.com/">

                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                    </div>
                                                    <input type="text" class="form-control"
                                                        placeholder="Rating & Reviews" name="insta_review">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-8">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                        <span class="input-group-text"><i
                                                                class="fab fa-twitter"></i></span>
                                                    </div>
                                                    <input type="text" name="twitter_username" class="form-control"
                                                        placeholder="Twitter Username">
                                                    <input type="hidden" name="twitter" value="https://twitter.com/">

                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                    </div>
                                                    <input type="text" class="form-control"
                                                        placeholder="Rating & Reviews" name="twitt_review">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-8">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                        <span class="input-group-text"><i
                                                                class="fab fa-youtube"></i></span>
                                                    </div>
                                                    <input type="text" name="youtube_username" class="form-control"
                                                        placeholder="Youtube Username">
                                                    <input type="hidden" name="youtube"
                                                        value="https://www.youtube.com/">

                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                    </div>
                                                    <input type="text" class="form-control"
                                                        placeholder="Rating & Reviews" name="youtube_review">
                                                </div>
                                            </div>
                                        </div>
                                        <!-- whatshapp  -->
                                        <div class="row">
                                            <div class="col-8">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                        <span class="input-group-text"><i
                                                                class="nav-icon fa fa-whatsapp fw-bold"></i></span>
                                                    </div>
                                                    <input type="text" class="form-control" name="whatsapp_username"
                                                        placeholder="WhatsApp Username">
                                                    <input type="hidden" name="whatsapp" value="https://wa.me/">
                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="input-group mb-3">
                                                    <div class="input-group-prepend">
                                                    </div>
                                                    <input type="text" class="form-control"
                                                        placeholder="Rating & Reviews" name="whatsapp_review">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-4">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Service</label>

                                                    <select name="service" class="form-control">
                                                        <?php
                                                            include('connection.php');
                                                            $sql1 = "SELECT * FROM add_service";
                                                            $res1 = mysqli_query($conn, $sql1);
                                                            while ($row = mysqli_fetch_assoc($res1)) {
                                                            ?>
                                                        <option value="<?php echo $row['name']; ?>">
                                                            <?php echo $row['name']; ?></option>
                                                        <?php } ?>
                                                    </select>

                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="form-group">
                                                    <label for="exampleInputContact2">Source</label>

                                                    <select name="source" class="form-control">
                                                        <?php
                                                            include('connection.php');
                                                            $sql1 = "SELECT * FROM add_source";
                                                            $res1 = mysqli_query($conn, $sql1);
                                                            while ($row = mysqli_fetch_assoc($res1)) {
                                                            ?>
                                                        <option value="<?php echo $row['name']; ?>">
                                                            <?php echo $row['name']; ?></option>
                                                        <?php } ?>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-4">
                                                <div class="form-group">
                                                    <label for="exampleInputContact3">Lead Date</label>
                                                    <input type="date" name="lead_date" class="form-control"
                                                        placeholder="Contact Number">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-12">
                                                <div class="form-group">
                                                    <label for="exampleInputContact1">Lead Discription</label>
                                                    <textarea id="" name="lead_discription" rows="5"
                                                        class="form-control" placeholder="Lead Discription here...."
                                                        name="discription"></textarea>
                                                </div>
                                            </div>

                                        </div>

                                    </div>


                                    <div class="card-footer">
                                        <button type="submit" class="btn text-white fw-bold"
                                            style="background: #343a40;">Add Lead</button>
                                    </div>
                                </form>
                            </div>


                        </div>

                    </div>

                </div>
            </section>

        </div>
        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
        <script>
        $(document).ready(function() {
            <?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>
        <?php include("footer.php")?>
    </div>


    <?php include("footerlink.php")?>
</body>

</html>