<?php include 'sets.php';?>
<?php
$superuser="1";
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webadmin <?php echo $domain ?></title>
<?php include 'codes.php';?>
</head>
<body>

<?php include 'navbar.php';?>
    
<div class="container">
<div class="frame">
<div class="frametitles fedit"><a href="sitelayout.php"><?php echo $admincolors ?> & Layout</a></div>

<div class="framein">
<?php
if  (isset($_POST['deleteimg2'])) {
unlink("./".$filepath."2.jpg");
}
if  (isset($_POST['deleteimg3'])) {
unlink("./".$filepath."3.jpg");
}
if  (isset($_POST['deleteimg4'])) {
unlink("./".$filepath."4.jpg");
}

if  (isset($_POST['submit'])) {

foreach($_REQUEST['id'] as $key => $idvalue ) {
$color = $mysqli->real_escape_string(stripslashes($_REQUEST['color'.$idvalue]));	
$mysqli->query("UPDATE colorcombi SET color='$color' WHERE id='$idvalue'");
}

$slide = $mysqli->real_escape_string(stripslashes($_REQUEST['slide']));
$stylesheet = $mysqli->real_escape_string(stripslashes($_REQUEST['stylesheet']));
$fontcss = $mysqli->real_escape_string(stripslashes($_REQUEST['fontcss']));
$customcss = $mysqli->real_escape_string(stripslashes($_REQUEST['customcss']));

$mysqli->query("UPDATE siteinfo SET slide='$slide', stylesheet='$stylesheet', fontcss='$fontcss', customcss='$customcss'");

if  ( $_FILES['upload']['tmp_name'] != "" ) {

	    $file_tmp =$_FILES['upload']['tmp_name'];
	   
		$uploaddir = $filepath; 
		$uploadname = 'logo.png'; 
	
		copy($file_tmp,$uploaddir.$uploadname);
	
resizephoto($uploaddir.$uploadname,$uploaddir.$uploadname,$thumb_w,$thumb_h);
}

if  ( $_FILES['uploadp']['tmp_name'] != "" ) {

	    $file_tmp =$_FILES['uploadp']['tmp_name'];
	   
		$uploaddir = $filepath; 
		$uploadname = '1.jpg'; 
	
		copy($file_tmp,$uploaddir.$uploadname);
	
resizephoto($uploaddir.$uploadname,$uploaddir.$uploadname,$thumb_w,$thumb_h);
}

if  ( $_FILES['uploadp2']['tmp_name'] != "" ) {

	    $file_tmp =$_FILES['uploadp2']['tmp_name'];
	   
		$uploaddir = $filepath; 
		$uploadname = '2.jpg'; 
	
		copy($file_tmp,$uploaddir.$uploadname);
	
resizephoto($uploaddir.$uploadname,$uploaddir.$uploadname,$thumb_w,$thumb_h);
}

if  ( $_FILES['uploadp3']['tmp_name'] != "" ) {

	    $file_tmp =$_FILES['uploadp3']['tmp_name'];
	   
		$uploaddir = $filepath; 
		$uploadname = '3.jpg'; 
	
		copy($file_tmp,$uploaddir.$uploadname);
	
resizephoto($uploaddir.$uploadname,$uploaddir.$uploadname,$thumb_w,$thumb_h);
}

if  ( $_FILES['uploadp4']['tmp_name'] != "" ) {

	    $file_tmp =$_FILES['uploadp4']['tmp_name'];
	   
		$uploaddir = $filepath; 
		$uploadname = '4.jpg'; 
	
		copy($file_tmp,$uploaddir.$uploadname);
	
resizephoto($uploaddir.$uploadname,$uploaddir.$uploadname,$thumb_w,$thumb_h);
}

}?> 

<form name="forma" method="post" enctype="multipart/form-data">

<table class="tablewidth">
  <tr valign="top">
    <td class="padright30">
  <?php
