category_get($id);
});
// Add Item Category
$rest->post('/category/', function () use($rest) {
    include_once API_ROOT . "/category.inc";
    category_add();
});
// Edit Item Category
$rest->put('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_edit($id);
});
// Delete Item Category
$rest->delete('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_delete($id);
});
// ------------------------------- Item Categories -------------------------------
// ------------------------------- Tax Types -------------------------------
// Tax Types
// Get All Item Tax Types
$rest->get('/taxtypes/', function () use($rest) {
    global $req;
    include_once API_ROOT . "/taxtypes.inc";
    $page = $req->get("page");
    if ($page == null) {
        taxtypes_all();
    } else {
        // If page = 1 the value will be 0, if page = 2 the value will be 1, ...
        $from = --$page * RESULTS_PER_PAGE;
        taxtypes_all($from);
Example #2
0
     // do logout
     if (!referer_check()) {
         die;
     }
     admin_logout();
     header('Location:index.php');
     exit;
     break;
 case '6':
     // delete category
     if (!referer_check()) {
         die;
     }
     if (admin_check()) {
         if ($category_name != 'general') {
             category_delete($category_name);
         }
         header('Location:index.php?ac=3');
         exit;
     } else {
         header('Location:index.php?ac=1&f=' . urlencode('index.php?ac=3'));
         exit;
     }
     break;
 case '7':
     // create category
     if (!referer_check()) {
         die;
     }
     if (admin_check()) {
         if ($category_name != 'general') {
include_once('ressources/class.html.pages.inc');
include_once('ressources/class.cyrus.inc');
include_once('ressources/class.main_cf.inc');
include_once('ressources/charts.php');
include_once('ressources/class.syslogs.inc');
include_once('ressources/class.system.network.inc');
include_once('ressources/class.os.system.inc');
include_once('ressources/class.dansguardian.inc');
include_once(dirname(__FILE__)."/ressources/class.mysql.squid.builder.php");


if(isset($_GET["blacklist"])){blacklist_start();exit;}
if(isset($_GET["blacklist-perform"])){blacklist();exit;}
if(isset($_GET["whitelist-perform"])){whitelist();exit;}
if(isset($_GET["delete-personal-category-js"])){category_delete_js();exit;}
if(isset($_POST["delete-personal-category"])){category_delete();exit;}

if(isset($_GET["whitelist"])){whitelist_start();exit;}



tabs();

function category_delete_js(){
	$page=CurrentPageName();
	$tpl=new templates();
	$q=new mysql_squid_builder();
	$t=time();
	
	$sql="SELECT category FROM usersisp_catztables WHERE zmd5='{$_GET["delete-personal-category-js"]}'";
	$ligne=@mysql_fetch_array($q->QUERY_SQL($sql));
    exit;
}
if (isset($_GET["blacklist-perform"])) {
    blacklist();
    exit;
}
if (isset($_GET["whitelist-perform"])) {
    whitelist();
    exit;
}
if (isset($_GET["delete-personal-category-js"])) {
    category_delete_js();
    exit;
}
if (isset($_POST["delete-personal-category"])) {
    category_delete();
    exit;
}
if (isset($_GET["whitelist"])) {
    whitelist_start();
    exit;
}
tabs();
function category_delete_js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $t = time();
    $sql = "SELECT category FROM usersisp_catztables WHERE zmd5='{$_GET["delete-personal-category-js"]}'";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql));
Example #5
0
      }
    }
    print "</result>\n";

    break;
  case "load":
    $content=category_load($id, $_GET);

    Header("Content-Type: text/xml; charset=UTF-8");
    ob_end_clean();

    print $content;

    break;
  case "delete":
    $status=category_delete($id);

    Header("Content-Type: text/xml; charset=UTF-8");
    ob_end_clean();

    print "<?xml version='1.0' encoding='UTF-8' ?".">\n";
    print "<result>\n";

    if($status[status]!==true) {
      print "  <status ";
      foreach($status as $ek=>$ev) {
	print " $ek='$ev'";
      }
      print " />\n";
    }
    else {