function PageContent()
{
    global $objTechnology;
    global $objTechnologyInfo;
    ?>
    
        <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: 'technologyinfoimage_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] = 'Technology';
    $aLinks[2] = 'technology_list.php?cat=' . $_REQUEST['cat'];
    $aLabels[3] = $objTechnology->TechnologyName;
    $aLinks[3] = 'technologyinfo_list.php?cat=' . $_REQUEST['cat'] . '&tech=' . $_REQUEST['tech'];
    $aLabels[4] = 'Technology Info Images';
    $aLinks[4] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading"><?php 
    echo $objTechnology->TechnologyName;
    ?>
</p>
                    <a href="technologyinfoimage_admin.php?cat=<?php 
    echo $_REQUEST['cat'];
    ?>
&tech=<?php 
    echo $_REQUEST['tech'];
    ?>
&techinfo=<?php 
    echo $_REQUEST['techinfo'];
    ?>
" class="button_link"><button class="">Add New Technology Info Image</button></a>
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Image</th>
                            <th>Ordering</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objTechnologyInfoImage = new TechnologyInfoImage();
    $oTechnologyInfoImage = $objTechnologyInfoImage->getAllTechnologyInfoImageByTechnologyInfoId($_REQUEST['techinfo']);
    foreach ($oTechnologyInfoImage as $techinfoimage) {
        echo '<tr id="img_' . $techinfoimage->Id . '">' . PHP_EOL;
        echo '<td>' . $techinfoimage->Id . '</td>' . PHP_EOL;
        echo '<td>';
        if ($techinfoimage->TechnologyInfoImageUrl != '') {
            echo substr($techinfoimage->TechnologyInfoImageUrl, 0, 200);
        }
        echo '</td>' . PHP_EOL;
        echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="technologyinfoimage_admin.php?cat=' . $_REQUEST['cat'] . '&tech=' . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo'] . '&id=' . $techinfoimage->Id . '"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="technologyinfoimage_delete.php?cat=' . $_REQUEST['cat'] . '&tech=' . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo'] . '&id=' . $techinfoimage->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
    exit;
}
if ($_POST['commit'] == "Save Technology Info Image") {
    if ($id == 0) {
        // insert
        $obj = new TechnologyInfoImage();
        $obj->TechnologyInfoId = $_REQUEST["techinfo"];
        $obj->create();
        $obj->handleFileUploads();
        $obj->handleDropFileUploads($aDropFields[0], 'TechnologyInfoImageUrl');
        // redirect to listing list
        header("Location:technologyinfoimage_list.php?cat=" . $_REQUEST['cat'] . "&tech=" . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo']);
        exit;
    } else {
        // update
        $obj = new TechnologyInfoImage($id);
        $obj->update();
        $obj->handleFileUploads();
        $obj->handleDropFileUploads($aDropFields[0], 'TechnologyInfoImageUrl');
        // redirect to listing list
        header("Location:technologyinfoimage_list.php?cat=" . $_REQUEST['cat'] . "&tech=" . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo']);
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objTechnologyInfoImage = new TechnologyInfoImage($id);
        $technology_info_image_url = $objTechnologyInfoImage->TechnologyInfoImageUrl;
    }
}
include "includes/pagetemplate.php";
require '../inc/classes/Helpers.php';
// page vars
$page_title = "";
$id = $_REQUEST['id'];
// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    header("Location:technologyinfoimage_list.php?cat=" . $_REQUEST['cat'] . "&tech=" . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo']);
    exit;
}
if ($_POST['commit'] == "Delete Technology Info Image") {
    $objTechnologyInfoImage = new TechnologyInfoImage($id);
    $objTechnologyInfoImage->Delete($id);
    header("Location:technologyinfoimage_list.php?cat=" . $_REQUEST['cat'] . "&tech=" . $_REQUEST['tech'] . '&techinfo=' . $_REQUEST['techinfo']);
    exit;
}
$objTechnologyInfoImage = new TechnologyInfoImage($id);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objTechnologyInfoImage;
    global $id;
    $objTechnology = new Technology($_REQUEST['tech']);
    ?>

            <div class="layout laymidwidth">
Exemplo n.º 4
0
<?php

session_start();
if (!isset($_SESSION['sessCategory'])) {
    header('Location: index.php');
    exit;
}
include_once 'inc/classes/Technology.php';
include_once 'inc/classes/TechnologyInfo.php';
include_once 'inc/classes/TechnologyInfoImage.php';
include_once 'inc/classes/Category.php';
$objTechnology = new Technology($_REQUEST['id']);
$objTechnologyInfo = new TechnologyInfo();
$oTechnologyInfo = $objTechnologyInfo->getAllTechnologyInfoByTechnologyId($_REQUEST['id']);
$objTechnologyInfoImage = new TechnologyInfoImage();
$oTechnologyInfoImage = $objTechnologyInfoImage->GetAllTechnologyInfoImageByTechnologyInfoId($oTechnologyInfo[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>
	<meta charset="UTF-8">
	<title>Coke Cooler</title>
	<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">