Advertisement
pazrat

content.php

Feb 10th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.69 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <link rel="stylesheet" type="text/css" href="Content.css">
  4.         <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  5.         <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
  6.     </head>
  7.     <script type="text/javascript">
  8.         $(document).ready(function(){
  9.             $("select#type").attr("disabled","disabled");
  10.             $("select#category").change(function(){
  11.             $("select#type").attr("disabled","disabled");
  12.             $("select#type").html("<option>wait...</option>");
  13.             var id = $("select#category option:selected").attr('value');
  14.             $.post("select_type.php", {id:id}, function(data){
  15.                 $("select#type").removeAttr("disabled");
  16.                 $("select#type").html(data);
  17.             });
  18.         });
  19.          
  20.          $("select#principle").attr("disabled","disabled");
  21.             $("select#type").change(function(){
  22.             $("select#principle").attr("disabled","disabled");
  23.             $("select#principle").html("<option>wait...</option>");
  24.             var id = $("select#type option:selected").attr('value');
  25.             $.post("select_principle.php", {id:id}, function(data){
  26.                 $("select#principle").removeAttr("disabled");
  27.                 $("select#principle").html(data);
  28.             });
  29.         });
  30.        
  31.         $("form#select_form").submit(function(){
  32.             var cat = $("select#category option:selected").attr('value');
  33.             var type = $("select#type option:selected").attr('value');
  34.             var princ = $("select#principle option:selected").attr('value');
  35.             if(cat>0 && type>0 && princ>0)
  36.             {
  37.                 var result = $("select#principle option:selected").html();
  38.                 $("#result").html('your choice: '+result);
  39.             }
  40.             else
  41.             {
  42.                 $("#result").html("you must choose two options!");
  43.             }
  44.             return false;
  45.         });
  46.     });
  47.     </script>  
  48. <body>
  49. <?php
  50. $host="127.0.0.0"; // Host name
  51. $username="username"; // Mysql username
  52. $password="password"; // Mysql password
  53. $db_name="database"; // Database name
  54. $tbl_name="table_name"; // Table name
  55. ?>
  56.  
  57.  
  58.  
  59.  
  60.     <?php
  61.         session_start();
  62.         $_SESSION["username"];
  63.         $_SESSION["password"];
  64.         $_SESSION["access"];
  65.     ?>
  66.    
  67.     <div id="Container">
  68.    
  69.         <div id="Header">
  70.        
  71.         <div id="SignIn">
  72.              <a href="logout.php">Logout</a>
  73.             <a href="login.php">Login</a>
  74.             <a href="index.php">Home</a>
  75.             </div>
  76.            
  77.             <div id="MainNavigationLanding">
  78.                 <nav>
  79.                     <ul>
  80.                         <li><a href="content.php" id="Kids" ></a></li>
  81.                         <li><a href="content.php" id="Students"></a></li>
  82.                         <li><a href="content.php" id="Business"></a>
  83.                         </li>
  84.                     </ul>
  85.                 </nav>
  86.             </div><!-- End of the MainNavigation -->
  87.         </div> <!-- End of the Header -->
  88.        
  89.         <div id="Content">
  90.        
  91.                 <?php include "select.class.php"; ?>
  92.                 <form id="select_form" >
  93.                 Choose a subject:<br />
  94.                 <select id="category" >
  95.                 <?php echo $opt->ShowCategory(); ?>
  96.                 </select>
  97.                 <br /><br />
  98.        
  99.                 Choose a section:<br />
  100.                 <select id="type">
  101.                 <option value="%">any...</option>
  102.                 </select>
  103.                 <br /><br />
  104.        
  105.                 Choose a principle:<br />
  106.                 <select id="principle">
  107.                 <option value="%">any...</option>
  108.                 </select>
  109.                 <br /><br />
  110.        
  111.                 <input type="submit" value="confirm" />
  112.                 </form>
  113.                 <div id="result"></div>
  114.            
  115.                 <!-- end of the Options -->
  116.                
  117.                
  118.        
  119.                
  120.                
  121.                
  122.                
  123.                 <div id="Results">             
  124.                 <?php
  125.                 $Public = "Please Login in or register an account to be able to see the content";
  126.                 $Consumer = "Hello you should only see this within a consumer account also known as kids or schools";
  127.                 $Contributor = " Hello you should only see this text if you are within a contributor account fro example work";
  128.                 $Admin = " Hello you should only see this when you are logged into and admin account";
  129.  
  130.                 if($_SESSION["username"] == ""){
  131.                     echo $Public;  
  132.                 }
  133.  
  134.                 if($_SESSION["access"] == "Consumer"){
  135.                 echo $Consumer;
  136.                    
  137.                 echo "<div id=\"Video\">";
  138.                 echo "<div id=\"VideoImage\">";
  139.                 echo "this is the video image";
  140.                 echo "</div>";
  141.                 echo "<div id=\"VideoDetails\">";
  142.                 echo "<div id=\"VideoTitle\">";
  143.                 echo "</div>";
  144.                 echo "<div id=\"VideoBlurb\">";
  145.                 echo "this is a video for a maths class made by thomas dudley";
  146.                 echo "</div>";
  147.                 echo "<a href=\"index.php\">Download</a>";
  148.                 echo "</div>";
  149.                 echo "</div>";
  150.                 }
  151.  
  152.                 if($_SESSION["access"] == "Contributor"){
  153.                     echo $Contributor;
  154.                
  155.                 echo "<div id=\"Video\">";
  156.                 echo "<div id=\"VideoImage\">";
  157.                 echo "this is the video image";
  158.                 echo "</div>";
  159.                 echo "<div id=\"VideoDetails\">";
  160.                 echo "<div id=\"VideoTitle\">";
  161.                 echo "</div>";
  162.                 echo "<div id=\"VideoBlurb\">";
  163.                 echo "this is a video for a maths class made by thomas dudley";
  164.                 echo "</div>";
  165.                 echo "<a href=\"index.php\">Download</a>";
  166.                 echo "</div>";
  167.                 echo "</div>";
  168.                 }
  169.  
  170.                 if($_SESSION["access"] == "Administrator"){
  171.                 echo $Admin;
  172.                
  173.                 echo "<div id=\"Video\">";
  174.                 echo "<div id=\"VideoImage\">";
  175.                 echo " this is the video image";
  176.                 echo "</div>";
  177.                 echo "<div id=\"VideoDetails\">";
  178.                 echo "<div id=\"VideoTitle\">";
  179.                 echo "</div>";
  180.                 echo "<div id=\"VideoBlurb\">";
  181.                 echo "this is a video for a maths class made by thomas dudley";
  182.                 echo "</div>";
  183.                 echo "<a href=\"index.php\">Download</a>";
  184.                 echo "</div>";
  185.                 echo "</div>";
  186.                 }
  187.                 ?>
  188.                 </div> <!-- end of the Results -->
  189.        
  190.         </div> <!-- End of the Content -->
  191.  
  192.     </div> <!-- End of the Container -->
  193. </body> <!-- End of the Body -->
  194. </html> <!-- End of the Html -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement