Advertisement
MeroslavTsaakoff

SoftUni 5. PHP Basics 3. Flow Controls 7. Student Sorting

Aug 23rd, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.55 KB | None | 0 0
  1. <?php
  2. include 'ChromePhp.php';
  3. //ChromePhp::log('Hello console!');
  4. //ChromePhp::log($_SERVER);
  5. //ChromePhp::warn('something went wrong!');
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10.     <meta charset="UTF-8">
  11.     <title>Student Sorting Task</title>
  12.     <style>
  13.         li {
  14.             width: 610px;
  15.         }
  16.  
  17.         li:first-child {
  18.             border: 1px solid black;
  19.         }
  20.  
  21.         span {
  22.             display: inline-block;
  23.             width: 100px;
  24.             margin-right: 8.5%;
  25.         }
  26.  
  27.         input[type="text"] {
  28.             width: 145px;
  29.             margin-right: 0.5%;
  30.         }
  31.  
  32.         input[type="number"] {
  33.             width: 100px;
  34.             margin-right: 0.5%;
  35.         }
  36.     </style>
  37.     <?php
  38.    if (isset($_POST['first-name-input']) &&
  39.        isset($_POST['last-name-input']) &&
  40.        isset($_POST['email-input']) &&
  41.        isset($_POST['score-input'])) {
  42.        $firstName = $_POST['first-name-input'];
  43.        $lastName = $_POST['last-name-input'];
  44.        $email = $_POST['email-input'];
  45.        $score = $_POST['score-input'];
  46.  
  47.        //$data = array(
  48.        //
  49.        //);
  50.    }
  51.    ?>
  52. </head>
  53. <body>
  54.     <main>
  55.         <section>
  56.             <form action="student-sorting.php" method="post">
  57.                 <ul>
  58.                     <li><span>First name:</span><span>Last name:</span><span>Email:</span><span>Exam score:</span></li>
  59.                     <li><input type="text" name="first-name-input[]" /><input type="text" name="last-name-input[]" /><input type="text" name="email-input[]" /><input type="number" name="score-input[]" /><button>-</button></li>
  60.                     <li><input type="text" name="first-name-input" /><input type="text" name="last-name-input" /><input type="text" name="email-input" /><input type="number" name="score-input" /><button>-</button></li>
  61.                 </ul>
  62.                 <button>+</button>
  63.                 <label for="sort-selection">Sort by:</label>
  64.                 <select id="sort-selection">
  65.                     <option>First name</option>
  66.                     <option>Last name</option>
  67.                     <option>Email</option>
  68.                     <option>Exam score</option>
  69.                 </select>
  70.                 <label for="order-selection">Order:</label>
  71.                 <select id="order-selection">
  72.                     <option>Ascending</option>
  73.                     <option>Descending</option>
  74.                 </select>
  75.                 <input type="submit" value="Submit" />
  76.             </form>
  77.         </section>
  78.     </main>
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement