Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CMS for bootstrap
<?php include 'includes/admin/Changesdbconnect.php';?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Admin Panel</title>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.css" type="text/css">
</head>
<body>
<table class="table table-striped">
<thead class="thead" style="background: #a1a1a1">
<tr>
<th>1 Seksjon</th>
<th>Forsiden . . .</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Company Name</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="CompName1">
<input type="submit" name="CompName">
</form>
</td>
</tr>
<tr>
<th scope="row">Menu button 1</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Menu11">
<input type="submit" name="Menu1">
</form>
</td>
</tr>
<tr>
<th scope="row">Menu button 2</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Menu22">
<input type="submit" name="Menu2">
</form>
</td>
</tr>
<tr>
<th scope="row">Menu button 3</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Menu33">
<input type="submit" name="Menu3">
</form>
</td>
</tr>
<tr>
<th scope="row">Menu button 4</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Menu44">
<input type="submit" name="Menu4">
</form>
</td>
</tr>
<tr>
<th scope="row">Menu button 5</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Menu55">
<input type="submit" name="Menu5">
</form>
</td>
</tr>
<tr>
<th scope="row">TOP text large</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="TopText1">
<input type="submit" name="TopText">
</form>
</td>
</tr>
<tr>
<th scope="row">TOP text small</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="TopUnder1">
<input type="submit" name="TopUnder">
</form>
</td>
</tr>
<tr>
<th scope="row">TOP text button</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="TopButton1">
<input type="submit" name="TopButton">
</form>
</td>
</tr>
<thead class="thead-default" style="background: #a1a1a1">
<tr>
<th>2 Seksjon</th>
<th>Om Meg . . .</th>
</tr>
</thead>
<tr>
<th scope="row">Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="ADname1">
<input type="submit" name="ADname">
</form>
</td>
</tr>
<tr>
<th scope="row">Text</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="ADtext1">
<input type="submit" name="ADtext">
</form>
</td>
</tr>
<tr>
<th scope="row">Button Text</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="ADbutton1">
<input type="submit" name="ADbutton">
</form>
</td>
</tr>
<thead class="thead-default" style="background: #a1a1a1">
<tr>
<th>3 Seksjon</th>
<th>Tjenester . . .</th>
</tr>
</thead>
<tr>
<th scope="row">Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="serviceText1">
<input type="submit" name="serviceText">
</form>
</td>
</tr>
<tr>
<th scope="row">1 block Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="service11">
<input type="submit" name="service1">
</form>
</td>
</tr>
<tr>
<th scope="row">1 block Title description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="serviceText11">
<input type="submit" name="serviceText1">
</form>
</td>
</tr>
<tr>
<th scope="row">2 block Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="service22">
<input type="submit" name="service2">
</form>
</td>
</tr>
<tr>
<th scope="row">2 block Title description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="serviceText22">
<input type="submit" name="serviceText2">
</form>
</td>
</tr>
<tr>
<th scope="row">3 block Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="service33">
<input type="submit" name="service3">
</form>
</td>
</tr>
<tr>
<th scope="row">3 block Title description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="serviceText33">
<input type="submit" name="serviceText3">
</form>
</td>
</tr>
<tr>
<th scope="row">4 block Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="service44">
<input type="submit" name="service4">
</form>
</td>
</tr>
<tr>
<th scope="row">4 block Title description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="serviceText44">
<input type="submit" name="serviceText4">
</form>
</td>
</tr>
<thead class="thead-default" style="background: #a1a1a1">
<tr>
<th>4 Seksjon</th>
<th>Portfolio . . .</th>
</tr>
</thead>
<tr>
<th scope="row">1 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img11">
<input type="submit" name="img1">
</form>
</td>
</tr>
<tr>
<th scope="row">1 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img1text1">
<input type="submit" name="img1text">
</form>
</td>
</tr>
<tr>
<th scope="row">1 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto">
<input type="submit" name="img1logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<tr>
<th scope="row">2 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img22">
<input type="submit" name="img2">
</form>
</td>
</tr>
<tr>
<th scope="row">2 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img2text2">
<input type="submit" name="img2text">
</form>
</td>
</tr>
<tr>
<th scope="row">2 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto2">
<input type="submit" name="img2logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<tr>
<th scope="row">3 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img33">
<input type="submit" name="img3">
</form>
</td>
</tr>
<tr>
<th scope="row">3 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img3text3">
<input type="submit" name="img3text">
</form>
</td>
</tr>
<tr>
<th scope="row">3 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto3">
<input type="submit" name="img3logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<tr>
<th scope="row">4 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img44">
<input type="submit" name="img4">
</form>
</td>
</tr>
<tr>
<th scope="row">4 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img4text4">
<input type="submit" name="img4text">
</form>
</td>
</tr>
<tr>
<th scope="row">4 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto4">
<input type="submit" name="img4logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<tr>
<th scope="row">5 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img55">
<input type="submit" name="img5">
</form>
</td>
</tr>
<tr>
<th scope="row">5 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img5text5">
<input type="submit" name="img5text">
</form>
</td>
</tr>
<tr>
<th scope="row">5 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto5">
<input type="submit" name="img5logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<tr>
<th scope="row">6 Projekt Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img66">
<input type="submit" name="img6">
</form>
</td>
</tr>
<tr>
<th scope="row">6 Projekt description</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="img6text6">
<input type="submit" name="img6text">
</form>
</td>
</tr>
<tr>
<th scope="row">6 Projekt Photo</th>
<td>
<form action='changes.php' method='post' enctype='multipart/form-data'>
<input type="file" name="foto6">
<input type="submit" name="img6logo">
<p class="help-block">All pictures must be the same size and less than 5 MB.</p>
</form>
</td>
</tr>
<thead class="thead-default" style="background: #a1a1a1">
<tr>
<th>5 Seksjon</th>
<th>Prisliste . . .</th>
</tr>
</thead>
<tr>
<th scope="row">Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="DownloadText1">
<input type="submit" name="DownloadText">
</form>
</td>
</tr>
<tr>
<th scope="row">Button text</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Button1">
<input type="submit" name="Button">
</form>
</td>
</tr>
<thead class="thead-default" style="background: #a1a1a1">
<tr>
<th>6 Seksjon</th>
<th>Kontakt . . .</th>
</tr>
</thead>
<tr>
<th scope="row">Title</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Kontakt1">
<input type="submit" name="Kontakt">
</form>
</td>
</tr>
<tr>
<th scope="row">Text</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="KontaktText1">
<input type="submit" name="KontaktText">
</form>
</td>
</tr>
<tr>
<th scope="row">Phone</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Phone1">
<input type="submit" name="Phone">
</form>
</td>
</tr>
<tr>
<th scope="row">E-mail</th>
<td>
<form action="changes.php" method="post">
<input type="text" name="Email1">
<input type="submit" name="Email">
</form>
</td>
</tr>
</tbody>
</table>
</body>
</html>
<!-- == Top Menu == -->
<!-- == Advertise == -->
<!-- == Services == -->
<!-- == Portfolio == -->
<!-- == IMG ikelimas == -->
<!-- == Download == -->
<!-- == Kontakt == -->
<?php
// ====== Photo upload============== -->
// === img 1
if(isset($_POST['img1logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img1logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img1logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto']['name'];
$logoSize = $_FILES['foto']['size'];
$logoType = $_FILES['foto']['type'];
$logoTemp = $_FILES['foto']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img1logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// === img 2
if(isset($_POST['img2logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img2logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img2logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto2']['name'];
$logoSize = $_FILES['foto2']['size'];
$logoType = $_FILES['foto2']['type'];
$logoTemp = $_FILES['foto2']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img2logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// === img 3
if(isset($_POST['img3logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img3logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img3logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto3']['name'];
$logoSize = $_FILES['foto3']['size'];
$logoType = $_FILES['foto3']['type'];
$logoTemp = $_FILES['foto3']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img3logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// === img 4
if(isset($_POST['img4logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img4logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img4logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto4']['name'];
$logoSize = $_FILES['foto4']['size'];
$logoType = $_FILES['foto4']['type'];
$logoTemp = $_FILES['foto4']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img4logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// === img 5
if(isset($_POST['img5logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img5logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img5logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto5']['name'];
$logoSize = $_FILES['foto5']['size'];
$logoType = $_FILES['foto5']['type'];
$logoTemp = $_FILES['foto5']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img5logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// === img 6
if(isset($_POST['img6logo'])) {
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM Portfolio WHERE `id` = 4");
$deleteselect = mysqli_fetch_array($select);
$namedelete = $deleteselect['img6logo'];
unlink("img/".$namedelete);
$submit = mysqli_query($connect, "UPDATE Portfolio SET `img6logo` = '$newText' WHERE id = 4");
$logoName = $_FILES['foto6']['name'];
$logoSize = $_FILES['foto6']['size'];
$logoType = $_FILES['foto6']['type'];
$logoTemp = $_FILES['foto6']['tmp_name'];
// $logoExtension = strtolower(substr(strrchr($logoName, '.'), 1));
// $newLogoName = $logoName . '.' . $logoExtension;
if (!empty($logoName)) {
if ($logoType == "image/jpeg" || $logoType == "image/png" || $logoType == "image/bmp" || $logoType == "image/gif" || $logoType == "image/jpg" || $logoType == "image/psd" || $logoType == "image/tiff" || $logoType == "image/tga" || $logoType == "") {
if ($logoSize < 500000) {
move_uploaded_file($logoTemp, "img/" . $logoName);
echo "Logotipas ikeltas!";
mysqli_query($connect, "UPDATE Portfolio SET img6logo = '$logoName' WHERE id = 4" );
} else {
die("Paveikslelis per didelis.");
}
} else {
die("Neleistinas failo formatas.");
}
}
}
// ======== Top MENU section ========
if(isset($_POST['CompName'])) {
$newText = $_POST['CompName1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `CompName` = '$newText' WHERE id = 1");
}if(isset($_POST['Menu1'])) {
$newText = $_POST['Menu11'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `Menu1` = '$newText' WHERE id = 1");
}if(isset($_POST['Menu2'])) {
$newText = $_POST['Menu22'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `Menu2` = '$newText' WHERE id = 1");
}if(isset($_POST['Menu3'])) {
$newText = $_POST['Menu33'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `Menu3` = '$newText' WHERE id = 1");
}if(isset($_POST['Menu4'])) {
$newText = $_POST['Menu44'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `Menu4` = '$newText' WHERE id = 1");
}if(isset($_POST['Menu5'])) {
$newText = $_POST['Menu55'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `Menu5` = '$newText' WHERE id = 1");
}
if(isset($_POST['TopText'])) {
$newText = $_POST['TopText1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `TopText` = '$newText' WHERE id = 1");
}if(isset($_POST['TopUnder'])) {
$newText = $_POST['TopUnder1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `TopUnder` = '$newText' WHERE id = 1");
}if(isset($_POST['TopButton'])) {
$newText = $_POST['TopButton1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Menu` SET `TopButton` = '$newText' WHERE id = 1");
}
// ======== Advertise section ========
if(isset($_POST['ADname'])) {
$newText = $_POST['ADname1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Advertise` SET `ADname` = '$newText' WHERE id = 2");
}if(isset($_POST['ADtext'])) {
$newText = $_POST['ADtext1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Advertise` SET `ADtext` = '$newText' WHERE id = 2");
}if(isset($_POST['ADbutton'])) {
$newText = $_POST['ADbutton1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Advertise` SET `ADbutton` = '$newText' WHERE id = 2");
}
// ======== Services section ========
if(isset($_POST['serviceText'])) {
$newText = $_POST['serviceText1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `serviceText` = '$newText' WHERE id = 3");
}
if(isset($_POST['service1'])) {
$newText = $_POST['service11'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `service1` = '$newText' WHERE id = 3");
}
if(isset($_POST['service2'])) {
$newText = $_POST['service22'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `service2` = '$newText' WHERE id = 3");
}
if(isset($_POST['service3'])) {
$newText = $_POST['service33'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `service3` = '$newText' WHERE id = 3");
}
if(isset($_POST['service4'])) {
$newText = $_POST['service44'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `service4` = '$newText' WHERE id = 3");
}
if(isset($_POST['serviceText1'])) {
$newText = $_POST['serviceText11'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `serviceText1` = '$newText' WHERE id = 3");
}
if(isset($_POST['serviceText2'])) {
$newText = $_POST['serviceText22'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `serviceText2` = '$newText' WHERE id = 3");
}
if(isset($_POST['serviceText3'])) {
$newText = $_POST['serviceText33'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `serviceText3` = '$newText' WHERE id = 3");
}
if(isset($_POST['serviceText4'])) {
$newText = $_POST['serviceText44'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$submit = mysqli_query($connect, "UPDATE `Services` SET `serviceText4` = '$newText' WHERE id = 3");
}
// ======== Portfolio section ========
if(isset($_POST['img1'])) {
$newText = $_POST['img11'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img1` = '$newText' WHERE id = 4");
}if(isset($_POST['img1text'])) {
$newText = $_POST['img1text1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img1text` = '$newText' WHERE id = 4");
}if(isset($_POST['img2'])) {
$newText = $_POST['img22'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img2` = '$newText' WHERE id = 4");
}if(isset($_POST['img2text'])) {
$newText = $_POST['img2text2'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img2text` = '$newText' WHERE id = 4");
}if(isset($_POST['img3'])) {
$newText = $_POST['img33'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img3` = '$newText' WHERE id = 4");
}if(isset($_POST['img3text'])) {
$newText = $_POST['img3text3'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img3text` = '$newText' WHERE id = 4");
}if(isset($_POST['img4'])) {
$newText = $_POST['img44'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img4` = '$newText' WHERE id = 4");
}if(isset($_POST['img4text'])) {
$newText = $_POST['img4text4'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img4text` = '$newText' WHERE id = 4");
}if(isset($_POST['img5'])) {
$newText = $_POST['img55'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img5` = '$newText' WHERE id = 4");
}if(isset($_POST['img5text'])) {
$newText = $_POST['img5text5'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img5text` = '$newText' WHERE id = 4");
}if(isset($_POST['img6'])) {
$newText = $_POST['img66'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img6` = '$newText' WHERE id = 4");
}if(isset($_POST['img6text'])) {
$newText = $_POST['img6text6'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$submit = mysqli_query($connect, "UPDATE `Portfolio` SET `img6text` = '$newText' WHERE id = 4");
}
// ======== Download catalog section ========
if(isset($_POST['DownloadText'])) {
$newText = $_POST['DownloadText1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Download` WHERE `id` = 6");
$submit = mysqli_query($connect, "UPDATE `Download` SET `DownloadText` = '$newText' WHERE id = 6");
}
if(isset($_POST['Button'])) {
$newText = $_POST['Button1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Download` WHERE `id` = 6");
$submit = mysqli_query($connect, "UPDATE `Download` SET `Button` = '$newText' WHERE id = 6");
}
// ======== Kontakt section ========
if(isset($_POST['Kontakt'])) {
$newText = $_POST['Kontakt1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$submit = mysqli_query($connect, "UPDATE `Kontakts` SET `Kontakt` = '$newText' WHERE id = 5");
}
if(isset($_POST['KontaktText'])) {
$newText = $_POST['KontaktText1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$submit = mysqli_query($connect, "UPDATE `Kontakts` SET `KontaktText` = '$newText' WHERE id = 5");
}
if(isset($_POST['Phone'])) {
$newText = $_POST['Phone1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$submit = mysqli_query($connect, "UPDATE `Kontakts` SET `Phone` = '$newText' WHERE id = 5");
}
if(isset($_POST['Email'])) {
$newText = $_POST['Email1'];
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$submit = mysqli_query($connect, "UPDATE `Kontakts` SET `Email` = '$newText' WHERE id = 5");
}
?>
<?php
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
?>
<?php include 'includes/admin/Indexdbconnect.php';?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Sample website</title>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<!-- Custom Fonts -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">
<!-- Plugin CSS -->
<link rel="stylesheet" href="css/animate.min.css" type="text/css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/creative.css" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="page-top">
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand page-scroll" href="#page-top"><?php CompName();?></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a class="page-scroll" href="#about"><?php Menu1();?></a>
</li>
<li>
<a class="page-scroll" href="#services"><?php Menu2();?></a>
</li>
<li>
<a class="page-scroll" href="#portfolio"><?php Menu3();?></a>
</li>
<li>
<a class="page-scroll" href="#pricelist"><?php Menu4();?></a>
</li>
<li>
<a class="page-scroll" href="#contact"><?php Menu5();?></a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<header>
<div class="header-content">
<div class="header-content-inner">
<h1><?php TopText();?></h1>
<hr>
<p><?php TopUnder();?></p>
<a href="#about" class="btn btn-primary btn-xl page-scroll"><?php TopButton();?></a>
</div>
</div>
</header>
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center">
<h2 class="section-heading"><?php ADname();?></h2>
<hr class="light">
<p class="text-faded"><?php ADtext();?></p>
<a href="#" class="btn btn-default btn-xl"><?php ADbutton();?></a>
</div>
</div>
</div>
</section>
<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading"><?php serviceText();?></h2>
<hr class="primary">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-diamond wow bounceIn text-primary"></i>
<h3><?php service1();?></h3>
<p class="text-muted"><?php serviceText1();?></p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-paper-plane wow bounceIn text-primary" data-wow-delay=".1s"></i>
<h3><?php service2();?></h3>
<p class="text-muted"><?php serviceText2();?></p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-newspaper-o wow bounceIn text-primary" data-wow-delay=".2s"></i>
<h3><?php service3();?></h3>
<p class="text-muted"><?php serviceText3();?></p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-heart wow bounceIn text-primary" data-wow-delay=".3s"></i>
<h3><?php service4();?></h3>
<p class="text-muted"><?php serviceText4();?></p>
</div>
</div>
</div>
</div>
</section>
<section class="no-padding" id="portfolio">
<div class="container-fluid">
<div class="row no-gutter">
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img1logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img1();?>
</div>
<div class="project-name text-faded">
<?php img1text();?>
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img2logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img2();?>
</div>
<div class="project-name text-faded">
<?php img2text();?>
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img3logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img3();?>
</div>
<div class="project-name text-faded">
<?php img3text();?>
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img4logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img4();?>
</div>
<div class="project-name text-faded">
<?php img4text();?>
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img5logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img5();?>
</div>
<div class="project-name text-faded">
<?php img5text();?>
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/<?php img6logo(); ?>" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category">
<?php img6();?>
</div>
<div class="project-name text-faded">
<?php img6text();?>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
<section id="pricelist" class="bg-dark">
<div class="container text-center">
<div class="call-to-action">
<h2><?php DownloadText();?></h2>
<a href="#" class="btn btn-default btn-xl wow tada"><?php Button();?></a>
</div>
</div>
</section>
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center">
<h2 class="section-heading"><?php Kontakt();?></h2>
<hr class="primary">
<p><?php KontaktText();?></p>
</div>
<div class="col-lg-4 col-lg-offset-2 text-center">
<i class="fa fa-phone fa-3x wow bounceIn"></i>
<p><?php Phone();?></p>
</div>
<div class="col-lg-4 text-center">
<i class="fa fa-envelope-o fa-3x wow bounceIn" data-wow-delay=".1s"></i>
<p><a href="mailto:<?php Email();?>"><?php Email();?></a></p>
</div>
</div>
</div>
</section>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="js/jquery.easing.min.js"></script>
<script src="js/jquery.fittext.js"></script>
<script src="js/wow.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/creative.js"></script>
</body>
</html>
<?php
// ======== Top section ========
function CompName(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$CompName = $rows['CompName'];
echo $CompName;
}function Menu1(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$Menu1 = $rows['Menu1'];
echo $Menu1;
}function Menu2(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$Menu2 = $rows['Menu2'];
echo $Menu2;
}function Menu3(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$Menu3 = $rows['Menu3'];
echo $Menu3;
}function Menu4(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$Menu4 = $rows['Menu4'];
echo $Menu4;
}function Menu5(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$Menu5 = $rows['Menu5'];
echo $Menu5;
}
function TopText(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$TopText = $rows['TopText'];
echo $TopText;
}function TopUnder(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$TopUnder = $rows['TopUnder'];
echo $TopUnder;
}function TopButton(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Menu` WHERE `id` = 1");
$rows = mysqli_fetch_array($select);
$TopButton = $rows['TopButton'];
echo $TopButton;
}
// ======== Advertise section ========
function ADname(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 2");
$rows = mysqli_fetch_array($select);
$ADname = $rows['ADname'];
echo $ADname;
}function ADtext(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 2");
$rows = mysqli_fetch_array($select);
$ADtext = $rows['ADtext'];
echo $ADtext;
}function ADbutton(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Advertise` WHERE `id` = 2");
$rows = mysqli_fetch_array($select);
$ADbutton = $rows['ADbutton'];
echo $ADbutton;
}
// ======== Services section ========
function serviceText(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$serviceText = $rows['serviceText'];
echo $serviceText;
}
function service1(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$service1 = $rows['service1'];
echo $service1;
}function service2(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$service2 = $rows['service2'];
echo $service2;
}function service3(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$service3 = $rows['service3'];
echo $service3;
}function service4(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$service4 = $rows['service4'];
echo $service4;
}
function serviceText1(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$serviceText1 = $rows['serviceText1'];
echo $serviceText1;
}
function serviceText2(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$serviceText2 = $rows['serviceText2'];
echo $serviceText2;
}
function serviceText3(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$serviceText3 = $rows['serviceText3'];
echo $serviceText3;
}
function serviceText4(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Services` WHERE `id` = 3");
$rows = mysqli_fetch_array($select);
$serviceText4 = $rows['serviceText4'];
echo $serviceText4;
}
// ======== Portfolio section ========
function img1(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img1 = $rows['img1'];
echo $img1;
}function img1text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img1text = $rows['img1text'];
echo $img1text;
}function img2(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img2 = $rows['img2'];
echo $img2;
}function img2text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img2text = $rows['img2text'];
echo $img2text;
}function img3(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img3 = $rows['img3'];
echo $img3;
}function img3text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img3text = $rows['img3text'];
echo $img3text;
}function img4(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img4 = $rows['img4'];
echo $img4;
}function img4text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img4text = $rows['img4text'];
echo $img4text;
}function img5(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img5 = $rows['img5'];
echo $img5;
}function img5text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img5text = $rows['img5text'];
echo $img5text;
}function img6(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img6 = $rows['img6'];
echo $img6;
}function img6text(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img6text = $rows['img6text'];
echo $img6text;
}
// ======== Download section ========
function DownloadText(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Download` WHERE `id` = 6");
$rows = mysqli_fetch_array($select);
$DownloadText = $rows['DownloadText'];
echo $DownloadText;
}
function Button(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Download` WHERE `id` = 6");
$rows = mysqli_fetch_array($select);
$Button = $rows['Button'];
echo $Button;
}
// ======== Kontakt section ========
function Kontakt(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$rows = mysqli_fetch_array($select);
$Kontakt = $rows['Kontakt'];
echo $Kontakt;
}
function KontaktText(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$rows = mysqli_fetch_array($select);
$KontaktText = $rows['KontaktText'];
echo $KontaktText;
}
function Phone(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$rows = mysqli_fetch_array($select);
$Phone = $rows['Phone'];
echo $Phone;
}
function Email(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Kontakts` WHERE `id` = 5");
$rows = mysqli_fetch_array($select);
$Email = $rows['Email'];
echo $Email;
}
// ======= Photo Upload ======
function img1logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img1logo = $rows['img1logo'];
echo $img1logo;
}
function img2logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img2logo = $rows['img2logo'];
echo $img2logo;
}
function img3logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img3logo = $rows['img3logo'];
echo $img3logo;
}
function img4logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img4logo = $rows['img4logo'];
echo $img4logo;
}
function img5logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img5logo = $rows['img5logo'];
echo $img5logo;
}
function img6logo(){
$connect = mysqli_connect('localhost', 'root', 'root', 'CMStest') or die(mysqli_error());
$select = mysqli_query($connect, "SELECT * FROM `Portfolio` WHERE `id` = 4");
$rows = mysqli_fetch_array($select);
$img6logo = $rows['img6logo'];
echo $img6logo;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login Form</title>
<!-- CSS -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="js/login/form-elements.css">
<link rel="stylesheet" href="js/login/style.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="js/login/ico/favicon.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="js/login/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="js/login/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="js/login/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="js/login/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<!-- Top content -->
<div class="top-content">
<div class="inner-bg">
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2 text">
<h1><strong>Logg på</strong> din side</h1>
<div class="description">
<p></p>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-sm-offset-3 form-box">
<div class="form-top">
<div class="form-top-left">
<h3></h3>
<p></p>
</div>
<div class="form-top-right">
<i class="fa fa-key"></i>
</div>
</div>
<div class="form-bottom">
<form action="loginForward.php" method="post" class="login-form">
<div class="form-group">
<label class="sr-only" for="form-username">Brukernavn</label>
<input type="text" name="username" placeholder="Brukernavn" class="form-username form-control" >
</div>
<div class="form-group">
<label class="sr-only" for="form-password">Passord</label>
<input type="password" name="password" placeholder="Passord" class="form-password form-control" >
</div>
<button type="submit" name="submit" class="btn">Logg på!</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Javascript -->
<script src="js/login/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/login/jquery.backstretch.min.js"></script>
<script src="js/login/scripts.js"></script>
<!--[if lt IE 10]>
<script src="js/login/placeholder.js"></script>
<![endif]-->
</body>
</html>
<?php
if(isset($_POST['submit'])) {
ob_start();
require 'includes/admin/dbconnect.php';
$username = $_POST['username'];
$password = $_POST['password'];
$result = mysqli_query($connect, "SELECT * FROM `admins` WHERE `username` LIKE '$username'");
$row = mysqli_fetch_assoc($result);
$userLogin = $row['username'];
$myPass = $row['password'];
if ($userLogin === $username && $password === $myPass){
header("Location: changes.php");
setcookie("password", $myPass, time()+3600*24*365, "/");
setcookie("username", $userLogin, time()+3600*24*365, "/");
ob_clean();
} else {
echo "<div class='container'><h1>Wrong username or password.</h1></div>";
header("Refresh: 3; login.php");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.