} if ($customeradd['post_building'] != '' && $customeradd['post_street'] == '') { $error['post_street'] = trans('Street name required!'); } if ($customeradd['post_apartment'] != '' && $customeradd['post_building'] == '') { $error['post_building'] = trans('Building number required!'); } if ($customeradd['ten'] != '' && !check_ten($customeradd['ten']) && !isset($customeradd['tenwarning'])) { $error['ten'] = trans('Incorrect Tax Exempt Number! If you are sure you want to accept it, then click "Submit" again.'); $customeradd['tenwarning'] = 1; } if ($customeradd['ssn'] != '' && !check_ssn($customeradd['ssn']) && !isset($customeradd['ssnwarning'])) { $error['ssn'] = trans('Incorrect Social Security Number! If you are sure you want to accept it, then click "Submit" again.'); $customeradd['ssnwarning'] = 1; } if ($customeradd['icn'] != '' && !check_icn($customeradd['icn'])) { $error['icn'] = trans('Incorrect Identity Card Number!'); } if ($customeradd['regon'] != '' && !check_regon($customeradd['regon'])) { $error['regon'] = trans('Incorrect Business Registration Number!'); } if ($customeradd['zip'] != '' && !check_zip($customeradd['zip']) && !isset($customeradd['zipwarning'])) { $error['zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $customeradd['zipwarning'] = 1; } if ($customeradd['post_zip'] != '' && !check_zip($customeradd['post_zip']) && !isset($customeradd['post_zipwarning'])) { $error['post_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $customeradd['post_zipwarning'] = 1; } if ($customeradd['pin'] == '') { $error['pin'] = trans('PIN code is required!');
} if ($customerdata['address'] == '') { $error['address'] = trans('Address required!'); } if ($customerdata['ten'] != '' && !check_ten($customerdata['ten']) && !isset($customerdata['tenwarning'])) { $error['ten'] = trans('Incorrect Tax Exempt Number! If you are sure you want to accept it, then click "Submit" again.'); $tenwarning = 1; } if ($customerdata['ssn'] != '' && !check_ssn($customerdata['ssn']) && !isset($customerdata['ssnwarning'])) { $error['ssn'] = trans('Incorrect Social Security Number! If you are sure you want to accept it, then click "Submit" again.'); $ssnwarning = 1; } if ($customerdata['regon'] != '' && !check_regon($customerdata['regon'])) { $error['regon'] = trans('Incorrect Business Registration Number!'); } if ($customerdata['icn'] != '' && !check_icn($customerdata['icn'])) { $error['icn'] = trans('Incorrect Identity Card Number!'); } if ($customerdata['zip'] != '' && !check_zip($customerdata['zip']) && !isset($customerdata['zipwarning'])) { $error['zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $zipwarning = 1; } if ($customerdata['post_zip'] != '' && !check_zip($customerdata['post_zip']) && !isset($customerdata['post_zipwarning'])) { $error['post_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $post_zipwarning = 1; } if ($customerdata['pin'] == '') { $error['pin'] = trans('PIN code is required!'); } elseif (!preg_match('/^[0-9]{4,6}$/', $customerdata['pin'])) { $error['pin'] = trans('Incorrect PIN code!'); }