function ThumbMaker()
{
    global $path;
    // Создаем массив с которым будем работать;
    // Если существуют оба массива;
    if (count($_SESSION['good_dbimages_file']) > 0 and count($_SESSION['good_images_file']) > 0) {
        $working_array = array_merge($_SESSION['good_dbimages_file'], $_SESSION['good_images_file']);
        goto make_thumb;
    }
    // Если существует только один массив;
    if (count($_SESSION['good_dbimages_file']) > 0) {
        $working_array = $_SESSION['good_dbimages_file'];
    }
    if (count($_SESSION['good_images_file']) > 0) {
        $working_array = $_SESSION['good_images_file'];
    }
    make_thumb:
    if (isset($working_array)) {
        // Функция для сортировки массива по положению фотографий;
        function sortBy($arr, $sortKey)
        {
            // Временный массив для сотритовки по нужному ключу;
            $tempArr = array();
            // Возвращаемый массив;
            $returnArr = array();
            // Перебор всего массива;
            foreach ($arr as $key => $value) {
                // Запись в массив значений ключа по которому быдет выполнена сортировка;
                $tempArr[$key] = $value[$sortKey];
            }
            // Сортировка значений с сохранением ключей;
            asort($tempArr);
            // Установка указателя массива не первый элемент;
            reset($tempArr);
            // Перебор всего временного массива;
            foreach ($tempArr as $key => $value) {
                // Формирование возвращаемого массива;
                $returnArr[] = $arr[$key];
            }
            return $returnArr;
        }
        $new_array = sortBy($working_array, 'position');
        $thumb_images = new Images();
        $thumb_images->Thumber($new_array, $path, 200, 200, 1, 1, 1);
        return $thumb_images->result;
    }
}
Esempio n. 2
0
defined('ROOT') or die('Not allowed!');
require ADMIN_SIDEBAR;
?>
<div id="main-contents">
    <nav class="data-header toolbar">
        <?php 
echo anchor('admin-shop/banners/form', 'Baru', ['class' => 'btn toolbar-btn btn-edit']);
?>
    </nav>
    <table class="data">
        <thead>
            <tr>
                <th>Gambar</th>
                <th><?php 
echo sortBy('judul', 'Judul');
?>
</th>
                <th>Penayangan</th>
                <th>Aktif</th>
                <th>Tipe</th>
                <th>Pilihan</th>
            </tr>
        </thead>
        <tbody>
        <?php 
