<?php
include "header.php";
?>

<!-- Main Working Space Start -->

<div class="col-md-12">
<div
          class="mt-4 grid grid-cols-12 gap-4 px-[var(--margin-x)] transition-all duration-[.25s] sm:mt-5 sm:gap-5 lg:mt-6 lg:gap-6"
        >
        
        <div style="">
          <div class="card my-3">
            <div class="col-md-12 card-header ">
                <div class="row">
                  <div class="col-md-2">  
                    <h3 class=""> New Lead </h3>
                  </div>
                  <div class="col-md-6">
                  <nav style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
                    <ol class="breadcrumb mt-2">
                      <li class="breadcrumb-item"><a href="index.php">Leads</a></li>
                      <li class="breadcrumb-item active" aria-current="page">New Leads</li>
                    </ol>
                  </nav>
                  </div>
                </div>
              </div>
                <div class="card-body">
                  <form action="lead_insert.php" method="post">
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-md-6" style="display: flex; flex-direction: column; line-height: 40px;">
                                <label for="name">Name</label><br>
                                <input type="text" autocomplete="off" class="form-control" id="name" name='name' placeholder="Lead Name">
                                <label for="location">Location</label>
                                <input type="text" autocomplete="off" id="location" name="location" class="form-control" placeholder="Location">
                                <label for="email">Email</label>
                                <input type="text" autocomplete="off" id="email" name="email" class="form-control" placeholder="Enter Email">
                                
                                <label for="team_manager">Team Manager</label>
                                <select name="team_manager" autocomplete="off" id="ddl" onchange="configureDropDownLists1(this, document.getElementById('ddl22'))" class="form-select">    
                                <option value="">Select</option>
                                    <option value="AKILA">AKILA</option>
                                    <!-- <option value="two">Two</option> -->
                                    <!-- <option value="three">Three</option> -->
                                    <!-- <option value="four">Four</option> -->
                                </select>
                                <label for="team_leader">Team Leader</label>
                                <select name="team_leader" autocomplete="off" id="ddl22" onchange="configureDropDownLists2(this, document.getElementById('ddl33'))"  class="form-select">
                                    <option value="">Select</option>
                                    <!-- <option value="BAKIYALAKSHMI">BAKIYALAKSHMI</option> -->
                                    <!-- <option value="VIJAYAKUMARI">VIJAYAKUMARI</option> -->
                                    <!-- <option value="three">Three</option> -->
                                    <!-- <option value="four">Four</option> -->
                                </select>
                                <label for="telecaller">Tele Caller</label>
                                <select autocomplete="off" name="telecaller" id="ddl33" class="form-select">
                                    <option value="">Select</option>
                                    <!-- <option value="PRADEEPRAJA">PRADEEPRAJA</option> -->
                                    <!-- <option value="RAMAPRABA.G">RAMAPRABA.G</option> -->
                                    <!-- <option value="SURUTHIKA">SURUTHIKA</option> -->
                                    <!-- <option value="YOKESH.M">YOKESH.M</option> -->
                                    <!-- <option value="ANI JOLLA">ANI JOLLA</option> -->
                                    <!-- <option value="MANIVEL.S">MANIVEL.S</option> -->
                                    <!-- <option value="POONGODI M">POONGODI M</option> -->
                                </select>
                                <label for="note">Note</label>
                                <textarea name="note" autocomplete="off" id="note" class="form-control" id="" cols="10" rows="2"></textarea>
                                <!-- <button class="btn btn-primary">Submit</button> -->
                            </div>
    
    
                            <!-- 2nd Row -->
                            <div class="col-md-6" style="display: flex; flex-direction: column; line-height: 40px;">
                                <label for="contact">Contact</label>
                                <input type="text" autocomplete="off" id="contact" name="contact" class="form-control" placeholder="Enter Your Contact No">
    
                                <label for="status">Lead Type</label>
                                <select name="status" autocomplete="off" id="status" class="form-select">
                                    <option value="">Select</option>
                                    <!-- <option value="Attempt to Contact">Attempt to Contact</option> -->
                                    <!-- <option value="Contact Future">Contact Future</option> -->
                                    <option value="Contacted">Contacted</option>
                                    <!-- <option value="Customer Not Interested">Customer Not Interested</option> -->
                                    <!-- <option value="Junk Lead">Junk Lead</option> -->
                                    <!-- <option value="Lead Completed">Lead Completed</option> -->
                                    <!-- <option value="Lost Lead">Lost Lead</option> -->
                                    <option value="Not Contacted">Not Contacted</option>
                                    <!-- <option value="Not Qualified">Not Qualified</option> -->
                                </select>
    
                                <label for="lead_status">Lead Status</label>
                                <select name="lead_status" autocomplete="off" id="lead_status" class="form-select">
                                    <option value="">Select</option>
                                    <option value="Pipeline">Pipeline</option>
                                    <option value="Sure Pipeline">Sure Pipeline</option>
                                    <option value="Projection">Projection</option>
                                    <option value="Not Interested">Not Interested</option>
                                    <option value="Converted">Converted</option>
                                </select>
                                <label for="ddl1">Lead Source</label>
                                <select id="ddl1" autocomplete="off" name="lead_source" onchange="configureDropDownLists(this,document.getElementById('ddl2'))" class="form-select">
                                    <option value="select">Select</option>
                                    <option value="Social-Media">Social Media</option>
                                    <option value="Direct-Visit">Direct Visit</option>
                                    <option value="Bought-Leads">Bought Leads</option>
                                    <option value="Telecaller-Generated">Telecaller Generated</option>
                                    <option value="Website-Lead">Website Lead</option>
                                    <option value="Via-Broker">Via Broker</option>
                                    <!-- <option value="Lead">Lead</option> -->
                                    <!-- <option value="Retension">Retension</option> -->
                                    <!-- <option value="Referal">Referal</option> -->
                                </select>
                                <label for="ddl2">Lead Micro Source</label>
                                <select name="lead_micro_source" autocomplete="off"  id="ddl2" class="form-select">
                                </select>
                                
                                <label for="fdate">Followup Date</label>
                                <input type="date" autocomplete="off" id="fdate" name="fdate" class="form-control"><br><br>
                                <div class="row">
                                    <div class="col-md-4">
                                        <label for="" class="mt-4">Lead Type</label>
                                        <div>
                                            <label for="type">Paid</label>
                                            <input type="radio" autocomplete="off" id="type" name="type" value="Paid">&nbsp;&nbsp;
                                            <label for="type">Un-Paid</label>
                                            <input type="radio" autocomplete="off" id="type" name="type" value="Un-Paid">
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <button class="btn btn-primary btn-md mt-5" style="margin-left: 50px;">Save Lead</button>
                                    </div>
                                    
                                </div>
                                
    
                            </div>  
                        </div>
    
                    </div>
                </form>
                  </div>
            </div>    
        </div>
            

            
          </div>

