header("Location:lighttest_list.php?cat=" . $_REQUEST['cat'] . "&light=" . $_REQUEST['light']); exit; } } else { if ($_REQUEST['mode'] == 'e') { //listing $objLightTest = new LightTest($id); $light_id = $objLightTest->LightId; $dark_text = $objLightTest->DarkText; $light_text = $objLightTest->LightText; $rgba_value = $objLightTest->RgbaValue; $rgba_value_right = $objLightTest->RgbaValueRight; $image_file_dark = $objLightTest->ImageFileDark; $image_file_light = $objLightTest->ImageFileLight; $background_image_file = $objLightTest->BackgroundImageFile; $path = $objLightTest->GetPath(); } else { if ($_REQUEST['mode'] == 'a') { $light_id = $_REQUEST["light"]; } } } include "includes/pagetemplate.php"; function PageContent() { global $id; global $light_id; global $dark_text; global $light_text; global $rgba_value; global $rgba_value_right;
function PageContent() { global $objLight; ?> <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: 'lighttest_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] = 'Light'; $aLinks[2] = 'light_list.php&cat=' . $_REQUEST['cat']; $aLabels[3] = 'Light Test List'; $aList[3] = ''; echo Helpers::CreateBreadCrumbs($aLabels, $aLinks); ?> <div class="bigbotspace flex-container space-between"> <p class="larger auto heading">Light Tests</p> <a href="lighttest_admin.php?cat=<?php echo $_REQUEST['cat']; ?> &light=<?php echo $objLight->Id; ?> " class="button_link"><button class="">Add New Light Test</button></a> </div> </div> <div class="layout"> <table class="tablestyle" id="list_table"> <thead> <tr> <th>ID</th> <td>Test Image</th> <th>Dark Image</th> <th>Light Image</th> <th class="mid">Order</th> <th class="mid">Actions</th> </tr> </thead> <tbody> <?php $objLightTest = new LightTest(); $oLightTest = $objLightTest->getAllLightTestByLightId($objLight->Id); foreach ($oLightTest as $lighttest) { echo '<tr id="img_' . $lighttest->Id . '">' . PHP_EOL; echo '<td>' . $lighttest->Id . '</td>' . PHP_EOL; echo '<td><img src="/' . $objLightTest->GetPath() . $lighttest->BackgroundImageFile . '" style="max-width: 100px;" /></td>' . PHP_EOL; echo '<td><img src="/' . $objLightTest->GetPath() . $lighttest->ImageFileDark . '" style="max-width: 200px;" /></td>' . PHP_EOL; echo '<td><img src="/' . $objLightTest->GetPath() . $lighttest->ImageFileLight . '" 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="lighttest_admin.php?cat=' . $_REQUEST['cat'] . '&light=' . $_REQUEST['light'] . '&id=' . $lighttest->Id . '"><img src="img/edit-icon.png" /></a> <a href="lighttest_delete.php?cat=' . $_REQUEST['cat'] . '&light=' . $_REQUEST['light'] . '&id=' . $lighttest->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL; echo '</tr>' . PHP_EOL; } ?> </tbody> </table> </div> <!-- layout --> <?php }
<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 echo $oLight[0]->OverviewText; ?> </p> </div> <?php $iCnt = 0; foreach ($oLightTest as $lighttest) { $iCnt++; echo '<div class="test-' . $iCnt . '">' . PHP_EOL; echo ' <div class="light-test-container">' . PHP_EOL; echo ' <div class="light-test-left col-sm-12" style="background-image: url(' . $objLightTest->GetPath() . $lighttest->BackgroundImageFile . ');">' . PHP_EOL; //echo ' <div id="draggable" class="dragger" style="background-color: rgba(' . $lighttest->RgbaValue . ');"><img class="handle" src="assets/img/handle.png" alt="handle"></div>' . PHP_EOL; echo ' <div id="draggable' . $iCnt . '" class="ui-draggable" style="position: relative; left: 0px; top: 0px;">'; echo ' <div class="dragger-left" style="background-color: rgba(' . $lighttest->RgbaValue . ');"></div>'; echo ' <img class="handle" src="assets/img/handle.png" alt="handle">'; echo ' <div class="dragger-right" style="background-color: rgba(' . $lighttest->RgbaValueRight . ');"></div>' . PHP_EOL; echo ' </div>' . PHP_EOL; echo ' </div>' . PHP_EOL; echo ' <div class="befor-after-container">' . PHP_EOL; echo ' <div class="col-sm-6">' . PHP_EOL; echo ' <img src="/' . $objLightTest->GetPath() . $lighttest->ImageFileDark . '" alt="Dark">' . PHP_EOL; echo ' <p>' . $lighttest->DarkText . '</p>' . PHP_EOL; echo ' </div> ' . PHP_EOL; echo ' <div class="col-sm-6">' . PHP_EOL; echo ' <img src="' . $objLightTest->GetPath() . $lighttest->ImageFileLight . '" alt="Light">' . PHP_EOL; echo ' <p>' . $lighttest->LightText . '</p>' . PHP_EOL;