if (($total = $data->count()) > 0) {
    foreach ($data->fetch() as $row) {
        ?>
            <tr id="data-<?php 
        echo $row->id_banner;
			function confirm_delete(){
				if(confirm("Are you sure you want to delete this food item?") == true){
					return true;
				}else{
					return false;
				}
			}
		</script>
	</head>
	<body>
		<div id="container">
			<?php 
include "db.php";
echo "<h2>Food Catalog</h2>";
//Search/categorizing
sortBy();
//Just displaying the add new food and category buttons.
addItem();
echo "<hr />";
//Querying the database and displaying.
getFoodItems();
$id = NULL;
$action = NULL;
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
//If someone pressed delete and the url is set.
if ($id && $action == "delete") {
function treeFormat($data)
{
    $new_data = array();
    foreach ($data as $user => $value) {
        $data[$user]["text"] = array("name" => stripAccents(substr($data[$user]["name"], 0, 20)), "title" => "ID:" . $data[$user]["Account_id"], "contact" => "PG:" . $data[$user]["GP"]);
        $data[$user]["image"] = "rsz_user_demo_images.jpg";
        $new_data[$user]["text"] = $data[$user]["text"];
        $new_data[$user]["image"] = $data[$user]["image"];
        $new_data[$user]["Account_id"] = $data[$user]["Account_id"];
        $new_data[$user]["parent_id"] = $data[$user]["parent_id"];
    }
    $new_data = sortBy($new_data, "parent_id", SORT_ASC);
    return $new_data;
}
Esempio n. 5
0
?>
<div id="main-contents">
    <nav class="data-header toolbar">
        <?php 
echo anchor('admin-shop/categories/form', 'Baru', ['class' => 'btn toolbar-btn btn-edit']);
?>
    </nav>
    <table class="data">
        <thead>
            <tr>
                <th><?php 
echo sortBy('nama', 'Nama');
?>
</th>
                <th><?php 
echo sortBy('alias', 'Alias');
?>
</th>
                <th>Keterangan</th>
                <th>Pilihan</th>
            </tr>
        </thead>
        <tbody>
        <?php 
if (($total = $data->count()) > 0) {
    foreach ($data->fetch() as $row) {
        ?>
            <tr id="data-<?php 
        echo $row->id_kategori;
        ?>
">
Esempio n. 6
0
//THE COMMON WORDS ARE SET HERE SO THAT WE CAN REMOVE THEM WHEN SETTING THE VALUE OF THE PASSED INFORMATION
$commonWords = 'and,the';
// GET USER INPUT VALUES & REMOVE COMMON WORDS
$title = removeCommonWords($commonWords, setVal('title'));
$author = removeCommonWords($commonWords, setVal('author'));
$publicationYear = removeCommonWords($commonWords, setVal('Year'));
$publisher = removeCommonWords($commonWords, setVal('publisher'));
$citationsMin = removeCommonWords($commonWords, setVal('citationsMin'));
$citationsMax = removeCommonWords($commonWords, setVal('citationsMax'));
$keywords = removeCommonWords($commonWords, setVal('keywords'));
// GET SORT SELECTION VALUES
$sortSelection = setVal('sort');
// GET MAX PAPERS TO SHOW
$maxPapers = setVal('noOfResults');
// FUNCTION TO CHOOSE CORRECT QUERY, SORT IF NECESSARY, LIMIT IF NECESSARY
$query = chooseQuery() . sortBy($sortSelection) . maxNoOfPapers($maxPapers);
//$keywords = keywordCount($title);
//SETS THE SEARCH TERM ENTERED (TITLE) TO BE THE COOKIE VALUE
if (!isset($_COOKIE['Query'])) {
    setcookie("Query", $title);
}
//IF THE COOKIE IS SET THEN MAKE A LINK TO THE MAIN PAGE FOR THE USER TO SEE THEIR PREVIOUS SEARCH TERMS
if (isset($_COOKIE['Query'])) {
    setcookie("Query", $title);
}
/*
//CREATES A TABLE FOR THE RESULTS OF THE SEARCH TERMS ENTERED
//ECHOING OUT THE AUTHORS, TITLE, ARTICLE URL AND SUMMARY
//IF CANNOT CONNECT TO THE DATABASE THEN DISPLAY A MYSQLI ERROR
//SENDS HIDDEN DATA FOR THE selectedPaper.php PAGE */
//Prints out the caption for the table depending on what fields are entered
Esempio n. 7
0
        <?php 
    echo anchor('admin-shop/orders/form', 'Baru', ['class' => 'btn toolbar-btn btn-edit']);
    ?>
    </nav>
<?php 
}
?>
    <table class="data">
        <thead>
            <tr>
                <th><?php 
echo sortBy('id_order', 'ID');
?>
</th>
                <th><?php 
echo sortBy('nama_lengkap', 'Pelanggan');
?>
</th>
                <th>Tanggal</th>
                <th>Status</th>
                <th>Total Harga (Rp.)</th>
                <th>Pilihan</th>
            </tr>
        </thead>
        <tbody>
        <?php 
if (($total = $data->count()) > 0) {
    foreach ($data->fetch() as $row) {
        ?>
            <tr id="data-<?php 
        echo $row->id_order;
Esempio n. 8
0
include_once '../functions/dbConn.php';
include '../functions/loginFunction.php';
include '../functions/until.php';
include '../functions/searchFunctions.php';
include '../functions/sortFunctions.php';
$id = $_SESSION['currentUserID'];
if (isPostRequest()) {
    //stores the search text and sends it to the search function
    $searchText = filter_input(INPUT_POST, 'searchtext');
    $searchBy = filter_input(INPUT_POST, 'searchBy');
    $results = search($searchText, $searchBy, $id);
}
if (isGetRequest()) {
    //stores the sort entry and sends it to the sortBy function
    $addressGroupSort = filter_input(INPUT_GET, 'addressGroupSort');
    $results = sortBy($addressGroupSort, $id);
}
?>
    <center>
        <div class="text-success">
            <h1>Your Address Book</h1><br /></div>

        <?php 
include '../includes/sortresults.php';
?>

        <br /><br />

        <?php 
if ($results == NULL) {
    echo "There are no contacts to display, try searching or add new contacts!";
Esempio n. 9
0
defined('ROOT') or die('Not allowed!');
require ADMIN_SIDEBAR;
?>
<div id="main-contents">
    <nav class="data-header toolbar">
        <?php 
echo anchor('admin-shop/products/form', 'Baru', ['class' => 'btn toolbar-btn btn-edit']);
?>
    </nav>
    <table class="data">
        <thead>
            <tr>
                <th>Gambar</th>
                <th><?php 
echo sortBy('nama', 'Nama');
?>
</th>
                <th>Tgl Masuk</th>
                <th>Stok</th>
                <th>Harga (Rp.)</th>
                <th>Pilihan</th>
            </tr>
        </thead>
        <tbody>
        <?php 
if (($total = $data->count()) > 0) {
    foreach ($data->fetch() as $row) {
        ?>
            <tr id="data-<?php 
        echo $row->id_produk;