</div>

<!-- Main Working Space End -->
  <!-- Onchange Dropdown Start -->
  <script type="text/javascript">
    function configureDropDownLists(ddl1,ddl2) {
    var select = ['Select'];
    var social_media = ['Select','Facebook', 'Instagram','Youtube','google'];
    var direct_visit = ['Select','Just A Visit', 'News Paper'];
    var bought_leads = ['Select', 'NA'];
    var telecaller_generated = ['Telecaller Generated'];
    var website_lead = ['Website Lead'];
    var via_broker = ['Via Broker'];
    // var lead = ['Lead'];
    // var retension = ['Retension'];
    // var referal = ['Referal'];
    // var names = ['John', 'David', 'Sarah'];

    switch (ddl1.value) {
        case 'select':
            ddl2.options.length = 0;
            for (i = 0; i < select.length; i++) {
                createOption(ddl2, select[i], select[i]);
            }
            break;
        case 'Social-Media':
            ddl2.options.length = 0;
            for (i = 0; i < social_media.length; i++) {
                createOption(ddl2, social_media[i], social_media[i]);
            }
            break;
        case 'Direct-Visit':
            ddl2.options.length = 0; 
            for (i = 0; i < direct_visit.length; i++) {
            createOption(ddl2, direct_visit[i], direct_visit[i]);
            }
            break;
        case 'Bought-Leads':
            ddl2.options.length = 0; 
            for (i = 0; i < bought_leads.length; i++) {
            createOption(ddl2, bought_leads[i], bought_leads[i]);
            }
            break;
        case 'Telecaller-Generated':
            ddl2.options.length = 0; 
            for (i = 0; i < telecaller_generated.length; i++) {
            createOption(ddl2, telecaller_generated[i], telecaller_generated[i]);
            }
            break;
        case 'Website-Lead':
            ddl2.options.length = 0; 
            for (i = 0; i < website_lead.length; i++) {
            createOption(ddl2, website_lead[i], website_lead[i]);
            }
            break;
        case 'Via-Broker':
            ddl2.options.length = 0; 
            for (i = 0; i < via_broker.length; i++) {
            createOption(ddl2, via_broker[i], via_broker[i]);
            }
            break;
        // case 'Lead':
        //     ddl2.options.length = 0; 
        //     for (i = 0; i < lead.length; i++) {
        //     createOption(ddl2, lead[i], lead[i]);
        //     }
        //     break;
        // case 'Retension':
        //     ddl2.options.length = 0; 
        //     for (i = 0; i < retension.length; i++) {
        //     createOption(ddl2, retension[i], retension[i]);
        //     }
        //     break;
        // case 'Referal':
        //     ddl2.options.length = 0; 
        //     for (i = 0; i < referal.length; i++) {
        //     createOption(ddl2, referal[i], referal[i]);
        //     }
        //     break;
    //     case 'Names':
    //         ddl2.options.length = 0;
    //         for (i = 0; i < names.length; i++) {
    //             createOption(ddl2, names[i], names[i]);
    //         }
    //         break;
    //         default:
    //             ddl2.options.length = 0;
    //         break;
    }

}

    function createOption(ddl1, text, value) {
        var opt = document.createElement('option');
        opt.value = value;
        opt.text = text;
        ddl.options.add(opt);
    }
