<?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", "off");
ini_set('memory_limit', '-1');

//connection with main db
require_once('../../library/db_main/rb.php');

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

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/aw_ar";

//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/aw_ar';
$smarty->compile_dir = '../temp';


/* 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);
#cookies config
define("COOKIE_RUNTIME", 1209600); //time of cookies // 2 weeks
define("COOKIE_DOMAIN", null); //for website must be like '.mydomain.com'
define("COOKIE_SECRET_KEY", "1gp@TMPS{+$78sfpMJFe-92s");  //a random value here
#Configuration for: Email server credentials
define("EMAIL_USE_SMTP", true);
define("EMAIL_SMTP_HOST", "ssl://smtp.gmail.com");
define("EMAIL_SMTP_AUTH", true);
define("EMAIL_SMTP_USERNAME", "ahmed.freedeveloper@gmail.com");
define("EMAIL_SMTP_PASSWORD", "");
define("EMAIL_SMTP_PORT", 465);
define("EMAIL_SMTP_ENCRYPTION", "ssl");
//if ther email server
/* define("EMAIL_USE_SMTP", false);
  define("EMAIL_SMTP_HOST", "yourhost");
  define("EMAIL_SMTP_AUTH", true);
  define("EMAIL_SMTP_USERNAME", "yourusername");
  define("EMAIL_SMTP_PASSWORD", "yourpassword");
  define("EMAIL_SMTP_PORT", 465);
  define("EMAIL_SMTP_ENCRYPTION", "ssl"); */
#Configuration for: password reset email data
define("EMAIL_PASSWORDRESET_URL", $hosturl . "/login/passrest");
define("EMAIL_PASSWORDRESET_FROM", "ahmed.freedeveloper@gmail.com");
define("EMAIL_PASSWORDRESET_FROM_NAME", "AW Admin panel");
define("EMAIL_PASSWORDRESET_SUBJECT", "Password reset for PROJECT XY");
define("EMAIL_PASSWORDRESET_CONTENT", "Please click on this link to reset your password:");
#Configuration for: verification email data
define("EMAIL_VERIFICATION_URL", $hosturl . "/register");
define("EMAIL_VERIFICATION_FROM", "ahmed.freedeveloper@gmail.com");
define("EMAIL_VERIFICATION_FROM_NAME", "AW Admin panel");
define("EMAIL_VERIFICATION_SUBJECT", "Account activation for PROJECT XY");
define("EMAIL_VERIFICATION_CONTENT", "Please click on this link to activate your account:");
#Configuration for: Hashing strength
//it might be useful to increase the cost factor to 11
define("HASH_COST_FACTOR", "10");

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

