This page was exported from Jurusan Ilmu Komputer FMIPA [ http://ilkom.unila.ac.id ]
Export date: Sun Aug 9 0:25:48 2020 / +0000 GMT

MK Pilihan Sem 3 Kurikulum 2016 (Mhs Angkatan 2017)



Mata Kuliah Pilihan, yaitu:

  1. PEMROGRAMAN DEKLARATIF
  2. PEMROGRAMAN INTERPRETER
  3. KEAMANAN SISTEM INFORMASI
  4. MANAJEMEN PROYEK TI
  5. PROSES DAN KUALITAS PERANGKAT LUNAK

Untuk Pilihan Minat kapasitas masing-masing sesi pilihan dibatasi sebanyak 16 mahasiswa dan untuk pilihan umum di pilihan ke 2 dibatasi max 40. Isi form berikut untuk mendaftarkan diri anda. Mahasiswa hanya diperkenankan memilih 1 kali untuk masing-masing pilihan, Mata Kuliah yang sudah penuh tidak dapat dipilih lagi.


[insert_php]

extract($_GET);

global $wpdb;

global $table;

global $data_bidang;

$table = $wpdb->prefix . 'bidangmk';

$data_bidang = array("PEMROGRAMAN DEKLARATIF","PEMROGRAMAN INTERPRETER","KEAMANAN SISTEM INFORMASI",

"MANAJEMEN PROYEK TI","PROSES DAN KUALITAS PERANGKAT LUNAK");

function getRealIpAddr()

{

if (!empty($_SERVER['HTTP_CLIENT_IP']))

{

$ip=$_SERVER['HTTP_CLIENT_IP'];

}

elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))

{

$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];

}

else

{

$ip=$_SERVER['REMOTE_ADDR'];

}

return $ip;

}

function printData(){

global $data_bidang;

global $wpdb;

$wpdb->show_errors();

$table = $wpdb->prefix . 'bidangmk';

$query = "SELECT npm, nama, bidang from $table ORDER BY npm";

$results = $wpdb->get_results($query);

if ($results) {

echo "";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

foreach ($results as $data) {

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

}

echo "

NPM NAMA BIDANG
".$data->npm." ".$data->nama." ".$data_bidang[$data->bidang-1]."
";

}

}

date_default_timezone_set("Asia/Jakarta");

$current = strtotime(date("Y-m-d H:i:s"));

$date = strtotime("2018-08-11 11:15:00");

$datediff = $date - $current;

// die(" ini datediff ".$datediff);

if ($datediff>0){

//if (1>0){

echo "Pendaftaran dibuka pada: Sabtu, 11 Agustus 2018 pukul 11:15";

// echo "Pendaftaran ditutup
";

// echo "
";

// printData();

} else {

if ($submit) {

//$sesi="mkpilihan_genap2018";

$next=1;

if ($sesi=='mk16pil1_gjl1819') {

if ($bidang>5) $next=0;

}

else if ($sesi=='mk16pil2_gjl1819') {

$data_sesi=$wpdb->get_row( "SELECT count(*) as jml

FROM $table

WHERE npm = $npm

AND sesi = 'mk16pil1_gjl1819'" );

if ($data_sesi->jml<1) $next=0;

// die($data_sesi->jml." next ".$next);

}

else if ($sesi=='mk16pil3_gjl1819') {

$data_sesi=$wpdb->get_row( "SELECT count(*) as jml

FROM $table

WHERE npm = $npm

AND sesi = 'mk16pil1_gjl1819'

AND sesi = 'mk16pil2_gjl1819'" );

if ($data_sesi->jml<1) $next=0;

// die($data_sesi->jml." next ".$next);

}

if ($next==0) {

echo "DATA GAGAL DISIMPAN. Kemungkinan Kesalahan:


1. Anda Belum Memilih Pilihan 1. Anda Harus Memilih Pilihan 1 Terlebih Dahulu.


2. Pilihan 1 Anda Bukan Salah satu MK Minat SI atau Ilkom


3. Anda memilih pilihan 3 tetapi anda belum memilih pilihan 1 dan 2.

";

} else {

$data = $wpdb->get_row( "SELECT count(*) as jml

FROM $table

WHERE bidang = $bidang

AND sesi = '$sesi'" );

$jml_max =18;

if (($sesi=='mk16pil2_gjl1819') || ($sesi=='mk16pil3_gjl1819')) $jml_max =20;

if ($data->jml<$jml_max) {

if ($wpdb->insert(

$table,

array(

'npm' => $npm,

'nama' => $nama,

'bidang' => $bidang,

'sesi' => $sesi,

'ip_address'=>getRealIpAddr()

)

)) {echo "DATA DISIMPAN";}

else { echo "DATA GAGAL DISIMPAN. NPM ANDA HANYA BOLEH MENDAFTAR 1 KALI";}

} else {

echo "MAAF KELAS SUDAH PENUH, SILAHKAN PILIH BIDANG LAIN";

}

}

}

function listResult($s) {

global $wpdb;

global $table;

global $data_bidang;

$kuery = "SELECT bidang, COUNT( bidang ) AS jml

FROM $table

WHERE sesi ='$s'

GROUP BY bidang";

//die ("ini ".$kuery);

$results = $wpdb->get_results($kuery);

if ($results) {

foreach ($results as $loc) {

echo "
".$data_bidang[$loc->bidang-1]." : ".$loc->jml;

}

}

}

echo "


Pilihan 1";

listResult('mk16pil1_gjl1819');

echo "


Pilihan 2";

listResult('mk16pil2_gjl1819');

echo "


Pilihan 3";

listResult('mk16pil3_gjl1819');

echo "



FORM PENDAFTARAN MK PILIHAN

";

echo "
No Pilihan:
";

echo "NPM : ";

echo "
Nama : ";

echo "
Pilih MK Pilihan: ";

echo"


";

}

[/insert_php]

 

 


Post date: 2018-08-11 10:48:34
Post date GMT: 2018-08-11 03:48:34
Post modified date: 2018-08-13 16:27:14
Post modified date GMT: 2018-08-13 09:27:14

Powered by [ Universal Post Manager ] plugin. MS Word saving format developed by gVectors Team www.gVectors.com