EVOLUTION-NINJA
Edit File: vendor_profile.php
<?php $this->load->view('includes/vendor_header');?> <form class="form-horizontal" method="post" id="company_infomartion"> <section class="mid_work_one"> <div class="container"> <div class="col-sm-6"> <h4 class="info_text">Company information</h4> <div class="form-group"> <label class="control-label col-sm-4">Company Name* :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="company_name" id="profile_comapny_name" value="<?php echo $user->company_name;?>" required="required"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Address* :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="address" value="<?php if($company){ echo $company->address; }?>" required="required"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4"></label> <div class="col-sm-8"> <input type="text" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4"></label> <div class="col-sm-8"> <input type="text" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">City :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="city" value="<?php if($company){ echo $company->city; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">State :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="state" value="<?php if($company){ echo $company->state; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Postal code :</label> <div class="col-sm-8"> <input type="num" class="form-control" name="postal_code" value="<?php if($company){ echo $company->postal_code; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Country :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="country" value="<?php if($company){ echo $company->country; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Telephone :</label> <div class="col-sm-8"> <input type="tel" class="form-control" id="perofile_tel" name="telephone" value="<?php if($company){ echo $company->telephone; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Fax :</label> <div class="col-sm-8"> <input type="tel" class="form-control" id="profile_fax" name="fax" value="<?php if($company){ echo $company->fax; }?>"> </div> </div> <!-- <div class="form-group"> <label class="control-label col-sm-4">Mobile No.* :</label> <div class="col-sm-8"> <input type="tel" class="form-control" name="mobile_no" maxlength="10" id="profile_mobile" value="<?php if($company){ echo $company->mobile_no; }?>" required="required"> </div> </div> --> <div class="form-group"> <label class="control-label col-sm-4">Website :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="website" value="<?php if($company){ echo $company->website; }?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Short Description :</label> <div class="col-sm-8"> <textarea class="form-control" rows="3" name="short_description" value="<?php if($company){ echo $company->short_desc; } ?>"><?php if($company){ echo $company->short_desc; }?></textarea> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Industry Type :</label> <div class="col-sm-8"> <textarea class="form-control" rows="3" name="industry_type" value="<?php if($company){ echo $company->industry_type; } ?>"><?php if($company){ echo $company->industry_type; }?></textarea> </div> </div> <?php if($company){ $industries=json_decode($company->industries); } ?> <p>Select the industries your company serves</p> <div class="row"> <div class="col-sm-6"> <div class="checkbox"> <label><input type="checkbox" onclick="check();" <?php if($company){ if($company->all_industry=='on') { echo 'checked'; }}?> name="all_industry" id="fluency" value="on">Select All Industries</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("1",$industries)){ echo 'checked'; } } }?> value="1" >Aerospace & Defense</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="2" <?php if($company){ if(!empty($industries)){ if(in_array("2",$industries)) { echo 'checked'; } } } ?>>Agriculture & Mining</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="6" <?php if($company){ if(!empty($industries)){ if(in_array("6",$industries)) { echo 'checked'; } } } ?>>Chemicals</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="7" <?php if($company){ if(!empty($industries)){ if(in_array("7",$industries)) { echo 'checked'; } } } ?>>Consumer Products</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="8" <?php if($company){ if(!empty($industries)){ if(in_array("8",$industries)) { echo 'checked'; } } } ?>>Engineering & Construction</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="9" <?php if($company){ if(!empty($industries)){ if(in_array("9",$industries)) { echo 'checked'; } } } ?>>Financial Services & Banking</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="10" <?php if($company){ if(!empty($industries)){ if(in_array("10",$industries)) { echo 'checked'; } } } ?>>Forest Products & Paper</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="11" <?php if($company){ if(!empty($industries)){ if(in_array("11",$industries)) { echo 'checked'; } } } ?>>Furniture</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="12" <?php if($company){ if(!empty($industries)){ if(in_array("12",$industries)) { echo 'checked'; } } } ?>>Healthcare</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="13" <?php if($company){ if(!empty($industries)){ if(in_array("13",$industries)) { echo 'checked'; } } } ?>>High Tech & Electronics</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="14" <?php if($company){ if(!empty($industries)){ if(in_array("14",$industries)) { echo 'checked'; } } } ?>>Higher Education & Research</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="15" <?php if($company){ if(!empty($industries)){ if(in_array("15",$industries)) { echo 'checked'; } } } ?>>Hospitality</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" value="16" <?php if($company){ if(!empty($industries)){ if(in_array("16",$industries)) { echo 'checked'; } } } ?>>Industrial Machinery & Components</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("29",$industries)) { echo 'checked'; } } }?> value="29">Wholesale Distribution</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("28",$industries)) { echo 'checked'; } } }?> value="28">Utilities</label> </div> </div> <div class="col-sm-6"> <div class="checkbox"> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("3",$industries)) { echo 'checked'; } } } ?> value="3">Automotive</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("4",$industries)) { echo 'checked'; } } }?> value="4">Building Materials, Clay & Glass</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if(!empty($industries)){ if(in_array("5",$industries)) { echo 'checked'; } } ?> value="5">Insurance</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("17",$industries)) { echo 'checked'; } } }?> value="17">Media</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("18",$industries)) { echo 'checked'; } } }?> value="18">Metal Products</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("19",$industries)) { echo 'checked'; } } }?> value="19">Oil & Gas</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("20",$industries)) { echo 'checked'; } } }?> value="20">Pharmaceuticals</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("21",$industries)) { echo 'checked'; } } }?> value="21">Primary Metal & Steel</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("22",$industries)) { echo 'checked'; } } }?> value="22">Public Sector</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("23",$industries)) { echo 'checked'; } } }?> value="23">Retail</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("24",$industries)) { echo 'checked'; } } }?> value="24">Service Provider</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("25",$industries)) { echo 'checked'; } } }?> value="25">Telecommunication</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("26",$industries)) { echo 'checked'; } } }?> value="26">Textile Production</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("27",$industries)) { echo 'checked'; } } }?> value="27">Transportation & Storage</label> </div> <div class="checkbox"> <label><input type="checkbox" name="industries[]" <?php if($company){ if(!empty($industries)){ if(in_array("30",$industries)) { echo 'checked'; } } }?> value="30">Other</label> </div> </div> </div> </div> <div class="col-sm-6"> </div> <div class="col-sm-6"> <h4 class="info_text">User information</h4> <div class="form-group"> <label class="control-label col-sm-4">Name* :</label> <div class="col-sm-8"> <div class="row"> <div class="col-sm-6"> <input type="hidden" name="user_id" value="<?php echo $user->user_id; ?>"> <input type="text" class="form-control" id="profile_first_name" placeholder="First Name" name="first_name" value="<?php echo $user->first_name;?>"> </div> <br class="hidden-sm hidden-md hidden-lg"> <div class="col-sm-6"> <input type="text" class="form-control" placeholder="Last Name" id="profile_last_name" name="last_name" value="<?php echo $user->last_name;?>"> </div> </div> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Email* :</label> <div class="col-sm-8"> <input type="email" class="form-control" name="email" value="<?php echo $user->email;?>" required="required"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Mobile No.* :</label> <div class="col-sm-8"> <input type="tel" class="form-control" name="mobile_number" id="profile_mob" maxlength="13" value="<?php echo $user->mobile_no;?>" required="required"> </div> </div> <div class="form-group"> <label class="control-label col-sm-4">Designation* :</label> <div class="col-sm-8"> <input type="text" class="form-control" name="designation_new" value="<?php echo $user->designation;?>" required="required"> </div> </div> <!-- <div class="form-group"> <label class="control-label col-sm-4">User Name* :</label> <div class="col-sm-8"> <input type="text" class="form-control" id="prof_user_name" name="user_name" value="<?php echo $user->user_name;?>" required="required"> </div> </div> --> <!-- <div class="form-group"> <label class="control-label col-sm-4">Reset Password :</label> <div class="col-sm-8"> <input type="password" class="form-control" placeholder="Enter New password" name="password"> </div> </div> --> <!-- <div class="form-group"> <label class="control-label col-sm-4"></label> <div class="col-sm-8"> <input type="password" class="form-control" placeholder="Re-enter New Password" > </div> </div> --> <div class="form-group"> <label class="control-label col-sm-4">Language* :</label> <div class="col-sm-8"> <select class="form-control" name="language"> <option value="English" <?php if($user->language=='English'){ echo 'selected'; }?>>English</option> <option value="Kannada" <?php if($user->language=='Kannada'){ echo 'selected'; }?>>Kannada</option> <option value="Hindi" <?php if($user->language=='Hindi'){ echo 'selected'; }?>>Hindi</option> </select> </div> </div> </div> </div> </section> <section class="mid_work_two"> <div class="container"> <h4 style="color:#0e1d56;">Key Contact for Information</h4> <div class="table-responsive"> <table class="table"> <thead> <tr> <th>Sl No</th> <th>Name</th> <th>Designation</th> <th>Mobile No.</th> <th>Email Id</th> </tr> </thead> <tbody class="tbody_new"> <?php if(!empty($contact)) { foreach ($contact as $key => $value) { ?> <tr> <td><?php echo $key+1; ?></td> <td><input type="text" name="contact_name[]" value="<?php echo $value->contact_name;?>" class="form-control key_name"/></td> <td><input type="text" name="designation[]" value="<?php echo $value->designation;?>" class="form-control"/></td> <td><input type="text" name="mobile_no_new[]" value="<?php echo $value->mobile_no;?>" class="form-control key_mobile" maxlength="13"/></td> <td><input type="text" name="email_id[]" value="<?php echo $value->email_id;?>" class="form-control"/></td> </tr> <?php } } else { ?> <tr> <td>1</td> <td><input type="text" name="contact_name[]" class="form-control key_name" value="<?php echo $user->first_name;?>"></td> <td><input type="text" name="designation[]" class="form-control" value="<?php echo $user->designation;?>"></td> <td><input type="text" name="mobile_no_new[]" class="form-control key_mobile" value="<?php echo $user->mobile_no;?>" maxlength="13"></td> <td><input type="text" name="email_id[]" class="form-control" value="<?php echo $user->email;?>"></td> </tr> <tr> <td>2</td> <td><input type="text" name="contact_name[]" class="form-control key_name"></td> <td><input type="text" name="designation[]" class="form-control"></td> <td><input type="text" name="mobile_no_new[]" class="form-control key_mobile" maxlength="13"></td> <td><input type="text" name="email_id[]" class="form-control"></td> </tr> <tr> <td>3</td> <td><input type="text" name="contact_name[]" class="form-control key_name"></td> <td><input type="text" name="designation[]" class="form-control"></td> <td><input type="text" name="mobile_no_new[]" class="form-control key_mobile" maxlength="13"></td> <td><input type="text" name="email_id[]" class="form-control"></td> </tr> <?php } ?> </tbody> </table> </div> <div class="" style="text-align: right;"> <i style="text-align:right;padding-top: 4px;padding:5px 30px;background:#96dafc;color:#333;" class="add_more">Add More</i> </div> </div> </section> <div class="form-group"> <div style="text-align: center;"> <button type="submit" class="btn btn-primary iad_btn">Save</button> </div> </div> </form> </body> </html> <script type="text/javascript"> $(document).ready(function(){ $('#profile_comapny_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_city').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_state').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_postal').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_country').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#perofile_tel').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9-()+ .]*$/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_fax').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9-()+ .]*$/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_state').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_first_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_last_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#prof_user_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('.key_name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^A-Z a-z. ]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_mob').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9 + .]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#profile_mobile').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('.key_mobile').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9 + .]/g, ''); $(this).val(sanitized); }); }); function check(){ var checkbox = document.getElementById('fluency'); if(checkbox.checked != true) { $("input[type='checkbox']").prop('checked', false); }else{ $("input[type='checkbox']").prop('checked', true); } } var i='<?php echo $r=count($contact);?>'; if(i==''){ i=4; }else{ i=parseInt(i); i=i+1; } $('.add_more').click(function(){ var content=''; content+='<tr>'; content+='<td>'+i+'</td>'; content+='<td><input type="text" class="form-control" name="contact_name[]"/></td>'; content+='<td><input type="text" class="form-control" name="designation[]"/></td>'; content+='<td><input type="text" class="form-control" name="mobile_no_new[]"/></td>'; content+='<td><input type="text" class="form-control" name="email_id[]"/></td>'; content+='<td><i class="fa fa-times remove_span'+i+'" aria-hidden="true"></i></td>'; content+='</tr>'; $('.tbody_new').append(content); $('.remove_span'+i).on('click',function(e){ e.preventDefault(); var whichtr = $(this).closest("tr"); whichtr.remove(); }); i++; }); $('#company_infomartion').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-client-information")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result=='1') { toastr["success"]("Added Successfully"); $(".iad_btn").text("Submit"); $(".iad_btn").removeAttr('disabled'); location.reload(); } else { toastr["error"]("Something went wrong..Try again"); $(".iad_btn").text("Submit"); $(".iad_btn").removeAttr('disabled'); } } }); }); </script>