Example #1
0
 public function Insert()
 {
     global $obj, $model;
     include_once 'Model/category.php';
     $model = new Category();
     if (isset($_POST['btnSubmit'])) {
         foreach ($_POST as $key => $value) {
             try {
                 $model->{$key} = $value;
             } catch (Exception $ex) {
             }
         }
         if ($model->Insert()) {
             print '<span class="success">Category Created</span>';
             $model = new Category();
         } else {
             print '<span class="error">' . $model->Error . '</span>';
         }
     }
     include_once 'View/Category/insert.php';
 }