<?php
/*************************************************************************/
/* ROLLER CMS - ADVANCED PORTAL MANAGEMENT SYSTEM */
/* ============================================ */
/* */
/* Copyright (c) 2005 by Federico Campoli (hide@address.com) */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/*************************************************************************/
include($_SERVER["DOCUMENT_ROOT"].'/common_files/template/main_app_header_admin.inc.php');
?>
<body bgcolor="White">
<?php
switch($HTTP_GET_VARS["action"])
{
//blocco cambio ordine categoria
case "up":
$str_sql=" SELECT ".$table_prefix."_cms_change_order_cat_2('".$HTTP_GET_VARS["id_cat"]."',1)";
$query_results=pg_query($data_conn,$str_sql);
$str_sql=" SELECT ".$table_prefix."_cms_order_cat_1('".$HTTP_GET_VARS["id_cat"]."')";
$query_results=pg_query($data_conn,$str_sql);
echo pg_last_error();
header("Location: ".$_SERVER["SCRIPT_NAME"]."?action=category");
break;
case "down":
$str_sql=" SELECT ".$table_prefix."_cms_change_order_cat_2('".$HTTP_GET_VARS["id_cat"]."',-1)";
$query_results=pg_query($data_conn,$str_sql);
$str_sql=" SELECT ".$table_prefix."_cms_order_cat_1('".$HTTP_GET_VARS["id_cat"]."')";
$query_results=pg_query($data_conn,$str_sql);
echo pg_last_error();
header("Location: ".$_SERVER["SCRIPT_NAME"]."?action=category");
break;
//blocco delete categoria
case "delete":
$str_sql=" SELECT ".$table_prefix."_cms_delete_cat_1('".$HTTP_GET_VARS["id_cat"]."')";
$query_results=pg_query($data_conn,$str_sql);
echo pg_last_error();
header("Location: ".$_SERVER["SCRIPT_NAME"]."?action=category");
break;
//blocco inserimento nuova categoria
case "insert":
$str_sql=" SELECT ".$table_prefix."_cms_insert_cat_5('".$HTTP_POST_VARS["category"]."','asd',".$HTTP_POST_VARS["id_parent"].",true,0)";
$query_results=pg_query($data_conn,$str_sql);
echo pg_last_error();
echo "<script language=\"javascript\">self.parent.show_hide(\"frm_new\", \"hide\");";
echo "self.parent.location.reload();";
echo "</script>";
break;
//blocco creazione nuova categoria
case "new":
echo "<form method=\"post\" action=\"".$_SERVER["SCRIPT_NAME"]."?action=insert\" onsubmit=\"return valida_category(this);\" name=\"form_insert\">";
echo "<table bgcolor=\"White\" border=\"1\">";
echo "<tr>";
echo "<td>Categoria</td>";
echo "<td><input type=\"text\" name=\"category\" value=\"\" /></td>";
echo "</tr>";
echo "</table>";
echo "<input type=\"submit\" value=\"aggiungi categoria\" />";
echo "<input type=\"hidden\" name=\"id_parent\" value=\"".$HTTP_GET_VARS["id_parent"]."\" />";
echo "</form>";
break;
// Blocco LAYER
case "layer":
echo " ";
break;
// Blocco CATEGORIE
case "category":
echo "<iframe width=\"400\" height=\"200\" name=\"frm_new\" id=\"frm_new\" src=\"".$_SERVER["SCRIPT_NAME"]."?action=layer\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\" visibility:hidden; position: absolute; border:solid; border-width : 1px;\"></iframe>";
echo "<table class=\"cat_container\">";
echo "<tr>";
echo "<td>";
extract_categories(0,0,0);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<img src='images/admin/scrivi.gif' alt='nuova categoria' id=\"img_new_category\"width='20' height='16' border='0' onclick=\"dlg_edit_prop('frm_new','img_new_category','".$_SERVER["SCRIPT_NAME"]."?action=new&id_parent=0')\" />";
break;
// Blocco default di amministrazione CMS
default:
echo "<table bgcolor=\"White\" border=\"1\">";
echo "<tr>";
echo "<th colspan=\"2\">Amministrazione CMS</th>";
echo "</tr>";
echo "<tr>";
echo "<td><a href=\"".$_SERVER["SCRIPT_NAME"]."?action=category\">Categorie</a></td>";
echo "<td>Articoli</td>";
echo "</tr>";
echo "</table>";
break;
}
?>
<br/>
<br/>
<A href="<?php echo $folder_admin;?>main/index.php">Main Admin</A>
</body>
</html>
<?php
include($_SERVER["DOCUMENT_ROOT"].'/common_files/template/main_app_footer.inc.php');
?>