- Admin

Inloggen"; echo "
"; echo "
"; echo "Gebruikersnaam:
"; echo ""; echo "
Wachtwoord
"; echo ""; echo "
"; echo "
"; } else{ //Controleren op juiste gebruikersnaam/wachtwoord... if (( $_SESSION['gp'] == $wachtwoord) && ($_SESSION['gg'] == $gebruiker)){ //Goede combinatie! if ($_GET['page'] == "home"){ echo "Welkom bij WebShop - Admin,
"; echo "Hier kunt u uw webshop met alle gemak besturen en beheren! Ga uw gang maar en probeer wat uit... LET OP:"; echo " als u klaar bent moet u uitloggen om misbruik met de WebShop te verkomen!
"; echo "

Categorie beheer

"; echo "

Met categorie beheer kunt u met alle gemak een categorie toevoegen of verwijderen...
  "; echo ">>Categorie beheer"; echo "
"; echo "

Product beheer

"; echo "

Met product beheer kunt u met alle gemak "; echo "een uw producten wijzigen, een nieuw product toevoegen of een product verwijderen...
  "; echo ">>Product beheer"; echo "

WebShop instellingen

"; echo "

Hier kunt u de instellingen van de WebShop wijzigen, de verzendkosten, naam van de WebShop, e-mailadres voor de bestellingen, gebruikersnaam en wachtwoord...
  "; echo ">>WebShop instellingen"; echo "
"; echo "

"; echo ""; echo ""; echo "
"; } if ($_GET['page'] == "cats"){ $q = ""; $file = fopen("WSFILES/cats", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $q = explode(",", $q); echo "Naar de adminpagina

"; echo "Nieuwe categorie...

"; echo "

Hieronder ziet u de categoriën die aanwezig zijn in de webshop...

"; foreach($q as $follow => $cat){ if (!$follow == ""){ echo $cat . "  [Verwijderen]"; echo "
"; } } echo "

"; } if ($_GET['page'] == "kcat"){ echo "Naar de adminpagina

