<?php include 'sets.php';?>
<?php
$superuser="0";
?>
<!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="wsinfo.php"><?php echo $adminsiteinfo ?></a></div>
<div class="framein">

<?php
$result1 = $mysqli->query("SELECT * FROM lang WHERE main=1");
$row = $result1->fetch_array(); 
$dir1=$row['dir'];

$result = $mysqli->query("SELECT * FROM siteinfo");
$row = $result->fetch_array(); 
$domain=$row['domain'];
$firma=$row['firma'];
$sitemail=$row['sitemail'];
$paymail=$row['paymail'];
$x=$row['x'];
$y=$row['y'];
$map=$row['map'];
$resurl=$row['resurl'];
$payurl=$row['payurl'];
$sitenr=$row['sitenr'];
$sitecode=$row['sitecode'];
$promocode=$row['promocode'];
$sitescript=$row['sitescript'];
$sitescript2=$row['sitescript2'];
$sitescript3=$row['sitescript3'];
$langadmin=$row['langadmin'];
$user=$row['user'];
$editor=$row['editor'];
$package=$row['package'];
$type=$row['type'];
$inquiry=$row['inquiry'];
$payment=$row['payment'];
$availability=$row['availability'];
$imgsite=$row['imgsite'];
$imgcat=$row['imgcat'];
$imgitem=$row['imgitem'];
$nritems=$row['nritems'];
$decimalprice=$row['decimalprice'];
$discount=$row['discount'];
$discount2=$row['discount2'];
$weight=$row['weight'];
$siteitem=$row['siteitem'];
$siteform=$row['siteform'];
$sitepath=$row['sitepath'];
$stylesheet=$row['stylesheet'];
$fontcss=$row['fontcss'];
$customcss=$row['customcss'];
?>

<?php
if  (isset($_POST['submit'])) {
$langadmin = $mysqli->real_escape_string(stripslashes($_REQUEST['langadmin']));
$editor = $mysqli->real_escape_string(stripslashes($_REQUEST['editor']));
$imgsite = $mysqli->real_escape_string(stripslashes($_REQUEST['imgsite']));
$imgcat = $mysqli->real_escape_string(stripslashes($_REQUEST['imgcat']));
$imgitem = $mysqli->real_escape_string(stripslashes($_REQUEST['imgitem']));
$nritems = $mysqli->real_escape_string(stripslashes($_REQUEST['nritems']));
$discount = $mysqli->real_escape_string(stripslashes($_REQUEST['discount']));
$discount2 = $mysqli->real_escape_string(stripslashes($_REQUEST['discount2']));
			 	 
$mysqli->query("UPDATE siteinfo SET langadmin='$langadmin', editor='$editor', imgsite='$imgsite', imgcat='$imgcat', imgitem='$imgitem', nritems='$nritems', discount='$discount', discount2='$discount2'");
?>
<meta http-equiv="refresh" content="0">
<?php } ?>  

<form name="forma" method="post" enctype="multipart/form-data">
  <table>
           <tr>
             <td class="tabletd1">
<?php
$result1 = $mysqli->query("SELECT * FROM lang WHERE id='$langadmin'");
$row = $result1->fetch_array(); 
$language=$row['language'];
$dir=$row['dir'];
?>
               <img src="img/<?php echo $dir ?>.png" width="16" height="16" title="<?php echo $language ?>" alt="<?php echo $language ?>"></td>
             <td class="tabletd2">Webadmin <?php echo $adminlang ?></td>
             <td>
