// update $obj = new ColorImage($id); $obj->update(); $obj->handleFileUploads(); $obj->handleDropFileUploads($aDropFields[0], 'ImageFile'); // redirect to listing list header("Location:colorimage_list.php?cat=" . $_REQUEST['cat'] . "&color=" . $_REQUEST['color']); exit; } } else { if ($_REQUEST['mode'] == 'e') { //listing $objColorImage = new ColorImage($id); $color_id = $objColorImage->ColorId; $image_file = $objColorImage->ImageFile; $path = $objColorImage->GetPath(); } else { if ($_REQUEST['mode'] == 'a') { $color_id = $_REQUEST["color"]; } } } include "includes/pagetemplate.php"; function PageContent() { global $id; global $color_id; global $image_file; global $path; global $aDropFields; global $aDropFieldTypes;
</ul> </div> <div class="col-sm-9 technology-content"> <h1><?php echo $objTechnology->TechnologyHeadline; ?> </h1> <div class="overview active-item"> <div id="tech-single" class="carousel slide" data-ride="carousel"> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <?php $cClass = ' active'; foreach ($oColorImage as $colorimage) { echo '<div class="item' . $cClass . ' slider-container">' . PHP_EOL; echo ' <img class="featured-img" src="/' . $objColorImage->GetPath() . $colorimage->ImageFile . '" />' . PHP_EOL; echo '</div>' . PHP_EOL; $cClass = ''; } ?> </div> </div> <div class="slider-controls"> <a class="slider-prev col-sm-5" href="#tech-single" role="button" data-slide="prev"> <img src="assets/img/arrow-toggle.png" alt="arrow"> </a> <a class="slider-next col-sm-5" href="#tech-single" role="button" data-slide="next"> <img src="assets/img/arrow-toggle.png" alt="arrow"> </a> </div> <p class="tech-description"><?php
function PageContent() { global $objColor; ?> <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> <script type="text/javascript"> $(document).ready(function() { // fix to preserve width of cells var fixHelper = function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }; var saveIndex = function(e, ui) { //alert("New position: " + ui.item.index()); //alert("Image Id: " + ui.item.attr("id")); id = ui.item.attr("id").replace("img_", ""); $.ajax({ url: 'colorimage_list.php', data: { dragsort: 1, idx: ui.item.index(), id: id }, type: 'POST', dataType: 'html', success: function (data) { //alert("done"); }, error: function (xhr, status) { alert('Sorry, there was a problem!'); } }); }; // end saveIndex $("#list_table tbody").sortable({ helper: fixHelper, stop: saveIndex }).disableSelection(); }); // end document.ready </script> <style> .icon-resize-vertical:hover { cursor:grab; } </style> <div class="layout center-flex"> <?php $aLabels = array(); $aLinks = array(); $aLabels[0] = 'Home'; $aLinks[0] = 'mainpage.php'; $aLabels[1] = 'Category List'; $aLinks[1] = 'category_list.php'; $aLabels[2] = 'Color List'; $aLinks[2] = 'color_list.php?cat=' . $_REQUEST['cat']; $aLabels[3] = 'Color Image List'; $aList[3] = ''; echo Helpers::CreateBreadCrumbs($aLabels, $aLinks); ?> <div class="bigbotspace flex-container space-between"> <p class="larger auto heading">Color Images</p> <a href="colorimage_admin.php?cat=<?php echo $_REQUEST['cat']; ?> &color=<?php echo $objColor->Id; ?> " class="button_link"><button class="">Add New Color Image</button></a> </div> </div> <div class="layout"> <table class="tablestyle" id="list_table"> <thead> <tr> <th>ID</th> <th>Image</th> <th class="mid">Order</th> <th class="mid">Actions</th> </tr> </thead> <tbody> <?php $objColorImage = new ColorImage(); $oColorImage = $objColorImage->getAllColorImageByColorId($objColor->Id); foreach ($oColorImage as $colorimage) { echo '<tr id="img_' . $colorimage->Id . '">' . PHP_EOL; echo '<td>' . $colorimage->Id . '</td>' . PHP_EOL; echo '<td><img src="/' . $objColorImage->GetPath() . $colorimage->ImageFile . '" style="max-width: 200px;" /></td>' . PHP_EOL; echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL; echo '<td class="mid"><a href="colorimage_admin.php?cat=' . $_REQUEST['cat'] . '&color=' . $_REQUEST['color'] . '&id=' . $colorimage->Id . '"><img src="img/edit-icon.png" /></a> <a href="colorimage_delete.php?color=' . $_REQUEST['color'] . '&id=' . $colorimage->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL; echo '</tr>' . PHP_EOL; } ?> </tbody> </table> </div> <!-- layout --> <?php }