Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. <?php
  2. $sv_name = "localhost";
  3. $username = "root";
  4. $password = "slash112bot";
  5. $db_name = "uni";
  6. $con = mysql_connect($sv_name, $username, $password) or die(mysql_error());
  7. mysql_select_db($db_name, $con) or die(mysql_error());
  8.  
  9. $jsType = $_GET['typeid'];
  10. $jsSub1 = $_GET['subid1'];
  11. $jsSub2 = $_GET['subid2'];
  12. $jsSub3 = $_GET['subid3'];
  13. $jsSub4 = $_GET['subid4'];
  14. $sub1 = $_GET['si1'];
  15. $sub2 = $_GET['si2'];
  16. $sub3 = $_GET['si3'];
  17. $sub4 = $_GET['si4'];
  18.  
  19.  
  20. if ($jsType == 2 && $sub1 > 0) {
  21. $atlast = 1;
  22. }
  23.  
  24. else if (($jsType == 1 || $jsType == 3) && $sub2 > 0) {
  25. $atlast = 1;
  26. }
  27.  
  28. else if ($jsType == 4 && $sub1 > 0) {
  29. $atlast = 1;
  30. }
  31.  
  32. else {
  33. $atlast = 0;
  34. }
  35.  
  36. echo "
  37.  
  38. lvl = document.uniform.level.value;
  39.  
  40. si1 = document.uniform.subject1.selectedIndex;
  41. si2 = document.uniform.subject2.selectedIndex;
  42. si3 = document.uniform.subject3.selectedIndex;
  43. si4 = document.uniform.subject4.selectedIndex;
  44. ";
  45.  
  46. $pages_table_name = "uni_combinations";
  47. $query_subjects = "SELECT * FROM " . $pages_table_name;
  48. $result_subjects = mysql_query($query_subjects, $con) or die(mysql_error());
  49.  
  50.  
  51. while($row_subjects = mysql_fetch_array($result_subjects))
  52. {
  53.  
  54. if (
  55. $jsType == $row_subjects['typeid'] &&
  56. (
  57.  
  58. ($jsSub1 == $row_subjects['subid1'] || $jsSub1 == 0)
  59. &&
  60. ($jsSub2 == $row_subjects['subid2'] || $jsSub2 == 0)
  61. &&
  62. ($jsSub3 == $row_subjects['subid3'] || $jsSub3 == 0)
  63. &&
  64. ($jsSub4 == $row_subjects['subid4'] || $jsSub4 == 0)
  65.  
  66. )
  67. )
  68. {
  69. if ($atlast == 1) {
  70. echo "
  71. document.uniform.subject2.options[".$row_subjects['subid2']."].disabled = true;
  72. document.uniform.subject2.options[".$row_subjects['subid2']."].style.display = 'none';
  73.  
  74. document.uniform.subject3.options[".$row_subjects['subid3']."].disabled = true;
  75. document.uniform.subject3.options[".$row_subjects['subid3']."].style.display = 'none';
  76.  
  77. document.uniform.subject4.options[".$row_subjects['subid4']."].disabled = true;
  78. document.uniform.subject4.options[".$row_subjects['subid4']."].style.display = 'none';
  79. ";
  80. }
  81.  
  82. }
  83. }
  84.  
  85. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement