<?php

require_once('config.php');
//require_once('dbconnect.php');
require_once('functions.php');
require_once('phpself.php');
require_once('sanitize.php');

global $con;
$con = new mysqli($host,$user,$pass,$name);
if ($con->connect_errno) {
    printf("Connect failed: %s\n", $con->connect_error);
    exit();
}

// Date
global $today; 
date_default_timezone_set("America/New_York");
$today = date('Y-m-d');

// Global Element File
global $URL, $ROOTPATH, $SITEURL;
$URL = 'http://' .$_SERVER['SERVER_NAME'];
$ROOTPATH = '.'; 
$SITEURL = 'http://billing.comocreative.com'; 

global $comanyName, $defaultCompany;
$companyName = 'Como Creative';
$defaultCompany = 130;

global $admin, $pageName, $greeting, $customScript, $content, $controls, $filters, $controlsRight, $pageSubTitle;
$admin = ''; 
$pageName = '';
$greeting = ''; 
$customScript = ''; 
$content = '';
$controls = ''; 
$filters = ''; 
$controlsRight = '';
$pageSubTitle = ''; 

global $docReady, $tabTable, $tableID, $footerScripts, $modalScripts, $ajaxUpdate; 
$docReady = '';
$tabTable = false;
$tableID = '';
$footerScripts = ''; 
$modalScripts = '';
$ajaxUpdate = false; 

// Login/Out, Main Admin, Back Links
global $logoutLink, $backtoMain, $backBtn, $adminBtns;
$adminBtns = ''; 
$logoutLink = $phpself . '?logout=logout';
$backtoMain = '<p id="backtoMain"><a href="' . $phpself . '" name="main">Back to Main Admin</a></p>';
//$backBtn = '<p id="backBtn"><a href="javascript:history.back()">Back</a></p>';
$backBtn = '<button id="backBtn" class="btn btn-default" onclick="javascript:history.back()"><i class="fa fa-angle-double-left"></i> Back</button>';

// Report Titles
global $amtInv, $comRate, $comDue;
$amtInv = 'Invoiced'; 
$comishRate = 'Comp %'; 
$comDue = 'Commission';

// Copyright Information
$copyright = 'Copyright &copy; ';
$copyright .= date("Y");
$copyright .= ' '. $companyName . ' LLC. All Rights Reserved.';

// Confirmation PopUp
$areYouSure = '<script language = "javascript">
				<!--
				function sure(ID) {
					y = confirm ("Are you sure you want to DEACTIVATE?"); 
					if (y) 
						return true;
					else 
						return false;
				}
				//-->
				</script>';

// Email This
$emailThis = '<script type="text/javascript">
				function mailThisPage() {
					var link = window.location;
					var pageTitle = document.title;
					pageTitle = pageTitle.replace(/&/g, "and").replace(/&amp;/g, "and").replace(/#/g, "");
					var emailSubject = "Check this out: "+ pageTitle;
					var emailAddress = prompt("Please enter the recipients email address","");
					window.location  = "mailto:"+emailAddress+"?Subject="+emailSubject+"&body="+link;                    
				};
			</script>';

?>