Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <!DOCTYPE html>
  2. <!--code by webdevtrick (webdevtrick.com) -->
  3. <head>
  4.     <meta charset=UTF-8" />
  5.    
  6.     <title>Early Detection COVID-19</title>
  7.    
  8.     <link rel="stylesheet" type="text/css" href="style.css" />
  9.     <script type="text/javascript" src="jquery.min.js"></script>
  10.     <link href="http://fonts.googleapis.com/css?family=Corben:bold" rel="stylesheet" type="text/css">
  11.     <link href="http://fonts.googleapis.com/css?family=Nobile" rel="stylesheet" type="text/css">
  12.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  13.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  14.   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  15.   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
  16. </head>
  17. <style>
  18. .question{
  19.   text-align: left;
  20.   text-indent: 40px;
  21. }
  22. .quest{
  23.     text-indent: 3px;
  24.     display: inline-block;
  25. }
  26. .result{
  27.     text-align:center;
  28.     color: white;
  29.     border: 3px solid grey;
  30.     background-color:#333333;
  31.     padding:13px 32px;
  32. }
  33. .myButton {
  34.     box-shadow:inset 0px 1px 0px 0px #bbdaf7;
  35.     background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);
  36.     background-color:#79bbff;
  37.     border-radius:6px;
  38.     position: relative;
  39.     margin-left:1050px;
  40.     margin-bottom: 20px;
  41.     border:1px solid #84bbf3;
  42.     display:inline-block;
  43.     cursor:pointer;
  44.     color:#ffffff;
  45.     font-family:Arial;
  46.     font-size:15px;
  47.     font-weight:bold;
  48.     padding:6px 24px;
  49.     text-decoration:none;
  50.     text-shadow:0px 1px 0px #528ecc;
  51. }
  52. .myButton:hover {
  53.     background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%);
  54.     background-color:#378de5;
  55. }
  56. .myButton:active {
  57.     position:relative;
  58.     top:1px;
  59. }
  60.  
  61.  
  62. </style>
  63. <body>
  64.  
  65. <div class="container p-3 my-3 bg-dark text-white" >
  66.   <h1 class="text-center">Early Detection of COVID-19</h1>
  67.   <p class="text-center">Mohon diisi dengan Data yang Sebenar-benarnya</p>
  68. </div>
  69.  
  70.  
  71.     <div class="question">
  72.         <form action="" method="post" class="quiz">
  73.             <ol>
  74.    
  75.                
  76.                     <h3>1. Apakah Anda Mengalami Demam?</h3>
  77.                    
  78.                     <div >
  79.                         <input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" required/>
  80.                         <label for="question-1-answers-A" class= 'quest'> Ya </label>
  81.                     </div>
  82.                    
  83.                     <div >
  84.                         <input type="radio" name="question-1-answers" id="question-1-answers-B" value="B"required />
  85.                         <label for="question-1-answers-B" class= 'quest'>Tidak</label>
  86.                     </div>
  87.                    
  88.    
  89.                
  90.                     <h3>2. Apakah Anda Mengalami Batuk?</h3>
  91.                    
  92.                     <div>
  93.                         <input type="radio" name="question-2-answers" id="question-2-answers-A" value="A"required />
  94.                         <label for="question-2-answers-A" class= 'quest'>Ya</label>
  95.                     </div>
  96.                    
  97.                     <div>
  98.                         <input type="radio" name="question-2-answers" id="question-2-answers-B" value="B"required />
  99.                         <label for="question-2-answers-B" class= 'quest'>Tidak</label>
  100.                     </div>
  101.                    
  102.  
  103.                     <h3>3. Apakah Anda Mengalami Nyeri Tenggorokan?</h3>
  104.                    
  105.                     <div>
  106.                         <input type="radio" name="question-3-answers" id="question-3-answers-A" value="A" required />
  107.                         <label for="question-3-answers-A" class= 'quest'>Ya</label>
  108.                     </div>
  109.                    
  110.                     <div>
  111.                         <input type="radio" name="question-3-answers" id="question-3-answers-B" value="B" required />
  112.                         <label for="question-3-answers-B" class= 'quest'>Tidak</label>
  113.                     </div>
  114.                    
  115.        
  116.                
  117.                     <h3>4. Apakah Anda Mengalami Lemah, Letih, dan Lesu?</h3>
  118.                    
  119.                     <div >
  120.                         <input type="radio" name="question-4-answers" id="question-4-answers-A" value="A" required/>
  121.                         <label for="question-4-answers-A"class= 'quest'>Ya</label>
  122.                     </div>
  123.                    
  124.                     <div>
  125.                         <input type="radio" name="question-4-answers" id="question-4-answers-B" value="B"required />
  126.                         <label for="question-4-answers-B" class= 'quest'>Tidak</label>
  127.                     </div>
  128.                    
  129.                
  130.                
  131.                     <h3>5. Apakah Anda mengalami sesak nafas?</h3>
  132.                    
  133.                     <div >
  134.                         <input type="radio" name="question-5-answers" id="question-5-answers-A" value="A" required/>
  135.                         <label for="question-5-answers-A" class= 'quest'>Ya</label>
  136.                     </div>
  137.                    
  138.                     <div>
  139.                         <input type="radio" name="question-5-answers" id="question-5-answers-B" value="B"required />
  140.                         <label for="question-5-answers-B" class= 'quest'>Tidak</label>
  141.                     </div>
  142.                    
  143.                
  144.                     <h3>6. Apakah Anda memiliki riwayat perjalanan ke luarnegeri?</h3>
  145.                    
  146.                     <div >
  147.                         <input type="radio" name="question-6-answers" id="question-6-answers-A" value="A" required/>
  148.                         <label for="question-6-answers-A" class= 'quest'>Ya</label>
  149.                     </div>
  150.                    
  151.                     <div>
  152.                         <input type="radio" name="question-6-answers" id="question-6-answers-B" value="B" required/>
  153.                         <label for="question-6-answers-B" class= 'quest'>Tidak</label>
  154.                     </div>
  155.                  
  156.                
  157.                 <h3>7. Apakah Anda memiliki riwayat perjalanan ke area terjangkit COVID-19?</h3>
  158.                
  159.                 <div>
  160.                     <input type="radio" name="question-7-answers" id="question-7-answers-A" value="A" required/>
  161.                     <label for="question-7-answers-A" class= 'quest'>Ya</label>
  162.                 </div>
  163.                
  164.                 <div >
  165.                     <input type="radio" name="question-7-answers" id="question-7-answers-B" value="B" required/>
  166.                     <label for="question-7-answers-B" class= 'quest'>Tidak</label>
  167.                 </div>
  168.              
  169.        
  170.                
  171.                 <h3>8. Apakah Anda memiliki riwayat kontak dengan pasien?</h3>
  172.                
  173.                 <div>
  174.                     <input type="radio" name="question-8-answers" id="question-8-answers-A" value="A"required />
  175.                     <label for="question-8-answers-A" class= 'quest'>Ya</label>
  176.                 </div>
  177.                
  178.                 <div>
  179.                     <input type="radio" name="question-8-answers" id="question-8-answers-B" value="B" required/>
  180.                     <label for="question-8-answers-B"class= 'quest'>Tidak</label>
  181.                 </div>
  182.              
  183.          
  184.            
  185.             </ol>
  186.            
  187.             <input type="submit" value="Submit" class="myButton" />
  188.             <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
  189.         </form>
  190.    
  191.     </div>
  192.     <div class="result">
  193.  
  194. <br>
  195.  
  196.  
  197.  
  198.  
  199.  
  200. <?php
  201.  
  202.     $answer1 = isset($_POST['question-1-answers']) ? $_POST['question-1-answers'] : null;
  203.  
  204.     $answer2 = isset($_POST['question-2-answers']) ? $_POST['question-2-answers'] : null;
  205.  
  206.     $answer3 = isset($_POST['question-3-answers']) ? $_POST['question-3-answers'] : null;
  207.  
  208.     $answer4 = isset($_POST['question-4-answers']) ? $_POST['question-4-answers'] : null;
  209.  
  210.     $answer5 = isset($_POST['question-5-answers']) ? $_POST['question-5-answers'] : null;
  211.  
  212.     $answer6 = isset($_POST['question-6-answers']) ? $_POST['question-6-answers'] : null;
  213.  
  214.     $answer7 = isset($_POST['question-7-answers']) ? $_POST['question-7-answers'] : null;
  215.  
  216.     $answer8 = isset($_POST['question-8-answers']) ? $_POST['question-8-answers'] : null;
  217.  
  218. /*
  219.  
  220.     $answer2 = $_POST['question-2-answers'];
  221.  
  222.     $answer3 = $_POST['question-3-answers'];
  223.  
  224.     $answer4 = $_POST['question-4-answers'];
  225.  
  226.     $answer5 = $_POST['question-5-answers'];
  227.  
  228.     $answer6 = $_POST['question-6-answers'];
  229.  
  230.     $answer7 = $_POST['question-7-answers'];
  231.  
  232.     $answer8 = $_POST['question-8-answers'];
  233.  
  234. */      
  235.  
  236.  
  237.  
  238.     $totalCorrect = 0;
  239.  
  240.    
  241.  
  242.     if ($answer1 == "A") { $totalCorrect++; }
  243.  
  244.     if ($answer2 == "A") { $totalCorrect++; }
  245.  
  246.     if ($answer3 == "A") { $totalCorrect++; }
  247.  
  248.     if ($answer4 == "A") { $totalCorrect++; }
  249.  
  250.     if ($answer5 == "A") { $totalCorrect++; }
  251.  
  252.     if ($answer6 == "A") { $totalCorrect++; }
  253.  
  254.     if ($answer7 == "A") { $totalCorrect++; }
  255.  
  256.     if ($answer8 == "A") { $totalCorrect++; }
  257.  
  258.  
  259.  
  260.     if ($answer1 == "B") {
  261.  
  262.         if ($answer2 == "B") {
  263.  
  264.             if ($answer3 == "B") {
  265.  
  266.                 if ($answer4 == "B") {
  267.  
  268.                     if ($answer5 == "B") {
  269.  
  270.                         if ($answer5 == "B") {
  271.  
  272.                             if ($answer6 == "B") {
  273.  
  274.                                 if ($answer7 == "B") {
  275.  
  276.                                     if ($answer8 == "B") { $totalCorrect = 1; }
  277.  
  278.                                 }
  279.  
  280.                             }
  281.  
  282.                         }
  283.  
  284.                     }
  285.  
  286.                 }
  287.  
  288.             }
  289.  
  290.         }
  291.  
  292.     }
  293.  
  294.  
  295.  
  296.     //echo "<div>$totalCorrect / 8 correct</div>";
  297.     if ($totalCorrect == 0) {echo "<div id='results'></div>";}
  298.     elseif ($totalCorrect >= 3) {echo "<div id='results'><h1>Result</h1><br><h2>Jangan Panik! Silahkan Menghubungi Fasilitas terdekat atau hubungi hotline COVID-19 RI 119</h2></div>";}
  299.     elseif ($totalCorrect < 3 && $totalCorrect > 0) {echo "<div id='results'><h1>Result</h1><br><h2>Istirahatlah teratur, jangan keluar rumah yaa</h2></div>";}
  300.  
  301. ?>
  302. <!-- <input type="submit" value="Back" class="backbtn" /> -->
  303. </div>
  304.  
  305. </body>
  306. <script>
  307.  
  308.  
  309. $(document).ready(function(){
  310. $(".submitbtn").click(function(){
  311. $(".result").show();
  312. var Serialized =  $(".quiz").serialize();
  313. $.ajax({
  314. type: "POST",
  315.     url: "result.php",
  316.     data: Serialized,
  317.     success: function(data) {
  318.         //var obj = jQuery.parseJSON(data); if the dataType is not specified as json uncomment this
  319.         // do what ever you want with the server response
  320.     },
  321.  
  322. }
  323. });
  324. });
  325. });
  326. </script>
  327.  
  328. <!-- <script>
  329.  
  330. $(document).ready(function(){
  331.  
  332. $(".result").hide();
  333.  
  334. });
  335.  
  336. $(document).ready(function(){
  337.  
  338. $(".submitbtn").click(function(){
  339.  
  340. $(".result").slideToggle("slow");
  341.  
  342. });
  343.  
  344. });
  345.  
  346. </script>
  347.  
  348. -->
  349.  
  350. </html>