ok
Direktori : /home2/selectio/public_html/y1jobportal.in/admin/ |
Current File : /home2/selectio/public_html/y1jobportal.in/admin/edit-customer.php |
<?php include('header.php'); $ids = $_GET['id']; $statement = $pdo->prepare("SELECT * FROM `customer` WHERE id=$ids"); $statement->execute(); $query = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); ?> <div class="page-wrapper"> <div class="page-content"> <div class="row"> <div class="col-xl-12 mx-auto"> <div class="card"> <div class="card-body"> <form id="add_client_details"> <h6 class="mb-1">Add Client Details</h6> <div class="row g-3"> <div class="col-12 col-lg-12"> <!--<b class="mr-top-20">To whom is the order suppliers?</b> <span class="color-liht-gray">(Client's Info)</span>--> </div> <div class="col-12 col-lg-6"> <div class="col-md-12"> <input type="hidden" value="<?=$ids?>" name="ids" /> <label for="input13" class="form-label required">First Name</label> <div class="position-relative input-icon"> <input type="text" name="client_first_name" class="form-control" id="input13" value="<?=$query[0]['cust_firstname']?>" placeholder="First Name"> <span class="position-absolute top-50 translate-middle-y"><i class="bx bx-user"></i></span> </div> </div> </div> <div class="col-12 col-lg-6"> <div class="col-md-12"> <label for="input13" class="form-label">Last Name</label> <div class="position-relative input-icon"> <input type="text" name="client_last_name" class="form-control" id="input13" value="<?=$query[0]['cust_lastname']?>" placeholder="Last Name"> <span class="position-absolute top-50 translate-middle-y"><i class="bx bx-user"></i></span> </div> </div> </div> <div class="col-12 col-lg-3"> <label for="PhoneNumber" class="form-label required">Mobile Number</label> <div class="position-relative input-icon"> <input type="text" name="client_mobile_no" class="form-control" id="input15" placeholder="Phone" value="<?=$query[0]['cust_phone']?>"> <span class="position-absolute top-50 translate-middle-y"><i class="bx bx-microphone"></i></span> </div> </div> <div class="col-12 col-lg-5"> <div class="mb-3"> <label class="form-label required">Email</label> <div class="position-relative input-icon"> <input type="text" name="client_email" class="form-control" id="input16" placeholder="Email" value="<?=$query[0]['email']?>"> <span class="position-absolute top-50 translate-middle-y"><i class="bx bx-envelope"></i></span> </div> </div> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">Date Of Birth</label> <input type="hidden" name="district" class="form-control" id="district" placeholder="Date Of Birth" value="<?=$query[0]['district_id']?>"> <input type="hidden" name="subcat" class="form-control" id="subcat" placeholder="Date Of Birth" value="<?=$query[0]['subcategory_id']?>"> <input type="date" name="dob" class="form-control" id="dob" placeholder="Date Of Birth" value="<?=$query[0]['dob']?>"> </div> <div class="col-12 col-lg-9"> <label for="Address" class="form-label required">Address</label> <input type="text" name="client_address1" class="form-control" id="buyer_mobile_no" placeholder="Address 1" value="<?=$query[0]['address_line1']?>"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">Category</label> <select name="category_id" id="category_id" class="form-select select2" style="font-size: 12px;" required> <option value="">All Category</option> <?php $statement = $pdo->prepare("SELECT * FROM `category` WHERE status=1"); $statement->execute(); $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($resultss as $result) { ?> <option value="<?=$result['id']?>" <?php if($result['id']==$query[0]['category_id']){echo "selected";}?>><?=$result['name']?></option> <?php } ?> </select> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">Subcategory</label> <select name="subcategory" id="subcategory" class="form-select select2" style="font-size: 12px;" required> <option value="">All Subcategory</option> </select> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">State</label> <select name="state_id" id="state_id" class="form-select select2" style="font-size: 12px;" required> <option value="">All State</option> <?php $statement = $pdo->prepare("SELECT * FROM `state` WHERE status=1"); $statement->execute(); $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($resultss as $result) { ?> <option value="<?=$result['id']?>" <?php if($result['id']==$query[0]['state_id']){echo "selected";}?>><?=$result['state_name']?></option> <?php } ?> </select> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">District</label> <select name="district_id" id="district_id" class="form-select select2" style="font-size: 12px;" required> </select> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">City</label> <input type="text" name="client_city" class="form-control" id="buyer_mobile_no" value="<?=$query[0]['city']?>" placeholder="City" required> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">Work Type</label> <select name="work_type" id="work_type" class="form-select select2" style="font-size: 12px;"> <option selected="">Choose...</option> <option value="1" <?php if(1==$query[0]['work_type']){echo "selected";}?>>Fresher</option> <option value="2" <?php if(2==$query[0]['work_type']){echo "selected";}?>>Experience </option> </select> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label required">Years Of Experience</label> <select name="years_of_experience" id="years_of_experience" class="form-select select2" style="font-size: 12px;"> <option selected="">Choose...</option> <?php for($y=1;$y<=50;$y++){ ?> <option value="<?=$y?>" <?php if($y==$query[0]['work_experirnce']){echo "selected";}?>><?=$y?></option> <?php } ?> </select> </div> <div class="col-12 col-lg-3"> <div class="ff_fileupload_wrap"> <div class="ff_fileupload_dropzone_wrap"> <div class="ff_fileupload_dropzone_tools"> <label for="Photo" class="form-label required">Photo</label> <?php if($query[0]['photo']!=''){?> <img src="<?=$query[0]['photo']?>" style="height:100%;width:30%;"> <?php } ?> <input id="client_photo" type="file" name="client_photo" accept=".jpg, .png, image/jpeg, image/png" class="ff_fileupload_hidden"> <input id="old_client_photo" type="hidden" name="old_client_photo" accept=".jpg, .png, image/jpeg, image/png" value="<?=$query[0]['photo']?>" class="ff_fileupload_hidden"> </div> </div> <table class="ff_fileupload_uploads"></table> </div> </div> <div class="col-12 col-lg-3"> <div class="ff_fileupload_wrap"> <div class="ff_fileupload_dropzone_wrap"> <div class="ff_fileupload_dropzone_tools"> <label for="Photo" class="form-label required">Resume</label> <?php if($query[0]['resume']!=''){?> <img src="<?=$query[0]['resume']?>" style="height:100%;width:30%;"> <?php } ?> <input id="documents" type="file" name="documents" accept=".pdf,.doc,.xls, image/png" class="ff_fileupload_hidden"> <input id="old_documents" type="hidden" name="old_documents" accept=".pdf,.doc,.xls, image/png" value="<?=$query[0]['resume']?>" class="ff_fileupload_hidden"> </div> </div> <table class="ff_fileupload_uploads"></table> </div> </div> <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> <center><h6 class="mb-1">Add Education Details</h6></center> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Qualification</label> <input type="text" name="qualification" class="form-control" id="qualification" value="<?=$query[0]['qualification']?>" placeholder="Qualification"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Board / University</label> <input type="text" name="university" class="form-control" id="university" value="<?=$query[0]['univercity']?>" placeholder="Univercity"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Name Of Institute</label> <input type="text" name="insituite" class="form-control" id="insituite" value="<?=$query[0]['insituite']?>" placeholder="Insituite"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Main Subject</label> <input type="text" name="subject" class="form-control" id="subject" value="<?=$query[0]['subject']?>" placeholder="Subject"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Passing Year</label> <input type="text" name="passing_year" class="form-control" id="passing_year" value="<?=$query[0]['passing_year']?>" placeholder="Passing Year"> </div> <div class="col-12 col-lg-3"> <label for="Address" class="form-label">Percentage (%)</label> <input type="text" name="percentage" class="form-control" id="percentage" value="<?=$query[0]['percentage']?>" placeholder="Percentage"> </div> <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> <center><button type="submit" name="save" class="btn btn-primary px-5">Save</button></center> </div> </div> </form> </div> </div> </div> </div> </div> </div> <style> .card { border: 0 solid transparent; margin-bottom: 1.5rem; box-shadow: 0 2px 6px 0 rgb(218 218 253 / 65%), 0 2px 6px 0 rgb(206 206 238 / 54%); } .card { --bs-card-spacer-y: 1rem; --bs-card-spacer-x: 1rem; --bs-card-title-spacer-y: 0.5rem; --bs-card-title-color: ; --bs-card-subtitle-color: ; --bs-card-border-width: var(--bs-border-width); --bs-card-border-color: var(--bs-border-color-translucent); --bs-card-border-radius: var(--bs-border-radius); --bs-card-box-shadow: ; --bs-card-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width))); --bs-card-cap-padding-y: 0.5rem; --bs-card-cap-padding-x: 1rem; --bs-card-cap-bg: rgba(var(--bs-body-color-rgb), 0.03); --bs-card-cap-color: ; --bs-card-height: ; --bs-card-color: ; --bs-card-bg: var(--bs-body-bg); --bs-card-img-overlay-padding: 1rem; --bs-card-group-margin: 0.75rem; position: relative; display: flex; flex-direction: column; min-width: 0; height: var(--bs-card-height); word-wrap: break-word; background-color: var(--bs-card-bg); background-clip: border-box; border: var(--bs-card-border-width) solid var(--bs-card-border-color); border-radius: var(--bs-card-border-radius); } </style> <script> $(document).ready(function(){ $(".select2").select2({ containerCssClass: "error", dropdownCssClass: "test" }); //Pickup Address Form Start $( "#add_client_details" ).validate( { rules: { client_first_name: { required: true, minlength: 6 }, client_mobile_no:{ minlength: 10, maxlength: 12 }, client_email: { required: true, email: true }, password: { required: true, minlength: 8 }, client_address1: "required", client_city: "required", }, messages: { client_first_name: { required: "please enter a client first name", minlength: "enter a client first name must consist of at least 6 characters" }, client_last_name: { required: "please enter a client last name" }, client_mobile_no: { minlength: "your contact alter mobile number must consist of at least 10 digit number", maxlength: "your contact alter mobile number max 12 digit only allowed" }, password: { required: "please enter a password", minlength: "your password must consist of at least 8 digit" }, client_email: "Please enter a valid email address", client_address1: "please enter first address", }, submitHandler: function(form) { add_client_details(form); // alert('coming Soon'); } } ); function add_client_details(form){ console.log("Form Working"); $('#loader').show(); var formData = new FormData(form); $.ajax({ url: 'api/update_customer_details.php', type: 'post', dataType: 'json', data: formData, cache: false, contentType: false, processData: false, enctype: 'multipart/form-data', success: function (response) { console.log(response); if(response['error']==false){ $('#exampleExtraLargeModal').modal('hide'); $('#add_client_details').trigger("reset"); $('#loader').hide(); success(response['message']); }else{ $('#loader').hide(); warning(response['message']); } } }); } //Pickup Address Form End }); function pro_count_arrenge(){ var counts=2; $('.pro_count').each(function(){ $(this).text(counts) ; counts++; }); } </script> <script> $(document).ready(function(){ get_subcategory(); get_district(); }); $("#category_id").change(function () { get_subcategory(); }); $("#state_id").change(function () { get_district(); }); function get_subcategory(){ $('#subcategory').empty(); var category_id = $('#category_id').val(); var subcat = $('#subcat').val(); $.ajax({ url: 'api/get-subcategory-api.php', type: 'post', dataType: 'json', data: {type:'get_subcategory',category_id:category_id}, success: function (response) { console.log(response); console.log(subcat); if(response['error']==false){ var m=''; for(var n=0;n<response['data'].length;n++){ if(response['data'][n]['id']==subcat){ m+='<option value='+response['data'][n]['id']+' selected>'+response['data'][n]['name']+'</option>'; }else{ m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['name']+'</option>'; } } $('#subcategory').append(m); $('#subcategory').trigger('change'); }else{ var m='<option value="">No Subcategory Found</option>'; $('#subcategory').append(m); } } }); } function get_district(){ $('#district_id').empty(); var state_id = $('#state_id').val(); var district = $('#district').val(); $.ajax({ url: 'api/get-district-api.php', type: 'post', dataType: 'json', data: {type:'get_district',state_id:state_id}, success: function (response) { console.log(response); if(response['error']==false){ var m=''; for(var n=0;n<response['data'].length;n++){ if(response['data'][n]['id']==district){ m+='<option value='+response['data'][n]['id']+' selected>'+response['data'][n]['district_name']+'</option>'; }else{ m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['district_name']+'</option>'; } } $('#district_id').append(m); }else{ var m='<option value="">No District Found</option>'; $('#district_id').append(m); } } }); } </script> <?php include('footer.php'); ?>