Advertisement
Guest User

Untitled

a guest
Feb 15th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 11.98 KB | None | 0 0
  1. <?php
  2. require $_SERVER['DOCUMENT_ROOT'].'/resources/feeds.php';
  3. require $_SERVER['DOCUMENT_ROOT'].'/resources/mysql.php';
  4. session_start();
  5. if(empty($_SESSION['username']) || $_SESSION['login'] != 'true'){ header("location:/"); }
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  8. <!--
  9. Design by Free CSS Templates
  10. http://www.freecsstemplates.org
  11. Released for free under a Creative Commons Attribution 2.5 License
  12.  
  13. Name       : Vegetables  
  14. Description: A two-column, fixed-width design with dark color scheme.
  15. Version    : 1.0
  16. Released   : 20110416
  17.  
  18. -->
  19. <html xmlns="http://www.w3.org/1999/xhtml">
  20. <head>
  21. <link rel="icon" type="/image/png" href="/resources/favicon.png">
  22. <meta name="keywords" content="" />
  23. <meta name="description" content="" />
  24. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  25. <title>My Website • Edit Information</title>
  26. <link href="/style.css" rel="stylesheet" type="text/css" media="screen" />
  27. </head>
  28. <body>
  29. <div id="header">
  30.     <div id="logo">
  31.       <h1><a href="/">My Website</a></h1>
  32.         <a href="/">This is the best website ever</a>
  33.       <p>&nbsp;</p>
  34. </div>
  35. </div>
  36. <!-- end #header -->
  37. <div id="wrapper">
  38.     <div id="menu">
  39.       <ul>
  40.             <li class="current_page_item"><a href="/">Home</a></li>
  41.             <li><a href="/events">Events</a></li>
  42.             <li><a href="/forum">Forums</a></li>
  43.             <li><a href="/about">About</a></li>
  44.             <li><a href="/minutes">Minutes</a></li>
  45.             <li><a href="/docs">Documents</a></li>
  46.             <li><a href="/contact">Contact Us</a></li>
  47.         </ul>
  48.     </div>
  49.     <!-- end #menu -->
  50. </div>
  51. <div id="page">
  52.     <div id="content">
  53.         <div class="post">
  54.             <h2 class="title"><a href="#">Edit Information</a></h2>
  55.             <div style="clear: both;"><form action="/admin"><input type="submit" value='Back'/></form></div>
  56. <div style="clear: both;"></div>
  57.             <div class="entry">
  58.  
  59.             <SCRIPT language="javascript">
  60.             function add() {
  61.                 x++;
  62.                 var foo = document.getElementById('my_div');
  63.                 foo.innerHTML = foo.innerHTML +"<input type='text' name='tg"+x+"' placeholder='name'><br />";
  64.             }
  65.             function addch() {
  66.                 y++;
  67.                 var foo = document.getElementById('my_other_div');
  68.                 foo.innerHTML = foo.innerHTML +"<input type='text' name='ch"+y+"' placeholder='name'><br />";
  69.             }
  70.             function addws() {
  71.                 z++;
  72.                 var foo = document.getElementById('my_other_other_div');
  73.                 foo.innerHTML = foo.innerHTML +"<input type='text' name='ws"+z+"' placeholder='workshop name and leaders' style='width: 98%;'><br />";
  74.             }
  75.             function detect(form) {
  76.                 if(form.checked) {
  77.                     window.backUpHtml = document.getElementById('con_div').innerHTML;  
  78.                     document.getElementById('con_div').innerHTML = '';
  79.                 } else {
  80.                     document.getElementById('con_div').innerHTML = window.backUpHtml;
  81.                     window.backUpHtml = '';
  82.                 }
  83.             }
  84.             </SCRIPT>
  85.  
  86.              <form name="form1" method="post" action="./"><font color="#FFFFFF">
  87.              <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#00000" style="max-width: 560px;">
  88.              <tr>
  89.              <td width="10%">Name</td>
  90.              <td width="90%"><?php echo "<input name='name' type='text' value='".stripslashes($_POST['name'])."' required='required'/>"; ?><input type="checkbox" onclick="detect(this)" name="isyac" id="isyac" value="yes" <?php if(isset($_POST['isyac'])) { echo "checked='checked'";} ?> /><label for="isyac">YAC Meeting</label></td>
  91.              </tr>
  92.              <tr>
  93.              <td width="10%" style="vertical-align:top;">Description</td>
  94.              <td width="90%"><?php echo '<textarea name="desc" rows="5" cols="60" style="resize: vertical;" required="required">'.stripslashes($_POST["desc"]).'</textarea>'; ?></td>
  95.              </tr>
  96.              <tbody id="con_div">
  97.              <!-- START OF CON DIV -->
  98.              <tr>
  99.              <td width="10%" style="vertical-align:top;">Touchgroup Leaders</td>
  100.              <td width="90%">
  101.  
  102.              <?php
  103.  
  104.             $blah = 1;
  105.  
  106.             while(isset($_POST['tg'.$blah])) {
  107.                 echo '<input type="text" name="tg'.$blah.'" value="'.stripslashes($_POST["tg".$blah]).'" /><br />';
  108.                  $blah++;
  109.              }
  110.              $hoo = $blah - 1;
  111.              echo "<script language='javascript'> var x = ".$hoo."; </script>";
  112.  
  113.              ?>
  114.              <div id="my_div"></div>
  115.              <input type="button" value="Add" onClick="add()">
  116.  
  117.              </td>
  118.              </tr>
  119.              <tr>
  120.              <td width="10%" style="vertical-align:top;">Chaplains</td>
  121.              <td width="90%">
  122.  
  123.              <?php
  124.              $blah = 1;
  125.  
  126.             while(isset($_POST['ch'.$blah])) {
  127.                 echo '<input type="text" name="ch'.$blah.'" value="'.stripslashes($_POST["ch".$blah]).'" /><br />';
  128.                  $blah++;
  129.              }
  130.              $hoo = $blah - 1;
  131.              echo "<script language='javascript'> var y = ".$hoo."; </script>";
  132.  
  133.              ?>
  134.              <div id="my_other_div"></div>
  135.              <input type="button" value="Add" onClick="addch()">
  136.  
  137.              </td>
  138.              </tr>
  139.              <tr>
  140.              <td width="10%" style="vertical-align:top;">Workshops</td>
  141.              <td width="90%">
  142.  
  143.              <?php
  144.              $blah = 1;
  145.  
  146.             while(isset($_POST['ws'.$blah])) {
  147.                 echo '<input type="text" name="ws'.$blah.'" value="'.stripslashes($_POST["ws".$blah]).'" style="width: 98%;"/><br />';
  148.                  $blah++;
  149.              }
  150.              $hoo = $blah - 1;
  151.              echo "<script language='javascript'> var z = ".$hoo."; </script>";
  152.  
  153.              ?>
  154.              <div id="my_other_other_div"></div>
  155.              <input type="button" value="Add" onClick="addws()">
  156.  
  157.              </td>
  158.              </tr>
  159.              </tbody>
  160.              <!-- END OF CON DIV -->
  161.              <tr>
  162.              <td width="10%" style="vertical-align:top;">Registration Links</td>
  163.              <td width="90%">
  164.  
  165.              <?php echo '<input type="text" name="YouthLink" value="'.stripslashes($_POST['YouthLink']).'"/>&nbsp;Youth Link<br />
  166.              <input type="text" name="AdultLink" value="'.stripslashes($_POST['AdultLink']).'"/>&nbsp;Adult Link'; ?>
  167.  
  168.              </td>
  169.              </tr>
  170.              <tr>
  171.              <td width="10%" style="vertical-align:top;">Start Date</td>
  172.              <td width="90%">
  173.  
  174.              <select name='startmonth'>
  175.                 <?php $idk = array("January","February","March","April","May","June","July","August","September","October","November","December");
  176.  
  177.                foreach ($idk as $bob):
  178.  
  179.                if($bob = $_POST['startmonth']) {
  180.                    echo '<option value="'.$bob.'" selected="selected">'.$bob.'</option>';
  181.                 } else {
  182.                     echo '<option value="'.$bob.'">'.$bob.'</option>';
  183.                 }
  184.  
  185.                 endforeach;
  186.  
  187.                 ?>
  188.              </select>
  189.              <select name="startday">
  190.                 <?php
  191.  
  192.                $x = 1;
  193.                while($x <= 31) {
  194.                    if((int)$_POST['startday'] == $x) {
  195.                        echo "<option value='".$x."' selected='selected'>".$x."</option>";
  196.                     } else {
  197.                         echo "<option value='".$x."'>".$x."</option>";
  198.                     }
  199.                     $x++;
  200.                 }
  201.  
  202.                 ?>
  203.              </select>
  204.              <select name="startyear">
  205.                 <?php $date = getdate();
  206.                for($x = 0;$x < 3;$x++) {
  207.                    $y = (int)$date['year']+$x;
  208.                    if($y == $_POST['startyear']) {
  209.                    echo "<option value='".$y."' selected='selected'>".$y."</option>";
  210.                     } else {
  211.                     echo "<option value='".$y."'>".$y."</option>";
  212.                     }
  213.                 }
  214.                 ?>
  215.              </select>
  216.  
  217.              </td>
  218.              </tr>
  219.              <tr>
  220.              <td width="10%" style="vertical-align:top;">End Date</td>
  221.              <td width="90%">
  222.  
  223.              <select name='endmonth'>
  224.                 <?php $idk = array("January","February","March","April","May","June","July","August","September","October","November","December");
  225.  
  226.                foreach ($idk as $bob):
  227.  
  228.                if($bob = $_POST['endmonth']) {
  229.                    echo '<option value="'.$bob.'" selected="selected">'.$bob.'</option>';
  230.                 } else {
  231.                     echo '<option value="'.$bob.'">'.$bob.'</option>';
  232.                 }
  233.  
  234.                 endforeach;
  235.  
  236.                 ?>
  237.              </select>
  238.              <select name="endday">
  239.                 <?php
  240.  
  241.                $x = 1;
  242.                while($x <= 31) {
  243.                    if((int)$_POST['endday'] < $x) {
  244.                        echo "<option value='".$x."'>".$x."</option>";
  245.                     } else if((int)$_POST['endday'] == $x) {
  246.                         echo "<option value='".$x."' selected='selected'>".$x."</option>";
  247.                     } else if((int)$_POST['endday'] > $x) {
  248.                         echo "<option value='".$x."'>".$x."</option>";
  249.                     }
  250.                     $x++;
  251.                 }
  252.  
  253.                 ?>
  254.              </select>
  255.              <select name="endyear">
  256.                 <?php $date = getdate();
  257.                for($x = 0;$x < 3;$x++) {
  258.                    $y = (int)$date['year']+$x;
  259.                    if($y == $_POST['endyear']) {
  260.                        echo "<option value='".$y."' selected='selected'>".$y."</option>";
  261.                     } else {
  262.                         echo "<option value='".$y."'>".$y."</option>";
  263.                     }
  264.                 }
  265.                 ?>
  266.              </select>
  267.  
  268.              </td>
  269.              </tr>
  270.              <tr>
  271.              <td width="10%" style="vertical-align:top;">Location</td>
  272.              <td width="90%">
  273.  
  274.                 <?php echo '<input type="text" name="location" value="'.stripslashes($_POST['location']).'" required="required"/>'; ?>
  275.  
  276.              </td>
  277.              </tr>
  278.              <tr>
  279.              <td width="90%"></td>
  280.              <td width="10%">
  281.  
  282.                 <input type="hidden" name="blah" value="blah"/>
  283.                 <input type="submit" name="woohoo" value="Save" align="right"/>
  284.  
  285.              </td>
  286.              </table>
  287.              </form>
  288.                  <?php if(isset($_POST['isyac'])) {
  289.                echo "<script language='javascript'>window.backUpHtml = document.getElementById('con_div').innerHTML;  
  290.                 document.getElementById('con_div').innerHTML = '';</script>"; ?>
  291.             }
  292.             </div>
  293.  
  294.         </div>
  295.  
  296. <div style="clear: both;">&nbsp;</div>
  297.     </div>
  298.     <!-- end #content -->
  299.     <div id="sidebar">
  300.         <?php include($_SERVER['DOCUMENT_ROOT'].'/resources/side.php'); ?>
  301.     </div>
  302.     <!-- end #sidebar -->
  303.     <div style="clear: both;">&nbsp;</div>
  304. </div>
  305. <!-- end #page -->
  306. <div id="footer-menu">
  307.     <ul>
  308.             <li class="current_page_item"><a href="/">Home</a></li>
  309.             <li><a href="/events">Events</a></li>
  310.             <li><a href="/forum">Forums</a></li>
  311.             <li><a href="/about">About</a></li>
  312.             <li><a href="/minutes">Minutes</a></li>
  313.             <li><a href="/docs">Documents</a></li>
  314.             <li><a href="/contact">Contact Us</a></li>
  315.   </ul>
  316. </div>
  317. <div id="footer">
  318.     <p>Copyright &copy; <?php $date = getdate(); echo $date['year']; ?> My Website. All rights reserved.</p>
  319. </div>
  320. <!-- end #footer -->
  321. </body>
  322. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement