<?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("display_errors", "on");
ini_set('max_input_time', 600);
ini_set('max_execution_time', 36000);
date_default_timezone_set('America/Los_Angeles');
ini_set('memory_limit', '2048M');

//here the hosturl
//$hosturl = 'http://localhost/obgy_app';
$hosturl = get_base_url() . '/obgy_app';
$hosturl_ERP = get_base_url() . '/ERP';

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

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

$db_host = 'localhost';
$db_name = 'obgy_app';
$db_user = 'root';
$db_password = '';

//connect to database
R::setup('mysql:host=' . $db_host . ';dbname=' . $db_name . '', '' . $db_user . '', '' . $db_password . '');
R::exec('SET NAMES latin1');
R::freeze(FALSE);
define("HOST_URL_ERP", $hosturl_ERP);
#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');

/* 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", "");
define("EMAIL_SMTP_PASSWORD", "");
define("EMAIL_SMTP_PORT", 587);
define("EMAIL_SMTP_ENCRYPTION", "tls");
//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.taha.developer@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");






