Ejemplo n.º 1
0
function PageContent()
{
    ?>
    
            <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] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading">Light</p>
                    <!--
                    <a href="category_admin.php" class="button_link"><button class="">Add New Light</button></a>
                    -->
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Overview Text</th>
                            <th>Images</th>
                            <th>Tests</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objLight = new Light();
    $oLight = $objLight->GetAllLightByCategoryId($_REQUEST['cat']);
    $objLightImage = new LightImage();
    $objLightTest = new LightTest();
    foreach ($oLight as $light) {
        echo '<tr id="img_' . $light->Id . '">' . PHP_EOL;
        echo '<td>' . $light->Id . '</td>' . PHP_EOL;
        echo '<td>' . substr($light->OverviewText, 0, 200) . '</td>' . PHP_EOL;
        echo '<td>(<a href="lightimage_list.php?cat=' . $_REQUEST['cat'] . '&light=' . $light->Id . '">' . $objLightImage->getCountLightImageByLightId($light->Id) . '</a>)</td>' . PHP_EOL;
        echo '<td>(<a href="lighttest_list.php?cat=' . $_REQUEST['cat'] . '&light=' . $light->Id . '">' . $objLightTest->getCountLightTestByLightId($light->Id) . '</a>)</td>' . PHP_EOL;
        echo '<td class="mid"><a href="light_admin.php?cat=' . $_REQUEST['cat'] . '&id=' . $light->Id . '"><img src="img/edit-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
Ejemplo n.º 2
0
        header("Location:lightimage_list.php?cat=" . $_REQUEST['cat'] . "&light=" . $_REQUEST['light']);
        exit;
    } else {
        // update
        $obj = new LightImage($id);
        $obj->update();
        $obj->handleFileUploads();
        $obj->handleDropFileUploads($aDropFields[0], 'ImageFile');
        // redirect to listing list
        header("Location:lightimage_list.php?cat=" . $_REQUEST['cat'] . "&light=" . $_REQUEST['light']);
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objLightImage = new LightImage($id);
        $light_id = $objLightImage->LightId;
        $image_file = $objLightImage->ImageFile;
        $path = $objLightImage->GetPath();
    } else {
        if ($_REQUEST['mode'] == 'a') {
            $light_id = $_REQUEST["light"];
        }
    }
}
include "includes/pagetemplate.php";
function PageContent()
{
    global $id;
    global $light_id;
    global $image_file;
Ejemplo n.º 3
0
<?php

session_start();
if (!isset($_SESSION['sessCategory'])) {
    header('Location: index.php');
    exit;
}
include_once 'inc/classes/Light.php';
include_once 'inc/classes/LightImage.php';
include_once 'inc/classes/LightTest.php';
include_once 'inc/classes/Technology.php';
include_once 'inc/classes/Category.php';
$objLight = new Light();
$oLight = $objLight->getAllLightByCategoryId($_SESSION['sessCategory']);
$objTechnology = new Technology(3);
$objLightImage = new LightImage();
$oLightImage = $objLightImage->getAllLightImageByLightId($oLight[0]->Id);
$objLightTest = new LightTest();
$oLightTest = $objLightTest->getAllLightTestByLightId($oLight[0]->Id);
$objCategory = new Category($_SESSION['sessCategory']);
$bgcolor = "#F40000";
// Coke red default
if ($objCategory->BackgroundColor != "") {
    $bgcolor = $objCategory->BackgroundColor;
}
$background = $bgcolor . " none repeat scroll 0% 0%";
// this is used in single-product-template.php
?>
<!DOCTYPE html>
<html lang="en">
<head>
Ejemplo n.º 4
0
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: 'lightimage_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 Image List';
    $aList[3] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading">Light Images</p>
                    <a href="lightimage_admin.php?cat=<?php 
    echo $_REQUEST['cat'];
    ?>
&light=<?php 
    echo $objLight->Id;
    ?>
" class="button_link"><button class="">Add New Light 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 
    $objLightImage = new LightImage();
    $oLightImage = $objLightImage->getAllLightImageByLightId($objLight->Id);
    foreach ($oLightImage as $lightimage) {
        echo '<tr id="img_' . $lightimage->Id . '">' . PHP_EOL;
        echo '<td>' . $lightimage->Id . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $objLightImage->GetPath() . $lightimage->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="lightimage_admin.php?cat=' . $_REQUEST['cat'] . '&light=' . $_REQUEST['light'] . '&id=' . $lightimage->Id . '"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="lightimage_delete.php?cat=' . $_REQUEST['cat'] . '&light=' . $_REQUEST['light'] . '&id=' . $lightimage->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
$page_title = "";
$id = $_REQUEST['id'];
// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    $objLightImage = new LightImage($id);
    $objLight = new Light($objLightImage->LightId);
    header("Location:lightimage_list.php?cat=" . $_REQUEST['cat'] . "&light=" . $objLight->Id);
    exit;
}
if ($_POST['commit'] == "Delete Light Image") {
    $objLightImage = new LightImage($id);
    $objLight = new Light($objLightImage->LightId);
    $objLightImage->Delete($id);
    header("Location:lightimage_list.php?cat=" . $_REQUEST['cat'] . "&light=" . $objLight->Id);
    exit;
}
$objLightImage = new LightImage($id);
$objLight = new Light($objLightImage->LightId);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objLightImage;
    global $objLight;
    global $id;
    ?>