public function run() { try { $form = new form(); $form->post('new_email')->val('is_email', '', 'Please enter a valid email address'); $form->post('new_user')->val('minlength', 5, 'Username is too short')->val('maxlength', 15, 'now it\'s too long!'); $form->post('new_pass')->val('minlength', 7, 'password is too short'); $to_check = $form->fetch('new_pass'); $form->post('new_pass_check')->val('confirm', $to_check, 'passwords do not match bruvnaar'); $form->submit(); $data = $form->fetch(); $this->model->createUser($data); } catch (Exception $e) { session::set('error_message', $e->getMessage()); header('Location: ../register'); } }
public function subVal() { try { $form = new form(); $form->post('name')->val('minlength', 2)->val('maxlength', 20)->post('password')->val('minlength', 1)->val('maxlength', 20)->post2('password', 'passwordConfirm')->val('samepass', 'password', 'passwordConfirm'); $form->mit(); $data = $form->fetch(); $this->editSave($_SESSION['userId']); } catch (Exception $e) { $str = $form->mit2(); $this->view->ValError = $str; $this->edit(); } }
public function emailValidation() { try { $form = new form(); $form->post('email')->val('minlength', 5)->val('emailExist'); $form->mit(); $data = $form->fetch(); return $data['email']; // print_r($data); // $this->view->render('signup/reset'); } catch (Exception $e) { $str = $form->mit2(); $this->view->ValError = $str; // $this->view->render('signup/reset'); } }
public function update() { try { $form = new form(); $form->post('email')->val('minlength', 5)->val('subExist')->post('notify'); $form->mit(); $data = $form->fetch(); $this->model->updateEmail($data); $this->view->ValError2 = 'Email options successfully updated!'; header('location: ' . URL . 'email?email=' . $data['email']); // $this->view->render('email/index'); } catch (Exception $e) { $str = $form->mit2(); $this->view->ValError = $str; $this->view->render('email/index'); } }
function addNew_exec() { $response_array = array(); try { $form = new form(); $form->post('comp_name')->val('Individual / Company Name', 'minlength')->post('comp_reg_no')->post('comp_address')->val('Address', 'minlength')->post('comp_postcode')->val('Poscode', 'minlength')->post('comp_state')->val('State', 'minlength')->post('state_other')->val('State', 'minlength')->post('comp_country')->val('Country', 'minlength')->post('comp_phone1')->val('Phone 1', 'minlength')->post('comp_phone2')->post('comp_fax')->post('website')->post('category')->val('Category', 'minlength')->post('tag')->val('Keyword Tag', 'minlength')->post('desc')->val('Description', 'minlength')->post('salutation')->val('Salutation', 'minlength')->post('p_fullname')->val('Fullname', 'minlength')->post('p_pos')->post('p_phone')->post('p_mobile')->val('Mobile No.', 'minlength')->post('p_gender')->val('Gender', 'minlength')->post('comp_email')->val('Email', 'minlength')->post('regdate'); $form->submit(); $data = $form->fetch(); $result = $this->model->addNew_exec($data); $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
function forgotPass() { $response_array = array(); try { $form = new form(); $form->post('email')->val('Email', 'email'); $form->submit(); $data = $form->fetch(); $result = $this->model->forgotPass_exec($data); $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
public function run() { try { $form = new form(); $form->post('username')->val('asci_check', '', 'No strange characters mind..'); $form->post('password'); if (isset($_POST['remember'])) { $form->post('remember'); } $form->submit(); $data = $form->fetch(); //print_r($data);die; $this->model->link($data); } catch (Exception $e) { $_SESSION = array(); $_SESSION['errors'] = $e->getMessage(); header('Location: ../login'); } }
function exec() { $response_array = array(); try { $form = new form(); $form->post('name')->val('Name', 'minlength')->post('email')->val('Email', 'email')->post('phone')->post('message')->val('Message', 'minlength'); $form->submit(); $data = $form->fetch(); $result = $this->model->exec($data); if ($result['r'] == 'true') { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } else { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
function exec() { $response_array = array(); try { $form = new form(); $form->post('salutation')->val('Salutation', 'minlength')->post('fullname')->val('Fullname', 'minlength')->post('username')->val('Username', 'minlength')->post('dob')->val('Date Of Birth', 'minlength')->post('email')->val('Email', 'minlength')->post('cemail')->val('Confirm Email', 'minlength')->post('acc_type')->val('Account Type', 'minlength')->post('subscribe')->post('chkusername')->post('dt_join')->post('sponsor_id')->val('Refferal ID', 'minlength'); $form->submit(); $data = $form->fetch(); $result = $this->model->join_exec($data); if ($result['r'] == 'true') { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } else { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
function savePayment() { $response_array = array(); try { $form = new form(); $form->post('agent_id')->post('payment_for')->post('ads_pin')->post('payment_date')->val('Payment Date', 'minlength')->post('payment_time')->val('Payment Time', 'minlength')->post('from_acc')->val('From Account', 'minlength')->post('to_acc')->val('To Account', 'minlength')->post('payment_type')->val('Payment Type', 'minlength')->post('ref')->post('amount')->val('Amount', 'minlength')->val('Amount', 'digit')->post('payment_price')->post('date_submit'); $form->submit(); $data = $form->fetch(); $result = $this->model->savePayment($data); if ($result['r'] == 'true') { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } else { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
function withdrawal_exec() { $response_array = array(); try { $form = new form(); $form->post('agent_id')->post('bank_name')->val('Bank Name', 'minlength')->post('acc_no')->val('Account No.', 'digit')->post('holder_name')->val('Bank Holder Name', 'minlength')->post('amount')->val('Amount', 'minlength')->post('password')->val('Password', 'minlength')->post('date_request'); $form->submit(); $data = $form->fetch(); $result = $this->model->withdrawal_exec($data); if ($result['r'] == 'true') { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } else { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
public function addagent_exec() { $response_array = array(); try { $form = new form(); $form->post('acc_type')->val('Account Type', 'minlength')->post('sponsor_id')->val('Sponsor ID', 'minlength')->post('lv1')->val('Upline ID', 'minlength')->post('salutation')->val('Salutation', 'minlength')->post('fullname')->val('Fullname', 'minlength')->post('ic_no')->val('IC Number', 'digit')->post('dob')->val('Date Of Birth', 'minlength')->post('address')->val('Mailing Address', 'minlength')->post('country')->val('Country', 'minlength')->post('states')->post('gender')->val('Gender', 'minlength')->post('phone')->post('mobile')->val('Mobile', 'minlength')->post('username')->val('Username', 'minlength')->post('chkusername')->post('email')->val('Email', 'minlength')->post('cemail')->val('Confirm Email', 'minlength')->post('lv2')->post('lv3')->post('lv4')->post('lv5')->post('lv6')->post('lv7')->post('lv8')->post('lv9')->post('lv10')->post('dt_join')->post('subscribe'); $form->submit(); $data = $form->fetch(); $result = $this->model->addagent_exec($data); if ($result['r'] == 'true') { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } else { $response_array['r'] = $result['r']; $response_array['msg'] = $result['msg']; } } catch (Exception $e) { $response_array['r'] = 'false'; $response_array['msg'] = $e->getMessage(); } echo json_encode($response_array); }
<?php require '../libs/form.php'; require '../libs/val.php'; if (isset($_REQUEST['run'])) { try { $form = new form(); $form->post('name')->val('minlength', 4)->post('age')->val('digit')->post('gender'); $form->submit(); $data = $form->fetch(); echo '<pre>'; print_r($data); echo '</pre>'; } catch (Exception $ex) { echo $ex->getMessage(); } } ?> <form method="POST" action="?run"> <label>Name :</label><input type="text" name="name" /> <label>Age :</label><input type="text" name="age" /> <label>Gender :</label> <select name="gender"> <option value="male">Male</option> <option value="female">Female</option> </select> <input type="submit" value="Submit" /> </form>