*/ get_header(); ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', 'page'); } // end of the loop. ?> <?php $post = isset($_POST['massages']) ? htmlspecialchars(nl2br(trim($_POST['massages']))) : null; if ($post) { $data = array('content' => $post); $rs = DBExt::insertByArray("ls_contact_msg", $data); if ($rs) { echo '<script>showRs();</script>'; } } ?> <?php get_sidebar(); get_footer(); ?>
static function saveCategory($data, $id = 0) { if (!$data) { return false; } self::init(); if (!$id) { if (!isset($data['name'])) { return false; } return DBExt::insertByArray(self::$category_table, $data); } else { $condition = array("id" => $id); return DBExt::updateByArray(self::$category_table, $condition, $data); } }