added active field for news submission in template & controller to simplify workflow

This commit is contained in:
xisi 2014-10-17 20:21:28 -04:00
parent 939cb805c8
commit 3068155f37
2 changed files with 5 additions and 0 deletions

View File

@ -88,6 +88,7 @@ class News extends Base {
if (empty($aData['header'])) return false;
if (empty($aData['content'])) return false;
if (!is_int($account_id)) return false;
if (@$aData['active']) $active = true;
$stmt = $this->mysqli->prepare("INSERT INTO $this->table (account_id, header, content, active) VALUES (?,?,?,?)");
if ($stmt && $stmt->bind_param('issi', $account_id, $aData['header'], $aData['content'], $active) && $stmt->execute())
return true;

View File

@ -18,6 +18,10 @@
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
<input type="hidden" name="do" value="add">
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
<div class="form-group">
<label>Active</label>
<input type="checkbox" class="switch" data-size="mini" name="data[active]" value="1" checked>
</div>
<div class="form-group">
<label>Header</label>
<input class="form-control" size="30" type="text" name="data[header]" required />