<select name="langadmin">
<?php
$result2 = $mysqli->query("SELECT * FROM lang WHERE active=1 ORDER BY priority");
while($row = $result2->fetch_array()) {
$langid=$row['id'];
$language=$row['language'];
$dir=$row['dir'];
?>
<option value="<?php echo $langid ?>"<?php if ($langid==$langadmin) { echo " selected"; }?>> 
<?php echo $language ?>
</option>
<?php } ?>
</select>
               &nbsp; &nbsp; &nbsp; &nbsp;
               Html editor    &nbsp; &nbsp;
              <input type="hidden" name="editor" value="0"> <input type="checkbox" name="editor" value="1"<?php if ($editor==1) { echo " checked"; }?>>
               </td>
           </tr>
           <tr>
             <td><hr></td>
             <td><hr></td>
             <td><hr></td>
           </tr>
           <tr>
             <td><span class="icon fa-cogs"></span></td>
             <td>Website</td>
             <td>
             <table class="tablewidth">
               <tr>
                 <td><?php echo $adminitems ?> / <?php echo $adminpage ?></td>
                 <td>&nbsp;</td>
                 <td><span title="<?php echo $adminimg ?> Website header"><?php echo $adminimg ?> site</span></td>
                 <td>&nbsp;</td>
                 <td><span title="<?php echo $adminitemimgdet ?>"><?php echo $adminitemimg ?></span></td>
                 <td>&nbsp;</td>
                 <td class="divimgmenu"><span title="<?php echo $admincatimgdet ?>"><?php echo $admincatimg ?></span></td>
                 <td>&nbsp;</td>
                 <td><span title="<?php echo $admindiscountdet ?>"><?php echo $admindiscount ?></span></td>
                 <?php if ($type==3 OR $type==5) { ?>
                 <td><span title="<?php echo $admindiscountdet ?>"><?php echo $admindiscount ?></span> <?php echo $adminchildren ?></td>
                 <?php } ?>
                 <td>&nbsp;</td>
                 <td>&nbsp;</td>
                </tr>
               <tr>
                 <td><input name="nritems" type="text" value="<?php echo $nritems ?>" size="2" maxlength="3" class="inputauto"></td>
                 <td>&nbsp;</td>
                 <td><input type="hidden" name="imgsite" value="0">
                   <input type="checkbox" name="imgsite" value="1"<?php if ($imgsite==1) { echo " checked"; }?>></td>
                 <td>&nbsp;</td>
                 <td>
              <input type="hidden" name="imgitem" value="0">
              <span class="icon icstyle fa-times-circle"></span> <input type="radio" name="imgitem" value="2"<?php if ($imgitem==2) { echo " checked"; }?>>
              &nbsp; &nbsp;
              <span class="icon icstyle fa-folder"></span> <input type="radio" name="imgitem" value="0"<?php if ($imgitem==0) { echo " checked"; }?>>
              &nbsp; &nbsp;
              <span class="icon icstyle fa-desktop"></span> <input type="radio" name="imgitem" value="1"<?php if ($imgitem==1) { echo " checked"; }?>>
                   </td>
                 <td>&nbsp;</td>
                 <td class="divimgmenu">
                <input type="hidden" name="imgcat" value="0"> <input type="checkbox" name="imgcat" value="1"<?php if ($imgcat==1) { echo " checked"; }?>>
                   </td>
                 <td>&nbsp;</td>
                 <td><input type="text" name="discount" value="<?php echo $discount ?>" size="2" maxlength="11" class="inputauto"> % </td>
                 <?php if ($type==3 OR $type==5) { ?>
                 <td><input type="text" name="discount2" value="<?php echo $discount2 ?>" size="2" maxlength="11" class="inputauto"> % </td>
                 <?php } ?>
                 <td>&nbsp;</td>
                 <?php if ($type==2) { ?>
                 <td><a href="list-transport.php" class="color3"><span class="icon icstyle fa-truck"></span> <?php echo $admintransport ?></a> </td>
                 <?php } ?>
                </tr>
               </table></td>
           </tr>
          <tr class="overlinet">
            <td></td>
            <td></td>
            <td></td>
          </tr>
        </table>

       <hr>
  <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>   

<?php
$resultst = $mysqli->query("SELECT * FROM langvars WHERE lang_id=$lang AND editable=1 ORDER BY priority, id, name");
while($row = $resultst->fetch_array()) {
$id=$row['id'];
$insert_id=$row['insert_id'];
$name=$row['name'];
$text=$row['text'];
?>
<div class="framerow pad10">
<div class="trigger"> 
<div class="divfloat1"><?php echo $text ?></div> <div class="linkoption" title="<?php echo $adminedit ?>"><span class="icon fa-edit"></span> <?php echo $adminedit ?></div> 
</div>  
<div class="toggle-container"> 
<?php include 'edit-sitetext.php';?>
</div>           
</div>
<?php } ?>

</div>

</div>
</div>

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

</body>
</html>