public function addAction() { $post = new Criteria("post"); $is_public = 0; if (isset($_POST["is_public"])) { $is_public = 1; } $post->insert(array("title" => "\"{$_POST['title']}\"", "content" => "\"{$_POST['content']}\"", "is_public" => $is_public, "created_at" => "NOW()")); Core::redir("./?r=blog/index"); }
public function addAction() { $criteria = new Criteria("person"); $criteria->insert(array("no" => "\"{$_POST['no']}\"", "name" => "\"{$_POST['name']}\"", "lastname" => "\"{$_POST['lastname']}\"", "job" => "\"{$_POST['job']}\"", "phone1" => "\"{$_POST['phone1']}\"", "phone2" => "\"{$_POST['phone2']}\"", "address1" => "\"{$_POST['address1']}\"", "address2" => "\"{$_POST['address2']}\"", "email1" => "\"{$_POST['email1']}\"", "email2" => "\"{$_POST['email2']}\"", "team_id" => "\"{$_POST['team_id']}\"", "category_id" => "\"{$_POST['category_id']}\"", "created_at" => "NOW()")); Core::redir("./?r=team/open&id={$_POST['sucursal_id']}"); }
<?php if (!empty($_POST)) { include "admin/app/autoload.php"; include "admin/app/models/TeamData.php"; include "admin/app/models/PersonData.php"; $criteria = new Criteria("item"); $criteria->insert(array("fullname" => "\"{$_POST['fullname']}\"", "phone" => "\"{$_POST['phone']}\"", "address" => "\"{$_POST['address']}\"", "kind" => "\"{$_POST['kind']}\"", "team_id" => "\"{$_POST['team_id']}\"", "msg" => "\"{$_POST['msg']}\"", "created_at" => "NOW()")); print "<script>alert(\"Mensaje enviado exitosamente.\");</script>"; Core::redir("./"); }
public function addcatAction() { $criteria = new Criteria("category"); $criteria->insert(array("name" => "\"{$_POST['name']}\"")); Core::redir("./?r=index/categories"); }