function main() { $action = ReadGETString('action', ''); switch ($action) { case 'add_category': AddCategory(); break; case 'delete_category': DeleteCategory(); break; case 'list_categories': ListCategories(); break; case 'rename_category': RenameCategory(); break; default: $json_out['status'] = 'fail'; $json_out['error_code'] = 'Unrecognized action'; echo json_encode($json_out); break; } }
<label for="callapp_checkbox_' . $aRow[$hidden] . '"></label> </div>'; } } $data['aaData'][] = $row; } break; case 'save_category': $cat_id = $_REQUEST['id']; $par_id = $_REQUEST['parent_id']; $ubani = $_REQUEST['ubani']; $branch_id = $_REQUEST['branch_id']; $cat_name = htmlspecialchars($_REQUEST['cat'], ENT_QUOTES); if ($cat_name != '' && $cat_id == '') { if (!CheckCategoryExist($cat_name, $par_id)) { AddCategory($cat_name, $par_id, $branch_id); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $par_id, $branch_id); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; default: $error = 'Action is Null'; } $data['error'] = $error;
EditCategory($catid); break; case "DelCategory": DelCategory($cat); break; case "YesDelCategory": YesDelCategory($catid); break; case "NoMoveCategory": NoMoveCategory($catid, $newcat); break; case "SaveEditCategory": SaveEditCategory($catid, $title); break; case "AddCategory": AddCategory(); break; case "SaveCategory": SaveCategory($title); break; case "DisplayStory": displayStory($qid); break; case "PreviewAgain": previewStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $members, $Mmembers, $deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur); break; case "PostStory": if (!$date_debval) { if (strlen($deb_day) == 1) { $deb_day = "0{$deb_day}"; }
$row[] = $aRow[$i]; if ($i == $count - 1) { $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; } } $data['aaData'][] = $row; } break; case 'save_category': $cat_id = $_REQUEST['id']; $par_id = $_REQUEST['par_id']; $hint = $_REQUEST['hint']; $cat_name = htmlspecialchars($_REQUEST['cat'], ENT_QUOTES); if ($cat_name != '' && $cat_id == '') { if (!CheckCategoryExist($cat_name, $par_id)) { AddCategory($cat_name, $par_id, $hint); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $par_id, $hint); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; case 'get_tree': $page = GetTree(); $data = array('page' => $page); break;
echo "<input type=\"hidden\" name=\"search\" id=\"search\" class=\"hidden\" value=\"" . $search_parameter . "-" . $search_value . "\" /> \n"; if ($_POST['btn-add-recipe'] == "Save Changes") { $category_id = $_POST['category_id']; $array_category_id = $_POST['array_category_id']; $category_name = $_POST['category_name']; $category_active = $_POST['category_active']; $category_visibility = $_POST['category_visibility']; $validate_name = $_get->validateCategoryNameCheck($category_name); $get_name = $_get->validateCategoryName($category_name); if (empty($category_id)) { if ($validate_name['rows'] > 0) { $category_name_check = $category_name . "-1"; } else { $category_name_check = $category_name; } AddCategory($category_name_check, $category_active, $category_visibility); } else { if ($validate_name['rows'] > 0) { if ($get_name['category_name'] == $category_name) { $category_name_check = $get_name['category_name']; } else { $category_name_check = $category_name . "-1"; } } else { $category_name_check = $category_name; } UpdateCategory($category_name_check, $category_active, $category_visibility, $category_id); } } else { if ($_POST['btn-add-recipe'] == "Delete") { $validate = validateCategory($category_id);
$row[] = '<div class="callapp_checkbox"> <input type="checkbox" id="callapp_checkbox_' . $aRow[$hidden] . '" name="check_' . $aRow[$hidden] . '" value="' . $aRow[$hidden] . '" class="check" /> <label for="callapp_checkbox_' . $aRow[$hidden] . '"></label> </div>'; } } $data['aaData'][] = $row; } break; case 'save_category': $cat_id = $_REQUEST['id']; $par_id = $_REQUEST['par_id']; $cat_name = htmlspecialchars($_REQUEST['cat'], ENT_QUOTES); if ($cat_name != '' && $cat_id == '') { if (!CheckCategoryExist($cat_name, $par_id)) { AddCategory($cat_name, $par_id); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $par_id); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; default: $error = 'Action is Null'; } $data['error'] = $error;
$pltext = $pltype ? __('Post layout') : __('Signature'); AddPage('layout', $pltext); AddCategory('layout', 'postlayout', $pltext); if ($pltype) { AddField('layout', 'postlayout', 'postheader', __('Post header'), 'textarea', array('rows' => 16)); } AddField('layout', 'postlayout', 'signature', __('Signature'), 'textarea', array('rows' => 16)); AddField('layout', 'postlayout', 'signsep', __('Show signature separator'), 'checkbox', array('negative' => true)); // TODO make a per-user permission for this one? if ($pltype == 2) { AddField('layout', 'postlayout', 'fulllayout', __('Apply layout to whole post box'), 'checkbox'); } } // EDITPROFILE TAB -- THEME --------------------------------------------------- AddPage('theme', __('Theme')); AddCategory('theme', 'theme', __('Theme')); AddField('theme', 'theme', 'theme', '', 'themeselector'); //Allow plugins to add their own fields $bucket = "editprofile"; include BOARD_ROOT . "lib/pluginloader.php"; $_POST['actionsave'] = isset($_POST['actionsave']) ? $_POST['actionsave'] : ''; /* QUERY PART * ---------- */ $failed = false; if ($_POST['actionsave']) { // catch spamvertisers early if (time() - $user['regdate'] < 300 && preg_match('@^\\w+\\d+$@', $user['name'])) { $lolbio = strtolower($_POST['bio']); if ((substr($lolbio, 0, 7) == 'http://' || substr($lolbio, 0, 12) == '[url]http://' || substr($lolbio, 0, 12) == '[url=http://') && (substr($_POST['email'], 0, strlen($user['name'])) == $user['name'] || substr($user['name'], 0, 6) == 'iphone')) { Query("UPDATE {users} SET primarygroup={0}, title={1} WHERE id={2}", Settings::get('bannedGroup'), 'Spamvertising', $loguserid);
if (isset($_POST["deletecoment"])) { $sth = $mysqli->prepare("DELETE FROM Comments WHERE id = ?"); $sth->bind_Param("i", $_POST["deletecoment"]); $sth->execute(); $_SESSION["list"] = $tmpl['mainAdmin']; } else { if ($_POST["selectoption"] == "Категории") { // list_of_categ($mysqli, $tmpl['list_categ_admin'], $tmpl['search']); } else { if ($_POST['DeleteCategory']) { DeleteCategory($mysqli, $_POST['select_name_category2']); $_SESSION["list"] = $tmpl['mainAdmin']; } else { if ($_POST['AddCategory']) { AddCategory($mysqli, $_POST['new_categ'], $_POST['select_name_category1']); $_SESSION["list"] = $tmpl['mainAdmin']; } else { if ($_POST["selectoption"] == "Пользователи") { list_users($mysqli, $tmpl['usersAdmin']); } else { if ($_POST['selectedUser']) { SelectUser($mysqli, $_POST['selectuser'], $tmpl['user_admin']); } else { if ($_POST['DeleteUser']) { DeleteUser($mysqli); $_SESSION["list"] = $tmpl['mainAdmin']; } else { if ($_POST['ChangeUser']) { ChangeUser($mysqli, $_POST['group_user'], $_POST['block']); $_SESSION["list"] = $tmpl['mainAdmin'];
$row[] = $aRow[$i]; if ($i == $count - 1) { $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; } } $data['aaData'][] = $row; } break; case 'save_category': $cat_id = $_REQUEST['id']; $image = $_REQUEST['img']; $checked = $_REQUEST['ch']; $cat_name = htmlspecialchars($_REQUEST['cat'], ENT_QUOTES); if ($cat_name != '' && $cat_id == '') { if (!CheckCategoryExist($cat_name, $cat_id)) { AddCategory($cat_name, $image, $checked); global $log; $log->setInsertLog('production_category'); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $image, $checked); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; case 'delete_image': $cat_id = $_REQUEST['id'];
<?php /** * Created by PhpStorm. * User: Hoan * Date: 10/28/2015 * Time: 12:50 AM * Thêm mới danh mục sản phẩm. */ //Khởi động session session_start(); //Kiểm tra nếu chưa đăng nhập thì quay về trang đăng nhập if (!isset($_SESSION['user'])) { header('location:../user/login.php'); } require '../../configs/config.php'; require '../../libraries/connect.php'; require '../../models/category.php'; date_default_timezone_set('Asia/Ho_Chi_Minh'); if ($_POST) { $data = array('name' => $_POST['name'], 'status' => isset($_POST['status']) ? 1 : 0, 'created' => date('Y-m-d H:i:s'), 'modified' => date('Y-m-d H:i:s')); if (AddCategory($data)) { $_SESSION['success'] = true; //header('location:add.php'); } } require '../../views/category/v_add.php';
function working($dd) { //echo "stringstringstringstringstringstringstringstring"; //var_dump($dd); $total = json_decode($dd, 1); if ($total['order'] == 'Insert') { if ($total['type'] == 'TEACHER') { ////////// AddTEACHER($total['data']); } else { if ($total['type'] == 'CLASS') { /////////////// AddCLASS($total['data']); } else { if ($total['type'] == 'IN') { AddIN($total['data']); } else { if ($total['type'] == 'OUT') { AddOUT($total['data']); } else { if ($total['type'] == 'USER') { /////////////////// AddUSER($total['data']); } else { if ($total['type'] == 'ROLE') { /////////////// AddRole($total['data']); } else { if ($total['type'] == 'SUP') { AddSupplier($total['data']); } else { if ($total['type'] == 'CUS') { AddCustomer($total['data']); } else { if ($total['type'] == 'CAT') { AddCategory($total['data']); } else { if ($total['type'] == 'UNIT') { AddUnit($total['data']); } else { if ($total['type'] == 'SKU') { AddSKU($total['data']); } else { if ($total['type'] == 'DEPT') { AddDepartment($total['data']); } else { if ($total['type'] == 'TRANSFER') { AddTRANSFER($total['data']); } else { echo "<<< DATA CAN'T BE INSERTED Please send an existing type!!! >>>"; } } } } } } } } } } } } } } else { if ($total['order'] == 'Fetch') { if ($total['type'] == 'PRICE') { FetchPrice($total['data']); } else { if ($total['type'] == 'INV') { FetchItemINV($total['data']); } else { if ($total['type'] == 'WH') { FetchItemWH($total['data']); } else { if ($total['type'] == 'USER') { FetchItemUser($total['data']); } else { if ($total['type'] == 'STOCK') { //var_dump($total['data']); FetchStock($total['data']); } else { if ($total['type'] == 'SUP') { ItemSupplier($total['data']); } else { echo "<<< DATA CAN'T BE INSERTED Please send an existing type!!! >>>"; } } } } } } } else { if ($total['order'] == 'Delete') { if ($total['type'] == 'INV') { DeleteINV($total['data']); } else { if ($total['type'] == 'WH') { DeleteWH($total['data']); } else { if ($total['type'] == 'USER') { DeleteUser($total['data']); } else { echo "<<< DATA CAN'T BE INSERTED Please send an existing type!!! >>>"; } } } } else { if ($total['order'] == 'Update') { if ($total['type'] == 'INV') { UpdateINV($total['data']); } else { if ($total['type'] == 'WH') { UpdateWH($total['data']); } else { if ($total['type'] == 'USER') { UpdateUser($total['data']); } else { echo "<<< DATA CAN'T BE INSERTED Please send an existing type!!! >>>"; } } } } else { if ($total['order'] == 'FetchAllNames') { if ($total['type'] == 'ROLE') { /////////////////// FetchAllNamesROLE(); } if ($total['type'] == 'CAT') { FetchAllNamesCAT(); } if ($total['type'] == 'UNIT') { FetchAllNamesUNIT(); } if ($total['type'] == 'PACk') { FetchAllNamesPACK(); } if ($total['type'] == 'INV_TYPE') { FetchAllNamesINV_TYPE(); } if ($total['type'] == 'CUS') { FetchAllNamesCUS(); } if ($total['type'] == 'SUP') { FetchAllNamesSUP(); } if ($total['type'] == 'DEPT') { FetchAllNamesDEPT(); } } else { if ($total['order'] == 'FetchAllIds') { if ($total['type'] == 'ROLE') { //////////////////// FetchAllIdsROLE(); } if ($total['type'] == 'RM') { FetchAllIdsRM(); } if ($total['type'] == 'INV') { FetchAllIdsINV(); } if ($total['type'] == 'INV_TYPE') { FetchAllIdsInvType(); } if ($total['type'] == 'PACK') { FetchAllIdsPACK(); } if ($total['type'] == 'SUP') { FetchAllIdsSUP(); } if ($total['type'] == 'CUS') { FetchAllIdsCUS(); } if ($total['type'] == 'DEPT') { FetchAllIdsDEPT(); } } else { if ($total['order'] == 'FetchAllAdmins') { FetchAllAdmins(); } else { if ($total['order'] == 'List') { if ($total['type'] == 'INV') { ListINV(); } else { if ($total['type'] == 'USER') { ListUser(); } else { if ($total['type'] == 'STOCK') { ListStock(); } else { if ($total['type'] == 'WH') { ListWH(); } else { if ($total['type'] == 'INV_WH') { ListINV_WH($total['data']); } else { if ($total['type'] == 'WH_INV') { ListWH_INV($total['data']); } else { if ($total['type'] == 'SUP') { ListSUP($total['data']); } else { if ($total['type'] == 'INV_SUP') { ListINV_SUP($total['data']); } else { if ($total['type'] == 'SUP_INV') { ListSUP_INV($total['data']); } else { if ($total['type'] == 'BINS') { ListBINS($total['data']); } } } } } } } } } } } else { if ($total['order'] == 'Value') { if ($total['type'] == 'WH') { ValueWH($total['data']); } else { if ($total['type'] == 'INV') { ValueINV($total['data']); } } } else { if ($total['order'] == 'Test') { if ($total['type'] == 'DATE') { TestDate(); } else { if ($total['type'] == 'BIN') { BinMap($total['data']); } else { if ($total['type'] == 'ItemLevel') { ItemLevel($total['data']); } } } } else { if ($total['order'] == 'FetchId') { if ($total['type'] == 'WH') { FetchIDWH($total['data']); } if ($total['type'] == 'CAT') { FetchIDCAT($total['data']); } if ($total['type'] == 'UNIT') { FetchIDUNIT($total['data']); } if ($total['type'] == 'ROLE') { /////////////////// FetchIDROLE($total['data']); } if ($total['type'] == 'INV_TYPE') { FetchIDINV_TYPE($total['data']); } if ($total['type'] == 'SUP') { FetchIDSUP($total['data']); } if ($total['type'] == 'PACK') { FetchIDPACK($total['data']); } if ($total['type'] == 'CUS') { FetchIDCUS($total['data']); } if ($total['type'] == 'DEPT') { FetchIDDEPT($total['data']); } } elseif ($total['order'] == 'login') { $recivedArray = $total['data']; //echo "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"; login($recivedArray['username'], $recivedArray['password']); } else { if ($total['order'] == 'logout') { //echo "Logout"; logout1(); } else { if ($total['order'] == 'authenticate') { authenticate(); } else { //Not Logged In Case OR Not Have required Privliges{ response("OK", 'fail', array('alertBox' => "Please Login First !")); } } } } } } } } } } } } } }
$row[] = $aRow[$i]; if ($i == $count - 1) { $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; } } $data['aaData'][] = $row; } break; case 'save_category': $cat_id = $_REQUEST['id']; $par_id = $_REQUEST['par_id']; $departament_id = $_REQUEST['departament_id']; $cat_name = htmlspecialchars($_REQUEST['cat'], ENT_QUOTES); if ($cat_name != '' && $cat_id == '') { if (!CheckCategoryExist($cat_name, $par_id)) { AddCategory($cat_name, $par_id, $departament_id); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $par_id, $departament_id); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; default: $error = 'Action is Null'; } $data['error'] = $error;