public function setData($formType = '', $method = '') { $this->subCategory_name = Validate::validateInputVar('newsubcat', 'INPUT_POST', 'str'); $this->published = Validate::validateInputVar('published', 'INPUT_POST', 'int'); $this->category_id = Validate::validateInputVar('categoryid', 'INPUT_POST', 'int'); if (empty($this->published)) { $this->published = 1; } }
public function setData($formType = '', $method = 'INPUT_POST') { if ($formType === 'userUpdate') { $this->id = Validate::validateInputVar('id', $method, 'int'); $this->roleId = Validate::validateInputVar('roles', $method, 'int'); $this->fullName = Validate::validateInputVar('fullName', $method, 'str'); $this->setAddressesAndPhones(); } }
public function setData($formType = '', $method = '') { $newCat = Validate::validateInputVar('newcat', 'INPUT_POST', 'str'); if (Validate::validateValue($this->db, $this->table, 'category_name', $newCat)) { $this->category_name = $newCat; } $this->published = Validate::validateInputVar('published', 'INPUT_POST', 'int'); if (empty($this->published)) { $this->published = 1; } return !$this->category_name ? FALSE : TRUE; }
function setPostData($data) { $method = 'INPUT_POST'; foreach ($data as $k => $v) { if (is_array($v)) { foreach ($v as $subK => $subV) { foreach ($subV as $subSubK => $subSubV) { $this->data[$k][$subK][$subSubK] = filter_var($subSubV, FILTER_SANITIZE_STRING); } } } else { $type = $k === 'currentCategoryWidget' ? 'int' : 'str'; $this->data[$k] = Validate::validateInputVar($k, $method, $type); } } }
public function setData($formType = '', $method = '') { $arr = []; foreach ($_POST as $key => $val) { switch ($key) { case 'content': $arr[$key] = Validate::validateInputVar($key, 'INPUT_POST', 'html'); break; case 'id': $arr[$key] = Validate::validateInputVar($key, 'INPUT_POST', 'int'); break; default: $arr[$key] = Validate::validateInputVar($key, 'INPUT_POST', 'str'); } } $this->article = new Article($arr); }
public function setData($formType = '', $method = '') { $data = []; $method = 'INPUT_POST'; $data['basket'] = Basket::get(); $data['user_id'] = Validate::validateInputVar('user_id', $method, 'int'); $data['delivery_type'] = Validate::validateInputVar('delivery_type', $method, 'int'); $data['user_address'] = Validate::validateInputVar('user_address', $method, 'int'); $data['city'] = Validate::validateInputVar('city', $method, 'str'); $data['street'] = Validate::validateInputVar('street', $method, 'str'); $data['home'] = Validate::validateInputVar('home', $method, 'str'); $data['flat'] = Validate::validateInputVar('flat', $method, 'int'); $data['postal'] = Validate::validateInputVar('postal', $method, 'int'); $data['user_phone'] = Validate::validateInputVar('user_phone', $method, 'int'); $data['number'] = Validate::validateInputVar('number', $method, 'int'); $data['numType'] = Validate::validateInputVar('numType', $method, 'int'); $data['deliveryDate'] = Validate::validateInputVar('deliveryDate', $method, 'str'); $data['deliveryTime'] = Validate::validateInputVar('deliveryTime', $method, 'str'); $data['note'] = Validate::validateInputVar('note', $method, 'str'); $data['rememberAddress'] = Validate::validateInputVar('rememberAddress', $method, 'int'); $data['rememberPhone'] = Validate::validateInputVar('rememberPhone', $method, 'int'); $this->order = new Order($data); }
public static function setData(array $data, $method = 'POST') { foreach ($data as $k => $v) { $filter = $k === 'email' ? 'email' : 'str'; self::$data[$k] = Validate::validateInputVar($k, $method, $filter); } }
public function setData($formType = '', $method = '') { $method = 'INPUT_POST'; $this->cat = Validate::validateInputVar('cat', $method, 'int'); $this->subcat = Validate::validateInputVar('subcat', $method, 'int'); $this->title = Validate::validateInputVar('title', $method, 'str'); $this->description = Validate::validateInputVar('desc', $method, 'html'); $this->spec = Validate::validateInputVar('spec', $method, 'html'); $this->setBrand(Validate::validateInputVar('brand', $method, 'str')); $this->setColor(Validate::validateInputVar('color', $method, 'str')); $this->price = Validate::validateInputVar('price', $method, 'int'); $this->quantity = Validate::validateInputVar('quant', $method, 'int'); $this->published = Validate::validateInputVar('published', $method, 'int'); $this->id = Validate::validateInputVar('product_id', $method, 'int'); if (empty($this->published)) { $this->published = 0; } }
public function setData($formType = '', $method = 'INPUT_POST') { $this->login = Validate::validateInputVar('username', $method, 'str'); $this->password = Validate::validateInputVar('pass', $method, 'str'); $this->remember = Validate::validateInputVar('remember', $method, 'int'); if ($formType === 'reg' || $formType === 'registration') { $this->fullName = Validate::validateInputVar('fullName', $method, 'str'); $this->email = Validate::validateInputVar('email', $method, 'email'); $this->photo = $_FILES['photo']['name']; $this->validateKey = Generator::generate(10); $this->path = Path::USERIMG_UPLOAD_DIR; $this->dpassword = Validate::validateInputVar('dpass', $method, 'str'); $this->setAddressesAndPhones(); return $this->password === $this->dpassword ? TRUE : FALSE; } }
public function SearchProductAction() { header('Content-type: application/json; charset=utf-8'); header('Cache-Control: no-store, no-cache'); header('Expires: ' . date('r')); $text = Validate::validateInputVar('text', 'INPUT_GET', 'str'); $model = new ProductTableModel(); $model->setTable('product'); $model->readAllRecords('id, title', "WHERE title LIKE '%{$text}%'"); echo json_encode($model->getAllRecords()); }