</script>
  <!-- Onchange Dropdown End -->
  <!-- Changing dropdown Start -->
  <script type="text/javascript">
        function configureDropDownLists1(ddl11, ddl22) {
            var AKILA = ['BAKIYALAKSHMI', 'VIJAYAKUMARI'];

            switch (ddl11.value) {
                case 'AKILA':
                    ddl2.options.length = 0;
                    for (var i = 0; i < AKILA.length; i++) {
                        createOption(ddl22, AKILA[i], AKILA[i]);
                    }
                    break;
                default:
                    ddl22.options.length = 0;
                    break;
            }
        }

        function configureDropDownLists2(ddl22, ddl33) {
            var BAKIYALAKSHMI = ['PRADEEPRAJA', 'RAMAPRABA.G', 'YOKESH.M', 'SURUTHIKA'];
            var VIJAYAKUMARI = ['ANI JOLLA', 'MANIVEL.S', 'POONGODI M'];

            switch (ddl22.value) {
                // You can add more cases here if needed
                case 'BAKIYALAKSHMI':
                    ddl33.options.length = 0;
                    for (var i = 0; i < BAKIYALAKSHMI.length; i++) {
                        createOption(ddl33, BAKIYALAKSHMI[i], BAKIYALAKSHMI[i]);
                    }
                    break;
                case 'VIJAYAKUMARI':
                    ddl33.options.length = 0;
                    for (var i = 0; i < VIJAYAKUMARI.length; i++) {
                        createOption(ddl33, VIJAYAKUMARI[i], VIJAYAKUMARI[i]);
                    }
                    break;
                default:
                    ddl33.options.length = 0;
                    break;
            }
        }

        function createOption(ddl, text, value) {
            var opt = document.createElement('option');
            opt.value = value;
            opt.text = text;
            ddl.options.add(opt);
        }
        </script>
    <!-- Changing dropdown END -->


<?php
include "footer.php";
?>