diff --git a/skel/pages/add().php b/skel/pages/add().php index f810ab1..74ca427 100644 --- a/skel/pages/add().php +++ b/skel/pages/add().php @@ -1,12 +1,18 @@ - -$ = DB::selectPairs('select ``,`` from ``'); + +$ = DB::selectPairs('select ``,`` from ``'); if ($_SERVER['REQUEST_METHOD']=='POST') { $data = $_POST; - - if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!$data['']['']) $errors['[]']=' must be filled'; + + + if (!$data['']['']) $data['']['']=null; + if (!isset($errors)) { $id = DB::insert('INSERT INTO `` () VALUES ()', ); if ($id) { diff --git a/skel/pages/add(admin).phtml b/skel/pages/add(admin).phtml index 258f81b..293ade5 100644 --- a/skel/pages/add(admin).phtml +++ b/skel/pages/add(admin).phtml @@ -2,21 +2,21 @@

New

- -
- - - + +
+ + + - - + + - e(isset($errors['[]'])?$errors['[]']:''); ?> + e(isset($errors['[]'])?$errors['[]']:''); ?>
diff --git a/skel/pages/edit($id).php b/skel/pages/edit($id).php index 399eebf..d68991c 100644 --- a/skel/pages/edit($id).php +++ b/skel/pages/edit($id).php @@ -1,12 +1,18 @@ - -$ = DB::selectPairs('select ``,`` from ``'); + +$ = DB::selectPairs('select ``,`` from ``'); if ($_SERVER['REQUEST_METHOD']=='POST') { $data = $_POST; - - if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!$data['']['']) $errors['[]']=' must be filled'; + + + if (!$data['']['']) $data['']['']=null; + if (!isset($errors)) { $rowsAffected = DB::update('UPDATE `` SET WHERE `id`=?', , $id); if ($rowsAffected!==false) { diff --git a/skel/pages/edit(admin).phtml b/skel/pages/edit(admin).phtml index 45f012b..38e666d 100644 --- a/skel/pages/edit(admin).phtml +++ b/skel/pages/edit(admin).phtml @@ -2,21 +2,21 @@

Edit

- -
- - - + +
+ + + - - + + - e(isset($errors['[]'])?$errors['[]']:''); ?> + e(isset($errors['[]'])?$errors['[]']:''); ?>
diff --git a/skel/pages/index(admin).phtml b/skel/pages/index(admin).phtml index bd94b69..9d79d83 100644 --- a/skel/pages/index(admin).phtml +++ b/skel/pages/index(admin).phtml @@ -2,8 +2,8 @@ - + @@ -14,8 +14,8 @@ foreach ($data as $row): ?> - + diff --git a/skel/pages/view($id).php b/skel/pages/view($id).php index 2460598..3f4feb6 100644 --- a/skel/pages/view($id).php +++ b/skel/pages/view($id).php @@ -1,5 +1,5 @@ $data = DB::selectOne('select * from `` where `id`=?',$id); - -$ = DB::selectPairs('select ``,`` from ``'); + +$ = DB::selectPairs('select ``,`` from ``'); \ No newline at end of file diff --git a/skel/pages/view(admin).phtml b/skel/pages/view(admin).phtml index 914284e..b634b6c 100644 --- a/skel/pages/view(admin).phtml +++ b/skel/pages/view(admin).phtml @@ -2,17 +2,17 @@

View

- +
- -
+ +
-
+
- -
e($[$data['']['']]);?>
+ +
e($[$data['']['']]);?>
-
e($data['']['']);?>
+
e($data['']['']);?>
e($[$row['']['']]);?> e($row['']['']);?>