<?php require_once "connect.php"; ?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>UPDATE SITE SYSTEM</title>
<style type="text/css">
@import url('../sf/font-awesome.min.css');
html, 
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height:130%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
 color: #555555;
 background: #ffffff;
 margin: 0;
}
a { color: #25c4eb !important; }
.button {
display: inline-block;
padding: 10px 30px;
*margin-left: .3em;
font-size: 20px;
text-align: center;
cursor: pointer;
color: #ffffff;
text-decoration: none;
 background-color: #fc6344;
*background-color: #fc6344;
-webkit-border-radius: 3px;
 -moz-border-radius: 3px;
border-radius: 3px;
border: none;
*zoom: 1;
-webkit-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.button:hover,
.button:focus,
.button:active,
.button.active {
background-color: #9bd161;
}
.icon {
font-family: FontAwesome;
text-decoration: none;
}
.icon:before {
display: inline-block;
text-decoration: none;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}
.icon > .label {
display: none;
}
.icstyle {
font-size: 30px;	
}
</style>
</head>

<body>

<div style="padding: 50px; text-align:center;">

<div style="padding: 10px; text-align:center;">
<a href="."><span class="icon icstyle fa-home"></span></a>
&nbsp; &nbsp; &nbsp; &nbsp; 
<a href="update.php"><span class="icon icstyle fa-refresh"></span></a>
</div>
<hr>

<div style="font-size: 24px; padding-top: 100px; padding-bottom: 50px;"> UPDATE SITE SYSTEM</div>

<?php
$result = $mysqli->query("SELECT * FROM langvars order by insert_id desc LIMIT 1");
$row = $result->fetch_array(); 	
$id=$row['insert_id'];
$name=$row['name'];
$insertid=$id+1;
$insertid2=$id+2;
$insertid3=$id+3;
$insertid4=$id+4;
$insertid4=$id+4;
$insertid5=$id+5;
$insertid6=$id+6;

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

$mysqli->query("INSERT INTO `langvars` (`insert_id`, `lang_id`, `name`, `details`, `text`, `editable`, `priority`) VALUES
('$insertid', 1, 'buttonupdate', '', 'Ενημέρωση', 0, 2),
('$insertid', 2, 'buttonupdate', '', 'Update', 0, 2),
('$insertid', 3, 'buttonupdate', '', 'Aktualisieren', 0, 2),
('$insertid', 4, 'buttonupdate', '', 'Actualiser', 0, 2),
('$insertid', 10, 'buttonupdate', '', 'Actualizare', 0, 2),
('$insertid2', 1, 'textname', '', 'Ονομασία', 0, 2),
('$insertid2', 2, 'textname', '', 'Name', 0, 2),
('$insertid2', 3, 'textname', '', 'Name', 0, 2),
('$insertid2', 4, 'textname', '', 'Nom', 0, 2),
('$insertid2', 10, 'textname', '', 'Nume', 0, 2),
('$insertid3', 1, 'textsort', '', 'Ταξινόμηση', 0, 2),
('$insertid3', 2, 'textsort', '', 'Sort by', 0, 2),
('$insertid3', 3, 'textsort', '', 'Sortierung', 0, 2),
('$insertid3', 4, 'textsort', '', 'Trier', 0, 2),
('$insertid3', 10, 'textsort', '', 'Sortare', 0, 2),
('$insertid4', 1, 'textnewest', '', 'Πρόσφατα', 0, 2),
('$insertid4', 2, 'textnewest', '', 'Newest', 0, 2),
('$insertid4', 3, 'textnewest', '', 'Neueste', 0, 2),
('$insertid4', 4, 'textnewest', '', 'Récent', 0, 2),
('$insertid4', 10, 'textnewest', '', 'Noutate', 0, 2),
('$insertid5', 1, 'adminselect', '', 'Επιλέξτε', 0, 2),
('$insertid5', 2, 'adminselect', '', 'Select', 0, 2),
('$insertid5', 3, 'adminselect', '', 'Wählen', 0, 2),
('$insertid5', 4, 'adminselect', '', 'Sélectionner', 0, 2),
('$insertid5', 10, 'adminselect', '', 'Selectați', 0, 2),
('$insertid6', 1, 'adminfilters', '', 'Φίλτρα', 0, 2),
('$insertid6', 2, 'adminfilters', '', 'Filters', 0, 2),
('$insertid6', 3, 'adminfilters', '', 'Filter', 0, 2),
('$insertid6', 4, 'adminfilters', '', 'Filtres', 0, 2),
('$insertid6', 10, 'adminfilters', '', 'Filtre', 0, 2);
");

$mysqli->query("INSERT INTO `menu` (`id`, `name`, `feature`, `active`, `priority`) VALUES (NULL, 'adminfilters', 'filters', '0', '65');");
$mysqli->query("INSERT INTO `menu` (`id`, `name`, `feature`, `active`, `priority`) VALUES (NULL, 'admindate', 'dateitem', '0', '63');");
$mysqli->query("INSERT INTO `menu` (`id`, `name`, `feature`, `active`, `priority`) VALUES (NULL, 'adminreviewsinfo', 'reviewsinfo', '0', '33');");

$mysqli->query("ALTER TABLE `cookies` ADD `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;");
$mysqli->query("ALTER TABLE `items` ADD `date` VARCHAR( 10 ) NOT NULL ;");

$mysqli->query("ALTER TABLE `photos` ADD `insert_id` INT( 11 ) NOT NULL AFTER `id` ;");
$mysqli->query("ALTER TABLE `photos` ADD `lang_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `insert_id` ;");
$mysqli->query("ALTER TABLE `photos` ADD `text` TEXT NOT NULL AFTER `name` ;");
$mysqli->query("ALTER TABLE `photos` ADD `url` TEXT NOT NULL AFTER `text` ;");
$mysqli->query("UPDATE `photos` SET insert_id=id ;");

$mysqli->query("ALTER TABLE `categories` CHANGE `typec` `type` INT( 2 ) NOT NULL DEFAULT '1';");
$mysqli->query("ALTER TABLE `categories` ADD `active` INT( 1 ) NOT NULL DEFAULT '0' AFTER `promote` ;");
$mysqli->query("ALTER TABLE `items` CHANGE `typei` `type` INT( 2 ) NOT NULL DEFAULT '1';");

$mysqli->query("ALTER TABLE `photos` ADD `color` VARCHAR( 6 ) NOT NULL AFTER `url` ;");
$mysqli->query("ALTER TABLE `photos` ADD `price` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0.00' AFTER `color` ;");
$mysqli->query("ALTER TABLE `photos` ADD `image` INT( 2 ) NOT NULL DEFAULT '0' AFTER `price` ;");
$mysqli->query("ALTER TABLE `photos` ADD `file` VARCHAR( 50 ) NOT NULL AFTER `image` ;");
$mysqli->query("ALTER TABLE `photos` ADD `publish` CHAR( 3 ) NOT NULL DEFAULT 'yes' AFTER `type` ;");
$mysqli->query("ALTER TABLE `cart` CHANGE `spec_id` `extra_id` INT( 11 ) NOT NULL DEFAULT '0';");

$mysqli->query("RENAME TABLE `photos` TO `extras`;");


}?>

<form name="forma" method="post" action="">
<button type="submit" name="submit" class="button"><span class="icon fa-check"></span> UPDATE</button>
</form>

</div>


</body>
</html>
