<?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 fadd"><?php echo $adminadd ?>
<div class="floatright"><a href="list-categories.php?t=4"><img src="img/list.png" alt="<?php echo $adminlist ?>" title="<?php echo $adminlist ?>"></a></div>
</div>
<div class="framein">

<form name="forma" method="post" enctype="multipart/form-data">
<?php
if  (isset($_POST['submit'])) {
$id = $mysqli->real_escape_string(stripslashes($_REQUEST['id']));
$category_id = $mysqli->real_escape_string(stripslashes($_REQUEST['category_id']));
$name = $mysqli->real_escape_string(stripslashes($_REQUEST['name']));
$name = strip_tags($name);
$name = preg_replace('/\s+/', ' ',$name);
$name = mb_convert_case($name, MB_CASE_TITLE, "UTF-8");
$email = $mysqli->real_escape_string(stripslashes($_REQUEST['email']));
$email=preg_replace('/\s+/', '', $email);
$email = strtolower($email);
$address = $mysqli->real_escape_string(stripslashes($_REQUEST['address']));
$address = mb_convert_case($address, MB_CASE_TITLE, "UTF-8");
$city = $mysqli->real_escape_string(stripslashes($_REQUEST['city']));
$city = mb_convert_case($city, MB_CASE_TITLE, "UTF-8");
$country = $mysqli->real_escape_string(stripslashes($_REQUEST['country']));
$country = mb_convert_case($country, MB_CASE_TITLE, "UTF-8");
$tel = $mysqli->real_escape_string(stripslashes($_REQUEST['tel']));
$fax = $mysqli->real_escape_string(stripslashes($_REQUEST['fax']));
$comments = $mysqli->real_escape_string(stripslashes($_REQUEST['comments']));
$date = $mysqli->real_escape_string(stripslashes($_REQUEST['date']));
	
$mysqli->query("INSERT INTO members (category_id, name, email, address, city, country, tel, fax, comments, date) VALUES ('$category_id', '$name', '$email', '$address', '$city', '$country', '$tel', '$fax', '$comments', '$date')");
}?>
  
  <table>
    <tr>
            <td class="tabletd1">&nbsp;</td> 
            <td class="tabletd2"><span class="icon fa-folder-open"></span></td>
            <td> 
<select name="category_id">
<?php
$result = $mysqli->query("SELECT * FROM categories WHERE type=4 AND active=1 AND lang_id=$lang ORDER BY priority");
while($row = $result->fetch_array()) {
$catid=$row['insert_id'];
$category=$row['name'];
?>
<option value="<?php echo $catid ?>"> 
<?php echo $category ?>
</option>                
<?php } ?>
</select>
            </td>
          </tr>
    <tr>
      <td>&nbsp;</td> 
      <td><?php echo $adminname ?> *</td>
      <td> 
        <input type="text" name="name" size="50" title="<?php echo $adminname ?>" class="inputauto" required>
         &nbsp; &nbsp; &nbsp; &nbsp; 
      <span class="icon fa-envelope" title="Email"></span> &nbsp; 
      <input type="text" name="email" size="40" title="Email" class="inputauto">
        </td>
    </tr>
    <tr>
      <td>&nbsp;</td> 
      <td><span class="icon fa-map-marker" title="<?php echo $adminaddress ?>"></span></td>
      <td>
      <input type="text" name="address" size="40" title="<?php echo $adminaddress ?>" class="inputauto">
      &nbsp; 
      <input type="text" name="city" size="30" title="<?php echo $admincity ?>" class="inputauto">
      &nbsp; 
      <input type="text" name="country" size="30" title="<?php echo $admincountry ?>" class="inputauto">
     </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>
      <span class="icon fa-phone" title="Tel"></span>
      </td>
      <td>
      <input type="text" name="tel" size="30" class="inputauto">
      &nbsp; &nbsp; &nbsp; &nbsp; 
      <span class="icon fa-fax" title="Fax"></span> &nbsp; 
      <input type="text" name="fax" size="30" class="inputauto">    
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="icon fa-comment" title="<?php echo $adminreviews ?>"></span></td>
      <td><div class="diveditor">
        <textarea name="comments" cols="75" rows="10" class="mceEditor"></textarea></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="icon fa-calendar" title="<?php echo $admindate ?>"></span></td>
      <td><input type="text" name="date" value="<?php echo date ("j.m.Y"); ?>" size="15" maxlength="10" class="inputauto"></td>
    </tr>
    </table>

     <hr>
  <div class="divallbuttons">
<div class="divlist"><a href="list-categories.php?t=4" title="<?php echo $adminlist ?>" class="icstyle1 color1"><span class="icon fa-tasks"></span></a></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>