"; $killcat = $_GET['cat']; $q = ""; $file = fopen("WSFILES/" . $killcat, "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $q = explode(",", $q); foreach($q as $nr => $prodID){ if (!$nr == ""){ unlink("WSFILES/" . $prodID . "_n"); unlink("WSFILES/" . $prodID . "_p"); unlink("WSFILES/" . $prodID . "_k"); unlink("WSFILES/" . $prodID . "_g"); unlink("WSFILES/" . $prodID . ".bmp"); $q = ""; $file = fopen("WSFILES/producten", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $q = str_replace("," . $prodID, "", $q); unlink("WSFILES/producten"); $file = fopen("WSFILES/producten", "a"); fputs($file, $q); fclose($file); } } unlink("WSFILES/" . $killcat); $q = ""; $file = fopen("WSFILES/cats", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $q = str_replace("," . $killcat, "", $q); unlink("WSFILES/cats"); $file = fopen("WSFILES/cats", "a"); fputs($file, $q); fclose($file); echo "

" . $killcat . " is met succes verwijderd!

"; } if ($_GET['page'] == "ncat"){ echo "Naar de adminpagina

"; echo "
"; echo ""; echo ""; echo "

Welke categorie wilt u toevoegen?
"; echo "
"; echo "In een categorie mogen alleen cijfers en letters voorkomen, geen spaties of andere tekens!!!"; echo "
"; echo "

"; } if ($_GET['page'] == "mcat"){ echo "Naar de adminpagina

"; if (!$_GET['cat'] == ""){ $file = fopen("WSFILES/" . $_GET['cat'], "a"); fclose($file); $q = ""; $file = fopen("WSFILES/cats", "r"); while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $q = str_replace("," . $_GET['cat'], "", $q); $q = "," . $_GET['cat'] . $q; unlink("WSFILES/cats"); $file = fopen("WSFILES/cats", "a"); fputs($file, $q); fclose($file); echo "

De volgende categorie is met succes aangemaakt: " . $_GET['cat']; } else{ echo "

Geef een categorie op...

"; echo "
"; echo ""; echo ""; echo "

Welke categorie wilt u toevoegen?
"; echo ""; echo "
"; echo "

"; } } if ($_GET['page'] == "nprodf"){ echo "Naar de adminpagina

"; echo "

Nieuw product"; echo "

"; echo ""; echo ""; echo "Product naam:
"; echo "
"; echo "Categorie:
"; echo '
"; echo "Prijs:
"; echo " (euro.centen)
"; echo "Korte beschrijving:
"; echo "
"; echo "Grondige omschrijving:
"; echo "
"; echo "
"; } if ($_GET['page'] == "nprodm"){ $prodID = make_prodID(); $y = ""; $file = fopen("WSFILES/producten", "r"); while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); $y = "," . $prodID . $y; $file = fopen("WSFILES/producten", "w"); fputs($file, $y); fclose($file); $y = ""; $file = fopen("WSFILES/" . $_GET['c'], "r"); while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); $y = "," . $prodID . $y; $file = fopen("WSFILES/" . $_GET['c'], "w"); fputs($file, $y); fclose($file); $file = fopen("WSFILES/" . $prodID . "_n", "a"); fputs($file, $_GET['n']); fclose($file); $file = fopen("WSFILES/" . $prodID . "_p", "a"); fputs($file, $_GET['p']); fclose($file); $file = fopen("WSFILES/" . $prodID . "_k", "a"); fputs($file, $_GET['k']); fclose($file); $file = fopen("WSFILES/" . $prodID . "_g", "a"); fputs($file, $_GET['g']); fclose($file); echo "Naar de adminpagina

"; echo "Product " . $prodID . " is met succes aangemaakt.

"; echo "LET OP!: Er is geen afbeelding voor product '" . $prodID . "', wilt u een afbeelding voor dit product gebruik dan een bitmap."; echo " Noem deze dan " . $prodID . ".bmp en upload deze dan naar de map WSFILES..."; } if ($_GET['page'] == "prod"){ echo "Naar de adminpagina

"; echo "Nieuw product...

"; echo "

Hieronder ziet u de producten die aanwezig zijn in de webshop...
"; echo "

"; echo ""; echo ""; echo "

Categorie:  "; echo '  

"; if ($_GET['cat'] == "noprod"){ echo "

Selecteer rechtsboven een categorie"; } else{ $file = fopen("WSFILES/" . $_GET['cat'], "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); $y = explode(",", $y); echo "

"; foreach($y as $nr => $prod){ if (!$prod == ""){ $file = fopen("WSFILES/" . $prod . "_n", "r"); $r = ""; while (!feof($file)){ $r .= fgets($file, 1024); } fclose($file); echo $r; echo "  ["; echo ""; echo "Wijzigen]"; echo "  ["; echo ""; echo "Verwijderen]"; echo "
"; }}}} if ($_GET['page'] == "kprod"){ echo "Naar de adminpagina

"; $file = fopen("WSFILES/producten", "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); $y = str_replace("," . $_GET['prod'], "", $y); unlink("WSFILES/producten"); $file = fopen("WSFILES/producten", "a"); fputs($file, $y); fclose($file); unlink("WSFILES/" . $_GET['prod'] . "_n"); unlink("WSFILES/" . $_GET['prod'] . "_p"); unlink("WSFILES/" . $_GET['prod'] . "_k"); unlink("WSFILES/" . $_GET['prod'] . "_g"); unlink("WSFILES/" . $_GET['prod'] . ".bmp"); $file = fopen("WSFILES/" . $_GET['cat'], "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); $s = "," . $_GET['prod']; $y = str_replace($s, "", $y); unlink("WSFILES/" . $_GET['cat']); $file = fopen("WSFILES/" . $_GET['cat'], "a"); fputs($file, $y); fclose($file); echo "

Het product '" . $_GET['prod'] . "' is met succes verwijderd!"; } if ($_GET['page'] == "eprodf"){ echo "Naar de adminpagina

"; echo "

"; echo ""; echo ""; echo ""; echo "ProductID:
"; echo "   " . $_GET['prod'] . "
"; $file = fopen("WSFILES/" . $_GET['prod'] . "_n", "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); echo "Product naam:
"; echo "
"; $file = fopen("WSFILES/" . $_GET['prod'] . "_p", "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); echo "Prijs:
"; echo " (euro.centen)
"; $file = fopen("WSFILES/" . $_GET['prod'] . "_k", "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); echo "Korte beschrijving:
"; echo "
"; $file = fopen("WSFILES/" . $_GET['prod'] . "_g", "r"); $y = ""; while (!feof($file)){ $y .= fgets($file, 1024); } fclose($file); echo "Grondige omschrijving:
"; echo "
"; echo "
"; } if ($_GET['page'] == "eprode"){ echo "Naar de adminpagina

