ACC SHELL

Path : /srv/www/vhosts/profias/admin/
File Upload :
Current File : /srv/www/vhosts/profias/admin/path.php

<?php

include('../inc/db.php');
$db = new Db();


function sys_name2($string){
  $origin=array('ě','š','č','ř','ž','ý','á','í','é','ů','ú','ó','ď','ň','ť','Ě','Š','Č','Ř','Ž','Ý','Á','Í','É','Ů','Ú','Ó','Ď','Ň','Ť', '&nbsp;', ' ', '/');
  $new=array('e','s','c','r','z','y','a','i','e','u','u','o','d','n','t','E','S','C','R','Z','Y','A','I','E','U','U','O','D','N','T', '-', '-', '-');
  $spec_chars=array('\'','\\',',','@','#','$','%','^','&','*','()');    

  $string=str_replace($origin, $new, $string);
  $string=str_replace($spec_chars, '', $string);         
  
  return  trim(strtolower($string));   
  
}
$path = '';
if ($_GET["id_page"]!=""){
  $tmp = $db -> select (
    'spl.path, sp.id_parent',
    'sys_pages as sp
    LEFT JOIN sys_pages_languages as spl on (sp.id = spl.id_page)',
    'sp.id = '.(int)$_GET["id_page"].' AND spl.id_language = '.$_GET["lang"],
    '1'
  );  
  
  if ($tmp["path"]!=""){
    $path = $tmp["path"];
  }else{
    $path .= '/';
  }
  $path .= sys_name2($_GET["q"]);
  $path2 = $path;
  $path .= '/';
}else{
  $path = '/'.sys_name2($_GET["q"]);
  $path2 = $path;
  $path .= '/';
}

$p = $db -> select (
  'spl.path',
  'sys_pages as sp
  LEFT JOIN sys_pages_languages as spl on (spl.id_page = sp.id)',
  'path LIKE "'.$path.'" AND spl.id_language = '.$_GET["lang"]
);

if (count($p)>0){
  $path = $path2.'2/';
}


echo $path;

?>

ACC SHELL 2018