ACC SHELL

Path : /www/hosting/oltv.cz/_/admin/core/
File Upload :
Current File : /www/hosting/oltv.cz/_/admin/core/files.php

<?php
/**
 * @author Filip Štencl
 * @since 16.02.2014
 *
 */

require("../../include/config.php");
const TABULKA = "files";
//----------------------------------------------------------------------------------------------------------
$admin = new admin();
$admin->head();

$admin->button_insert();
$admin->button_back();
$admin->button_razeni();

	if (isset($_GET['typ']) && intval($_GET['typ']) == "1") { $nadpis = "Seznam fotografií k vybrané položce"; $typ = 1; }
	else { $nadpis = "Seznam dokumentů ke stažení k vybrané položce"; $typ = 2; }
	$admin->slideHead($nadpis);

	$sql = " SELECT A.* FROM [".TABULKA."] A";
	$table = new table($sql);
	$table->setId(TABULKA.$typ);
	$table->sortable();
	$table->where("A.pomid = '".intval($_GET['pomid'])."' AND cesta = '".trim(strip_tags($_GET['cesta']))."' AND typ = ".intval($_GET['typ']));
	$table->setOrder("A.poradi ASC");
	if ($typ == 1) { $table->addMainColumn("Náhled"); }
	if ($typ == 2) { $table->addMainColumn("Typ"); }
	$table->addMainColumn("Soubor");
	$table->addMainColumn("Velikost");
	if ($typ == 1) { $table->addMainColumn("Hlavní"); }
	$table->addMainColumn();
	$table->addMainColumn();
	$table->addMainColumn();

	$table->tableHead();
	foreach ($table->getResult() as $row) {
		$table->addRow($row->id);
		if ($typ == 1) { $table->addColumn("<td width=\"100\"><a href=\"../../data/".$row->cesta."/".$row->pomid."/foto/".($row->typ == 1 ? "":"dokumenty/")."".$row->soubor."\" title=\"soubor: ".$row->soubor."\"  target=\"_blank\"".($row->typ == 1 ? " rel='lightbox'":"")."><img src=\"../../images-crop/100x100/".$row->cesta."/".$row->pomid."/".$row->soubor."\"></a></td>"); }
		if ($typ == 2) { $table->addColumn("<td width=\"30\"><a href=\"../../data/".$row->cesta."/".$row->pomid."/foto/".($row->typ == 1 ? "":"dokumenty/")."".$row->soubor."\" title=\"soubor: ".$row->soubor."\"  target=\"_blank\">".files::getIco($row->pripona)."</a></td>"); }
		$table->addColumn("<td><strong><a href=\"../../data/".$row->cesta."/".$row->pomid."/".($row->typ == 1 ? "foto/":"dokumenty/")."".$row->soubor."\" title=\"soubor: ".$row->soubor."\" target=\"_blank\"".($row->typ == 1 ? " rel='lightbox'":"").">".$row->soubor."</a></strong><br />".$row->popis."</td>");
		$table->addColumn("<td>".toVelikost($row->velikost)."</td>");
		if ($typ == 1) { $table->addColumn("<td><strong>".($row->hlavni==true?"ano":"ne")."</strong></td>"); }
		$table->addStaticColumn_presun();
		$table->addStaticColumn_edit();
		$table->addStaticColumn_delete();
	}
	$table->writeTable();
$admin->slideFooter();
$admin->footer();

ACC SHELL 2018