<?php

/*
 * awframework from aw.inc present aw config
 * it will help you develop easy and fast with secure tools
 * you can edit and add what you feel right
 * don't change in strucure of file
 */

//ini_set("display_errors", "on");
ini_set("display_errors", "off");
//connection with main db
require_once('../library/db_main/rb.php');

//here the hosturl
$hosturl = get_base_url() . '/Sela_Admin';

function get_base_url() {
    if (isset($_SERVER['HTTPS'])) {
        $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
    } else {
        $protocol = 'http';
    }
    return $protocol . "://" . $_SERVER['HTTP_HOST'];
}

//main vars
$path = $hosturl . "/views/default";

//db connection
$db_host = '197.44.62.106';
$db_name = 'sela';
$db_user = 'gt4';
$db_password = 'mysql';
//$db_host = 'localhost';
//$db_name = 'sela';
//$db_user = 'root';
//$db_password = '';
//connect to database
R::setup('mysql:host=' . $db_host . ';dbname=' . $db_name . '', '' . $db_user . '', '' . $db_password . '');

#here smarty library
//use smarty template , it will found in public folder
require_once('../library/smarty_plg/libs/Smarty.class.php');
//use smarty paginate to paging the records from db
require_once('../library/smarty_plg/libs/SmartyPaginate.class.php');
//use trucate method to munipliate the restore data
require_once('../library/smarty_plg/libs/modifier.mb_truncate.php');


//use smarty as instance
$smarty = new Smarty();
$smarty->template_dir = '../views/default';
$smarty->compile_dir = '../temp';


#end variable path and hosturl to views
//main vars
$smarty->assign("path", $path);
$smarty->assign("hosturl", $hosturl);

/* if there login must this conif here */
#db connection
define("DB_HOST", $db_host);
define("DB_NAME", $db_name);
define("DB_USER", $db_user);
define("DB_PASS", $db_password);

