sub config_set_vars {

# $useropts{title} = 'AI Sport Africa Admin | ' . ucfirst $username ;
# $title           = $useropts{title} ;

$useropts{acronym}           = 'AISA' ;
$useropts{short}             = 'AI Sport Africa' ;
$useropts{title}             = ($env eq 'DEV') ? "*DEV* " : '' ;
$useropts{title}            .= "$useropts{short} Admin | " . ucfirst $username ;
$title                       = $useropts{title} ;
$useropts{salt}              = '1Tv4dM1n' ;
$useropts{company}           = "$useropts{short} (Pty) Ltd" ;
$useropts{lc}                = lc $useropts{acronym} ;
# $useropts{logo}            = 'itv_logo.jpg' ;
$useropts{logo}              = 'aisa_logo.jpg' ;
$useropts{domainpart}        = 'itvadmin' ;
$useropts{table_id}          = 'itv-table' ;
$useropts{web}               = 'itvadmin.co.za' ;
$useropts{address1}          = '16 Wessel Road, Unit 3' ;
$useropts{address2}          = 'Eden Gardens' ;
$useropts{address3}          = 'Rivonia' ;
$useropts{city}              = 'Johannesburg' ;
$useropts{post_code}         = '2128' ;
# $useropts{cell}            = '+27 83 653 9151' ;
$useropts{tel}               = '+27 10 534 7011' ;
$useropts{vat_nr}            = '4280292691' ;
$useropts{co_reg}            = '2020/535585/07' ;
$useropts{email}             = 'info@aisport.africa' ;
# $useropts{linkcolor}       = '#0092dc' ;
# $useropts{infocolor}       = '#039deb' ;
# $useropts{primarycolor}    = '#00559b' ;
# $useropts{pdfcolor}        = '#0098e3' ;

$useropts{boss}{'vivian'}    = 1 ;
$useropts{boss}{'shaun'}     = 1 ;
$useropts{boss}{'rory'}      = 1 ;
						    
$useropts{super}{'rory'}     = 1 ;
$useropts{super}{'handre'}   = 1 ;
$useropts{super}{'vivian'}   = 1 ;
$useropts{super}{'shaun'}    = 1 ;

# $useropts{tickets}{'dom'}    = 1 ;
# $useropts{tickets}{'erin'}   = 1 ;
# $useropts{tickets}{'cristy'} = 1 ;

$useropts{it}{'rory'}        = 1 ;
$useropts{it}{'handre'}      = 1 ;
$useropts{it}{'jean'}        = 1 ;
					    
$pixellot_limit{'connor'}    = 1 ;
						    
$events_limit{$username}     = 1 if ($usertype eq 'nonquote');

our $glod_user_level  = ($usertype eq 'manager' || $usertype eq 'senior_manager' || $usertype eq 'it') ? 5 : 0 ; # max 

our $is_installation_partner = ($usertype eq 'installation_partner') ? 1 : 0 ;
our $is_dcb_partner          = ($usertype eq 'dcb_partner') ? 1 : 0 ;
our $is_schools_manager      = ($usertype eq 'schools_manager') ? 1 : 0 ;
our $is_operator             = (substr($usertype,0,6) eq 'casual') ? 1 : 0 ;
our $is_temp_calibrator      = ($usertype eq 'casual_calibrator') ? 1 : 0 ;
our $operator_level          = ($is_operator && (substr($usertype,-1,1) eq 'a' || substr($usertype,-10,10) eq 'calibrator')) ? 1 : ($is_operator && substr($usertype,-1,1) eq 'b') ? 2 : ($is_operator &&  substr($usertype,-1,1) eq 'c') ? 3 : 0 ;

if ($is_operator && $operator_level) {
	$glod_user_level  = $operator_level ;
} elsif ($usertype eq 'external' || $usertype eq 'installation_partner' || $usertype eq 'dcb_partner') {
	$glod_user_level  = 1 ;
} elsif ($usertype eq 'schools_manager' || $usertype eq 'support') {
	$glod_user_level  = 2 ;
# } elsif ($events_limit{$username} || $usertype eq 'permanent' || $username eq 'cristy' || $username eq 'dom') {
} elsif ($events_limit{$username} || $usertype eq 'permanent') {
	$glod_user_level  = 4 ;
}

our $smtp_server             = 'smtp.interactivetvafrica.com';
$email_add{'tickets'}        = 'tickets@interactivetvafrica.com' ;
our $send_mail_psw           = 'vf1VBE6AGuPE' ;
$email_add{'events'}         = 'events@interactivetvafrica.com' ;
our $send_mail_psw_events    = 'ickxadYgbZ)X' ;
our $email_reply_to          = 'marizen@aisport.africa' ;
our %email_events            = () ;
    $email_events{1}         = 'marizen@aisport.africa' ;
    $email_events{2}         = 'cristy@aisport.africa' ;
    $email_events{3}         = 'dom@aisport.africa' ;
    $email_events{4}         = 'erin@aisport.africa' ;
    $email_events{5}         = 'techsupport@aisport.africa' ;
    $email_events{6}         = 'dan@aisport.africa' ;
    $email_events{7}         = 'mitheel@aisport.africa' ;	
    $email_events{8}         = 'mikhaar@aisport.africa' ;	
    $email_events{9}         = 'daniel@aisport.africa' ;	
    # $email_events{10}      = 'events@kre8it.co.za' ;	
our $email_it_1              = 'rory@kre8it.co.za' ;
our $email_it_2              = 'handre@kre8it.co.za' ;
our $email_accounts          = 'viv@aisport.africa' ;

our $afrihost_smtp           = 'mail.aisport.africa';
our $afrihost_psw            = 'Events@2025' ;
our $afrihost_port           = 465 ;
our $afrihost_from           = 'events@aisport.africa' ;

our $gmail_smtp              = 'smtp.googlemail.com';
our $gmail_psw               = 'AISA@Events1+' ;
our $gmail_port              = 465 ;
our $gmail_from              = 'aisportafrica@gmail.com' ;

our ($subdomain,$domain,$ext) = split(/\./,$ENV{SERVER_NAME}) ;

} #------------------------------------------------------------------------------------

