<?php

include_once "./sys/functions.php";
isLogged();
$logged_user = getLoggedUser();
$server_name = getServerProperty("server_name");
$fast_packages = json_decode(getServerProperty("fast_packages"), true);
$fixed_informations = getServerProperty("fixed_informations");
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php echo $server_name; ?> :: Office</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="bower_components/morris.js/morris.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<?php injectCustomCss(); ?>
</head>
<body class="hold-transition <?php echo getServerProperty("theme_color", "skin-red"); ?> sidebar-mini">
<div class="wrapper">
  <header class="main-header">
    <!-- Logo -->
    <a href="dashboard.php" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><img src="dist/img/logo_small.png" width="50" height="50"></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><img src="dist/img/logo_medium.png" height="50"></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Credits -->
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle">
              <i class="fa fa-dollar"></i>
              <span class="label label-success"><?php echo $logged_user["credits"]; ?>
	          </span>
            </a>
          </li>
          <!-- Control Sidebar Toggle Button -->
<?php 
if (isAdmin($logged_user)) {
?>          <li>
            <a href="settings.php"><i class="fa fa-gears"></i></a>
          </li>
<?php 
}
?>       </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">MENU PRINCIPAL</li>
        <li>
          <a href="dashboard.php">
            <i class="fa fa-dashboard"></i> <span>Painel</span>
          </a>
        </li>
        <li class="active">
          <a href="informations.php">
            <i class="fa fa-align-left"></i> <span>Informações</span>
          </a>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-bug"></i>
            <span>Criar teste</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="create_test.php"><i class="fa fa-circle-o"></i> Customizado</a></li>
<?php 
$packages = getPackages();
foreach ($fast_packages as $package_id) {
    $package_key = array_search($package_id, array_column($packages, "id"));
    if ($package_key !== false) {
        $current_package = $packages[$package_key];
        if ($current_package["is_trial"] == 1) {
?>          
			<li><a href="./sys/API.php?action=create_test&package_id=<?php echo $current_package["id"]; ?>"><i class="fa fa-circle-o"></i>
			<?php 
            echo $current_package["package_name"];
            ?></a></li>
<?php 
        }
    }
}
?>        </ul>
        </li>
<?php 
if (isAdmin($logged_user) || isUltra($logged_user) || isMaster($logged_user)) {
?>        <li class="treeview">
          <a href="#">
            <i class="fa fa-users"></i>
            <span>Sub-Revendas</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="resellers.php"><i class="fa fa-cogs"></i> Gerir Revendas</a></li>
            <li><a href="create_reseller.php"><i class="fa fa-user-plus"></i> Criar Revenda</a></li>
          </ul>
        </li>
<?php 
}
?>        <li class="treeview">
          <a href="#">
            <i class="fa fa-users"></i>
            <span>Usuários</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="online.php"><i class="fa fa-circle"></i> Usuários Online</a></li>
            <li><a href="clients.php"><i class="fa fa-cogs"></i> Gerir Usuários</a></li>
            <li><a href="create_client.php"><i class="fa fa-user-plus"></i> Criar Usuário</a></li>
          </ul>
        </li>
        <li>
          <a href="shortener.php">
            <i class="fa fa-link"></i> <span>Encurtador</span>
          </a>
        </li>
        <li>
          <a href="tools.php">
            <i class="fa fa-wrench"></i> <span>Ferramentas</span>
          </a>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-film"></i>
            <span>Conteúdo Novo</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="new_channels.php"><i class="fa fa-circle-o"></i> Novos Canais</a></li>
            <li><a href="new_movies.php"><i class="fa fa-circle-o"></i> Novos Filmes</a></li>
            <li><a href="new_series.php"><i class="fa fa-circle-o"></i> Novas Series</a></li>
          </ul>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-ticket"></i>
            <span>Ticket Suporte</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="create_ticket.php"><i class="fa fa-circle-o"></i> Criar Ticket</a></li>
            <li><a href="manage_tickets.php"><i class="fa fa-circle-o"></i> Gerenciar Tickets</a></li>
          </ul>
        </li>
        <li>
          <a href="profile.php">
            <i class="fa fa-user-circle"></i> <span>Perfil</span>
          </a>
        </li>
        <li>
          <a href="logout.php">
            <i class="fa fa-power-off"></i> <span>Desconectar</span>
          </a>
        </li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Informações Fixas
        <small>Informações importantes.</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Painel</a></li>
        <li class="active">Informações Fixas</li>
      </ol>
    </section>
    <!-- Main content -->
    <section class="content">
      <!-- Main row -->
      <div class="row">
        <!-- Left col -->
        <section class="col-md-12 connectedSortable">
          <div class="box">
            <!-- /.box-header -->
            <div class="box-body">
              <div class="html-content">
                <span><?php echo $fixed_informations; ?></span>
              </div>
            </div>
            <!-- /.box-body -->
          </div>
        </section>
      </div>
      <!-- /.box -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="row">
      <div class="text-left col-md-6">
        <strong>Copyright &copy; <?php echo date("Y"); ?> <a href="#"><?php echo $server_name; ?></a>.</strong> All rights reserved.
      </div>
      <div class="text-right col-md-6">Prime Office. <?php echo KOFFICE_PANEL_VERSION; ?> - 2019</div>
    </div>
  </footer>
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="bower_components/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="bower_components/raphael/raphael.min.js"></script>
<script src="bower_components/morris.js/morris.min.js"></script>
<!-- FastClick -->
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
</body>
</html>