function editapply() { $this->load->library('m_security'); $this->m_security->filterPost('termid', 'required'); $this->m_security->filterPost('editname', 'required'); if ($this->m_security->startPost() == TRUE) { $termid = $this->input->post('termid', TRUE); $name = $this->input->post('editname', TRUE); $slug = $this->input->post('editslug', TRUE); $parent = $this->input->post('editparent', TRUE); $desc = $this->input->post('editdescription', TRUE); $proses = updateCategory($termid, $name, $slug, $desc, $parent); if ($proses == TRUE) { redirect(base_url(roleURIUser() . 'content/category'), 'refresh'); } else { redirect(base_url(roleURIUser() . 'content/category'), 'refresh'); } } else { redirect(base_url(roleURIUser() . 'content/category'), 'refresh'); } }
<?php if ($_POST) { $id = post("id"); $name = post("name"); updateCategory($id, $name); } if ($_GET) { $id = get("id"); $category = getCategory($id); } ?> <div class="row"> <div class="col-lg-12"> <h3 class="">Edit Category #<?php echo $id; ?> </h3> <hr/> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-6"> <form method="POST" action=""> <input type="hidden" name="id" value="<?php echo $category["id"]; ?>
} $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; switch ($op) { case 'new': formCategory(); break; case 'edit': formCategory(1); break; case 'save': saveCategory(); break; case 'saveedit': saveCategory(1); break; case 'delete': deleteCategory(); break; case 'update': updateCategory(); break; case 'active': activeCategory(1); break; case 'desactive': activeCategory(); break; default: showCategories(); break; }
XSRFdefender('update'); $obj = new ZenpageCategory(sanitize($_GET['titlelink'])); $obj->setShow(sanitize_numeric($_GET['publish'])); $obj->save(); } if (isset($_GET['save'])) { XSRFdefender('save_categories'); addCategory($reports); } if (isset($_GET['id'])) { $x = $_zp_zenpage->getCategory(sanitize_numeric($_GET['id'])); $result = new ZenpageCategory($x['titlelink']); } else { if (isset($_GET['update'])) { XSRFdefender('update_categories'); $result = updateCategory($reports); } else { $result = new ZenpageCategory(''); } } printAdminHeader('news', 'categories'); zp_apply_filter('texteditor_config', '', 'zenpage'); printSortableHead(); zenpageJSCSS(); ?> <script type="text/javascript"> //<!-- <![CDATA[ var deleteCategory = "<?php echo gettext("Are you sure you want to delete this category? THIS CANNOT BE UNDONE!"); ?> ";
getProduct(intval($r), $s); break; case 'addProduct': addProduct(intval($r)); break; case 'removeProduct': removeProduct(intval($r)); break; case 'addDosage': addDosage(intval($r)); break; case 'removeDosage': removeDosage(intval($r)); break; case 'updateCategory': updateCategory(intval($r), $s); break; case 'updateProduct': updateProduct(intval($r), $s, $t); break; case 'updateDosage': updateDosage(intval($r), $s, $t); break; case 'updateCompound': updateCompound(intval($r), $s, $t); break; case 'uploadPhoto': uploadPhoto(intval($r), $s); break; default: return false;
$params = getParamsFromCategory(); if ($params == null) { header("Location: 403.php"); return; } if (count($params) == 0) { header("Location: 403.php"); return; } $category = getCategoryFromCategoryId($params['category_id']); if ($category == null) { header("Location: 403.php"); return; } if (isset($_POST['submit'])) { updateCategory($category); } ?> <!DOCTYPE html> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="http://getbootstrap.com/assets/ico/favicon.ico"> <title>Deal Finder</title> <!-- Bootstrap core CSS -->
if (isset($_GET['hitcounter'])) { XSRFdefender('hitcounter'); $x = $_zp_CMS->getCategory(sanitize_numeric($_GET['id'])); $obj = newCategory($x['titlelink']); $obj->set('hitcounter', 0); $obj->save(); } if (isset($_GET['publish'])) { XSRFdefender('update'); $obj = newCategory(sanitize($_GET['titlelink'])); $obj->setShow(sanitize_numeric($_GET['publish'])); $obj->save(); } if (isset($_GET['save'])) { XSRFdefender('save_categories'); updateCategory($reports, true); } /* * Here we should restart if any action processing has occurred to be sure that everything is * in its proper state. But that would require significant rewrite of the handling and * reporting code so is impractical. Instead we will presume that all that needs to be restarted * is the CMS object. */ $_zp_CMS = new CMS(); printAdminHeader('news', 'categories'); zp_apply_filter('texteditor_config', 'zenpage'); printSortableHead(); zenpageJSCSS(); ?> <script type="text/javascript"> //<!-- <![CDATA[
//checking whether admin logged in or not. $categoryid = $url_arr[3]; if ($_POST) { $categoryname = htmlentities($_POST['categoryname'], ENT_QUOTES); $category_url = htmlentities($_POST['permalink'], ENT_QUOTES); $category_img = htmlentities($_POST['imglink'], ENT_QUOTES); $categoryicon = htmlentities($_POST['imglink'], ENT_QUOTES); $categoryid = $url_arr[3]; $queryString = "select * from coupons_category where category_name = '{$categoryname}' and category_id<>'{$categoryid}'"; $resultSet = mysql_query($queryString); if (mysql_num_rows($resultSet) > 0) { set_response_mes(-1, $admin_language['categorynameexist']); $redirect_url = DOCROOT . 'edit/category/' . $categoryid . '/'; url_redirect($redirect_url); } else { updateCategory($categoryname, $category_url, $categoryid, $category_img, $categoryicon); set_response_mes(1, $admin_language['changesmodified']); $redirect_url = DOCROOT . 'manage/category/'; url_redirect($redirect_url); } } ?> <script type="text/javascript"> /* validation */ $(document).ready(function(){ $("#form_editcategory").validate();}); </script> <?php $queryString = "select * from coupons_category where category_id='" . $categoryid . "'"; $resultSet = mysql_query($queryString);
if (isset($_REQUEST['id'])) { $id = $_REQUEST['id']; } if (isset($_REQUEST['name'])) { $name = $_REQUEST['name']; } if (isset($_REQUEST['description'])) { $description = $_REQUEST['description']; } if (isset($_REQUEST['type'])) { $type = $_REQUEST['type']; } if (isset($_REQUEST['target'])) { $target = $_REQUEST['target']; } updateCategory($name, $id, $description, $target, $type); break; case "move_category": $oldid = ''; $newid = ''; $type = ''; if (isset($_REQUEST['oldid'])) { $oldid = $_REQUEST['oldid']; } if (isset($_REQUEST['newid'])) { $newid = $_REQUEST['newid']; } if (isset($_REQUEST['type'])) { $type = $_REQUEST['type']; } moveCategory($type, $oldid, $newid);
$pathParts = trim(isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/', '/'); $pathParts = explode('/', $pathParts); switch ($pathParts[0]) { //2 case 'category': switch ($_SERVER['REQUEST_METHOD']) { case 'GET': if (empty($pathParts[1])) { echo getCategories(); } else { echo getCategory($pathParts[1]); } break; case 'POST': postCategory(); break; case 'DELETE': if (empty($pathParts[1])) { echo "you can delete everthing!!"; } else { deleteCategories($pathParts[1]); } break; case 'UPDATE': if (isset($pathParts[1])) { updateCategory($pathParts[1], $_POST); } } break; } //2
</head> <body> <?php require_once '../../includes/session-start.php'; require_once '../../includes/access-required.html.php'; include_once '../../functions/dbConn.php'; include_once '../../functions/categoryFunctions.php'; include_once '../../functions/productsFunctions.php'; include_once '../../functions/until.php'; $categories = getAllCategories(); $results = ''; if (isPostRequest()) { $category_id = filter_input(INPUT_POST, 'category_id'); $category = filter_input(INPUT_POST, 'category'); updateCategory($category_id, $category); if (updateCategory($category_id, $category) == true) { $results = 'Category updated'; } else { $results = 'Category was not updated'; } } ?> <center> <h1>Update Category</h1><br/> <form method="post" action="#"> <div class="form-group"> <select name="category_id"> <?php foreach ($categories as $row) {
$res = addRate('destinations', $val, $db); break; case 'kb': $res = addRate('search', $val, $db); break; case 'kw': $res = addRate('keywords', $val, $db); break; case 'pg': $res = addRate('pages', $val, $db); break; case 'cp': $res = updateCategory($val, '+1', $db); break; case 'cm': $res = updateCategory($val, '-1', $db); break; } if ($res) { echo 'OK'; } else { echo json_encode($db->errorInfo()); } break; case 'get_data': if (isset($get['index'])) { $index = $get['index']; if (strpos($index, '.json') === false) { $index = $index . '.json'; } $fn = DATA . $index;
<title></title> <link href="../../css/bootstrap.min.css" rel="stylesheet"> </head> <body> <?php require_once '../../includes/session-start.req-inc.php'; require_once '../../includes/access-required.html.php'; include_once '../../functions/dbconnect.php'; include_once '../../functions/category_functions.php'; include_once '../../functions/util.php'; $categories = getAllCategories(); if (isPostRequest()) { $newCategory = filter_input(INPUT_POST, 'newCategory'); $oldCategoryID = filter_input(INPUT_POST, 'category_id'); if (isValidCategory($newCategory)) { if (updateCategory($newCategory, $oldCategoryID)) { $results = 'Category updated'; } else { $results = 'Category was not updated'; } } else { $results = 'Category is not valid'; } } ?> <h1>Update Category</h1> <?php include '../../includes/results.html.php';
$category_title = $_POST['category_title']; if (empty(trim($category_title))) { $insert_error_message = "Category title can not be empty"; } else { insertCategory($category_title); $insert_success_message = "Category created successfully"; } } /** UPDATE CATEGORY **/ if (isset($_POST['submit_edit_category'])) { $category_id = $_POST['category_id']; $new_category_title = $_POST['category_title']; if (empty(trim($new_category_title))) { $update_error_message = "Category title can not be empty"; } else { updateCategory($category_id, $new_category_title); $update_success_message = "Category updated successfully"; } } /** DELETE CATEGORY **/ if (isset($_GET['delete'])) { $category_id = $_GET['delete']; deleteCategory($category_id); } ?> <div id="wrapper"> <?php require "includes/admin_navigation.php"; ?>
<?php include "admin_table_tabs.php"; ?> <form id="adminCatForm" action="admin_cat.php" method="post"> <div class="adminTable_C"> <div id="adminCat_C" class="adminCat_C"> <?php include_once 'Brain/field_const.php'; include_once 'Brain/functions.php'; include_once 'Brain/Category.php'; regPost('catNo', 'catName', 'newCatNo', 'newCatName', 'newCatParent', 'dels'); if (isset($catNo)) { //from post method $size = sizeof($catNo); for ($i = 0; $i < $size; $i++) { updateCategory($catNo[$i], $catName[$i]); } } if (isset($newCatNo)) { $catNoTable = array(); foreach ($newCatNo as $i => $v) { if ($newCatNo[$i] == "") { continue; } $nCatParent = $newCatParent[$i]; if ($nCatParent[0] != 'C') { $nCatParent = $catNoTable[$nCatParent]; } $newIndex = addCategory($newCatName[$i], $nCatParent); $catNoTable[$newCatNo[$i]] = $newIndex; }
?> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> </head> <body> <?php require_once '../../includes/session-start.req-inc.php'; require_once '../../includes/access-required.html.php'; $id = filter_input(INPUT_GET, 'id'); $category = ""; if (isPostRequest()) { $category = filter_input(INPUT_POST, 'category'); $message = updateCategory($category, $id); } else { $category = specificCategory($id); } ?> <h1> Update data for <?php echo $category; ?> </h1> <p> <?php if (isset($message)) { echo $message; } ?>