Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///...
- else if ($pecah[0] == "RATA-RATA")
- {
- // cari no telpon dulu
- $query2 = "SELECT * FROM data_siswa WHERE no_telp = '$noPengirim'";
- $hasil2 = mysql_query($query2);
- // cek bila no telpon tidak ditemukan
- if (mysql_num_rows($hasil2) == 0)
- {
- $reply = "Nomor Handphone Anda tidak terdaftar pada Sistem Kami";
- }
- else
- {
- // baca NIS dari pesan SMS
- $thn_ajaran = $pecah[1];
- $semester = $pecah[2];
- $nis = $pecah[3];
- // bila no telpon ditemukan, kirim sms sesuai Pesan yg diminta
- $query3=mysql_query("SELECT *
- FROM data_nilai nilai, data_siswa siswa, data_mapel mapel
- WHERE nilai.id_siswa=siswa.id_siswa
- AND nilai.id_mapel=mapel.id_mapel
- AND thn_ajaran='$thn_ajaran'
- AND semester='$semester'
- AND nis='$nis' ");
- if (mysql_num_rows($query3) == 0)
- {
- $reply = "Nilai Rata-rata tidak Ada atau format penulisan pesan Anda Salah.
- Ketik : RATA-RATA.TA.SEMESTER.NIS";
- }
- else
- {
- $i = 1;
- $reply='';
- while ($data3=mysql_fetch_array($query3))
- {
- //CEK APA NILAI ADA YG SESUAI DG FORMAT SMS?
- $reply .=($i==1?"Nilai Rata-rata Anak Anda".$data3['nama_siswa']:'')
- ." Mapel ".$data3['nama_mapel']
- ." ThnAjaran ".$data3['thn_ajaran']
- ." Smt ".$data3['semester']
- . " Rata-rata= ".$data3['rata_rata'];
- $i++;
- }
- }
- }
- }
- //...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement