Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sv_name = "localhost";
- $username = "root";
- $password = "slash112bot";
- $db_name = "uni";
- $con = mysql_connect($sv_name, $username, $password) or die(mysql_error());
- mysql_select_db($db_name, $con) or die(mysql_error());
- $jsType = $_GET['typeid'];
- $jsSub1 = $_GET['subid1'];
- $jsSub2 = $_GET['subid2'];
- $jsSub3 = $_GET['subid3'];
- $jsSub4 = $_GET['subid4'];
- $sub1 = $_GET['si1'];
- $sub2 = $_GET['si2'];
- $sub3 = $_GET['si3'];
- $sub4 = $_GET['si4'];
- if ($jsType == 2 && $sub1 > 0) {
- $atlast = 1;
- }
- else if (($jsType == 1 || $jsType == 3) && $sub2 > 0) {
- $atlast = 1;
- }
- else if ($jsType == 4 && $sub1 > 0) {
- $atlast = 1;
- }
- else {
- $atlast = 0;
- }
- echo "
- lvl = document.uniform.level.value;
- si1 = document.uniform.subject1.selectedIndex;
- si2 = document.uniform.subject2.selectedIndex;
- si3 = document.uniform.subject3.selectedIndex;
- si4 = document.uniform.subject4.selectedIndex;
- ";
- $pages_table_name = "uni_combinations";
- $query_subjects = "SELECT * FROM " . $pages_table_name;
- $result_subjects = mysql_query($query_subjects, $con) or die(mysql_error());
- while($row_subjects = mysql_fetch_array($result_subjects))
- {
- if (
- $jsType == $row_subjects['typeid'] &&
- (
- ($jsSub1 == $row_subjects['subid1'] || $jsSub1 == 0)
- &&
- ($jsSub2 == $row_subjects['subid2'] || $jsSub2 == 0)
- &&
- ($jsSub3 == $row_subjects['subid3'] || $jsSub3 == 0)
- &&
- ($jsSub4 == $row_subjects['subid4'] || $jsSub4 == 0)
- )
- )
- {
- if ($atlast == 1) {
- echo "
- document.uniform.subject2.options[".$row_subjects['subid2']."].disabled = true;
- document.uniform.subject2.options[".$row_subjects['subid2']."].style.display = 'none';
- document.uniform.subject3.options[".$row_subjects['subid3']."].disabled = true;
- document.uniform.subject3.options[".$row_subjects['subid3']."].style.display = 'none';
- document.uniform.subject4.options[".$row_subjects['subid4']."].disabled = true;
- document.uniform.subject4.options[".$row_subjects['subid4']."].style.display = 'none';
- ";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement