This commit is contained in:
sriramv 2021-01-05 10:35:33 +05:30
parent 3b9b4ab36d
commit 1ce7da4f8d
9 changed files with 62 additions and 14 deletions

View File

@ -66,7 +66,7 @@ class Donor_controller extends BaseController
$rules=[
'name' =>'required|min_length[3]|max_length[30]',
'phone' =>'required|min_length[3]|max_length[10]',
'email' =>'required|min_length[6]|max_length[50]|valid_email|is_unique[donar_management.email]',
'email' =>'required|min_length[6]|max_length[50]|valid_email|is_unique[user_management.email]',
'pan' =>'required|min_length[3]|max_length[20]',
'address' =>'required|min_length[3]|max_length[70]',
'pin_code' =>'required|min_length[6]|max_length[6]',

View File

@ -14,7 +14,41 @@ class My_controller extends BaseController
$this->Dashboard_model = new Dashboard_model();
}
// public function donor_register() {
// helper(['form', 'url']);
// $input = $this->validate([
// 'name' =>'required|min_length[3]|max_length[20]',
// 'phone' =>'required|min_length[3]|max_length[10]',
// 'email' =>'required|min_length[6]|max_length[50]|valid_email|is_unique[donar_management.email]',
// 'pan' =>'required|min_length[3]|max_length[20]',
// 'address' =>'required|min_length[3]|max_length[70]',
// 'country' =>'required',
// 'state' =>'required',
// 'city' =>'required',
// 'pin_code' =>'required|min_length[6]|max_length[6]',
// 'date_of_birth' =>'required|min_length[3]|max_length[20]',
// 'gender' =>'required',
// 'org_name' =>'required|min_length[3]|max_length[20]',
// 'gstin' =>'required|min_length[3]|max_length[20]',
// ]);
// $formModel = new FormModel();
// if (!$input) {
// echo view('contact_form', [
// 'validation' => $this->validator
// ]);
// } else {
// $formModel->save([
// 'name' => $this->request->getVar('name'),
// 'email' => $this->request->getVar('email'),
// 'phone' => $this->request->getVar('phone'),
// ]);
// return $this->response->redirect(site_url('/submit-form'));
// }
// }
@ -22,7 +56,7 @@ class My_controller extends BaseController
{
$data['country']=$this->Dashboard_model->fetch_country();
helper(['form']);
helper(['form', 'url']);
if(!session()->has('logged_user'))
{
return redirect()->to(base_url());
@ -44,15 +78,14 @@ class My_controller extends BaseController
'city' =>'required',
'pin_code' =>'required|min_length[6]|max_length[6]',
'date_of_birth' =>'required|min_length[3]|max_length[20]',
'gender' =>'required|min_length[3]|max_length[20]',
'gender' =>'required',
'org_name' =>'required|min_length[3]|max_length[20]',
'gstin' =>'required|min_length[3]|max_length[20]',
];
if(! $this->validate($rules))
{
$data['validation'] = $this->validator;
$data['validation'] = $this->validator;
//echo '<script>alert("Please import correct file, did not match excel sheet column")</script>';
}else{
$Address_model = new Address_model();
@ -194,6 +227,8 @@ class My_controller extends BaseController
}
//--------------------------------------------------------------------
}

View File

@ -343,7 +343,7 @@ $(document).ready(function(){
<div class="name">PinCode</div>
<div class="value">
<div class="input-group">
<input class="input--style-5" type="text" name="pin_code" id="pin_code">
<input class="input--style-5" type="text" name="pin_code" id="pin_code" value="<?= set_value('pin_code') ?>">
</div>
</div>
</div>
@ -389,17 +389,24 @@ $(document).ready(function(){
</div>
</div>
<div class="form-row">
<div class="name">
<?php $validation = \Config\Services::validation(); ?>
<?php if(isset($validation)): ?>
<div class="alert alert-danger" role="aler">
<div class='alert alert-danger mt-2'>
<?= $validation->listErrors() ?>
</div>
<?php endif; ?>
</div>
</div>
<!--- <?php if($validation->getError('phone')) {?>
<div class='alert alert-danger mt-2'>
<?= $error = $validation->getError('phone'); ?>
</div>
<?php }?>---->
</div>
<div>

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609821938;_ci_previous_url|s:40:"http://localhost/donation/donor_register";logged_user|s:1:"3";

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609821140;_ci_previous_url|s:40:"http://localhost/donation/donor_register";logged_user|s:1:"3";

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609822667;_ci_previous_url|s:40:"http://localhost/donation/donor_register";logged_user|s:1:"3";

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609820338;_ci_previous_url|s:32:"http://localhost/donation/signup";

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609823015;_ci_previous_url|s:26:"http://localhost/donation/";

View File

@ -0,0 +1 @@
__ci_last_regenerate|i:1609822987;_ci_previous_url|s:40:"http://localhost/donation/donor_register";logged_user|s:1:"3";