From 178c35bd63f95b6e9dc46936a98aa7e1c1f26f40 Mon Sep 17 00:00:00 2001 From: goujonpa <goujonpa@gmail.com> Date: Wed, 18 Jun 2014 17:11:34 +0200 Subject: [PATCH] datefield - begin --- class/datefield.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 class/datefield.php diff --git a/class/datefield.php b/class/datefield.php new file mode 100644 index 0000000..b2fe5a7 --- /dev/null +++ b/class/datefield.php @@ -0,0 +1,27 @@ +<?php +{ + public function html() { + $html = '<div class = "form-group"> + <label for = "form'.$this->name.'"> + <input type = "date" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + </label> + </div>'; + return $html; + } + + public function validate() + { + + /*if (isset($_POST[$this->name])) + { + $_POST[$this->name] = htmlspecialchars($_POST[$this->name]); + if (preg_match("#^0[1-68]([-. ]?[0-9]{2}){4}$#", $_POST[$this->name])) + { + $this->value = $_POST[$this->name]; + return true; + } + */ + return false; + } + +} -- GitLab