include "../inc/classes/Category.php"; include "../inc/classes/Helpers.php"; if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'sort') { $objItemPresentation = new ItemPresentation(); $objItemPresentation->SortValues(substr($_REQUEST['action'], 1), substr($_REQUEST['action'], 0, 1)); unset($objItem); } elseif (isset($_REQUEST['dragsort'])) { // handle drag sort ajax request: $objItemPresentation = new ItemPresentation($_REQUEST['id']); $new_sort_order = $_REQUEST['idx'] * 10 + 5; if ($new_sort_order > $objItemPresentation->SortOrder) { $new_sort_order += 10; // increasing sort order so must add another 10 } $objItemPresentation->SortOrder = $new_sort_order; $objItemPresentation->update(); echo "success"; exit; // just exit since this is an ajax request } $objCategory = new Category($_REQUEST['cat']); $objItem = new Item($_REQUEST['item']); include "includes/pagetemplate.php"; function PageContent() { global $objCategory; global $objItem; ?> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
if ($id == 0) { // insert $obj = new ItemPresentation(); $obj->ItemId = $_REQUEST["item"]; $obj->ItemPresentationName = $_REQUEST["item_presentation_name"]; $obj->create(); $obj->handleFileUploads(); $obj->handleDropFileUploads($aDropFields[0], 'ItemPresentationThumbnailUrl'); // redirect to listing list header("Location:itempresentation_list.php?cat=" . $_REQUEST['cat'] . "&item=" . $_REQUEST['item']); exit; } else { // update $obj = new ItemPresentation($id); $obj->ItemPresentationName = $_REQUEST["item_presentation_name"]; $obj->update(); $obj->handleFileUploads(); $obj->handleDropFileUploads($aDropFields[0], 'ItemPresentationThumbnailUrl'); // redirect to listing list header("Location:itempresentation_list.php?cat=" . $_REQUEST['cat'] . "&item=" . $_REQUEST['item']); exit; } } else { if ($_REQUEST['mode'] == 'e') { //listing $objItemPresentation = new ItemPresentation($id); $item_id = $objItemPresentation->ItemId; $item_presentation_name = $objItemPresentation->ItemPresentationName; $item_presentation_thumbnail_url = $objItemPresentation->ItemPresentationThumbnailUrl; $path = $objItemPresentation->GetPath(); } else {