sub config_set_paths {

# $cgipath                      = "/home/libs" ;  
# $htmlpath                     = "/var/www/html" ; 
# $htmlpath_sss				  = "/var/www/sssadmin.co.za/public_html" ; 

# $useropts{'scripts'}          = '/cgi-bin/scripts';
$useropts{'folder'}           = '';

$useropts{'js'}               = '/js' ;
$useropts{'css'}              = '/css' ;
$useropts{'img'}              = '/img' ;
$useropts{'fonts'}            = '/fonts' ;
$useropts{'bower_components'} = '/bower_components' ;
$useropts{'mail'}             = '/mail' ;

$mailpath                     = "$cgipath/data/mail" ;

our $mysqlbakpath             = "/home/mysqlbak";

our $pdfpath                  = $htmlpath . '/pdf' ; 
   
} #------------------------------------------------------------------------------------

sub config_common_html {

# .controls .form-control { height:24px; } .chosen-container { position:relative;max-width:100%; }

# ---------------- spacelab --------------------------------------------------------------------------

# $useropts{'common'}{'css'} = qq(tbody tr td { font-size: 11px; }
# .control-label { font-size:12px; } .controls .form-control { height:24px;font-size:12px; } .controls span.input-group-addon { padding:0px 5px 0px 5px;font-size:12px; } textarea.form-control { font-size:12px; } .chosen-container { position:relative;max-width:100%; } .controls table { font-size:12px; }
# .waybill-dialog .modal-dialog { width: 94%; }
# .medium-dialog .modal-dialog { width: 76%; }
# .table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#EAEAEA}
# label { margin-top:5px; }
# form-control{ padding:8px 12px; }
# ) ;

# ---------------- darkly ----------------------------------------------------------------------------

our $main_bg_color = ($env eq 'DEV') ? 'red' : '#5e5e5e' ;

$useropts{'common'}{'css'} = qq~tbody tr td { font-size: 11px; }
.control-label { font-size:12px; } .controls .form-control { height:24px;font-size:12px; } .controls span.input-group-addon { padding:0px 5px 0px 5px;font-size:12px; } textarea.form-control { font-size:12px; } .chosen-container { position:relative;max-width:100%; } 
.controls table { font-size:12px; }
.label { font-size:12px; }
.fc-event { font-size:12px; }
.form-control, input, textarea { border: 1px solid #AAAAAA; }
.max-dialog .modal-dialog { width: 99%; }
.waybill-dialog .modal-dialog { width: 94%; }
.medium-dialog .modal-dialog { width: 76%; }
.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#EAEAEA; color:#222222; }
.table-striped>tbody>tr:nth-child(even)>td,.table-striped>tbody>tr:nth-child(even)>th{ background-color:#a4a2a2; color:#ffffff; }
.table-striped>tbody>tr:nth-child(odd)>td a:not(.btn) { text-decoration: none; color: #708399; font-weight: bold; }
.table-striped>tbody>tr:nth-child(even)>td a:not(.btn) { text-decoration: none; color: #708399; }
.chosen-container, .help-block { color:#222222; }
label { margin-top:5px; }
form-control{ padding:8px 12px; }
.box-header { background: #5e5e5e ; }
.modal-body, .modal-footer { background-color: #ffffff ; border-top: 1px solid #ffffff; }
.modal-header { border-bottom: 1px solid #ffffff; }
.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}
hr { border-top: 2px solid #5e5e5e; }
body { background-color:#ffffff; color:#222222; }
.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}
.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}
.ffinline { display:inline-block; }
.form-control { height:12px;padding:2px 8px;font-size:12px; }
.search-query { height: 35px; padding: 10px 15px; font-size: 13px; width: 75%; margin-top: 4px; }
.alert-info a { color:#80BEE8 ;}
.alert-info a:hover { color:#ffffff;text-decoration:none;}
th.dt-center, td.dt-center { text-align: center; }
th.dt-right, td.dt-right { text-align: right; }
#atalist .form-control,#spinvlist .form-control,#clientvatlist .form-control,#clientinvlist .form-control,#storagelist .form-control { height:25px;padding:2px 5px;font-size:12px;color:#464545; }
.saccidate { width: 120px; }
.tooltip {white-space:normal}
~ ;

$useropts{'common'}{'css'} .= qq~.navbar-default { background-color: $main_bg_color; } .navbar-default .navbar-nav > li > a { color: white; }~ if $env eq 'DEV' ;

# $useropts{'common'}{'css'} .= qq~
# .buttons .glyphicons:before { padding: 0px; }
# ~;

# .search-query { height:43px;padding:10px 15px;font-size:14px;width:70%; }

my  $menu_list_leave     = qq(<li><a href="$useropts{'folder'}/list-leave">List Leave</a></li>);
my  $menu_leave_settings = qq(<li><a href="$useropts{'folder'}/list-leave-settings">Leave Settings</a></li>);
my  $menu_leave_report   = qq(<li><a href="$useropts{'folder'}/leave-report">Leave Report</a></li>);
our $menu_leave          = '' ;

my  $menu_list_weekend   = qq(<li><a href="$useropts{'folder'}/list-weekend">Weekend Work</a></li>);
my  $menu_weekend_report = qq(<li><a href="$useropts{'folder'}/weekend-report">Weekend Report</a></li>);
our $menu_weekend        = '' ;

# if ($useropts{super}{lc $username}){ 
if ($useropts{boss}{lc $username}){ 
	$menu_leave = qq( 
		<li class="divider"></li>
		$menu_list_leave
		$menu_leave_settings
		$menu_leave_report
		);
	$menu_weekend = qq( 
		<li class="divider"></li>
		$menu_list_weekend
		$menu_weekend_report
		);
	}
else
	{
	$menu_leave = qq( 
		<li class="divider"></li>
		$menu_leave_report
		);
	$menu_weekend = qq( 
		<li class="divider"></li>
		$menu_list_weekend
		);
	}

} #------------------------------------------------------------------------------------

sub config_set_breadcrumbs {
   
our $curr_crumb = $ENV{REQUEST_URI} ;
   $curr_crumb =~ s/\///g ;   
   @curr_crumb = split(/\-/,$curr_crumb) ;   
   @curr_crumb_ucf = map(ucfirst, map(lc,@curr_crumb));   
   $curr_crumb = join(' ', @curr_crumb_ucf);  

$useropts{'breadcrumbs'} = qq(<div><ul class="breadcrumb"><li><a href="$useropts{'folder'}/">Home</a></li>$insert_crumbs<li><a href="$useropts{'folder'}$ENV{REQUEST_URI}">$curr_crumb</a></li></ul></div>) ;

} #------------------------------------------------------------------------------------

1;
