ACC SHELL

Path : /srv/www/vhosts/profias/inc/
File Upload :
Current File : /srv/www/vhosts/profias/inc/tables-list.php

<?php
  
  

    
    
    if (TRUE==$_GET['start'])
    {
      $db->queryN('UPDATE sys_pages SET start=\'N\'');
      $db->queryN('UPDATE sys_pages SET start=\'Y\' WHERE id='.(int)$_GET['start']);
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('start'))));
      die();
    }
    
    if (TRUE==$_GET['unstart'])
    {
      $db->queryN('UPDATE sys_pages SET start=\'N\' WHERE id='.(int)$_GET['unstart']);
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('unstart'))));
      die();
    }
    
    if (TRUE==$_GET['active'])
    {
      $db->queryN('UPDATE sys_pages SET active=\'Y\' WHERE id='.(int)$_GET['active']);
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('active'))));
      die();
    }    
    
    if (TRUE==$_GET['deactive'])
    {
      $db->queryN('UPDATE sys_pages SET active=\'N\' WHERE id='.(int)$_GET['deactive']);
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('deactive'))));
      die();
    }    

    if (TRUE==$_GET['up'])
    {
      $tmp=$db->select('id_parent, list', 'sys_pages', 'id='.(int)$_GET['up'], '1');
      $tmp2=$db->select('MAX(list) AS list', 'sys_pages', 'list<'.(int)$tmp['list'].' AND id_parent='.(int)$tmp['id_parent'], '1');
      if (TRUE==$tmp2['list'])
      {
        $db->queryN('UPDATE sys_pages SET list=999999 WHERE list='.(int)$tmp['list']);
        $db->queryN('UPDATE sys_pages SET list='.(int)$tmp['list'].' WHERE list='.(int)$tmp2['list']);
        $db->queryN('UPDATE sys_pages SET list='.(int)$tmp2['list'].' WHERE list=999999');
      }
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('up'))));
      die();
    }    

    if (TRUE==$_GET['down'])
    {
      $tmp=$db->select('id_parent, list', 'sys_pages', 'id='.(int)$_GET['down'], '1');
      $tmp2=$db->select('MIN(list) AS list', 'sys_pages', 'list>'.(int)$tmp['list'].' AND id_parent='.(int)$tmp['id_parent'], '1');
      if (TRUE==$tmp2['list'])
      {
        $db->queryN('UPDATE sys_pages SET list=999999 WHERE list='.(int)$tmp['list']);
        $db->queryN('UPDATE sys_pages SET list='.(int)$tmp['list'].' WHERE list='.(int)$tmp2['list']);
        $db->queryN('UPDATE sys_pages SET list='.(int)$tmp2['list'].' WHERE list=999999');
      }
      header('location: ?'.str_replace('&amp;', '&', get_params($_GET, array('down'))));
      die();
    }    

    
    $output='';
    
      $tmp=$db->select('*', 'sys_db_tables', 'type=2', '', 'name');
  

      for ($i=0; $i<count($tmp); $i++)
      {
        $output.='<li>
          <a href="?table='.$tmp[$i]['id'].'">'.$tmp[$i]['name'].'</a>
        </li>
        ';
      }


        $output='
          <hr class="no_css">
          <ul id="pages-tree">
                '.$output.'
          </ul>
          <p class="admin-icons">
          <a class="admin-icon-new" href="?table=new"><!-- --></a>
          </p>
        ';
  
    
  
  
  
  echo $output;
  
?>

ACC SHELL 2018