pnbp

a terrible but reliable site builder
Log | Files | Refs | README

edit.template (1961B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 	<title>Admin</title>
      5 	<style>
      6 html {
      7 	font-family:sans-serif;
      8 	background-color:#EFEFEF;
      9 	border-top:5px solid #FF9311;
     10 }
     11 a {
     12 	text-decoration:none;
     13 	color:#4183c4;
     14 }
     15 a:hover {
     16 	text-decoration:underline;
     17 }
     18 a:visited {
     19 	color:#4183c4;
     20 }
     21 #wrapper {
     22 	width:700px;
     23 	margin:0 auto;
     24 }
     25 #wrapper label {
     26 	font-family:Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, monospace, serif;
     27 }
     28 #post {
     29 	width:100%;
     30 	height:1000px;
     31 }
     32 #submit {
     33 	background-color:#EFEFEF;
     34 }
     35 #submit:hover {
     36 	box-shadow:0px 0px 3px black inset;
     37 }
     38 #submit:active {
     39 	background-color:#AAEEFF;
     40 }
     41 .input {
     42 	outline:none;
     43 	padding:5px;
     44 	border:1px solid #DEDEDE;
     45 	border-radius:5px;
     46 	box-shadow:0px 0px 3px #DEDEDE inset;
     47 }
     48 	</style>
     49 </head>
     50 <body>
     51     <div id="wrapper">
     52 		<a href="/admin" class="nav">Home</a>
     53 <?php
     54 
     55 if (isset($_GET['location']) && isset($_GET['post'])) {
     56 	$data = json_decode(file_get_contents($_GET['location']), TRUE);
     57 	$out = "";
     58 	foreach ($data[$_GET['post']] as $key => $val) {
     59 		if ($key !== "content") {
     60 			$out = $out . $key . "=" . $val . ", ";
     61 		}
     62 	}
     63 	$_SESSION['vars'] = $out;
     64 	$_SESSION['post'] = $data[$_GET['post']]['content'];
     65 } else {
     66 	$_SESSION['post'] = "";
     67 	$_SESSION['vars'] = "";
     68 	if (isset($_GET['location']) == false) { $_GET['location'] = ""; }
     69 	if (isset($_GET['newpost'])) { $_SESSION['vars'] = "post=".$_GET['newpost'].", "; }
     70 }
     71 ?>
     72 		<form id="update" action="./post.php" method="post" onsubmit="return validate();">
     73 			<label>Variables:</label><input id="vars" name="vars" type="text" class="input" value="<?php echo $_SESSION['vars']; ?>"/><input type="submit" id="submit" class="input"/><br />
     74 			<label>Location :</label><input id="loc" name="loc" type="text" class="input" value="<?php echo $_GET['location']; ?>"/><br />
     75 			<textarea id="post" name="post" form="update" class="input"><?php echo $_SESSION['post']; ?></textarea>
     76 		</form>
     77 	</div>
     78 </body>
     79 </html>
     80 "