$result = $mysqli->query("SELECT * FROM colorcombi ORDER BY id");
while($row = $result->fetch_array()) {
$id=$row['id'];
$name=$row['name'];
$description=$row['description'];
$color=$row['color'];
?>
      
  <table>
    <tr>
      <td class="tabletd1"><b><?php echo $id ?></b></td>
      <td class="tabletd2">&raquo; <?php echo $description ?></td>
      <td class="tabletd2" bgcolor="#<?php echo $color ?>">&nbsp;</td>
      <td><input type="hidden" name="id[]" value="<?php echo $id ?>">
        #
        <input type="text" name="color<?php echo $id ?>" size="15" value="<?php echo $color ?>" maxlength="6" class="inputauto jscolor {position:'right'}"></td>
      </tr>
    </table>
  <?php } ?> 
    </td>
    <td>
  <table>
    <tr>
      <td class="tabletd1"><span class="icon icstyle2 fa-creative-commons color1"></span></td>
      <td>Logo</td>
      <td><input name="upload" type="file" size="15" title="upload .png" class="inputfilesmall"> (.png) &nbsp; &nbsp;
        <img src="<?php echo $filepath ?>logo.png">
        </td>
      </tr>
    <tr>
      <td><span class="icon icstyle2 fa-image color1"></span></td>
      <td>Photo</td>
      <td><input name="uploadp" type="file" size="15" title="upload photo .jpg" class="inputfilesmall"> (.jpg) &nbsp; &nbsp;
        <img src="<?php echo $filepath ?>1.jpg" width="80">
        </td>
      </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="icon fa-envelope-open" title="<?php echo $adminform ?>"></span> </td>
      <td><input name="uploadp2" type="file" size="15" title="upload photo .jpg" class="inputfilesmall"> (.jpg) &nbsp; &nbsp;
        <?php if (file_exists("./".$filepath."2.jpg")) { ?>
        <img src="<?php echo $filepath ?>2.jpg" width="80" alt="<?php echo $adminform ?>">
        <button type="submit" name="deleteimg2" title="<?php echo $admindelete ?> <?php echo $adminimg ?>" class="buttonicon color1"><span class="icon fa-trash-o"></span></button>
        <?php } ?>  
        </td>
      </tr>
    <?php if ($seasons==1) { ?>
    <tr>
      <td>&nbsp;</td>
      <td><span class="icon fa-euro" title="<?php echo $adminpricelist ?>"></span></td>
      <td><input name="uploadp3" type="file" size="15" title="upload photo .jpg" class="inputfilesmall">  (.jpg) &nbsp; &nbsp;
        <?php if (file_exists("./".$filepath."3.jpg")) { ?>
        <img src="<?php echo $filepath ?>3.jpg" width="80" alt="<?php echo $adminpricelist ?>">
        <button type="submit" name="deleteimg3" title="<?php echo $admindelete ?> <?php echo $adminimg ?>" class="buttonicon color1"><span class="icon fa-trash-o"></span></button>
        <?php } ?>
        </td>
      </tr>
    <?php } ?>
    <?php if ($reviews==1) { ?>
    <tr>
      <td>&nbsp;</td>
      <td><span class="icon fa-comments" title="<?php echo $adminreviews ?>"></span></td>
      <td><input name="uploadp4" type="file" size="15" title="upload photo .jpg" class="inputfilesmall">  (.jpg) &nbsp; &nbsp;
        <?php if (file_exists("./".$filepath."4.jpg")) { ?>
        <img src="<?php echo $filepath ?>4.jpg" width="80" alt="<?php echo $adminreviews ?>">
        <button type="submit" name="deleteimg4" title="<?php echo $admindelete ?> <?php echo $adminimg ?>" class="buttonicon color1"><span class="icon fa-trash-o"></span></button>
        <?php } ?>
        </td>
      </tr>
    <?php } ?>
    
        <tr>
      <td colspan="3"><hr></td>
      </tr>
    <tr>
      <td><span class="icon icstyle2 fa-dot-circle-o color3"></span></td>
      <td>Icons</td>
      <td><a href="http://fontawesome.io/icons/" target="_blank" class="color3">&raquo; Font Awesome</a></td>
    </tr>
    </table>
    </td>
  </tr>
</table>

<hr>

