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

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin : WhastApp Database</title>
    <?php include("headerlink.php")?>
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.min.css">
</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">Whatsapp Database</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 ">WAP Database</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 fw-bold text-white text-uppercase">Add WA Database</h3>
                                </div>
                                <form action="whatspp_database_code.php" method="POST" enctype="multipart/form-data">
                                    <div class="card-body">
                                        <div class="row">
                                            <div class=" col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Country</label>
                                                    <select name="country" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Afghanistan">Afghanistan</option>
                                                        <option value="Albania">Albania</option>
                                                        <option value="DZ">Algeria</option>
                                                        <option value="AS">American Samoa</option>
                                                        <option value="AD">Andorra</option>
                                                        <option value="AG">Angola</option>
                                                        <option value="AI">Anguilla</option>
                                                        <option value="AG">Antigua &amp; Barbuda</option>
                                                        <option value="AR">Argentina</option>
                                                        <option value="AA">Armenia</option>
                                                        <option value="AW">Aruba</option>
                                                        <option value="AU">Australia</option>
                                                        <option value="AT">Austria</option>
                                                        <option value="AZ">Azerbaijan</option>
                                                        <option value="BS">Bahamas</option>
                                                        <option value="BH">Bahrain</option>
                                                        <option value="BD">Bangladesh</option>
                                                        <option value="BB">Barbados</option>
                                                        <option value="BY">Belarus</option>
                                                        <option value="BE">Belgium</option>
                                                        <option value="BZ">Belize</option>
                                                        <option value="BJ">Benin</option>
                                                        <option value="BM">Bermuda</option>
                                                        <option value="BT">Bhutan</option>
                                                        <option value="BO">Bolivia</option>
                                                        <option value="BL">Bonaire</option>
                                                        <option value="BA">Bosnia &amp; Herzegovina</option>
                                                        <option value="BW">Botswana</option>
                                                        <option value="BR">Brazil</option>
                                                        <option value="BC">British Indian Ocean Ter</option>
                                                        <option value="BN">Brunei</option>
                                                        <option value="BG">Bulgaria</option>
                                                        <option value="BF">Burkina Faso</option>
                                                        <option value="BI">Burundi</option>
                                                        <option value="KH">Cambodia</option>
                                                        <option value="CM">Cameroon</option>
                                                        <option value="CA">Canada</option>
                                                        <option value="IC">Canary Islands</option>
                                                        <option value="CV">Cape Verde</option>
                                                        <option value="KY">Cayman Islands</option>
                                                        <option value="CF">Central African Republic</option>
                                                        <option value="TD">Chad</option>
                                                        <option value="CD">Channel Islands</option>
                                                        <option value="CL">Chile</option>
                                                        <option value="CN">China</option>
                                                        <option value="CI">Christmas Island</option>
                                                        <option value="CS">Cocos Island</option>
                                                        <option value="CO">Colombia</option>
                                                        <option value="CC">Comoros</option>
                                                        <option value="CG">Congo</option>
                                                        <option value="CK">Cook Islands</option>
                                                        <option value="CR">Costa Rica</option>
                                                        <option value="CT">Cote D'Ivoire</option>
                                                        <option value="HR">Croatia</option>
                                                        <option value="CU">Cuba</option>
                                                        <option value="CB">Curacao</option>
                                                        <option value="CY">Cyprus</option>
                                                        <option value="CZ">Czech Republic</option>
                                                        <option value="DK">Denmark</option>
                                                        <option value="DJ">Djibouti</option>
                                                        <option value="DM">Dominica</option>
                                                        <option value="DO">Dominican Republic</option>
                                                        <option value="TM">East Timor</option>
                                                        <option value="EC">Ecuador</option>
                                                        <option value="EG">Egypt</option>
                                                        <option value="SV">El Salvador</option>
                                                        <option value="GQ">Equatorial Guinea</option>
                                                        <option value="ER">Eritrea</option>
                                                        <option value="EE">Estonia</option>
                                                        <option value="ET">Ethiopia</option>
                                                        <option value="FA">Falkland Islands</option>
                                                        <option value="FO">Faroe Islands</option>
                                                        <option value="FJ">Fiji</option>
                                                        <option value="FI">Finland</option>
                                                        <option value="FR">France</option>
                                                        <option value="GF">French Guiana</option>
                                                        <option value="PF">French Polynesia</option>
                                                        <option value="FS">French Southern Ter</option>
                                                        <option value="GA">Gabon</option>
                                                        <option value="GM">Gambia</option>
                                                        <option value="GE">Georgia</option>
                                                        <option value="DE">Germany</option>
                                                        <option value="GH">Ghana</option>
                                                        <option value="GI">Gibraltar</option>
                                                        <option value="GB">Great Britain</option>
                                                        <option value="GR">Greece</option>
                                                        <option value="GL">Greenland</option>
                                                        <option value="GD">Grenada</option>
                                                        <option value="GP">Guadeloupe</option>
                                                        <option value="GU">Guam</option>
                                                        <option value="GT">Guatemala</option>
                                                        <option value="GN">Guinea</option>
                                                        <option value="GY">Guyana</option>
                                                        <option value="HT">Haiti</option>
                                                        <option value="HW">Hawaii</option>
                                                        <option value="HN">Honduras</option>
                                                        <option value="HK">Hong Kong</option>
                                                        <option value="HU">Hungary</option>
                                                        <option value="IS">Iceland</option>
                                                        <option value="IN">India</option>
                                                        <option value="ID">Indonesia</option>
                                                        <option value="IA">Iran</option>
                                                        <option value="IQ">Iraq</option>
                                                        <option value="IR">Ireland</option>
                                                        <option value="IM">Isle of Man</option>
                                                        <option value="IL">Israel</option>
                                                        <option value="IT">Italy</option>
                                                        <option value="JM">Jamaica</option>
                                                        <option value="JP">Japan</option>
                                                        <option value="JO">Jordan</option>
                                                        <option value="KZ">Kazakhstan</option>
                                                        <option value="KE">Kenya</option>
                                                        <option value="KI">Kiribati</option>
                                                        <option value="NK">Korea North</option>
                                                        <option value="KS">Korea South</option>
                                                        <option value="KW">Kuwait</option>
                                                        <option value="KG">Kyrgyzstan</option>
                                                        <option value="LA">Laos</option>
                                                        <option value="LV">Latvia</option>
                                                        <option value="LB">Lebanon</option>
                                                        <option value="LS">Lesotho</option>
                                                        <option value="LR">Liberia</option>
                                                        <option value="LY">Libya</option>
                                                        <option value="LI">Liechtenstein</option>
                                                        <option value="LT">Lithuania</option>
                                                        <option value="LU">Luxembourg</option>
                                                        <option value="MO">Macau</option>
                                                        <option value="MK">Macedonia</option>
                                                        <option value="MG">Madagascar</option>
                                                        <option value="MY">Malaysia</option>
                                                        <option value="MW">Malawi</option>
                                                        <option value="MV">Maldives</option>
                                                        <option value="ML">Mali</option>
                                                        <option value="MT">Malta</option>
                                                        <option value="MH">Marshall Islands</option>
                                                        <option value="MQ">Martinique</option>
                                                        <option value="MR">Mauritania</option>
                                                        <option value="MU">Mauritius</option>
                                                        <option value="ME">Mayotte</option>
                                                        <option value="MX">Mexico</option>
                                                        <option value="MI">Midway Islands</option>
                                                        <option value="MD">Moldova</option>
                                                        <option value="MC">Monaco</option>
                                                        <option value="MN">Mongolia</option>
                                                        <option value="MS">Montserrat</option>
                                                        <option value="MA">Morocco</option>
                                                        <option value="MZ">Mozambique</option>
                                                        <option value="MM">Myanmar</option>
                                                        <option value="NA">Nambia</option>
                                                        <option value="NU">Nauru</option>
                                                        <option value="NP">Nepal</option>
                                                        <option value="AN">Netherland Antilles</option>
                                                        <option value="NL">Netherlands (Holland, Europe)</option>
                                                        <option value="NV">Nevis</option>
                                                        <option value="NC">New Caledonia</option>
                                                        <option value="NZ">New Zealand</option>
                                                        <option value="NI">Nicaragua</option>
                                                        <option value="NE">Niger</option>
                                                        <option value="NG">Nigeria</option>
                                                        <option value="NW">Niue</option>
                                                        <option value="NF">Norfolk Island</option>
                                                        <option value="NO">Norway</option>
                                                        <option value="OM">Oman</option>
                                                        <option value="PK">Pakistan</option>
                                                        <option value="PW">Palau Island</option>
                                                        <option value="PS">Palestine</option>
                                                        <option value="PA">Panama</option>
                                                        <option value="PG">Papua New Guinea</option>
                                                        <option value="PY">Paraguay</option>
                                                        <option value="PE">Peru</option>
                                                        <option value="PH">Philippines</option>
                                                        <option value="PO">Pitcairn Island</option>
                                                        <option value="PL">Poland</option>
                                                        <option value="PT">Portugal</option>
                                                        <option value="PR">Puerto Rico</option>
                                                        <option value="QA">Qatar</option>
                                                        <option value="ME">Republic of Montenegro</option>
                                                        <option value="RS">Republic of Serbia</option>
                                                        <option value="RE">Reunion</option>
                                                        <option value="RO">Romania</option>
                                                        <option value="RU">Russia</option>
                                                        <option value="RW">Rwanda</option>
                                                        <option value="NT">St Barthelemy</option>
                                                        <option value="EU">St Eustatius</option>
                                                        <option value="HE">St Helena</option>
                                                        <option value="KN">St Kitts-Nevis</option>
                                                        <option value="LC">St Lucia</option>
                                                        <option value="MB">St Maarten</option>
                                                        <option value="PM">St Pierre &amp; Miquelon</option>
                                                        <option value="VC">St Vincent &amp; Grenadines</option>
                                                        <option value="SP">Saipan</option>
                                                        <option value="SO">Samoa</option>
                                                        <option value="AS">Samoa American</option>
                                                        <option value="SM">San Marino</option>
                                                        <option value="ST">Sao Tome &amp; Principe</option>
                                                        <option value="SA">Saudi Arabia</option>
                                                        <option value="SN">Senegal</option>
                                                        <option value="RS">Serbia</option>
                                                        <option value="SC">Seychelles</option>
                                                        <option value="SL">Sierra Leone</option>
                                                        <option value="SG">Singapore</option>
                                                        <option value="SK">Slovakia</option>
                                                        <option value="SI">Slovenia</option>
                                                        <option value="SB">Solomon Islands</option>
                                                        <option value="OI">Somalia</option>
                                                        <option value="ZA">South Africa</option>
                                                        <option value="ES">Spain</option>
                                                        <option value="LK">Sri Lanka</option>
                                                        <option value="SD">Sudan</option>
                                                        <option value="SR">Suriname</option>
                                                        <option value="SZ">Swaziland</option>
                                                        <option value="SE">Sweden</option>
                                                        <option value="CH">Switzerland</option>
                                                        <option value="SY">Syria</option>
                                                        <option value="TA">Tahiti</option>
                                                        <option value="TW">Taiwan</option>
                                                        <option value="TJ">Tajikistan</option>
                                                        <option value="TZ">Tanzania</option>
                                                        <option value="TH">Thailand</option>
                                                        <option value="TG">Togo</option>
                                                        <option value="TK">Tokelau</option>
                                                        <option value="TO">Tonga</option>
                                                        <option value="TT">Trinidad &amp; Tobago</option>
                                                        <option value="TN">Tunisia</option>
                                                        <option value="TR">Turkey</option>
                                                        <option value="TU">Turkmenistan</option>
                                                        <option value="TC">Turks &amp; Caicos Is</option>
                                                        <option value="TV">Tuvalu</option>
                                                        <option value="UG">Uganda</option>
                                                        <option value="UA">Ukraine</option>
                                                        <option value="AE">United Arab Emirates</option>
                                                        <option value="GB">United Kingdom</option>
                                                        <option value="US">United States of America</option>
                                                        <option value="UY">Uruguay</option>
                                                        <option value="UZ">Uzbekistan</option>
                                                        <option value="VU">Vanuatu</option>
                                                        <option value="VS">Vatican City State</option>
                                                        <option value="VE">Venezuela</option>
                                                        <option value="VN">Vietnam</option>
                                                        <option value="VB">Virgin Islands (Brit)</option>
                                                        <option value="VA">Virgin Islands (USA)</option>
                                                        <option value="WK">Wake Island</option>
                                                        <option value="WF">Wallis &amp; Futana Is</option>
                                                        <option value="YE">Yemen</option>
                                                        <option value="ZR">Zaire</option>
                                                        <option value="ZM">Zambia</option>
                                                        <option value="ZW">Zimbabwe</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class=" col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">State</label>
                                                    <select name="state" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Maharashtra">Maharashtra</option>
                                                        <option value="Madhya Pradesh">Madhya Pradesh</option>
                                                        <option value="Chattisgarh">Chattisgarh</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">City</label>
                                                    <select name="city" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Lucknow">Lucknow </option>
                                                        <option value="Mumbai">Mumbai</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Gender</label>
                                                    <select name="gender" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Male">Male </option>
                                                        <option value="Female">Female</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Religion</label>
                                                    <select name="religion" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Hindu">Hindu </option>
                                                        <option value="Muslim">Muslim</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-2 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Profile</label>
                                                    <select name="profile" class="form-control">
                                                        <option value="">Select</option>
                                                        <option value="Student">Student</option>
                                                        <option value="Business">Business</option>
                                                        <option value="Housewife">Housewife</option>
                                                    </select>
                                                </div>
                                            </div>


                                        </div>
                                        <div class="row">
                                            <div class=" col-lg-6 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputName">Title</label>
                                                    <input type="text" class="form-control"
                                                        placeholder="Ex: Mumbai Data 25K M M" name="title">
                                                </div>
                                            </div>

                                            <div class="col-lg-6 col-sm-12">
                                                <div class="form-group">
                                                    <label for="exampleInputFile">Upload File</label>
                                                    <div class="input-group">

                                                        <!-- <div class="custom-file">
                                                            <input type="file" name="file" class="custom-file-input">
                                                            <label class="custom-file-label"
                                                                for="exampleInputFile">Choose
                                                                file</label>
                                                        </div> -->
                                                        <input type="file" name="file" class="form-control">

                                                        <div class="input-group-append">
                                                            <button class="btn text-white"
                                                                style="background: #343a40; ">Submit</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>

                                    </div>

                                </form>

                            </div>

                        </div>

                    </div>

                </div>
            </section>

            <section class="content">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-12">
                            <div class="card shadow">
                                <div class="card-header" style="background: #343a40; ">
                                    <h3 class="card-title text-white text-bold text-uppercase"> Show All Databases</h3>
                                </div>

                                <div class="card-body">
                                    <div id="example2_wrapper" class="dataTables_wrapper dt-bootstrap4">
                                        <div class="row">
                                            <div class="col-sm-12 col-md-6"></div>
                                            <div class="col-sm-12 col-md-6"></div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12">
                                                <table class="table-responsive">
                                                    <table id="example2"
                                                        class="table table-bordered table-hover dataTable dtr-inline display text-center"
                                                        aria-describedby="example2_info">
                                                        <thead>
                                                            <tr>
                                                                <th>Date &amp; Time</th>
                                                                <th>Title</th>
                                                                <th>State</th>
                                                                <th>Gender</th>
                                                                <th>Profile</th>
                                                                <th>Download</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <?php 
                                                            include('connection.php');
                                                            $query = "SELECT * FROM add_whatshapp_database"; 
                                                            $result = mysqli_query($conn, $query);
                                                            while ($row = mysqli_fetch_assoc($result)) {
                                                            ?>
                                                            <tr>
                                                                <td><?php echo $row['datetime']?></td>

                                                                <td class=" view-details-button fw-bold text-danger text-uppercase"
                                                                    style="text-decoration: none; " data-toggle="modal"
                                                                    data-target="#detailsModal<?php echo $row['id'];?>">
                                                                    <?php echo $row['title']?>
                                                                </td>

                                                                <td><?php echo $row['state']?></td>
                                                                <td><?php echo $row['gender']?></td>
                                                                <td><?php echo $row['profile']?></td>

                                                                <td class="text-center">
                                                                    <a href="download_csv.php?id=<?php echo $row['id']; ?>"
                                                                        class="badge badge-primary">
                                                                        <i class="fa fa-arrow-circle-down p-1 "
                                                                            aria-hidden="true"
                                                                            style=" font-size: 15px;"></i>
                                                                    </a>
                                                                </td>


                                                            </tr>
                                                            <?php }?>

                                                        </tbody>

                                                    </table>
                                                </table>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </section>
        </div>


        <?php 
            include('connection.php');
             $query = "SELECT * FROM add_whatshapp_database"; 
             $result = mysqli_query($conn, $query);
             while ($row = mysqli_fetch_assoc($result)) {
            ?>
        <div class="modal fade" id="detailsModal<?php echo $row['id'];?>">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header" style="background: #343a40; ">
                        <h4 class="modal-title text-white">Large Modal</h4>
                        <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <form action="whatspp_database_update_code.php" method="POST" enctype="multipart/form-data">
                            <div class="card-body">
                                <input type="hidden" name="id" id="id" value="<?php echo $row['id']?>">
                                <input type="hidden" name="existing_file" value="<?php echo $row['upload_file']?>">
                                <div class="row">
                                    <div class=" col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">Country</label>
                                            <select name="country" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Afghanistan"
                                                    <?php echo ($row['country'] === 'Afghanistan') ? 'selected' : ''; ?>>
                                                    Afghanistan
                                                </option>

                                                <option value="Albania"
                                                    <?php echo ($row['country'] === 'Albania') ? 'selected' : ''; ?>>
                                                    Albania
                                                </option>

                                                <option value="DZ">Algeria</option>
                                                <option value="Algeria">American Samoa</option>
                                                <option value="Andorra">Andorra</option>
                                                <option value="Angola">Angola</option>
                                                <option value="Anguilla">Anguilla</option>
                                                <option value="Barbuda">Antigua &amp; Barbuda</option>
                                                <option value="AR">Argentina</option>
                                                <option value="Argentina">Armenia</option>
                                                <option value="Aruba">Aruba</option>
                                                <option value="Australia">Australia</option>
                                                <option value="Austria">Austria</option>
                                                <option value="Azerbaijan">Azerbaijan</option>
                                                <option value="Bahamas">Bahamas</option>
                                                <option value="Bahrain">Bahrain</option>
                                                <option value="Bangladesh">Bangladesh</option>
                                                <option value="Barbados">Barbados</option>
                                                <option value="Belarus">Belarus</option>
                                                <option value="Belgium">Belgium</option>
                                                <option value="Belize">Belize</option>
                                                <option value="Benin">Benin</option>
                                                <option value="Bermuda">Bermuda</option>
                                                <option value="Bhutan">Bhutan</option>
                                                <option value="Bolivia">Bolivia</option>
                                                <option value="Bonaire">Bonaire</option>
                                                <option value="Bosnia">Bosnia &amp; Herzegovina</option>
                                                <option value="Botswana">Botswana</option>
                                                <option value="Brazil">Brazil</option>
                                                <option value="British Indian Ocean Ter">British Indian Ocean Ter
                                                </option>
                                                <option value="Brunei">Brunei</option>
                                                <option value="Bulgaria">Bulgaria</option>
                                                <option value="Burkina Faso">Burkina Faso</option>
                                                <option value="Burundi">Burundi</option>
                                                <option value="Cambodia">Cambodia</option>
                                                <option value="Cameroon">Cameroon</option>
                                                <option value="Canada">Canada</option>
                                                <option value="Canary Islands">Canary Islands</option>
                                                <option value="CV">Cape Verde</option>
                                                <option value="KY">Cayman Islands</option>
                                                <option value="CF">Central African Republic</option>
                                                <option value="TD">Chad</option>
                                                <option value="CD">Channel Islands</option>
                                                <option value="CL">Chile</option>
                                                <option value="CN">China</option>
                                                <option value="CI">Christmas Island</option>
                                                <option value="CS">Cocos Island</option>
                                                <option value="CO">Colombia</option>
                                                <option value="CC">Comoros</option>
                                                <option value="CG">Congo</option>
                                                <option value="CK">Cook Islands</option>
                                                <option value="CR">Costa Rica</option>
                                                <option value="CT">Cote D'Ivoire</option>
                                                <option value="HR">Croatia</option>
                                                <option value="CU">Cuba</option>
                                                <option value="CB">Curacao</option>
                                                <option value="CY">Cyprus</option>
                                                <option value="CZ">Czech Republic</option>
                                                <option value="DK">Denmark</option>
                                                <option value="DJ">Djibouti</option>
                                                <option value="DM">Dominica</option>
                                                <option value="DO">Dominican Republic</option>
                                                <option value="TM">East Timor</option>
                                                <option value="EC">Ecuador</option>
                                                <option value="EG">Egypt</option>
                                                <option value="SV">El Salvador</option>
                                                <option value="GQ">Equatorial Guinea</option>
                                                <option value="ER">Eritrea</option>
                                                <option value="EE">Estonia</option>
                                                <option value="ET">Ethiopia</option>
                                                <option value="FA">Falkland Islands</option>
                                                <option value="FO">Faroe Islands</option>
                                                <option value="FJ">Fiji</option>
                                                <option value="FI">Finland</option>
                                                <option value="FR">France</option>
                                                <option value="GF">French Guiana</option>
                                                <option value="PF">French Polynesia</option>
                                                <option value="FS">French Southern Ter</option>
                                                <option value="GA">Gabon</option>
                                                <option value="GM">Gambia</option>
                                                <option value="GE">Georgia</option>
                                                <option value="DE">Germany</option>
                                                <option value="GH">Ghana</option>
                                                <option value="GI">Gibraltar</option>
                                                <option value="GB">Great Britain</option>
                                                <option value="GR">Greece</option>
                                                <option value="GL">Greenland</option>
                                                <option value="GD">Grenada</option>
                                                <option value="GP">Guadeloupe</option>
                                                <option value="GU">Guam</option>
                                                <option value="GT">Guatemala</option>
                                                <option value="GN">Guinea</option>
                                                <option value="GY">Guyana</option>
                                                <option value="HT">Haiti</option>
                                                <option value="HW">Hawaii</option>
                                                <option value="HN">Honduras</option>
                                                <option value="HK">Hong Kong</option>
                                                <option value="HU">Hungary</option>
                                                <option value="IS">Iceland</option>
                                                <option value="IN">India</option>
                                                <option value="ID">Indonesia</option>
                                                <option value="IA">Iran</option>
                                                <option value="IQ">Iraq</option>
                                                <option value="IR">Ireland</option>
                                                <option value="IM">Isle of Man</option>
                                                <option value="IL">Israel</option>
                                                <option value="IT">Italy</option>
                                                <option value="JM">Jamaica</option>
                                                <option value="JP">Japan</option>
                                                <option value="JO">Jordan</option>
                                                <option value="KZ">Kazakhstan</option>
                                                <option value="KE">Kenya</option>
                                                <option value="KI">Kiribati</option>
                                                <option value="NK">Korea North</option>
                                                <option value="KS">Korea South</option>
                                                <option value="KW">Kuwait</option>
                                                <option value="KG">Kyrgyzstan</option>
                                                <option value="LA">Laos</option>
                                                <option value="LV">Latvia</option>
                                                <option value="LB">Lebanon</option>
                                                <option value="LS">Lesotho</option>
                                                <option value="LR">Liberia</option>
                                                <option value="LY">Libya</option>
                                                <option value="LI">Liechtenstein</option>
                                                <option value="LT">Lithuania</option>
                                                <option value="LU">Luxembourg</option>
                                                <option value="MO">Macau</option>
                                                <option value="MK">Macedonia</option>
                                                <option value="MG">Madagascar</option>
                                                <option value="MY">Malaysia</option>
                                                <option value="MW">Malawi</option>
                                                <option value="MV">Maldives</option>
                                                <option value="ML">Mali</option>
                                                <option value="MT">Malta</option>
                                                <option value="MH">Marshall Islands</option>
                                                <option value="MQ">Martinique</option>
                                                <option value="MR">Mauritania</option>
                                                <option value="MU">Mauritius</option>
                                                <option value="ME">Mayotte</option>
                                                <option value="MX">Mexico</option>
                                                <option value="MI">Midway Islands</option>
                                                <option value="MD">Moldova</option>
                                                <option value="MC">Monaco</option>
                                                <option value="MN">Mongolia</option>
                                                <option value="MS">Montserrat</option>
                                                <option value="MA">Morocco</option>
                                                <option value="MZ">Mozambique</option>
                                                <option value="MM">Myanmar</option>
                                                <option value="NA">Nambia</option>
                                                <option value="NU">Nauru</option>
                                                <option value="NP">Nepal</option>
                                                <option value="AN">Netherland Antilles</option>
                                                <option value="NL">Netherlands (Holland, Europe)</option>
                                                <option value="NV">Nevis</option>
                                                <option value="NC">New Caledonia</option>
                                                <option value="NZ">New Zealand</option>
                                                <option value="NI">Nicaragua</option>
                                                <option value="NE">Niger</option>
                                                <option value="NG">Nigeria</option>
                                                <option value="NW">Niue</option>
                                                <option value="NF">Norfolk Island</option>
                                                <option value="NO">Norway</option>
                                                <option value="OM">Oman</option>
                                                <option value="PK">Pakistan</option>
                                                <option value="PW">Palau Island</option>
                                                <option value="PS">Palestine</option>
                                                <option value="PA">Panama</option>
                                                <option value="PG">Papua New Guinea</option>
                                                <option value="PY">Paraguay</option>
                                                <option value="PE">Peru</option>
                                                <option value="PH">Philippines</option>
                                                <option value="PO">Pitcairn Island</option>
                                                <option value="PL">Poland</option>
                                                <option value="PT">Portugal</option>
                                                <option value="PR">Puerto Rico</option>
                                                <option value="QA">Qatar</option>
                                                <option value="ME">Republic of Montenegro</option>
                                                <option value="RS">Republic of Serbia</option>
                                                <option value="RE">Reunion</option>
                                                <option value="RO">Romania</option>
                                                <option value="RU">Russia</option>
                                                <option value="RW">Rwanda</option>
                                                <option value="NT">St Barthelemy</option>
                                                <option value="EU">St Eustatius</option>
                                                <option value="HE">St Helena</option>
                                                <option value="KN">St Kitts-Nevis</option>
                                                <option value="LC">St Lucia</option>
                                                <option value="MB">St Maarten</option>
                                                <option value="PM">St Pierre &amp; Miquelon</option>
                                                <option value="VC">St Vincent &amp; Grenadines</option>
                                                <option value="SP">Saipan</option>
                                                <option value="SO">Samoa</option>
                                                <option value="AS">Samoa American</option>
                                                <option value="SM">San Marino</option>
                                                <option value="ST">Sao Tome &amp; Principe</option>
                                                <option value="SA">Saudi Arabia</option>
                                                <option value="SN">Senegal</option>
                                                <option value="RS">Serbia</option>
                                                <option value="SC">Seychelles</option>
                                                <option value="SL">Sierra Leone</option>
                                                <option value="SG">Singapore</option>
                                                <option value="SK">Slovakia</option>
                                                <option value="SI">Slovenia</option>
                                                <option value="SB">Solomon Islands</option>
                                                <option value="OI">Somalia</option>
                                                <option value="ZA">South Africa</option>
                                                <option value="ES">Spain</option>
                                                <option value="LK">Sri Lanka</option>
                                                <option value="SD">Sudan</option>
                                                <option value="SR">Suriname</option>
                                                <option value="SZ">Swaziland</option>
                                                <option value="SE">Sweden</option>
                                                <option value="CH">Switzerland</option>
                                                <option value="SY">Syria</option>
                                                <option value="TA">Tahiti</option>
                                                <option value="TW">Taiwan</option>
                                                <option value="TJ">Tajikistan</option>
                                                <option value="TZ">Tanzania</option>
                                                <option value="TH">Thailand</option>
                                                <option value="TG">Togo</option>
                                                <option value="TK">Tokelau</option>
                                                <option value="TO">Tonga</option>
                                                <option value="TT">Trinidad &amp; Tobago</option>
                                                <option value="TN">Tunisia</option>
                                                <option value="TR">Turkey</option>
                                                <option value="TU">Turkmenistan</option>
                                                <option value="TC">Turks &amp; Caicos Is</option>
                                                <option value="TV">Tuvalu</option>
                                                <option value="UG">Uganda</option>
                                                <option value="UA">Ukraine</option>
                                                <option value="AE">United Arab Emirates</option>
                                                <option value="GB">United Kingdom</option>
                                                <option value="US">United States of America</option>
                                                <option value="UY">Uruguay</option>
                                                <option value="UZ">Uzbekistan</option>
                                                <option value="VU">Vanuatu</option>
                                                <option value="VS">Vatican City State</option>
                                                <option value="VE">Venezuela</option>
                                                <option value="VN">Vietnam</option>
                                                <option value="VB">Virgin Islands (Brit)</option>
                                                <option value="VA">Virgin Islands (USA)</option>
                                                <option value="WK">Wake Island</option>
                                                <option value="WF">Wallis &amp; Futana Is</option>
                                                <option value="YE">Yemen</option>
                                                <option value="ZR">Zaire</option>
                                                <option value="ZM">Zambia</option>
                                                <option value="ZW">Zimbabwe</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class=" col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">State</label>
                                            <select name="state" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Maharashtra"
                                                    <?php echo ($row['state'] === 'Maharashtra') ? 'selected' : ''; ?>>
                                                    Maharashtra
                                                </option>
                                                <option value="Madhya Pradesh"
                                                    <?php echo ($row['state'] === 'Madhya Pradesh') ? 'selected' : ''; ?>>
                                                    Madhya Pradesh
                                                </option>
                                                <option value="Chattisgarh"
                                                    <?php echo ($row['state'] === 'Chattisgarh') ? 'selected' : ''; ?>>
                                                    Chattisgarh
                                                </option>

                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">City</label>
                                            <select name="city" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Lucknow"
                                                    <?php echo ($row['city'] === 'Lucknow') ? 'selected' : ''; ?>>
                                                    Lucknow
                                                </option>
                                                <option value="Mumbai"
                                                    <?php echo ($row['city'] === 'Mumbai') ? 'selected' : ''; ?>>
                                                    Mumbai
                                                </option>

                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">Gender</label>
                                            <select name="gender" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Male"
                                                    <?php echo ($row['gender'] === 'Male') ? 'selected' : ''; ?>>
                                                    Male
                                                </option>
                                                <option value="Female"
                                                    <?php echo ($row['gender'] === 'Female') ? 'selected' : ''; ?>>
                                                    Female
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">Religion</label>
                                            <select name="religion" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Hindu"
                                                    <?php echo ($row['religion'] === 'Hindu') ? 'selected' : ''; ?>>
                                                    Hindu
                                                </option>
                                                <option value="Muslim"
                                                    <?php echo ($row['religion'] === 'Muslim') ? 'selected' : ''; ?>>
                                                    Muslim
                                                </option>

                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-2 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">Profile</label>
                                            <select name="profile" class="form-control">
                                                <option value="">Select</option>
                                                <option value="Student"
                                                    <?php echo ($row['profile'] === 'Student') ? 'selected' : ''; ?>>
                                                    Student
                                                </option>
                                                <option value="Business"
                                                    <?php echo ($row['profile'] === 'Business') ? 'selected' : ''; ?>>
                                                    Business
                                                </option>
                                                <option value="Housewife"
                                                    <?php echo ($row['profile'] === 'Housewife') ? 'selected' : ''; ?>>
                                                    Housewife
                                                </option>

                                            </select>
                                        </div>
                                    </div>


                                </div>
                                <div class="row">
                                    <div class=" col-lg-6 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputName">Title</label>
                                            <input type="text" class="form-control"
                                                placeholder="Ex: Mumbai Data 25K M M" name="title"
                                                value="<?php echo $row['title']?>">
                                        </div>
                                    </div>

                                    <div class="col-lg-6">
                                        <div class="form-group">
                                            <label for="exampleInputName">Title</label>
                                            <img src="<?php echo $row['upload_file']?>" alt="" name="file"
                                                style="height:200px; width:200px">
                                        </div>

                                    </div>
                                    <div class="col-lg-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="exampleInputFile">Upload File</label>
                                            <div class="input-group">

                                                <!-- <div class="custom-file">
                                                    <input type="file" name="file" class="custom-file-input">
                                                    <label class="custom-file-label" for="exampleInputFile">Choose
                                                        file</label>
                                                </div> -->
                                                <div class="custom-file">
                                                    <input type="file" class="custom-file-input" id="video_file"
                                                        name="file" onchange="displayFileName()">
                                                    <label class="custom-file-label"
                                                        for="file"><?php echo $row['upload_file']; ?></label>
                                                </div>

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

                                                    <button class="btn text-white"
                                                        style="background: #343a40; ">Update</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>

                        </form>
                    </div>

                </div>

            </div>

        </div>
        <?php }?>

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


    </div>


    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.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>
    <script>
    var $j = jQuery.noConflict();
    $j(document).ready(function() {
        $j('#example2').DataTable();
    });
    </script>

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

</html>