"; unlink("WSFILES/" . $_GET['prod'] . "_n"); unlink("WSFILES/" . $_GET['prod'] . "_p"); unlink("WSFILES/" . $_GET['prod'] . "_k"); unlink("WSFILES/" . $_GET['prod'] . "_g"); $file = fopen("WSFILES/" . $_GET['prod'] . "_n", "a"); fputs($file, $_GET['n']); fclose($file); $file = fopen("WSFILES/" . $_GET['prod'] . "_p", "a"); fputs($file, $_GET['p']); fclose($file); $file = fopen("WSFILES/" . $_GET['prod'] . "_k", "a"); fputs($file, $_GET['k']); fclose($file); $file = fopen("WSFILES/" . $_GET['prod'] . "_g", "a"); fputs($file, $_GET['g']); fclose($file); echo "

Het product '" . $_GET['prod'] . "' is met succes gewijzigd!"; } if ($_GET['page'] == "settingsf"){ echo "Naar de adminpagina

"; $file = fopen("config.php", "r"); $string = fgets($file, 1024); list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string); fclose($file); echo "

"; echo ""; echo ""; echo "WebShopnaam:
"; echo "
"; echo "E-mailadres voor de bestellingen:
"; echo "
"; echo "Verzend kosten binnen Nederland:
"; echo "(euro.centen)
"; echo "Gebruikersnaam:
"; echo "
"; echo "Wachtwoord:
"; echo "
"; echo "
"; } if ($_GET['page'] == "settingse"){ if (!$_GET['wsn'] || !$_GET['mail'] || !$_GET['vzk'] || !$_GET['user'] || !$_GET['pass']){ echo "Naar de adminpagina

"; echo "

U heeft het formulier niet helemaal ingevuld! Probeer opnieuw...

"; $file = fopen("config.php", "r"); $string = fgets($file, 1024); list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string); fclose($file); echo "
"; echo ""; echo ""; echo "WebShopnaam:
"; echo "
"; echo "E-mailadres voor de bestellingen:
"; echo "
"; echo "Verzend kosten binnen Nederland:
"; echo "(euro.centen)
"; echo "Gebruikersnaam:
"; echo "
"; echo "Wachtwoord:
"; echo "
"; echo "
"; } else{ unlink("config.php"); $file = fopen("config.php", "a"); $string = ""; fputs($file, $string); fclose($file); $_SESSION['gg'] = $_GET['user']; $_SESSION['gp'] = $_GET['pass']; echo "

Uw instellingen zijn met succes gewijzigd! U moet nu hieronder inloggen met uw nieuwe gegevens...
"; echo "
Inloggen"; echo "
"; echo "

"; echo "Gebruikersnaam:
"; echo ""; echo "
Wachtwoord
"; echo ""; echo "
"; echo "
"; } } if ($_GET['page'] == "logout"){ $_SESSION['gg'] = ""; $_SESSION['gp'] = ""; echo "

U bent nu uitgelogd!"; } }else{ //Onjuist login... echo "

Ongeldig login! Probeer opnieuw...

"; echo "
"; echo "
"; echo "Gebruikersnaam:
"; echo ""; echo "
Wachtwoord
"; echo ""; echo "
"; echo "
"; } } ?>

Copyright © Stefan Koenders