Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="Content.css">
- <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
- <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
- </head>
- <script type="text/javascript">
- $(document).ready(function(){
- $("select#type").attr("disabled","disabled");
- $("select#category").change(function(){
- $("select#type").attr("disabled","disabled");
- $("select#type").html("<option>wait...</option>");
- var id = $("select#category option:selected").attr('value');
- $.post("select_type.php", {id:id}, function(data){
- $("select#type").removeAttr("disabled");
- $("select#type").html(data);
- });
- });
- $("select#principle").attr("disabled","disabled");
- $("select#type").change(function(){
- $("select#principle").attr("disabled","disabled");
- $("select#principle").html("<option>wait...</option>");
- var id = $("select#type option:selected").attr('value');
- $.post("select_principle.php", {id:id}, function(data){
- $("select#principle").removeAttr("disabled");
- $("select#principle").html(data);
- });
- });
- $("form#select_form").submit(function(){
- var cat = $("select#category option:selected").attr('value');
- var type = $("select#type option:selected").attr('value');
- var princ = $("select#principle option:selected").attr('value');
- if(cat>0 && type>0 && princ>0)
- {
- var result = $("select#principle option:selected").html();
- $("#result").html('your choice: '+result);
- }
- else
- {
- $("#result").html("you must choose two options!");
- }
- return false;
- });
- });
- </script>
- <body>
- <?php
- $host="127.0.0.0"; // Host name
- $username="username"; // Mysql username
- $password="password"; // Mysql password
- $db_name="database"; // Database name
- $tbl_name="table_name"; // Table name
- ?>
- <?php
- session_start();
- $_SESSION["username"];
- $_SESSION["password"];
- $_SESSION["access"];
- ?>
- <div id="Container">
- <div id="Header">
- <div id="SignIn">
- <a href="logout.php">Logout</a>
- <a href="login.php">Login</a>
- <a href="index.php">Home</a>
- </div>
- <div id="MainNavigationLanding">
- <nav>
- <ul>
- <li><a href="content.php" id="Kids" ></a></li>
- <li><a href="content.php" id="Students"></a></li>
- <li><a href="content.php" id="Business"></a>
- </li>
- </ul>
- </nav>
- </div><!-- End of the MainNavigation -->
- </div> <!-- End of the Header -->
- <div id="Content">
- <?php include "select.class.php"; ?>
- <form id="select_form" >
- Choose a subject:<br />
- <select id="category" >
- <?php echo $opt->ShowCategory(); ?>
- </select>
- <br /><br />
- Choose a section:<br />
- <select id="type">
- <option value="%">any...</option>
- </select>
- <br /><br />
- Choose a principle:<br />
- <select id="principle">
- <option value="%">any...</option>
- </select>
- <br /><br />
- <input type="submit" value="confirm" />
- </form>
- <div id="result"></div>
- <!-- end of the Options -->
- <div id="Results">
- <?php
- $Public = "Please Login in or register an account to be able to see the content";
- $Consumer = "Hello you should only see this within a consumer account also known as kids or schools";
- $Contributor = " Hello you should only see this text if you are within a contributor account fro example work";
- $Admin = " Hello you should only see this when you are logged into and admin account";
- if($_SESSION["username"] == ""){
- echo $Public;
- }
- if($_SESSION["access"] == "Consumer"){
- echo $Consumer;
- echo "<div id=\"Video\">";
- echo "<div id=\"VideoImage\">";
- echo "this is the video image";
- echo "</div>";
- echo "<div id=\"VideoDetails\">";
- echo "<div id=\"VideoTitle\">";
- echo "</div>";
- echo "<div id=\"VideoBlurb\">";
- echo "this is a video for a maths class made by thomas dudley";
- echo "</div>";
- echo "<a href=\"index.php\">Download</a>";
- echo "</div>";
- echo "</div>";
- }
- if($_SESSION["access"] == "Contributor"){
- echo $Contributor;
- echo "<div id=\"Video\">";
- echo "<div id=\"VideoImage\">";
- echo "this is the video image";
- echo "</div>";
- echo "<div id=\"VideoDetails\">";
- echo "<div id=\"VideoTitle\">";
- echo "</div>";
- echo "<div id=\"VideoBlurb\">";
- echo "this is a video for a maths class made by thomas dudley";
- echo "</div>";
- echo "<a href=\"index.php\">Download</a>";
- echo "</div>";
- echo "</div>";
- }
- if($_SESSION["access"] == "Administrator"){
- echo $Admin;
- echo "<div id=\"Video\">";
- echo "<div id=\"VideoImage\">";
- echo " this is the video image";
- echo "</div>";
- echo "<div id=\"VideoDetails\">";
- echo "<div id=\"VideoTitle\">";
- echo "</div>";
- echo "<div id=\"VideoBlurb\">";
- echo "this is a video for a maths class made by thomas dudley";
- echo "</div>";
- echo "<a href=\"index.php\">Download</a>";
- echo "</div>";
- echo "</div>";
- }
- ?>
- </div> <!-- end of the Results -->
- </div> <!-- End of the Content -->
- </div> <!-- End of the Container -->
- </body> <!-- End of the Body -->
- </html> <!-- End of the Html -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement