<?php 
header("Content-type: text/css;");
$fullurl = (htmlentities($_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'], ENT_QUOTES, "UTF-8"));
$siteurl1 = substr($fullurl, 0, strrpos( $fullurl, '/'));
$siteurl = substr($siteurl1, strrpos($siteurl1, '/') + 1);
$sitename = substr($siteurl, 0, strrpos( $siteurl, '.'));

if (strpos($fullurl, '/sites/') === false) {
require_once 'includes/connect.php';
} else {
require_once 'sites/'.$sitename.'/includes/connect.php';
}

$result = $mysqli->query("SELECT name, color FROM colorcombi ORDER BY id");
while($row = $result->fetch_array()) {
$fnamecolor=$row['name'];
$fcolor=$row['color'];
			
$fresult=$$fnamecolor="$fcolor";

$hex = "$color1";
 
$r = hexdec(substr($hex,0,2)); 
$g = hexdec(substr($hex,2,2)); 
$b = hexdec(substr($hex,4,2));  

$r1=($r)*0.8;
$g1=($g)*0.8;
$b1=($b)*0.8;

$r2=dechex($r1); 
if (strlen($r2)<2) $r2='0'.$r2;   
$g2=dechex($g1); 
if (strlen($g2)<2) $g2='0'.$g2;  
$b2=dechex($b1); 
if (strlen($b2)<2) $b2='0'.$b2;  

$acolor = ($r2 . $g2 . $b2);

$hexb = "$color3";
 
$rb = hexdec(substr($hexb,0,2)); 
$gb = hexdec(substr($hexb,2,2)); 
$bb = hexdec(substr($hexb,4,2));  

$r1=($rb)*0.8;
$g1=($gb)*0.8;
$b1=($bb)*0.8;

$r2=dechex($r1); 
if (strlen($r2)<2) $r2='0'.$r2;   
$g2=dechex($g1); 
if (strlen($g2)<2) $g2='0'.$g2;  
$b2=dechex($b1); 
if (strlen($b2)<2) $b2='0'.$b2;  

$bcolor = ($r2 . $g2 . $b2);
}
$result = $mysqli->query("SELECT fontcss FROM siteinfo");
$row = $result->fetch_array();
$fontcss=$row['fontcss'];
?>
@charset "utf-8";
<?php echo $fontcss ?>

body { background-color: #<?php echo $color10 ?>; }
.pages, .pages:after, .divh, .boxcattitles { border-color: #<?php echo $color3 ?> !important; }
.pages { background-color: #<?php echo $color5 ?>; }
h1, h2, h3, h4 .titlesmenu, .titlesmenu:hover, .titlesmenu a, .titlesmenu a:hover, .titlesmenu2, .titlesmenu2:hover, .titlesmenu2 a, .titlesmenu2 a:hover,  .linksmenu, .linksmenu a { color: #<?php echo $color1 ?>; border-color: #<?php echo $color2 ?> !important; }
h1:after, h2:after { background-color: #<?php echo $color3 ?>; }
.bgrstyle2, .boxmenu { background-color: #<?php echo $color2 ?>; }
.menucontainer { background-color: #<?php echo $color4 ?>; border-color: #<?php echo $color1 ?> !important; }
.menuscrolled { background: #<?php echo $color4 ?> !important;}
.menucontainer:after, .menubox:after {
background: linear-gradient(to right, #<?php echo $color1 ?> 25%,#<?php echo $color3 ?> 25%, #<?php echo $color3 ?> 50%, #<?php echo $color2 ?> 50%, #<?php echo $color2 ?> 75%, #<?php echo $color1 ?> 75%);
background: -webkit-linear-gradient(to right, #<?php echo $color1 ?> 25%,#<?php echo $color3 ?> 25%, #<?php echo $color3 ?> 50%, #<?php echo $color2 ?> 50%, #<?php echo $color2 ?> 75%, #<?php echo $color1 ?> 75%);
background: -ms-linear-gradient(to right, #<?php echo $color1 ?> 25%,#<?php echo $color3 ?> 25%, #<?php echo $color3 ?> 50%, #<?php echo $color2 ?> 50%, #<?php echo $color2 ?> 75%, #<?php echo $color1 ?> 75%);
}
.menudcontainer { background-color: #<?php echo $color5 ?>; color: #<?php echo $color7 ?>; }
.menudbgr { background-color: #<?php echo $color5 ?> !important; }
.menudstyle { background-color: #<?php echo $color9 ?> !important; }
.menudstyle, .menudstyle a, .menudcontent a, .example3b { color: #<?php echo $color3 ?>; }
.boxdownin { background-color: #<?php echo $color2 ?>; border-color: #<?php echo $color3 ?> !important; }
.divbanner { background: #<?php echo $color1 ?>; background: rgba(<?php echo $r ?>, <?php echo $g ?>, <?php echo $b ?>, 0.7); border-color: #<?php echo $color5 ?> }
.banner { background: #<?php echo $color1 ?>; background: rgba(<?php echo $r ?>, <?php echo $g ?>, <?php echo $b ?>, 0.7); color: #<?php echo $color3 ?>; }
.divmodel { color: #<?php echo $color1 ?>; }
.divmodel1 { color: #<?php echo $color3 ?>; }
.divmodel2 { color: #<?php echo $color2 ?>; }
.divcat, .divcat a { color: #<?php echo $color2 ?>; }
.titles, .titles1 { color: #<?php echo $color2 ?>; border-color: #<?php echo $color1 ?> !important; }
.titleextra { color: #<?php echo $color1 ?>; }
a, .titlesboxes, .boxes:hover, .example2a, .example3, .example4, .links, .links1, .price, .links:hover, .boxcat:hover .color1h, .boxreviews:hover .textreviews { color: #<?php echo $color1 ?>; }
a.links1:hover { color: #<?php echo $color3 ?>; }
.boxreviews a { color: #<?php echo $color3 ?> !important; }
.titlesboxes:hover, .boxes:hover .titlesboxes , .boxes2:hover .titlesboxes { color: #<?php echo $color2 ?>; }
.titlesboxes:after { background-color: #<?php echo $color3 ?>; }
.titlesdown, a.titlesdown, .titlesdown a { color: #<?php echo $color6 ?> !important; border-color: #<?php echo $color2 ?> !important; }
.titlesdown1, .linksdown { color: #<?php echo $color3 ?>; }
input, select, textarea, .forms1 { border-color: #<?php echo $color3 ?> !important; }
.button {
color: #<?php echo $color3 ?>;
background-color: #<?php echo $color3 ?>;
background-image: -moz-linear-gradient(top, #<?php echo $color3 ?>, #<?php echo $bcolor ?>);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#<?php echo $color3 ?>), to(#<?php echo $bcolor ?>));
background-image: -webkit-linear-gradient(top, #<?php echo $color3 ?>, #<?php echo $bcolor ?>);
background-image: -o-linear-gradient(top, #<?php echo $color3 ?>, #<?php echo $bcolor ?>);
background-image: linear-gradient(to bottom, #<?php echo $color3 ?>, #<?php echo $bcolor ?>);
background-repeat: repeat-x;
border-color: #<?php echo $color3 ?> !important;
}
.button:hover,
.button1:focus,
.button:active,
.button.active,
.button.disabled,
.button[disabled] { background-color: #<?php echo $color3 ?>; color: #<?php echo $color3 ?>; }
.button1 { background-color: #<?php echo $color1 ?>; color: #<?php echo $color1 ?> !important; border-color: #<?php echo $color1 ?> !important; }
.button1:hover, .button1:focus, .button1:active { background-color: #<?php echo $color2 ?>; color: #<?php echo $color2 ?> !important; border-color: #<?php echo $color2 ?> !important; }
.buttonicon { color: #<?php echo $color3 ?> !important; }
.buttoncart { background-color: #<?php echo $color3 ?>; color: #<?php echo $color3 ?>; }
.buttoncart:hover { background-color: #<?php echo $color2 ?>; }
.menubox { background-color: #<?php echo $color1 ?>; }
.navbar { background-color: #<?php echo $color2 ?>; }
.menubox, .navbar {
background-image: -moz-linear-gradient(top, #<?php echo $color1 ?>, #<?php echo $acolor ?>);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#<?php echo $color1 ?>), to(#<?php echo $acolor ?>));
background-image: -webkit-linear-gradient(top, #<?php echo $color1 ?>, #<?php echo $acolor ?>);
background-image: -o-linear-gradient(top, #<?php echo $color1 ?>, #<?php echo $acolor ?>);
background-image: linear-gradient(to bottom, #<?php echo $color1 ?>, #<?php echo $acolor ?>);
background-repeat: repeat-x;
border-color: #<?php echo $color1 ?> !important;
}
.navbar .nav > li { border-color: #<?php echo $color1 ?>; }
.navbar .nav > li > a, .navbar .nav > li > a:after { background-color: #<?php echo $color1 ?>; }
.navbar .nav > li > a:focus, .navbar .nav > li > a:hover, .navbar .nav > li > a.navactive, .navbar .nav > li > a:hover:after, .navbar .nav > li > a.navactive:after, .navbar .nav li.dropdown:focus > .dropdown-toggle, .navbar .nav li.dropdown:hover > .dropdown-toggle, .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle
{ background: #<?php echo $color1 ?>; color: #<?php echo $color1 ?>; border-color: #<?php echo $color3 ?> !important; }
.caret { background-color: #<?php echo $color3 ?>; border-top-color: #<?php echo $color3 ?> !important; }
.navbar .nav li.dropdown:focus .caret, .navbar .nav li.dropdown:hover .caret { border-top-color: #<?php echo $color1 ?> !important; }
.dropdown-menu { background-color: #<?php echo $color1 ?>; border-color: #<?php echo $color3 ?>; }
.dropdown-menu > li > a { background-color: #<?php echo $color1 ?>; border-color: #<?php echo $color1 ?>; }
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-submenu:hover > a,
.dropdown-submenu:focus > a,
.dropdown-menu > li > a.navactive-submenu { background-color: #<?php echo $color2 ?>; color: #<?php echo $color1 ?>; border-color: #<?php echo $color1 ?>;}
.dropdown-container { border-color: #<?php echo $color1 ?> !important; }
.titlesnav { background-color: #<?php echo $color2 ?>; }
.licat, .dropdown-menu > .licat > a { background-color: #<?php echo $color2 ?> !important; border-color: #<?php echo $color2 ?>; }
.licat a { color: #<?php echo $color1 ?> !important; }
.extrascat { background-color: #<?php echo $color2 ?>; }
.extrascat, .arrowcat { border-color: #<?php echo $color2 ?> !important; }
.navlink, .navlink a { color: #<?php echo $color2 ?> !important; }
.boxin { background-color: #<?php echo $color8 ?>; border-color: #<?php echo $color1 ?> !important; }
.boxin:hover { background-color: #<?php echo $color3 ?>; border-color: #<?php echo $color3 ?> !important; }
.boxin:hover .img-item, .img-item { border-color: #<?php echo $color5 ?> !important; }
.boxin:hover .button { border-color: #<?php echo $color8 ?> !important; }
.boximage-item { background-color: #<?php echo $color8 ?>; }
.boxtitles:hover, .boxin:hover .boxtitles { color: #<?php echo $color3 ?>; }
.boxcat:hover .color2h { color: #<?php echo $color2 ?>; }
.img-boxes { border-color: #<?php echo $color5 ?>; }
.img-social:hover { background-color: #<?php echo $color2 ?>; }
.img-share:hover, .navibutton:hover, .pagination a:hover, .pagination a:active, .pagination span.active { background-color: #<?php echo $color3 ?>; }
.pagination a, .pagination span { border-color: #<?php echo $color3 ?>; }
.arrowtop { color: #<?php echo $color3 ?>; }
.arrowtop:hover, arrowtop:focus, arrowtop:active { background-color: #<?php echo $color3 ?>; color: #<?php echo $color6 ?>; }
.ui-widget-content { background: #ffffff; border-color: #<?php echo $color3 ?> !important; }
.ui-widget-header { background: #<?php echo $color2 ?>; }
.ui-state-active { background: #<?php echo $color3 ?> !important; }
.color1, .color1h:hover { color: #<?php echo $color1 ?>; }
.color2, .color2h:hover  { color: #<?php echo $color2 ?>; }
.color3, .color3h:hover  { color: #<?php echo $color3 ?>; }
.color4, .color4h:hover  { color: #<?php echo $color4 ?>; }
.color5, .color5h:hover  { color: #<?php echo $color5 ?>; }
.color6, .color6h:hover  { color: #<?php echo $color6 ?>; }
.color7, .color7h:hover  { color: #<?php echo $color7 ?>; }
.color8, .color8h:hover  { color: #<?php echo $color8 ?>; }
.color9, .color9h:hover  { color: #<?php echo $color9 ?>; }
.color10, .color10h:hover  { color: #<?php echo $color10 ?>; }
.bgrcolor1 { background-color: #<?php echo $color1 ?>; }
.bgrcolor2 { background-color: #<?php echo $color2 ?>; }
.bgrcolor3 { background-color: #<?php echo $color3 ?>; }
.bgrcolor4 { background-color: #<?php echo $color4 ?>; }
.bgrcolor5 { background-color: #<?php echo $color5 ?>; }
.bgrcolor6, .bgrcolor6h:hover  { background-color: #<?php echo $color6 ?>; }
.bgrcolor7, .bgrcolor7h:hover  { background-color: #<?php echo $color7 ?>; }
.bgrcolor8, .bgrcolor8h:hover  { background-color: #<?php echo $color8 ?>; }
.bgrcolor9, .bgrcolor9h:hover  { background-color: #<?php echo $color9 ?>; }
.bgrcolor10, .bgrcolor10h:hover  { background-color: #<?php echo $color10 ?>; }
.bordercolor1, .bordercolor1:hover { border-color: #<?php echo $color1 ?> !important; }
.bordercolor2, .bordercolor2:hover  { border-color: #<?php echo $color2 ?> !important; }
.bordercolor3, .bordercolor3:hover  { border-color: #<?php echo $color3 ?> !important; }
.bordercolor4, .bordercolor4:hover  { border-color: #<?php echo $color4 ?> !important; }
.bordercolor5, .bordercolor5:hover  { border-color: #<?php echo $color5 ?> !important; }
.bordercolor6, .bordercolor6h:hover  { border-color: #<?php echo $color6 ?> !important; }
.bordercolor7, .bordercolor7h:hover  { border-color: #<?php echo $color7 ?> !important; }
.bordercolor8, .bordercolor8h:hover  { border-color: #<?php echo $color8 ?> !important; }
.bordercolor9, .bordercolor9h:hover  { border-color: #<?php echo $color9 ?> !important; }
.bordercolor10, .bordercolor10h:hover  { border-color: #<?php echo $color10 ?> !important; }
.colorlight { background-color: rgba(<?php echo $r ?>, <?php echo $g ?>, <?php echo $b ?>, 0.1) }
.carousel-inner { background-color: rgba(<?php echo $r ?>, <?php echo $g ?>, <?php echo $b ?>, 0.1) }
@media (max-width: 1200px) {
.menucontainer { background-color: #<?php echo $color4 ?> !important; }
}