<?php
$result = $mysqli->query("SELECT * FROM siteinfo");
$row = $result->fetch_array();
$slide=$row['slide'];
$stylesheet=$row['stylesheet'];
$fontcss=$row['fontcss'];
$customcss=$row['customcss'];
?>
<input type="hidden" name="stylesheet" value="<?php echo $stylesheet ?>">
<input type="hidden" name="customcss" value="<?php echo $customcss ?>">

<table>
          <tr>
            <td class="tabletd1"><span class="icon icstyle2 fa-desktop color1"></span></td>
            <td class="tabletd2">Layout</td>
            <td>
<div>

<div class="divlayout">    
  <div>default
    <input type="radio" name="stylesheet" value="0"<?php if ($stylesheet==0) { echo " checked"; }?>></div>
  <div>
    <a id="thumb" href="layout/layout.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout default" title="Layout default"></a> 
  </div> 
</div>

<div class="divlayout">
  <div><strong>1</strong> 
  <input type="radio" name="stylesheet" value="1"<?php if ($stylesheet==1) { echo " checked"; }?>></div>
  <div>
    <a id="thumb1" href="layout/layout1.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout1.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 1" title="Layout 1"></a> 
  </div>  
</div>

<div class="divlayout">
  <div><strong>2</strong> 
  <input type="radio" name="stylesheet" value="2"<?php if ($stylesheet==2) { echo " checked"; }?>></div>
  <div>
    <a id="thumb2" href="layout/layout2.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout2.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 2" title="Layout 2"></a> 
  </div>    
</div>

<div class="divlayout">
  <div><strong>3</strong> 
  <input type="radio" name="stylesheet" value="3"<?php if ($stylesheet==3) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout3.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout3.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 3" title="Layout 3"></a></div>    
</div>

<div class="divlayout">
  <div><strong>4</strong>
  <input type="radio" name="stylesheet" value="4"<?php if ($stylesheet==4) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout4.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout4.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 4" title="Layout 4"></a></div>  
</div>

<div class="divlayout">
  <div><strong>5</strong> portal
  <input type="radio" name="stylesheet" value="5"<?php if ($stylesheet==5) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout5.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout5.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 5-portal" title="Layout 5-portal"></a></div>  
</div>

<div class="divlayout">
  <div><strong>6</strong> columns
  <input type="radio" name="stylesheet" value="6"<?php if ($stylesheet==6) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout6.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout6.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 6-columns" title="Layout 6-columns"></a></div>  
</div>

<div class="divlayout">
  <div><strong>7</strong>
  <input type="radio" name="stylesheet" value="7"<?php if ($stylesheet==7) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout7.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout7.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 7" title="Layout 7"></a></div>   
</div>

<div class="divlayout">
  <div><strong>8</strong>
  <input type="radio" name="stylesheet" value="8"<?php if ($stylesheet==8) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout8.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout8.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 8" title="Layout 8"></a></div>   
</div>

<div class="divlayout">
  <div><strong>9</strong>
  <input type="radio" name="stylesheet" value="9"<?php if ($stylesheet==9) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout9.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout9.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 9" title="Layout 9"></a></div>   
</div>

<div class="divlayout">
  <div><strong>10</strong>
  <input type="radio" name="stylesheet" value="10"<?php if ($stylesheet==10) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout10.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout10.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 10" title="Layout 10"></a></div>    
</div>

<div class="divlayout">
  <div><strong>11</strong>
  <input type="radio" name="stylesheet" value="11"<?php if ($stylesheet==11) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout11.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout11.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 11" title="Layout 11"></a></div>     
</div>

<div class="divlayout">
  <div><strong>12</strong>
  <input type="radio" name="stylesheet" value="12"<?php if ($stylesheet==12) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout12.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout12.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 12" title="Layout 12"></a></div>     
</div>

<div class="divlayout">
  <div><strong>13</strong>
  <input type="radio" name="stylesheet" value="13"<?php if ($stylesheet==13) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout13.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout13.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 13" title="Layout 13"></a></div>  
</div>

<div class="divlayout">
  <div><strong>14</strong>
  <input type="radio" name="stylesheet" value="14"<?php if ($stylesheet==14) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout14.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout14.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 14" title="Layout 14"></a></div>    
