Guest User

Untitled

a guest
Apr 13th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 19.82 KB | None | 0 0
  1. <?php
  2.  
  3. if($_POST["username"] == "camdunlop" && $_POST["password"] == "Goosey1@") {
  4.     setcookie("username","camdunlop",time()+86400);//cookie lasts for 24 hours
  5.     setcookie("password","Goosey1@",time()+86400);
  6.    
  7.     echo '<script type="text/javascript" language="javascript">window.location.href="admin.php"</script>';
  8. }else if($_GET["p"] == "logout") {
  9.     setcookie("username","",time()-1000);
  10.     setcookie("password","",time()-1000);
  11.    
  12.     echo '<script type="text/javascript" language="javascript">window.location.href="admin.php"</script>';
  13. }
  14.  
  15. ?>
  16. <!DOCTYPE html>
  17. <html lang="en">
  18. <head>
  19. <meta charset="utf-8">
  20. <title>CUT TO - Admin Tools</title>
  21.  
  22. <link type="text/css" href="styles.css" rel="stylesheet" />
  23. <script src="jquery.js"></script>
  24. <script src="jquery.arrayshift.js"></script>
  25.  
  26. </head>
  27. <body>
  28. <center>
  29. <div class="page">
  30. <div class="leftColumn">
  31. <img src="images/logo.png" width="125" height="160" align="CUT TO" id="logo" border="0" style="clear: both;" /><br>
  32. <?php
  33.  
  34. //error_reporting(0);
  35.  
  36. if($_COOKIE["username"] == "camdunlop" && $_COOKIE["password"] == "Goosey1@") {
  37.    
  38.     $loggedin = true;
  39.    
  40.     echo '
  41. <p>
  42. <a href="admin.php?p=about" class="heading">Edit About</a><br />
  43. <a href="admin.php?p=showreel" class="heading">Edit Showreel</a><br />
  44. </p><p>
  45. <a href="admin.php?p=newvideo" class="heading">New Video</a><br />
  46. <a href="admin.php?p=delvideo" class="heading">Delete Video</a><br />
  47. <a href="admin.php?p=video" class="heading">Edit Portfolio Info</a><br />
  48. <a href="admin.php?p=thumbs" class="heading">Edit Portfolio Thumbnails</a><br />
  49. </p><p>
  50. <a href="admin.php?p=css" class="heading">Edit Site CSS</a><br />
  51. <a href="admin.php?p=meta" class="heading">Edit META Data</a><br />
  52. </p>
  53. <p>
  54. <a href="admin.php?p=logout" class="heading">Log Out</a><br />
  55. </p>
  56.     ';
  57.    
  58. }else{
  59.    
  60.     echo '
  61.    
  62. <form action="admin.php" method="post">
  63. Username:<br />
  64. <input type="text" name="username" class="formInput" /><br />
  65. Password:<br />
  66. <input type="password" name="password" class="formInput" /><br />
  67. <br />
  68. <input type="submit" value="Login" class="formInput" />
  69. </form>
  70.  
  71.    
  72.     ';
  73.    
  74. }
  75.  
  76. ?>
  77. </div>
  78. <div class="rightColumn">
  79.  
  80. <?php
  81.  
  82.  
  83.  
  84. if($loggedin == true) {
  85.    
  86.     $sql = mysql_connect("cuttosql.db","camdunlop","Goosey1@");
  87.     mysql_select_db("videos", $sql);
  88.    
  89.     if($_GET["p"] == "about") {
  90.        
  91.        
  92.         if(isset($_POST["aboutHTML"])) {
  93.            
  94.             $html = $_POST["aboutHTML"];
  95.             $html = str_replace("\\'","'",$html);
  96.             $html = str_replace('\\"','"',$html);
  97.            
  98.             $file = fopen("about.html","w");
  99.             fwrite($file,$html);
  100.             fclose($file);
  101.            
  102.            
  103.             echo 'Page updated!';
  104.            
  105.         }else{
  106.        
  107.             echo '
  108.        
  109. <form action="admin.php?p=about" method="post">
  110. <h1>Edit About Page HTML:</h1>
  111. <textarea name="aboutHTML" style="width: 700px; height: 650px;" class="formInput">'.file_get_contents('about.html').'</textarea><br />
  112. <br />
  113. <input type="submit" value="Update Page" class="formInput" />
  114. </form>
  115.        
  116.             ';
  117.         }
  118.     }else if($_GET["p"] == "delvideo") {
  119.        
  120.         if(isset($_GET["n"])) {
  121.            
  122.             if(isset($_POST["confirmed"])) {
  123.                
  124.                 $update = mysql_query("DELETE FROM videostable WHERE shortname = '".$_GET["n"]."'",$sql);
  125.                 if(!$update) die('Failed to delete video! Sorry!<br>' . mysql_error());
  126.                 else echo "Video deleted successfully.";       
  127.                
  128.                
  129.             }else{
  130.                
  131.                 echo '<p>
  132. <form action="admin.php?p=delvideo&n='.$_GET["n"].'" method="post">
  133. <h1>Are you sure?</h1>
  134. <input type="hidden" name="confirmed" value="true">
  135. <input type="submit" class="formInput" value="Sure am!" />
  136. </form>
  137. ';
  138.                
  139.             }
  140.            
  141.         }else{
  142.            
  143.             $result = mysql_query("SELECT * FROM videostable");
  144.             echo "<h1>Select which video you'd like to delete:</h1>";
  145.             while($row = mysql_fetch_array($result)) {
  146.                 $sn = $row["shortname"];
  147.                 $fn = $row["fullname"];
  148.                 echo'<a href="admin.php?p=delvideo&n='.$sn.'" class="heading">'.$fn.'</a><br />
  149. ';
  150.                
  151.             }
  152.            
  153.         }
  154.        
  155.     }else if($_GET["p"] == "newvideo") {
  156.        
  157.         if(isset($_POST["description"])) {
  158.            
  159.             $sn = $_POST["shortname"];
  160.             $fn = $_POST["fullname"];
  161.             $vimeo = $_POST["vimeo"];
  162.             $desc = $_POST["description"];
  163.             $desc = str_replace("\\'","&lsquo;",$desc);
  164.             $desc = str_replace('\\"','"',$desc);
  165.             $desc = str_replace("\n","<br />\n",$desc);
  166.            
  167.             $update = mysql_query("INSERT INTO videostable (shortname, fullname, vimeo, dateadded, description) VALUES ('".$sn."', '".$fn."', '".$vimeo."', '".DATE_ATOM."', '".$desc."')", $sql);
  168.            
  169.             if(!$update) die('Failed to create video! Sorry!<br>' . mysql_error());
  170.             else echo "'".$fn."' created successfully!";       
  171.            
  172.         }else{
  173.            
  174.             echo '
  175.            
  176. <form action="admin.php?p=newvideo" method="post">
  177. <h1>Create New Video</h1>
  178. <p>
  179. Short name:<br>
  180. <input type="text" class="formInput" name="shortname" value="" />
  181. </p>
  182. <p>
  183. Full name:<br>
  184. <input type="text" class="formInput" name="fullname" value="" />
  185. </p>
  186. <p>
  187. Vimeo ID#:<br>
  188. <input type="text" class="formInput" name="vimeo" maxlength="8" value="" />
  189. </p>
  190. <p>
  191. Description (HTML):<br>
  192. <textarea name="description" style="width: 700px; height: 350px; resize: vertical;" class="formInput"></textarea><br />
  193. (5000 character limit)
  194. </p>
  195. <p>
  196. <input type="submit" value="Create Video" class="formInput" />
  197. </p>
  198. </form>
  199.            
  200.                 ';
  201.            
  202.         }
  203.        
  204.        
  205.     }else if($_GET["p"] == "video") {
  206.        
  207.        
  208.         if(isset($_GET["n"])) {
  209.            
  210.             if(isset($_POST["description"])) {
  211.                
  212.                 $sn = $_POST["shortname"];
  213.                 $fn = $_POST["fullname"];
  214.                 $vimeo = $_POST["vimeo"];
  215.                 $desc = $_POST["description"];
  216.                 $desc = str_replace("\\'","&lsquo;",$desc);
  217.                 $desc = str_replace('\\"','"',$desc);
  218.                 $desc = str_replace("\n","<br />\n",$desc);
  219.                
  220.                 //echo "$sn<br>$fn<br>$vimeo<br>$desc<br>";
  221.                
  222.                 $update = mysql_query("UPDATE videostable SET fullname = '".$fn."', vimeo = '".$vimeo."', description = '".$desc."'  WHERE shortname = '".$sn."'", $sql);
  223.                 if(!$update) die('Failed to update! Sorry!<br>' . mysql_error());
  224.                 else echo "'".$fn."' info updated successfully!";
  225.                
  226.             }else{
  227.                
  228.                
  229.                 $result = mysql_query("SELECT * FROM videostable WHERE shortname='".$_GET["n"]."'");
  230.                 while($row = mysql_fetch_array($result)) {
  231.                     $sn = $row["shortname"];
  232.                     $fn = $row["fullname"];
  233.                     $vimeo = $row["vimeo"];
  234.                     $desc = $row["description"];
  235.                     echo '
  236.            
  237. <form action="admin.php?p=video&n='.$sn.'" method="post">
  238. <h1>You\'re editing the video \''.$fn.'\':</h1>
  239. <p>
  240. Short name:<br>
  241. <input type="text" class="formInput" value="'.$sn.'" disabled />
  242. <input type="hidden" name="shortname" value="'.$sn.'" />
  243. </p>
  244. <p>
  245. Full name:<br>
  246. <input type="text" class="formInput" name="fullname" value="'.$fn.'" />
  247. </p>
  248. <p>
  249. Vimeo ID#:<br>
  250. <input type="text" class="formInput" name="vimeo" maxlength="8" value="'.$vimeo.'" />
  251. </p>
  252. <p>
  253. Description (HTML):<br>
  254. <textarea name="description" style="width: 700px; height: 350px; resize: vertical;" class="formInput">'.$desc.'</textarea><br />
  255. (5000 character limit)
  256. </p>
  257. <p>
  258. <input type="submit" value="Update Video Info" class="formInput" />
  259. </p>
  260. </form>
  261.            
  262.                 ';
  263.                 }
  264.                
  265.         }
  266.            
  267.            
  268.         }else{
  269.            
  270.            
  271.             //echo $_POST["reorder"];
  272.             if($_POST["reorder"] == "true") {
  273.                    
  274.                     foreach($_POST as $key => $data) {
  275.                         if(strstr($key,"shortname_") != false) {
  276.                            
  277.                             $newOrder = str_replace("vid","",$data);
  278.                             $newOrder = str_replace("_","",$newOrder);
  279.                             $shortName = str_replace("shortname_","",$key);
  280.                            
  281.                            
  282.                             $update = mysql_query("UPDATE videostable SET `order` = ".$newOrder." WHERE `shortname` = '".$shortName."'", $sql);
  283.                             if(!$update) die('Failed to update! Sorry!<br>' . mysql_error());
  284.                             else echo "Videos reordered successfully!";
  285.                            
  286.                         }
  287.                     }
  288.                     echo "reordered yo";
  289.            
  290.             }else{
  291.            
  292.                 $result = mysql_query("SELECT * FROM videostable ORDER BY  `videostable`.`order` ASC");
  293.                 echo "<h1>Select which video you'd like to edit or reorder.</h1>";
  294.                 echo '
  295. <form action="admin.php?p=video" method="post" id="reorderForm">
  296. <div style="position: relative;">
  297.             ';
  298.                 $i = 0;
  299.                 while($row = mysql_fetch_array($result)) {
  300.                     $sn = $row["shortname"];
  301.                     $fn = $row["fullname"];
  302.                     $i++;
  303.                     echo'
  304.                
  305. <div id="vid'.$i.'_table" style=" position: absolute; display: block; left: 0px; top: '.(($i-1)*30).'px">
  306. <span style="display: inline-block; width: 300px;"><a href="admin.php?p=video&n='.$sn.'" class="heading">'.$fn.'</a></span>
  307. <input type="button" class="formInput" id="vid'.$i.'_up" value="Up" />
  308. <input type="button" class="formInput" id="vid'.$i.'_down" value="Down" />
  309. <input type="hidden" id="vid'.$i.'_order" name="shortname_'.$sn.'" value="vid'.($i).'_" />
  310. </div><br />
  311. ';
  312.                
  313.                 }
  314.                 echo '
  315. <br><br>
  316. <div style="position: absolute; left: 0px; top: '.($i*30).'px">
  317. <span style="display: inline-block; width: 300px;"> </span>
  318. <input type="hidden" id="reorderHidden" name="reorder" value="false" />
  319. <input type="submit" class="formInput" value="Reorder Videos" id="reorderSubmit" />
  320. </div>
  321. </div>
  322. </form>
  323. <script>
  324.  
  325. function swapTables(id1,id2) {
  326.    
  327.     var t1 = $("#vid"+id1+"_table");
  328.     var t2 = $("#vid"+id2+"_table");
  329.     t1.html(t1.html().split("vid"+id1+"_").join("vid"+id2+"_"));
  330.     t2.html(t2.html().split("vid"+id2+"_").join("vid"+id1+"_"));
  331.    
  332.     y1 = parseInt(t1.css("top").replace("px",""));
  333.     y2 = parseInt(t2.css("top").replace("px",""));
  334.    
  335.     t1.animate({"top": (y1+30)+"px"},500);
  336.     t2.animate({"top": (y2-30)+"px"},500);
  337.    
  338.     t1.attr("id","vid"+id2+"_table");
  339.     t2.attr("id","vid"+id1+"_table");
  340.     redeclare();
  341.    
  342. }
  343. function redeclare() {
  344.     tables = $("div[id*=\'_table\']");
  345.    
  346.     $("input[id=\'reorderSubmit\']").unbind("click");
  347.     $("input[id*=\'_up\']").unbind("click");
  348.     $("input[id*=\'_down\']").unbind("click");
  349.     declare();
  350. }
  351. function declare() {
  352.     tables = $("div[id*=\'_table\']");
  353.    
  354.     $("#reorderForm").submit(function() {
  355.         if($("#reorderHidden").attr("value") == "false") $("#reorderHidden").attr("value","true");
  356.         return true;
  357.        
  358.     });
  359.     $("input[id*=\'_up\']").bind("click",function() {
  360.         var iconN = $(this).attr("id").split("_up").join("");
  361.         iconN = parseInt(iconN.split("vid").join(""));
  362.         //alert(iconN);
  363.         if(iconN > 1) {
  364.             swapTables(iconN-1,iconN);
  365.    
  366.         }
  367.     });
  368.     $("input[id*=\'_down\']").bind("click",function() {
  369.         var iconN = $(this).attr("id").split("_down").join("");
  370.         iconN = parseInt(iconN.split("vid").join(""));
  371.         //alert(iconN);
  372.         if(iconN < tables.length) {
  373.             swapTables(iconN,iconN+1);
  374.         }
  375.     });
  376. }
  377. declare();
  378.  
  379. </script>
  380.            
  381.             ';
  382.             }
  383.            
  384.         }
  385.        
  386.        
  387.        
  388.     }else if($_GET["p"] == "thumbs") {
  389.        
  390.         if(isset($_POST["count"])) {
  391.            
  392.             $posts = intval($_POST["count"]);
  393.             $iconlist = '';
  394.             for($i=1; $i < $posts+1; $i++) {
  395.                 $result = mysql_fetch_row(mysql_query("SELECT fullname FROM videostable WHERE shortname = '".$_POST["img".$i."_name"]."'"));
  396.                 $fullname = $result[0];
  397.                 //echo $result."///".$fullname;
  398.                 if(isset($_POST["img".$i."_upload"])) {
  399.                    
  400.                     $curfile = $_FILES["img".$i."_url"];
  401.                     if(strpos($curfile["type"],"image") > -1) {
  402.                         move_uploaded_file($curfile["tmp_name"], "images/icons/" . $curfile["name"]);
  403.                     }else{
  404.                         echo $curfile["name"]." is not a valid image file.";
  405.                     }
  406.                    
  407.                     $iconlist .= "images/icons/".$curfile["name"].",".$_POST["img".$i."_name"].",".$fullname.",".$_POST["img".$i."_alt"].";\n";
  408.                    
  409.                 }else{
  410.                
  411.                     $iconlist .= $_POST["img".$i."_url"].",".$_POST["img".$i."_name"].",".$fullname.",".$_POST["img".$i."_alt"].";\n";
  412.                
  413.                 }
  414.             }
  415.            
  416.             $iconlistfile = fopen("iconlist.txt","w");
  417.             fwrite($iconlistfile,$iconlist);
  418.             fclose($iconlistfile);
  419.            
  420.            
  421.         }else{
  422.            
  423.             $txt = file_get_contents("iconlist.txt");
  424.             $icons = explode(";\n",$txt);
  425.             array_pop($icons);
  426.            
  427.            
  428.             echo '
  429. <div id="pageContainer" style="display: block; position: relative;">
  430. <form action="admin.php?p=thumbs" method="post" enctype="multipart/form-data">
  431. <input type="hidden" name="count" id="thumbsCount" value="'.count($icons).'" />
  432. <h1>Edit Portfolio Thumbnails</h1>
  433. <div id="thumbTables">
  434.             ';
  435.            
  436.             $result = mysql_query("SELECT * FROM videostable");
  437.             while($row = mysql_fetch_array($result)) {
  438.                 $dropdown .= '<option value="'.$row["shortname"].'">'.$row["fullname"]."</option>\n";
  439.             }
  440.            
  441.             $i = 0;
  442.             foreach($icons as $icon) {
  443.                 $i++;
  444.                 $iconParts = explode(",",$icon);
  445.                 echo $curIcon;
  446.                 echo '
  447. <div id="img'.$i.'_table" class="thumbTable" style=" position: absolute; display: block; left: 0px; top: '.(($i-1)*200).'px">
  448. <p>
  449. <table border="0" cellpadding="0" cellspacing="5">
  450. <tr><td rowspan="3" valign="top">
  451. <img src="'.$iconParts[0].'" id="img'.$i.'_img" width="220" height="125" border="0" /><br />
  452. <input type="button" class="formInput" id="img'.$i.'_up" value="Up" />
  453. <input type="button" class="formInput" id="img'.$i.'_down" value="Down" />
  454. <input type="button" class="formInput" id="img'.$i.'_delete" value="Delete Thumbnail" />
  455. </td>
  456. <td>
  457. Thumbnail name:<br />
  458. <select name="img'.$i.'_name" class="formInput">
  459. <option value="null">-Select One-</option>';
  460.                 $result = mysql_query("SELECT * FROM videostable");
  461.                 while($row = mysql_fetch_array($result)) {
  462.                     if($row["shortname"] == $iconParts[1]) echo '<option value="'.$row["shortname"].'" selected>'.$row["fullname"]."</option>\n";
  463.                     else echo '<option value="'.$row["shortname"].'">'.$row["fullname"]."</option>\n";
  464.                 }
  465.                 echo '
  466. </select>
  467. </td></tr>
  468. <tr><td>
  469. Thumbnail url:<br />
  470. <input type="text" class="formInput" name="img'.$i.'_url" value="'.$iconParts[0].'" style="width: 360px;" readonly />
  471. </td></tr>
  472. <tr><td>
  473. Thumbnail description:<br />
  474. <textarea class="formInput" name="img'.$i.'_alt" style="resize: vertical; width: 360px;" rows="2" />'.$iconParts[3].'</textarea>
  475. </td></tr>
  476. </table>
  477. </p>
  478. <br />
  479. </div>
  480.                 ';
  481.                
  482.                
  483.             }
  484.             echo '
  485.            
  486. </div>
  487.  
  488. <br />
  489. <br />
  490. <table border="0" cellpadding="0" cellspacing="0" style="display:block; position: absolute; left: 0px; top: '.((count($icons)+1)*200).'px" id="thumbToolbar"><tr><td width="200">
  491. <input type="button" class="formInput" id="addThumb" value="Add Thumbnail" />
  492. </td><td width="400" align="right">
  493. <input type="submit" class="formInput" value="Update Thumbnails" />
  494. </td></tr>
  495. <td><td colspan="2" height="50"></td></tr></table>
  496.  
  497. </form>
  498. </div>
  499. <br />
  500. <br />
  501. <br />
  502. <br />
  503. <br />
  504.  
  505. <script>
  506.  
  507.  
  508. function swapTables(id1,id2) {
  509.    
  510.     var t1 = $("#img"+id1+"_table");
  511.     var t2 = $("#img"+id2+"_table");
  512.     t1.html(t1.html().split("img"+id1+"_").join("img"+id2+"_"));
  513.     t2.html(t2.html().split("img"+id2+"_").join("img"+id1+"_"));
  514.    
  515.     y1 = parseInt(t1.css("top").replace("px",""));
  516.     y2 = parseInt(t2.css("top").replace("px",""));
  517.    
  518.     t1.animate({"top": (y1+200)+"px"},500);
  519.     t2.animate({"top": (y2-200)+"px"},500);
  520.    
  521.     t1.attr("id","img"+id2+"_table");
  522.     t2.attr("id","img"+id1+"_table");
  523.     redeclare();
  524.    
  525. }
  526. function redeclare() {
  527.     tables = $("div[id*=\'_table\']");
  528.     $("#thumbToolbar").css("top",200+((200*tables.length))+"px");
  529.    
  530.     $("input[id*=\'_delete\']").unbind("click");
  531.     $("input[id*=\'_up\']").unbind("click");
  532.     $("input[id*=\'_down\']").unbind("click");
  533.     declare();
  534. }
  535. function declare() {
  536.     tables = $("div[id*=\'_table\']");
  537.     $("input[id*=\'_delete\']").each(function() { $(this).removeAttr("disabled") });
  538.     $("input[id*=\'_delete\']").bind("click",function() {
  539.         $("input[id*=\'_delete\']").each(function() { $(this).attr("disabled","disabled") });
  540.         var iconN = $(this).attr("id").replace("_delete","");
  541.         var iconNo = parseInt(iconN.replace("img",""));
  542.         if(iconN != "img1") {
  543.             $("#thumbsCount").attr("value",parseInt($("#thumbsCount").attr("value"))-1);
  544.             $("#"+iconN+"_table").toggle("slow",function() {
  545.                
  546.                
  547.                
  548.                
  549.                 $(this).remove();
  550.                 redeclare();
  551.                
  552.                
  553.             });
  554.             tables.each(function(i) {
  555.                 if(i+1 > iconNo) {
  556.                     //alert($(this).html());
  557.                     $(this).html($(this).html().split("img"+(i+1)+"_").join("img"+(i)+"_"));
  558.                     $(this).attr("id","img"+(i)+"_table");
  559.                     //alert($(this).html());
  560.                     $(this).animate({"top": (parseInt($(this).css("top").replace("px",""))-200)+"px"},500);
  561.                    
  562.                 }
  563.                
  564.             });
  565.         }
  566.        
  567.        
  568.     });
  569.     $("input[id*=\'_up\']").bind("click",function() {
  570.         var iconN = $(this).attr("id").split("_up").join("");
  571.         iconN = parseInt(iconN.split("img").join(""));
  572.         //alert(iconN);
  573.         if(iconN > 1) {
  574.             swapTables(iconN-1,iconN);
  575.    
  576.         }
  577.     });
  578.     $("input[id*=\'_down\']").bind("click",function() {
  579.         var iconN = $(this).attr("id").split("_down").join("");
  580.         iconN = parseInt(iconN.split("img").join(""));
  581.         //alert(iconN);
  582.         if(iconN < tables.length) {
  583.             swapTables(iconN,iconN+1);
  584.         }
  585.     });
  586. }
  587. declare();
  588. $("#addThumb").bind("click",function() {
  589.     $("#thumbsCount").attr("value",parseInt($("#thumbsCount").attr("value"))+1);
  590.     var newName = "img"+$("#thumbsCount").attr("value");
  591.    
  592.     $("#img1_table").clone().appendTo($("#thumbTables"));
  593.    
  594.     var $newTable = $("div[id*=\'_table\']").last();
  595.     $newTable.css("top",(200*(tables.length))+"px");
  596.     $newTable.attr("id",newName+"_table");
  597.    
  598.     $newTable.find("input").each(function(i) {
  599.         if(i <= 2) $(this).attr("id", $(this).attr("id").replace("img1_",newName+"_"));
  600.         else $(this).replaceWith(\'<input type="file" class="formInput" name="\'+newName+\'_url" style="width:360px" /><input type="hidden" name="\'+newName+\'_upload" value="true" />\');
  601.     });
  602.     $newTable.find("textarea").each(function(i) {
  603.         //alert($(this).attr("name"));
  604.         $(this).attr("name", $(this).attr("name").replace("img1_",newName+"_"));
  605.         $(this).html("");
  606.     });
  607.     $newTable.find("img").each(function(i) {
  608.         //alert($(this).attr("name"));
  609.         $(this).attr("src","images/transparentgreybg.png");
  610.         $(this).css("border","1px solid black");
  611.     });
  612.     $newTable.hide();
  613.     $newTable.toggle("slow");
  614.    
  615.     redeclare();
  616.    
  617. });
  618.  
  619.  
  620. </script>
  621.             ';
  622.            
  623.         }
  624.        
  625.     }else if($_GET["p"] == "css") {
  626.        
  627.         if(isset($_POST["CSScontent"])) {
  628.            
  629.             $html = $_POST["CSScontent"];
  630.             $html = str_replace("\\'","'",$html);
  631.             $html = str_replace('\\"','"',$html);
  632.            
  633.             $file = fopen("styles.css","w");
  634.             fwrite($file,$html);
  635.             fclose($file);
  636.            
  637.            
  638.             echo 'CSS updated!';
  639.            
  640.         }else{
  641.            
  642.             echo '<form action="admin.php?p=css" method="post">
  643. <h1>Edit Site CSS:</h1>
  644. <textarea name="CSScontent" style="width: 700px; height: 650px;" class="formInput">'.file_get_contents('styles.css').'</textarea><br />
  645. <br />
  646. <input type="submit" value="Update CSS" class="formInput" />
  647. </form>';
  648.            
  649.         }
  650.        
  651.     }else if($_GET["p"] == "meta") {
  652.        
  653.         if(isset($_POST["keywords"])) {
  654.             $file = fopen("keywords.txt","w");
  655.             fwrite($file,$_POST["keywords"]);
  656.             fclose($file);
  657.             $file = fopen("description.txt","w");
  658.             fwrite($file,$_POST["description"]);
  659.             fclose($file);
  660.             echo 'Meta tags updated.';
  661.         }else{
  662.            
  663. echo '<form action="admin.php?p=meta" method="post">
  664. <h1>Edit Site META tags:</h1>
  665. <p>
  666. Keywords:<br />
  667. <input type="text" class="formInput" name="keywords" value="'.file_get_contents('keywords.txt').'" size="100" />
  668. </p><p>
  669. Description:<br />
  670. <textarea name="description" style="width: 700px; height: 200px;" class="formInput">'.file_get_contents('description.txt').'</textarea>
  671. </p>
  672. <br />
  673. <input type="submit" value="Update META Tags" class="formInput" />
  674. </form>';
  675.            
  676.         }
  677.        
  678.     }else if($_GET["p"] == "showreel") {
  679.        
  680.        
  681.         if(isset($_POST["reelHTML"])) {
  682.            
  683.             $html = $_POST["reelHTML"];
  684.             $html = str_replace("\\'","'",$html);
  685.             $html = str_replace('\\"','"',$html);
  686.            
  687.             $file = fopen("reel.html","w");
  688.             fwrite($file,$html);
  689.             fclose($file);
  690.            
  691.            
  692.             echo 'Page updated!';
  693.            
  694.         }else{
  695.        
  696.             echo '
  697.        
  698. <form action="admin.php?p=showreel" method="post">
  699. <h1>Edit Showreel Page HTML:</h1>
  700. <textarea name="reelHTML" style="width: 700px; height: 650px;" class="formInput">'.file_get_contents('reel.html').'</textarea><br />
  701. <br />
  702. <input type="submit" value="Update Page" class="formInput" />
  703. </form>
  704.        
  705.             ';
  706.         }
  707.        
  708.     }
  709.    
  710.     mysql_close($sql);
  711.    
  712.    
  713. }
  714.  
  715.  
  716. ?>
  717.  
  718. </div>
  719. </div>
  720. </center>
  721.  
  722.  
  723. </body>
  724. </html>
Add Comment
Please, Sign In to add comment