<?php
require 'classes/gump.class.php';
require_once 'classes/fun_class.php';
$obj = new Function();
if (isset($_POST['addCms'])) {
if (isset($_POST['cmsCatDes'])) {
$cmsCatDes = $_POST['cmsCatDes'];
} else {
$cmsCatDes = NULL;
}
$data = array(
'Description' => $_POST['cmsCatDes']
);
$rules = array(
'Description' => 'required|max_len,3000|min_len,50',
);
$validated = GUMP::is_valid($data, $rules);
if ($validated === true) {
$res = $obj->addCms($cmsCatDes);
//echo $res;
} else {
$error = $validated;
//print_r($validated);
}
}
?>
<form class="user" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<div class="form-group">
<label class="col-md-6">Description</label>
<textarea id="editor" class="form-control selector" rows="10" name="cmsCatDes" placeholder="CMS Description"></textarea>
</div>
<input class="btn btn-primary" type="submit" value="Submit" name="addCms">
</form>