</div>

<div class="divlayout">
  <div><strong>15</strong>
  <input type="radio" name="stylesheet" value="15"<?php if ($stylesheet==15) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout15.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout15.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 15" title="Layout 15"></a></div>    
</div>

<div class="divlayout">
  <div><strong>16</strong>
  <input type="radio" name="stylesheet" value="16"<?php if ($stylesheet==16) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout16.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout16.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 16" title="Layout 16"></a></div>    
</div>

<div class="divlayout">
  <div><strong>17</strong>
  <input type="radio" name="stylesheet" value="17"<?php if ($stylesheet==17) { echo " checked"; }?>></div>
  <div><a id="thumb" href="layout/layout17.jpg" onclick="return hs.expand(this)"><img src="../includes/image.php?image=../webadmin/layout/layout17.jpg&amp;nwidth=100" class="lphoto plinks" alt="Layout 17" title="Layout 17"></a></div>    
</div>

<div class="cleared"></div>
</div>
            </td>
          </tr>
          <tr>
            <td><span class="icon icstyle2 fa-toggle-on color1"></span></td>
            <td>Slideshow</td>
            <td>
            <table class="tablewidth pad5">
              <tr class="text-center">
                <td class="colortd"><span class="icon fa-long-arrow-left color1" title="right-left"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="0"<?php if ($slide==0) { echo " checked"; }?> title="right-left"></td>
                <td class="colortd"><span class="icon fa-long-arrow-right color1" title="left-right"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="1"<?php if ($slide==1) { echo " checked"; }?> title="left-right"></td>
                <td class="colortd"><span class="icon fa-long-arrow-up color1" title="down-up"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="2"<?php if ($slide==2) { echo " checked"; }?> title="down-up"></td>
                <td class="colortd"><span class="icon fa-long-arrow-down color1" title="up-down"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="3"<?php if ($slide==3) { echo " checked"; }?> title="up-down"></td>
                <td class="colortd"><span class="icon fa-clone color1" title="fade"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="4"<?php if ($slide==4) { echo " checked"; }?> title="fade"></td>
                <td class="colortd"><span class="icon fa-clone iconbig color1" title="fade zoom-in"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="5"<?php if ($slide==5) { echo " checked"; }?> title="fade zoom-in"></td>
                <td class="colortd"><span class="icon fa-clone iconsmall color1" title="fade zoom-out"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="6"<?php if ($slide==6) { echo " checked"; }?> title="fade zoom-out"></td>
                <td class="colortd"><span class="icon fa-files-o iconsmall color1" title="fade decrease"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="7"<?php if ($slide==7) { echo " checked"; }?> title="fade decrease"></td>
                <td class="colortd"><span class="icon fa-files-o color1" title="fade zoom-in-out"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="8"<?php if ($slide==8) { echo " checked"; }?> title="fade zoom-in-out"></td>
                <td class="colortd"><span class="icon fa-random color1" title="fade move"></span></td>
                <td class="padright20"><input type="radio" name="slide" value="9"<?php if ($slide==9) { echo " checked"; }?> title="fade move"></td>
              </tr>
              </table>
            </td>
          </tr>
<tr>
            <td><span class="icon icstyle2 color1">{ }</span></td>
            <td>Font css</td>
            <td><textarea name="fontcss" cols="75" rows="4"><?php echo $fontcss ?></textarea></td>
          </tr>          
          <tr>
            <td>&nbsp;</td>
            <td>Custom css</td>
            <td><textarea name="customcss" cols="75" rows="16"><?php echo $customcss ?></textarea></td>
          </tr>
          
</table>

   <div class="divallbuttons">
<div class="divlist"></div>   
<div class="divbuttons">
  <button type="submit" name="submit" class="button"><span class="icon fa-check"></span> <?php echo $adminsubmit ?></button>
  <button type="reset" name="reset" class="button buttondelete"><span class="icon fa-refresh"></span> <?php echo $adminreset ?></button> 
</div>
   </div>  
   
     </form> 
      
</div>
</div>
</div>

<?php include 'menudown.php';?>

</body>
</html>