<?php
$root = "https://pos.eli-tpr.com/";

if($_SERVER['HTTPS']!=="on")
  {
     $redirect= $root.$_SERVER['REQUEST_URI'];
     header("Location:$redirect");
  }

$host = "localhost";
$user = "eli-t_pos";
$pass = "95GqMWjVFdw9";
$db = "eli-t_pos";
/*
 *Recuerda credenciales de DataTable
 *assets/DataTables/config.php
 *
*/


$con = mysqli_connect($host,$user,$pass,$db);

error_reporting(E_ALL);
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

mysqli_query($con,"SET SQL_BIG_SELECTS=1");
mysqli_query($con,"SET time_zone = '+0:00';");
/// Connecting PDO

$dsn = "mysql:host=" . $host . ";dbname=" . $db;
try{
   //PDO Instance
$pdo = new PDO($dsn, $user, $pass);
$pdo->SetAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e){
   die("Error connection pdo!!!");
   echo "Error: " . $e->getMessage();
}

// Include and instantiate the class.
$isAdmin = stripos($_SERVER['SCRIPT_NAME'],"/admin/")===false?false:true;
$folder = $isAdmin?"..":".";
require_once "$folder/assets/Mobile_Detect.php";
$detect = new Mobile_Detect;



?>
