Beispiel #1
0
<?php

require_once "framework2/CredentialStore.php";
$cs = new CredentialStore();
$schoolTextId = $cs->cookieCheck("sPref");
if ($cs->getSchoolName($schoolTextId) == null) {
    header('Location: selector');
}
if (!($loggedIn = $cs->getLoginStatus())) {
    header('Location: ./');
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Walkntrade</title>
	<link type="text/css" rel="stylesheet" href="css/style.css">
	<link type="text/css" rel="stylesheet" href="/css/spritesheet.css">
	<link type="text/css" rel="stylesheet" href="css/login_window.css">
	<link type="text/css" rel="stylesheet" href="css/addlisting.css">
	<link rel="shortcut icon" href="http://www.walkntrade.com/favicon.ico?v=2" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="en" />
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-42896980-1', 'auto');
	  ga('send', 'pageview');
Beispiel #2
0
<?php

require_once "framework2/CredentialStore.php";
$cs = new CredentialStore();
$loggedIn = $cs->getLoginStatus();
//get page args
$args = array_keys($_GET);
$args = split(":", $args[0]);
$identifier = $args[1];
$schoolTextId = $args[0];
if ($cs->getSchoolName($schoolTextId) == null || !$loggedIn) {
    return;
}
if ($identifier != null) {
    if ($editSTMT = $cs->getListingConnection()->prepare("SELECT id, title, details, price, tags FROM " . $schoolTextId . " WHERE identifier = ? LIMIT 1")) {
        $editSTMT->bind_param("s", $identifier);
        $editSTMT->execute();
        // Execute the prepared query.
        $editSTMT->store_result();
        $editSTMT->bind_result($id, $title, $details, $price, $tags);
        $editSTMT->fetch();
        if ($editSTMT->num_rows < 1) {
            header('Location: ./');
        }
        $title = htmlspecialchars($title);
        $price = $price != 0 ? "\$" . round($price, 2) : "(no price)";
        $details = htmlspecialchars($details);
    }
}
?>
<!DOCTYPE html>