EVOLUTION-NINJA
Edit File: client_task.php
<?php $this->load->view('includes/client_header');?> <script> </script> <link rel="stylesheet" href="<?php echo base_url('assets/css/datepicker3.css');?>" /> <link rel="stylesheet" href="<?php echo base_url('assets/css/jquery-ui.css');?>"> <script src="<?php echo base_url('assets/js/bootstrap-datepicker.js');?>"></script> <script src="<?php echo base_url('assets/js/jquery-ui.js');?>"></script> <link rel="stylesheet" href="<?php echo base_url('assets/sweet_alert/sweet-alert.css');?>"> <link rel="stylesheet" href="<?php echo base_url('assets/toastr/toastr.min.css');?>"> <script src="<?php echo base_url('assets/sweet_alert/sweet-alert.js');?>"></script> <script src="<?php echo base_url('assets/toastr/toastr.min.js');?>"></script> <link rel="stylesheet" href="<?php echo base_url('assets/css/bootstrap-timepicker.min.css');?>"> <script src="<?php echo base_url('assets/js/bootstrap-timepicker.min.js');?>"></script> <section class="mid_work_one"> <div class="container"> <div class="row mid_container"> <form class="form-horizontal" id="bid_item"> <div class="col-sm-12 bid_div"> <h4 class="info_text" style="border-bottom:1px solid #333;padding-bottom:10px;color:#001e64;">Create Event</h4> <div class="row no_row"> <div class="col-sm-12 col-md-offset-4 col-md-5 main_bid_div"> <!-- <div class="bidding_input"> <h4 style="color:#001e64;">Bidding Title: </h4> <div class="b_input"> <input type="text" class="form-control" name="bidding_title" required=""/> </div> </div> <p class="p_bidding">Time Limit per bidding item: <input type="text" class="form-control" value="120" style="width:50px" name="bidding_time"/> seconds</p> --> <div class="form-group t_form"> <label>Bidding Title</label> <input type="text" class="form-control" name="bidding_title" autocomplete="off"> </div> </div> </div> <div class="row"> <!-- <div class="form-group"> <label class="control-label col-sm-3" style="text-align: left;padding-right: 0px;width: 20% !important;">Final Bidding date :</label> <div class="col-sm-3" style="padding-left: 0px;"> <input type="text" class="form-control date_picker" name="final_bidding_date"> </div> <div class="3"> <label class="control-label" style="float: left;padding-right:10px;">Time :</label> <input type="text" class="form-control" style="width: 80px;" name="final_bidding_time"> </div> </div> --> <div class="col-sm-4 bidding_div"> <div class="form-group t_form"> <label>Bidding Date</label> <input type="text" class="form-control date_picker" name="final_bidding_date" style="width: ;" autocomplete="off"> </div> </div> <div class="col-sm-4 bidding_div"> <div class="form-group t_form input-group bootstrap-timepicker timepicker"> <label>Bidding Time</label> <input type="text" class="form-control" name="final_bidding_time" id="timepicker1" style="width: ;" autocomplete="off"> <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span> </div> </div> <div class="col-sm-4 bidding_div"> <div class="form-group t_form"> <label class="timer_label" style="">Timer</label> <input type="text" class="form-control" name="bidding_time" id="timers_sec" autocomplete="off"><span class="hidden-xs"> </span> <label class="seconds_label hidden-xs" style="">Seconds</label> </div> </div> </div> <div class="col-sm-12 bid_div_coordinate"> <h4 class="info_text" style="border-bottom:1px solid #333;padding-bottom:10px;color:#001e64;">Coordinators</h4> <div class="table-responsive"> <table class="table action_table" style="background:#f3f7f1;margin-bottom:0px;"> <thead> <tr> <th>Email Id</th> <th>Name</th> <th>Phone Number</th> <th>Company Name</th> </tr> </thead> <tbody class="tbody_latest_new"> <tr> <td><input type="email" n="1" name="coordinator_mail[]" class="form-control input_table coordinators_email_ids1" onfocusout="coordinators_email1();" id="text1" autocomplete="off" ></td> <td><input type="text" name="coordinator_name[]" class="form-control input_table co_name1" autocomplete="off" ></td> <td><input type="text" name="coordinator_phone[]" class="form-control input_table c_phone co_phone1" autocomplete="off" maxlength="13"></td> <td><input type="text" name="coordinator_company[]" class="form-control input_table co_company1" autocomplete="off"></td> </tr> <tr> <td><input type="email" n="1" name="coordinator_mail[]" class="form-control input_table coordinators_email_ids2" onfocusout="coordinators_email2();" id="text1" autocomplete="off" ></td> <td><input type="text" name="coordinator_name[]" class="form-control input_table co_name2" autocomplete="off" ></td> <td><input type="text" name="coordinator_phone[]" class="form-control input_table co_phone2" autocomplete="off" maxlength="13"></td> <td><input type="text" name="coordinator_company[]" class="form-control input_table co_company2 " autocomplete="off"></td> </tr> <tr> <td><input type="email" n="1" name="coordinator_mail[]" class="form-control input_table coordinators_email_ids3" onfocusout="coordinators_email3();" id="text1" autocomplete="off" ></td> <td><input type="text" name="coordinator_name[]" class="form-control input_table co_name3" autocomplete="off" ></td> <td><input type="text" name="coordinator_phone[]" class="form-control input_table co_phone3" autocomplete="off" maxlength="13"></td> <td><input type="text" name="coordinator_company[]" class="form-control input_table co_company3 " autocomplete="off" ></td> </tr> <tr> <td><input type="email" n="1" name="coordinator_mail[]" class="form-control input_table coordinators_email_ids4" onfocusout="coordinators_email4();" id="text1" autocomplete="off" ></td> <td><input type="text" name="coordinator_name[]" class="form-control input_table co_name4" autocomplete="off" ></td> <td><input type="text" name="coordinator_phone[]" class="form-control input_table co_phone4" autocomplete="off" maxlength="13"></td> <td><input type="text" name="coordinator_company[]" class="form-control input_table co_company4" autocomplete="off" ></td> </tr> </tbody> </table> </div> </div> <!---- <div class="col-sm-6 col-md-3"> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> </div> <div class="col-sm-6 col-md-3"> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> </div> <div class="col-sm-6 col-md-3"> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> <div class="form-group t_form"> <label>Name</label> <input type="text" class="form-control coordinator_name" name="coordinator_name[]"> </div> </div> <div class="col-sm-6 col-md-3"> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> <div class="form-group t_form"> <label>Phone No.</label> <input type="text" class="form-control coordinator_phone" name="coordinator_phone[]" maxlength="10"> </div> </div> </div>--> <h4 class="info_text" style="border-bottom:1px solid #333;padding-bottom:10px;color:#001e64;">Tasks</h4> <div class="row"> <div class="col-sm-8"> <div class="form-group"> <label class="control-label col-sm-6"></label> <div class="col-sm-6"> <p style="font-weight: bold;text-align: center;margin-bottom:0px;">Proposed Dates</p> </div> </div> <div class="form-group"> <label class="control-label col-sm-6">Sending Invitations :</label> <div class="col-sm-6"> <input type="text" class="form-control date_picker" name="sending_invitation" autocomplete="off"> </div> </div> <div class="form-group"> <label class="control-label col-sm-6">Coordinating with vendors for registration :</label> <div class="col-sm-6"> <input type="text" class="form-control date_picker" name="coordinate_vendor" autocomplete="off"> </div> </div> <div class="form-group"> <label class="control-label col-sm-6">Finalize the bidding date & time :</label> <div class="col-sm-6"> <input type="text" class="form-control date_picker" name="finalized_bid_date_time" autocomplete="off"> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <div class="col-sm-6 completed_dates"> <p style="font-weight: bold;text-align: center;">Completed Dates</p> </div> </div> <div class="form-group"> <div class="col-sm-6 completed_dates"> <input type="text" class="form-control date_picker" name="sending_completed_date" autocomplete="off"> </div> </div> <div class="form-group"> <div class="col-sm-6 completed_dates"> <input type="text" class="form-control date_picker" name="coordinate_completed_date" autocomplete="off"> </div> </div> <div class="form-group"> <div class="col-sm-6 completed_dates"> <input type="text" class="form-control date_picker" name="finalized_completed_date" autocomplete="off"> </div> </div> </div> </div><!-- row 1 end--> <br> <div class="row" style="border-bottom:1px solid #333;margin-bottom:10px;"> <h4 class="info_text" style="float:left;color:#001e64;margin-bottom:0px;">Descriptions of items</h4> <button type="button" style="margin-left: 15px;background-color: #00A65A;float:right;" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModalnew">import</button> </div> <div class="table-responsive"> <table class="table action_table" id="item_table" style="background:#f3f7f1;margin-bottom:0px;"> <thead> <tr> <th>Sl No</th> <th>Items Descriptions</th> <th>Specifications</th> <th>Quantity</th> </tr> </thead> <tbody class="tbody_new"> <!-- <tr> <td style="width: 10%;"><input type="text" class="sl_no sr_no1" value="<?php echo '1'; ?>" readonly="readonly"></td> <td><input type="text" name="item_desc[]" class="form-control input_table" required="" autocomplete="off"></td> <td><input type="text" name="specification[]" class="form-control input_table" required="" autocomplete="off"></td> <td><input type="text" name="quantity[]" class="form-control input_table" required="" autocomplete="off"></td> </tr> <tr> <td style="width: 10%;"><input type="text" class="sl_no sr_no2" value="<?php echo '2'; ?>" readonly="readonly"></td> <td><input type="text" name="item_desc[]" class="form-control input_table" autocomplete="off"></td> <td><input type="text" name="specification[]" class="form-control input_table" autocomplete="off"></td> <td><input type="text" name="quantity[]" class="form-control input_table" autocomplete="off"></td> </tr> <tr> <td style="width: 10%;"><input type="text" class="sl_no sr_no3" value="<?php echo '3'; ?>" readonly="readonly"></td> <td><input type="text" name="item_desc[]" class="form-control input_table" autocomplete="off"></td> <td><input type="text" name="specification[]" class="form-control input_table" autocomplete="off"></td> <td><input type="text" name="quantity[]" class="form-control input_table" autocomplete="off"></td> </tr> --> <tr> <td style="width: 10%;"><input type="text" name="item_sl[]" class="sl_no sr_no1" value="<?php echo '1'; ?>" readonly="readonly"></td> <td> <textarea class="form-control" name="item_desc[]" style="height:34px !important;"></textarea> </td> <td> <textarea class="form-control" name="specification[]" style="height:34px !important;"></textarea> </td> <td> <div onload="init();"> <textarea class="form-control" name="quantity[]" style="height:34px;" id="text2"></textarea> </div> </td> </tr> </tbody> </table> </div> <div class="" style="text-align: right;"> <span class="btn btn-primary btn-sm add_more" role="button">Add More</span> </div> <br> <div class="row" style="border-bottom:1px solid #333;margin-bottom:10px;"> <h4 class="info_text" style="color:#001e64;float: left;margin-bottom:0px;">Vendors List </h4> <button style="margin-left: 15px;background-color: #00A65A;float:right;" type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">import</button> </div> <div class="table-responsive"> <table class="table action_table" style="background:#f3f7f1;margin-bottom:0px;"> <thead> <tr> <th>Sl No</th> <th>Email Id</th> <th>Company Name</th> <th>Contact Person</th> <th>Phone Number</th> </tr> </thead> <tbody class="tbody_latest"> <tr class="ss1"> <td style="width: 10%;"><input type="text" class="slv_no srv_no1" value="<?php echo '1'; ?>" readonly="readonly"></td> <td><input type="email" n="1" name="email_id[]" onfocusout="myFunction('1');" class="email1 form-control input_table" id="text1" autocomplete="off" required="" ></td> <td><input type="text" name="company_name[]" class="form-control input_table company_name1" autocomplete="off" required="" ></td> <td><input type="text" name="contact_parson[]" class="form-control input_table contact1" autocomplete="off" required=""></td> <td><input type="text" name="phone_number[]" class="form-control input_table phone1 v_phone" maxlength="13" autocomplete="off" required=""></td> </tr> <tr class="ss2"> <td style="width: 10%;"><input type="text" class="slv_no srv_no2" value="<?php echo '2'; ?>" readonly="readonly"></td> <td><input type="email" n="2" name="email_id[]" onfocusout="myFunction('2');" class="email2 form-control input_table" autocomplete="off" id="text2" required=""></td> <td><input type="text" name="company_name[]" class="company_name2 form-control input_table" autocomplete="off" required=""></td> <td><input type="text" name="contact_parson[]" class="contact2 form-control input_table" autocomplete="off" required=""></td> <td><input type="text" name="phone_number[]" class="phone2 form-control input_table v_phone" maxlength="13" autocomplete="off" required=""></td> </tr> <tr class="ss3"> <td style="width: 10%;"><input type="text" class="slv_no srv_no3" value="<?php echo '3'; ?>" readonly="readonly"></td> <td><input type="email" n="3" name="email_id[]" onfocusout="myFunction('3');" class="email3 form-control input_table" autocomplete="off" id="text3" ></td> <td><input type="text" name="company_name[]" class="company_name3 form-control input_table" autocomplete="off"></td> <td><input type="text" name="contact_parson[]" class="contact3 form-control input_table" autocomplete="off" ></td> <td><input type="text" name="phone_number[]" class="phone3 form-control input_table v_phone" maxlength="13" autocomplete="off"></td> </tr> </tbody> </table> </div> <div class="" style="text-align: right;"> <span class="btn btn-primary btn-sm add_latest" role="button">Add More</span> </div> <br> <div class="form-group"> <input type="hidden" value="<?php echo $user->date_of_expiry; ?>" class="exp_dates"> <input type="hidden" value="<?php echo date("Y-m-d"); ?>" class="todys_dates"> <div class="col-sm-12" style="text-align: center;"> <?php if($user->date_of_expiry < date("Y-m-d")) { ?> <?php } else { ?> <button type="submit" class="btn btn-round iad_btn">Save</button> <?php } ?> </div> </div> <!-- <h4 class="info_text" style="border-bottom: 1px solid #a19d9d;padding-bottom:10px;color:#334b83;">Mailing</h4> <p style="padding-bottom:15px;color:#334b83;">Send Invitation to join the session</p> <div class="row"> <div class="col-sm-6 col-md-6 col-lg-5"> <div class="form-group"> <label class="control-label col-sm-5">Sender Email Id :</label> <div class="col-sm-7"> <input type="text" class="form-control" > </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Subject :</label> <div class="col-sm-7"> <input type="text" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Text :</label> <div class="col-sm-7"> <textarea class="form-control" rows="3"></textarea> </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Senders Name :</label> <div class="col-sm-7"> <input type="text" class="form-control" id="email_sender_name"> </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Contact No 1 * :</label> <div class="col-sm-7"> <input type="text" class="form-control v_phone" id="email_conatct_num" maxlength="13"> </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Contact No 2 * :</label> <div class="col-sm-7"> <input type="text" class="form-control v_phone" id="email_conatct_scn__num" maxlength="13"> </div> </div> <div class="form-group"> <div class="col-sm-offset-5 col-sm-7"> <center><button type="button" class="btn btn-round">Send</button></center> </div> </div> </div> <div class="col-sm-6 col-md-6 col-lg-6"> </div> </div>--><!-- row 1 end--> </div> </form> <div id="myModalnew" class="modal fade" role="dialog"> <form method="post" class="item_form"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Import Item</h4> </div> <div class="modal-body"> <p></p> <table class="table"> <thead> <tr> <th>item description</th> <th>specification</th> <th>quantity</th> </tr> </thead> <tbody> </tbody> </table> <input type="file" name="item_file"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-default iad1_btn">Import</button> </div> </div> </div> </form> </div> <div id="myModal" class="modal fade" role="dialog"> <form method="post" class="vendor_import"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Import Vendor</h4> </div> <div class="modal-body"> <table class="table"> <thead> <tr> <th>Email Id</th> <th>Company Name</th> <th>Contact Person</th> <th>Phone No.</th> </tr> </thead> <tbody> </tbody> </table> <input type="file" name="vendor_file"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-default iad2_btn">Import</button> </div> </div> </div> </form> </div> </div> </div> </section> </body> </html> <script> // q=[]; function coordinators_email1() { var v1= $('.coordinators_email_ids1').val(); var v2= $('.coordinators_email_ids2').val(); var v3= $('.coordinators_email_ids3').val(); var v4= $('.coordinators_email_ids4').val(); if(v1 =='') { } else { if(v1 == v2 || v1 == v3 || v1 == v4) { toastr["error"]("This Email Id Already Enter"); $('.coordinators_email_ids1').val(''); } else { var email=v1; $.ajax({ type : 'post', url : '<?php echo site_url("get-co-ordinator-email")?>', data : {'email':email}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ if(response.detail.company_name!=""){ $('.co_company1').val(response.detail.company_name); $('.coordinators_email_ids1').val(response.detail.email); $('.co_name1').val(response.detail.first_name); $('.co_phone1').val(response.detail.mobile_no); } } } }); } } } function coordinators_email2() { var v1= $('.coordinators_email_ids1').val(); var v2= $('.coordinators_email_ids2').val(); var v3= $('.coordinators_email_ids3').val(); var v4= $('.coordinators_email_ids4').val(); if(v2 =='') { } else { if(v2 == v1 || v2 == v3 || v2 == v4) { $('.coordinators_email_ids2').val(''); toastr["error"]("This Email Id Already Enter"); } else { var email=v2; $.ajax({ type : 'post', url : '<?php echo site_url("get-co-ordinator-email")?>', data : {'email':email}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ if(response.detail.company_name!=""){ $('.co_name2').val(response.detail.first_name); $('.coordinators_email_ids2').val(response.detail.email); $('.co_company2').val(response.detail.company_name); $('.co_phone2').val(response.detail.mobile_no); } } } }); } } } function coordinators_email3() { var v1= $('.coordinators_email_ids1').val(); var v2= $('.coordinators_email_ids2').val(); var v3= $('.coordinators_email_ids3').val(); var v4= $('.coordinators_email_ids4').val(); if(v3 =='') { } else { if(v3 == v2 || v3 == v1 || v3 == v4) { $('.coordinators_email_ids3').val(''); toastr["error"]("This Email Id Already Enter"); } else { var email=v3; $.ajax({ type : 'post', url : '<?php echo site_url("get-co-ordinator-email")?>', data : {'email':email}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ if(response.detail.company_name!=""){ $('.co_name3').val(response.detail.first_name); $('.coordinators_email_ids3').val(response.detail.email); $('.co_company3').val(response.detail.company_name); $('.co_phone3').val(response.detail.mobile_no); } } } }); } } } function coordinators_email4() { var v1= $('.coordinators_email_ids1').val(); var v2= $('.coordinators_email_ids2').val(); var v3= $('.coordinators_email_ids3').val(); var v4= $('.coordinators_email_ids4').val(); if(v4 =='') { } else { if(v4 == v2 || v4 == v1 || v4 == v3) { $('.coordinators_email_ids4').val(''); toastr["error"]("This Email Id Already Enter"); } else { var email=v4; $.ajax({ type : 'post', url : '<?php echo site_url("get-co-ordinator-email")?>', data : {'email':email}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ if(response.detail.company_name!=""){ $('.co_name4').val(response.detail.first_name); $('.coordinators_email_ids4').val(response.detail.email); $('.co_company4').val(response.detail.company_name); $('.co_phone4').val(response.detail.mobile_no); } } } }); } } } </script> <script> $(document).ready(function(){ $('.c_phone').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9 + .]/g, ''); $(this).val(sanitized); }); }); </script> <script type="text/javascript"> $('#timepicker1').timepicker(); </script> <script type="text/javascript"> $(document).ready(function(){ $('#email_sender_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#email_conatct_num').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9-()+ .]*$/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#email_conatct_scn__num').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9-()+ .]*$/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('.coordinator_phone').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#timers_sec').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $('.date_picker').datepicker({ changeMonth : true, changeYear : true, dateFormat: "dd-mm-yy", }); //var i=4; var sl_no=[]; var sll_no=[]; $('.add_more').click(function(){ var i=$('input[name="item_sl[]"]').length; var i=i+1; var content=''; content+='<tr>'; content+='<td style="width: 10%;"><input type="text" name="item_sl[]" class="sl_no sr_no'+i+'" value="'+i+'" readonly="readonly"></td>'; content+='<td><input type="text" name="item_desc[]" class="form-control input_table" required="" autocomplete="off"/></td>'; content+='<td><input type="text" name="specification[]" class="form-control input_table" required="" autocomplete="off"/></td>'; content+='<td><input type="text" name="quantity[]" class="form-control input_table" required="" autocomplete="off"/></td>'; content+='<td><span class="btn btn-danger btn-xs" role="button"><i class="fa fa-trash remove_span'+i+'" aria-hidden="true" ></i></span></td>'; content+='</tr>'; $('.tbody_new').append(content); $('.remove_span'+i).on('click',function(e){ e.preventDefault(); var whichtr = $(this).closest("tr"); whichtr.remove(); var t=$('input[name="item_desc[]"]').length; sl_no.length=0; sll_no.length=0; $('.sl_no').each(function () { sl_no.push($(this).val()); }); var y =0; $.each( sl_no, function( key, value ) { y=y+1; $('.sr_no'+value).addClass('sr_nos'+y); $("input").removeClass('sr_no'+value); $('.sr_nos'+y).val(y); $('.sr_nos'+y).addClass('sr_no'+y); $("input").removeClass('sr_nos'+y); }); }); }); $('input[name^="email_id"]').focusout(function() { var $current = $(this); var n=$(this).attr('n'); $('input[name^="email_id"]').each(function() { if ($(this).val() == $current.val() && $(this).attr('id') != $current.attr('id')) { //$('.ss'+n).find('input').val(''); // toastr["error"]('Email Found!'); } }); }); var slv_no=[]; var sllv_no=[]; $('.add_latest').click(function(){ var n=$('input[name="email_id[]"]').length; var n=n+1; var content=''; content+='<tr class="ss'+n+'">'; content+='<td style="width: 10%;"><input type="text" class="slv_no srv_no'+n+'" value="'+n+'" readonly="readonly"></td>'; content+='<td><input type="email" name="email_id[]" n="'+n+'" onfocusout="myFunction('+n+');" class="form-control input_table email'+n+'" id="text'+n+'" autocomplete="off" required/></td>'; content+='<td><input type="text" name="company_name[]" class="form-control input_table company_name'+n+'" autocomplete="off" required/></td>'; content+='<td><input type="text" name="contact_parson[]" class="form-control input_table contact'+n+'" autocomplete="off" required/></td>'; content+='<td><input type="text" name="phone_number[]" class="form-control vv_phone input_table phone'+n+'" maxlength="13" autocomplete="off" required/></td>'; content+='<td><span class="btn btn-danger btn-xs" role="button"><i class="fa fa-trash remove_span'+n+'" aria-hidden="true"></i></span></td>'; content+='</tr>'; $('.tbody_latest').append(content); $('.remove_span'+n).on('click',function(e){ e.preventDefault(); var whichtr = $(this).closest("tr"); whichtr.remove(); var t=$('input[name="email_id[]"]').length; slv_no.length=0; sllv_no.length=0; $('.slv_no').each(function () { slv_no.push($(this).val()); }); var y =0; $.each( slv_no, function( key, value ) { y=y+1; $('.srv_no'+value).addClass('srv_nos'+y); $("input").removeClass('srv_no'+value); $('.srv_nos'+y).val(y); $('.srv_nos'+y).addClass('srv_no'+y); $("input").removeClass('srv_nos'+y); }); }); n++; }); $(document).on('focusout','input[name^="email_id"]',function() { var $current = $(this); var n=$(this).attr('n'); $('input[name^="email_id"]').each(function() { if ($(this).val() == $current.val() && $(this).attr('id') != $current.attr('id')) { $('.email'+n).val(''); $('.company_name'+n).val(''); $('.contact'+n).val(''); $('.phone'+n).val(''); } }); }); function myFunction(n){ var email=$('.email'+n).val(); if(email == '') { } else { $.ajax({ type : 'post', url : '<?php echo site_url("get-contact-email")?>', data : {'email':email}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ $('.company_name'+n).val(response.detail.company_name); $('.email'+n).val(response.detail.email); $('.contact'+n).val(response.detail.first_name); $('.phone'+n).val(response.detail.mobile_no); var t=$('input[name="email_id[]"]').length; slv_no.length=0; sllv_no.length=0; $('.slv_no').each(function () { slv_no.push($(this).val()); }); var y =0; $.each( slv_no, function( key, value ) { y=y+1; $('.srv_no'+value).addClass('srv_nos'+y); $("input").removeClass('srv_no'+value); $('.srv_nos'+y).val(y); $('.srv_nos'+y).addClass('srv_no'+y); $("input").removeClass('srv_nos'+y); }); } } }); } } $('.item_form').submit(function(e){ e.preventDefault(); $(".iad1_btn").attr('disabled', 'disabled'); $(".iad1_btn").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("welcome/add_item")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result=='1') { $('#myModalnew').modal('hide'); //toastr["success"]("Added Successfull"); item(); $(".iad1_btn").text("Submit"); $(".iad1_btn").removeAttr('disabled'); } else { toastr["error"]("Something went wrong..Try again"); $(".iad1_btn").text("Submit"); $(".iad1_btn").removeAttr('disabled'); } } }); }); $('.vendor_import').submit(function(e){ e.preventDefault(); $(".iad2_btn").attr('disabled', 'disabled'); $(".iad2_btn").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("welcome/add_vendor")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result=='1') { $('#myModal').modal('hide'); //toastr["success"]("Added Successfull"); vendor(); $(".iad2_btn").text("Submit"); $(".iad2_btn").removeAttr('disabled'); } else { toastr["error"]("Something went wrong..Try again"); $(".iad2_btn").text("Submit"); $(".iad2_btn").removeAttr('disabled'); } } }); }); function vendor(){ $.ajax({ type : 'get', url : '<?php echo site_url("welcome/get_vendor")?>', success:function(response){ response=jQuery.parseJSON(response); var content=''; var i=1; $.each(response,function(index,val){ content+='<tr class="ss'+i+'">'; content+='<td>'+i+'</td>'; content+='<td><input type="text" n="1" name="email_id[]" class="email1 form-control input_table" value="'+val.demo_vendor_email+'" id="text1" required="" ></td>'; content+='<td><input type="text" name="company_name[]" class="form-control input_table company_name1" value="'+val.demo_vendor_company+'" required="" ></td>'; content+='<td><input type="text" name="contact_parson[]" class="form-control input_table contact1" value="'+val.demo_vendor_contact+'" required=""></td>'; content+='<td><input type="text" name="phone_number[]" class="form-control input_table phone1" value="'+val.demo_vendor_phone+'" required=""></td>'; content+='<td><span class="btn btn-danger btn-xs" role="button"><i class="fa fa-trash remove_spann" aria-hidden="true"></i></span></td>'; content+='</tr>'; i++; }); $('.tbody_latest').empty(); $('.tbody_latest').append(content); } }); } $(document).on('click','.remove_spann',function(e){ e.preventDefault(); var whichtr = $(this).closest("tr"); whichtr.remove(); }); function item(){ $.ajax({ type : 'get', url : '<?php echo site_url("welcome/get_item")?>', success:function(response){ response=jQuery.parseJSON(response); var content=''; var i=1; $.each(response,function(index,val){ content+='<tr>'; content+='<td>'+i+'</td>'; content+='<td><input type="text" name="item_desc[]" class="form-control input_table" required="" value="'+val.demo_item_name+'"></td>'; content+='<td><input type="text" name="specification[]" class="form-control input_table" required="" value="'+val.demo_item_specification+'"></td>'; content+='<td><input type="text" name="quantity[]" class="form-control input_table" required="" value="'+val.demo_item_quantity+'"></td>'; content+='<td><span class="btn btn-danger btn-xs" role="button"><i class="fa fa-trash remove_span" aria-hidden="true" ></i></span></td>'; content+='</tr>'; i++; }); $('.tbody_new').empty(); $('.tbody_new').append(content); } }); } $(document).on('click','.remove_span',function(e){ e.preventDefault(); var whichtr = $(this).closest("tr"); whichtr.remove(); }); $('#bid_item').submit(function(e){ e.preventDefault(); $(".iad_btn").attr('disabled', 'disabled'); $(".iad_btn").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("add-biddig-item")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result=='1') { toastr["success"]("Added Successfull"); window.location.href='<?php echo base_url('/edit-session'); ?>/'+response.bid_id+''; $(".iad_btn").text("Submit"); $(".iad_btn").removeAttr('disabled'); } else if(response.result=='2') { toastr["error"](response.msg); $(".iad_btn").text("Submit"); $(".iad_btn").removeAttr('disabled'); } else { toastr["error"]("Something went wrong..Try again"); $(".iad_btn").text("Submit"); $(".iad_btn").removeAttr('disabled'); } } }); }); </script> <style type="text/css"> .input_table { border:initial !important; } no_row { margin-left:0px !important; margin-right:0px !important; } .t_form { display: flex; align-items: flex-end; margin-left:0px !important; margin-right:10px !important; } .t_form label { min-width: 90px; } .input-group-addon { padding: 2.3% 5% !important; } .input-group-addon i { left: -5px; } .no_row input { /*width: 65% !important;*/ } </style> <style type="text/css"> .main_bid_div { padding-left: 4px !important; } #timers_sec { width: 50%; } .bidding_div_coordinate input { width: 70%; } .completed_dates { width: 70%; } textarea { border:transparent !important; resize:none; } @media only screen and (min-width: 320px) and (max-width: 640px) { .table1 { width: 100%; overflow-x: scroll !important; } .input-group-addon { padding: 2.5% 6% !important; } .bid_div { padding-right: 0px !important; padding-left: 0px !important; } .bidding_div { padding-right: 0px !important; } .bid_div_coordinate { padding-left: 0px !important; padding-right: 0px !important; } .bidding_div_coordinate { padding-right: 0px !important; padding-left: 0px !important; } #timers_sec { width: 100%; } #timepicker1 { width: 59%; } } @media only screen and (min-width: 641px) and (max-width: 991px) { .table1 { width: 100%; overflow-x: scroll !important; } .timer_label { text-align: initial; min-width: 40px !important; } .seconds_label { padding-left: 3px; } .input-group-addon { padding: 3.8% 5% !important; } .bidding_div input { width: 46% !important; } } @media only screen and (min-width: 992px) and (max-width: 1258px) { .table1 { width: 100%; overflow-x: scroll !important; } .input-group-addon { padding: 2.8% 5% !important; } .bidding_div input { width: 55% !important; } .bidding_div_coordinate input { width: 45% !important; } } .sl_no { border: none; width: 60%; background: #f9f8f2; } .slv_no { border: none; width: 60%; background: #f9f8f2; } textarea { border: 0 none white; overflow: hidden; padding: 0; outline: none; background-color: #D0D0D0; } </style> <script> $('textarea').each(function () { this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;'); }).on('input', function () { this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px'; }); </script> <script> $(document).ready(function(){ $('.vv_phone').on('change keyup', function() { alert(); var sanitized = $(this).val().replace(/[^0-9 + .]/g, ''); $(this).val(sanitized); }); }); </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"> <script> function checkDuplicateEmails() { var allEmailInputs = document.querySelectorAll('input[type="email"]'); var emailSet = new Set(); allEmailInputs.forEach(function(emailInput) { var email = emailInput.value.trim(); if (email !== '') { if (emailSet.has(email)) { // Show toaster message for duplicate email toastr.error('Email ' + email + ' already exists!'); // Clear the input field emailInput.value = ''; } else { emailSet.add(email); } } }); } // Call the function whenever an email input loses focus var allEmailInputs = document.querySelectorAll('input[type="email"]'); allEmailInputs.forEach(function(emailInput) { emailInput.addEventListener('blur', checkDuplicateEmails); }); </script>