<?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-transport.php"><img src="img/list.png" alt="<?php echo $adminlist ?>" title="<?php echo $adminlist ?>"></a></div>
</div>
<div class="framein">

<?php
$result = $mysqli->query("SELECT priority FROM transport ORDER BY priority desc LIMIT 1");
$row = $result->fetch_array(); 
$pid=$row['priority'];
$priorityid=$pid + 1;
?>			

<form name="forma" method="post" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="5000000">

<?php   
if  (isset($_POST['submit'])) {
$name = $mysqli->real_escape_string(stripslashes($_REQUEST['name']));
$name = strip_tags($name);
$name = preg_replace('/\s+/', ' ',$name);
$startprice = $mysqli->real_escape_string(stripslashes($_REQUEST['startprice']));
$startweightprice = $mysqli->real_escape_string(stripslashes($_REQUEST['startweightprice']));
$kgprice = $mysqli->real_escape_string(stripslashes($_REQUEST['kgprice']));
$publish = $mysqli->real_escape_string(stripslashes($_REQUEST['publish']));	  
$priority = $mysqli->real_escape_string(stripslashes($_REQUEST['priority']));	

$mysqli->query("INSERT INTO transport (name, startprice, startweightprice, kgprice, publish, priority) VALUES ('$name', '$startprice', '$startweightprice', '$kgprice', '$publish', '$priorityid')");
} ?>

  <table>
    <tr>
      <td class="tabletd1">&nbsp;</td> 
      <td class="tabletd2"><?php echo $adminnamed ?> *
        </td>
      <td> 
        <input type="text" name="name" size="100" required>
        </td>
    </tr>
    <tr class="price divdprice">
    <td>&nbsp;</td>
    <td><span class="icon fa-truck"></span>
    <div class="floatright"><span class="icon fa-eur"></span></div>
    </td>
    <td>
    Start < <?php echo $siteweight ?> Kg <input type="text" name="startweightprice" maxlength="11" size="15" class="inputauto">
      &nbsp; &nbsp; 
    Start > <?php echo $siteweight ?> Kg <input type="text" name="startprice" maxlength="11" size="15" class="inputauto">
      &nbsp; &nbsp;    
    Kg <input type="text" name="kgprice" maxlength="11" size="15" class="inputauto">
     </td>
  </tr>
    <tr>
      <td>&nbsp;</td> 
      <td><span class="icon fa-eye" title="<?php echo $adminpublish ?>"></span></td>
      <td><input type="hidden" name="publish" value="no"> 
          <input type="checkbox" name="publish" value="yes" checked></td>
    </tr>
    </table>

     <hr>
  <div class="divallbuttons">
<div class="divlist"><a href="list-transport.php" 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>