Skip to content

Commit

Permalink
Update selectbooks.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jianminglok authored Sep 21, 2017
1 parent b15962f commit 63e9c9a
Showing 1 changed file with 4 additions and 136 deletions.
140 changes: 4 additions & 136 deletions selectbooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,144 +12,12 @@

//check if form is submitted
if (isset($_POST['signup'])) {
if (isset($_POST['1'])) {
$chi_s1_1_sc = "1";
$_SESSION['chi_s1_1_sc'] = "1";
} else {
$chi_s1_1_sc = "0";
$_SESSION['chi_s1_1_sc'] = "0";
}

if (isset($_POST['2'])) {
$chi_s1_2_sc = "1";
$_SESSION['chi_s1_2_sc'] = "1";
} else {
$chi_s1_2_sc = "0";
$_SESSION['chi_s1_2_sc'] = "0";
}

if (isset($_POST['3'])) {
$chi_j1_1_sc = "1";
$_SESSION['chi_j1_1_sc'] = "1";
} else {
$chi_j1_1_sc = "0";
$_SESSION['chi_j1_1_sc'] = "0";
}

if (isset($_POST['4'])) {
$chi_j1_2_sc = "1";
$_SESSION['chi_j1_2_sc'] = "1";
} else {
$chi_j1_2_sc = "0";
$_SESSION['chi_j1_2_sc'] = "0";
}

if (isset($_POST['5'])) {
$kupasan_s1_sc = "1";
$_SESSION['kupasan_s1_sc'] = "1";
} else {
$kupasan_s1_sc = "0";
$_SESSION['kupasan_s1_sc'] = "0";
}

if (isset($_POST['6'])) {
$jaket_s1_sc = "1";
$_SESSION['jaket_s1_sc'] = "1";
} else {
$jaket_s1_sc = "0";
$_SESSION['jaket_s1_sc'] = "0";
}

if (isset($_POST['7'])) {
$dinara_s1_sc = "1";
$_SESSION['dinara_s1_sc'] = "1";
} else {
$dinara_s1_sc = "0";
$_SESSION['dinara_s1_sc'] = "0";
}

if (isset($_POST['8'])) {
$think_s1_sc = "1";
$_SESSION['think_s1_sc'] = "1";
} else {
$think_s1_sc = "0";
$_SESSION['think_s1_sc'] = "0";
}

if (isset($_POST['9'])) {
$poems_s1_sc = "1";
$_SESSION['poems_s1_sc'] = "1";
} else {
$poems_s1_sc = "0";
$_SESSION['poems_s1_sc'] = "0";
}

if (isset($_POST['10'])) {
$sejarah_s1_sc = "1";
$_SESSION['sejarah_s1_sc'] = "1";
} else {
$sejarah_s1_sc = "0";
$_SESSION['sejarah_s1_sc'] = "0";
}

if (isset($_POST['11'])) {
$nexus_s1_sc = "1";
$_SESSION['nexus_s1_sc'] = "1";
} else {
$nexus_s1_sc = "0";
$_SESSION['nexus_s1_sc'] = "0";
}

if (isset($_POST['12'])) {
$comp_s1_sc = "1";
$_SESSION['comp_s1_sc'] = "1";
} else {
$comp_s1_sc = "0";
$_SESSION['comp_s1_sc'] = "0";
}

if (isset($_POST['13'])) {
$addmaths_s1_1_sc = "1";
$_SESSION['addmaths_s1_1_sc'] = "1";
} else {
$addmaths_s1_1_sc = "0";
$_SESSION['addmaths_s1_1_sc'] = "0";
}

if (isset($_POST['14'])) {
$addmaths_s1_2_sc = "1";
$_SESSION['addmaths_s1_2_sc'] = "1";
} else {
$addmaths_s1_2_sc = "0";
$_SESSION['addmaths_s1_2_sc'] = "0";
}


if (isset($_POST['15'])) {
$bio_s1_sc = "1";
$_SESSION['bio_s1_sc'] = "1";
} else {
$bio_s1_sc = "0";
$_SESSION['bio_s1_sc'] = "0";
}

if (isset($_POST['16'])) {
$chem_s1_sc = "1";
$_SESSION['chem_s1_sc'] = "1";
} else {
$chem_s1_sc = "0";
$_SESSION['chem_s1_sc'] = "0";
}

if (isset($_POST['17'])) {
$phy_s1_sc = "1";
$_SESSION['phy_s1_sc'] = "1";
} else {
$phy_s1_sc = "0";
$_SESSION['phy_s1_sc'] = "0";

for($i=0; $i < sizeof($_POST['books']; $i++) {
$_SESSION['books'][$i] = $_POST['books'][$i];
}

if(empty($_POST['1']) && empty($_POST['2']) && empty($_POST['3']) && empty($_POST['4']) && empty($_POST['5']) && empty($_POST['6']) && empty($_POST['7']) && empty($_POST['8']) && empty($_POST['9']) && empty($_POST['10']) && empty($_POST['11']) && empty($_POST['12']) && empty($_POST['13']) && empty($_POST['14']) && empty($_POST['15']) && empty($_POST['16']) && empty($_POST['17'])) {
if(empty($_POST['books']) {
$errorinfo = "Please select your books before continuing.";
} else {
$key2 = md5($dateofsubmit.time());
Expand Down

0 comments on commit 63e9c9a

Please sign in to comment.