maya grha kencana"; //$strHeader.="
Total bisnis solution
"; // online //include "onlineSuport.php"; //$strTopMenu=""; if (isset($_SESSION['level']) && isset($_SESSION['nama'])) { $username = $_SESSION['nama']; $sesNama = $_SESSION['nama']; $logUser = $username; $level = $_SESSION['level']; $strHeader .= "LOGOUT"; $defRef = "Masukan kode refill"; //$strHeader.="
$username
"; // menu //include "menuTop.php"; $strSesNama .= "$sesNama"; include "menuLeft.php"; //$strTopMenu.="88888"; //include "menuLeft.php"; if (($_SESSION['level'] == "3") || ($_SESSION['level'] == "2") || ($_SESSION['level'] == "1")) { //$username=$_SESSION['username']; $qq = "select * from radreply where username='$username'"; $xq = mysql_query($qq, $conn) or die(mysql_error()); $numq = mysql_num_rows($xq); if ($numq == 1) { //$mode="LIMITED"; $strSesNama .= "
LIMITED CONNECTION"; if (($_SESSION['level'] != 3)) { $strNote .= "PERINGATAN!
dalam mode LIMITED ini kecepatan akses Anda terbatas
ada kemungkinan halaman web yang tidak bisa dibuka. segera lakukan isi ulang di sini untuk kembali bisa menikmati akses koneksi PREMIUM"; } } else { $strSesNama .= "
PREMIUM CONNECTION"; } include_once "../../Pages/Misc/arrUserSpecial.php"; switch ($_GET[Mode]) { case "HisRefill": $hisNama = $_GET[nama]; if (isset($hisNama)) { if ($hisNama != $sesNama) { $msg = "Illegal operation"; die (toAlert("$msg")); // echo "$msg $sesNama"; } } $historyUser = $_POST['nama']; if (!$historyUser) { $historyUser = $logUser; } $strTitle .= "History Refill"; $strMainTitle = "
history refill
"; include "hisRefill.php"; break; case "SlowOn": //limit upload download voucher free $up = 131072; $dw = 131072; //$strMain.=show_confirm().""; //echo ""; $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute6 = "Mikrotik-Total-Limit"; $attribute4 = "Max-Access-Period-Time"; $attribute5 = "Mikrotik-Rate-Limit"; $op = ":="; $newMA = $masaAktif + $masaAktif2; //period-time $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; $newLBw = $limitTotal + $limitTotal2; $limitKecepatan2 = "$up/$dw"; $newLK = $limitKecepatan2; // $upload = $ll['acctinputoctets']; // $download = $ll['acctoutputoctets']; // cek masa aktif $q = "SELECT * FROM radcheck where username='$username' and attribute='$attribute6' "; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); $limitQuotaBw = $l[value]; // cek kuota bandwith $q = "SELECT * FROM radcheck where username='$username' and attribute='$attribute4' "; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); if ($j = mysql_num_rows($x) > 0) { $attribute4_value = $l[value]; } else { $attribute4_value = "unlimited"; $masaAktiveHr = "unlimited"; $attribute4_value = 2592000; // 30 hari $q = "insert into radcheck (username,attribute,value) "; $q .= "values ('$username','$attribute4','$attribute4_value')"; $x = mysql_query($q, $conn) or die(mysql_error()); } $masaAktiveHr = $attribute4_value / 86400 . " hari"; // menghitung bandwit yang sudah dipakai $q = "SELECT SUM(acctinputoctets) AS 'totalUpload', SUM(acctoutputoctets) AS 'totalDownload' FROM radacct "; $q .= "where username='$username' AND acctstoptime IS NOT NULL"; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); $totalUpload = $l['totalUpload']; $totalDownload = $l['totalDownload']; $masaAktive = $attribute4_value; // second $kuota = $limitQuotaBw; // byte $pemakaianBw = $totalUpload + $totalDownload; // byte $sisaQbw = $limitQuotaBw - $pemakaianBw; // byte // die(); // $q = "insert into radtemp (username,totalupload,totaldownload,totalbw,tanggal,quotabw,sisaquotabw) "; // $q .= "values ('$username','$totalUpload','$totalDownload','$pemakaianBw',CURRENT_TIMESTAMP(),'$limitQuotaBw','$sisaQbw')"; // $x = mysql_query($q, $conn) or die(mysql_error()); // membuat kuota menjadi unlimid $q = "update radcheck set username='$username-slow' "; $q .= "where username='$username' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); // membuat premium jadi limited $query = "insert into radreply (username,attribute,op,value) values ('$username','$attribute5','$op','$newLK')"; $action = mysql_query($query, $conn) or die(mysql_error()); echo ""; //creatLog $jenis = "slow"; $deskripsi = "Slow Mode On pada total pemakaian $pemakaianBw=$totalUpload(up) + $totalDownload(dl);"; creatLog($logUser, $level, $jenis, $deskripsi); // notivikasi email // $smtp = "gmail"; $smtp = "local"; $fromAddr = ""; $fromLabel = "free-radius"; $toAddr = "cahbagoesdewe@yahoo.com"; // $toAddr = "maya_teknis@yahoogroups.com"; $toLabel = ""; $subject = "slow mode"; $message = "$username mengaktifkan slow mode sisa masa aktive : $masaAktiveHr"; $attach = ""; sendSMTPMail($smtp, $fromAddr, $fromLabel, $toAddr, $toLabel, $subject, $message, $attach); break; case "Reload": $u = $_GET['u']; switch ($_GET['j']) { case "1": if (isset($_GET['u']) && in_array("$u", $arrUserSpecial) || in_array("$u", $arrUserSuperSpecial)) { // echo "gondes"; $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute6 = "Mikrotik-Total-Limit"; // kuota bandwith $attribute4 = "Max-Access-Period-Time"; // masa aktive $attribute5 = "Mikrotik-Rate-Limit"; // vouceher free $op = ":="; // $hari_ini = date() $q = "SELECT DATEDIFF(now(),acctstarttime) AS 'umur' FROM radacct WHERE username='$username' ORDER BY radacctid ASC LIMIT 1"; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); $hari = $l['umur']; // value $q = "SELECT * FROM radcheck where username='$username' and attribute='$attribute6' "; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); $limitQuotaBw = $l[value]; $q = "SELECT * FROM radcheck where username='$username' and attribute='$attribute4' "; $x = mysql_query($q, $conn) or die(mysql_error()); $l = mysql_fetch_array($x); $attribute4_value = $l[value]; // $attribute4_value = 2592000; // 30 hari // 1073741824; // 1Gb // 3221225472; // 3Gb // $limitTotal2 = 2147483648; // 2Gb $vrefillGb = $limitQuotaBw / 1073741824; // 2Gb // membuat jejak refill $q = "insert into radrefill (username,onlineLimit,totalBw,tglUsed,user)"; $q .= "values('self_inject','$attribute4_value','$limitQuotaBw',CURRENT_TIMESTAMP,'$u' )"; $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__)); // MENGEMBALIKAN KE MODE PREMIUM $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set username='$username' "; $q .= "where username='$username-slow'"; $x = mysql_query($q, $conn) or die(""); // radpostauth $q = "delete from radpostauth "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); // merername history $q = "update radacct set username='$username-his' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(""); $q = "update radcheck set refill=refill+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); // mencatat refill pada history $comment = "refill $vrefillGb Gb "; $q = "insert into radacct (username,acctstarttime,acctstoptime,type,comment)"; $q .= "values('$username',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,'1','$comment' )"; $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__)); $msg = "Refill Sukses"; echo ""; //creatLog $jenis = "refill"; $deskripsi = "$username merefill dengan kode $kode, Q-Bandw $sisaQbw + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA"; creatLog($logUser, $level, $jenis, $deskripsi); if (in_array("$u", $arrUserSpecial)) { $karena = "masa aktif sudah habis (30 hari)"; } else { $karena = "karena kuota $vrefillGb Gb habis selama $hari "; } // notivikasi email // $smtp = "gmail"; $smtp = "local"; $fromAddr = ""; $fromLabel = "radius"; // $toAddr = "tandori_yk@yahoo.com"; // $toAddr = "cahbagoesdewe@yahoo.com"; $toAddr = "maya_teknis@yahoogroups.com"; $toLabel = "hot spot"; $subject = "reactivasi $username "; $message = "$username melakukan reaktivasi sendiri $karena"; $attach = ""; sendSMTPMail($smtp, $fromAddr, $fromLabel, $toAddr, $toLabel, $subject, $message, $attach); } break; } break; case "UserTraffic": header("refresh:60"); $strTitle .= "Status Pemakaian"; $strMain .= "
berikut ini adalah status voucher anda
"; include "userTraffic.php"; $strTitle .= " $username"; // $strMain .= ""; if ($habis == 'EXPIRED') { $strMain .= "
Voucher $username sudah EXPIRED
"; // region khusu untuk user special if (in_array("$username", $arrUserSpecial)) { $strMain .= "
Apakah masih ingin melanjutkan?
"; } // endregion khusu untuk agus bigburger } elseif (($limitTotal > 0) and ($pemakaianBw >= $limitTotal)) { if (in_array("$username", $arrUserSuperSpecial)) { $slow = "$_SERVER[PHP_SELF]?Mode=Reload&u=$username&j=1"; } else { $slow = "$_SERVER[PHP_SELF]?Mode=SlowOn"; } $strMain .= "
"; $strMain .= "
Quota bandwith Anda sudah tercapai, lakukan refill sebelum expired.!
"; // $strMain .= "
"; $strMain .= "

"; // $strMain .= "
"; $strMain .= "
Anda masih bisa melanjutkan access dengan kecepatan terbatas, dengan mengeklik tombol SLOW MODE"; $strMain .= " atau klik disini untuk melakukan refill"; $strMain .= "
"; $strMain .= "
"; //$linkDelete="Hapus"; //$strMain.="atau klik tombol "; // tidak dipakai gantinya mode SlowOn if (isset($_POST['submit'])) // mengaktifkan slow mode { $up = $_POST['upload']; $dw = $_POST['download']; //$strMain.=show_confirm().""; //echo ""; $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute6 = "Mikrotik-Total-Limit"; $attribute4 = "Max-Access-Period-Time"; $attribute5 = "Mikrotik-Rate-Limit"; $op = ":="; $newMA = $masaAktif + $masaAktif2; //period-time $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; $newLBw = $limitTotal + $limitTotal2; $limitKecepatan2 = "$up/$dw"; $newLK = $limitKecepatan2; $query = "insert into radreply (username,attribute,op,value) values ('$username','$attribute5','$op','$newLK')"; $action = mysql_query($query, $conn) or die(mysql_error()); $q = "update radcheck set username='$username-slow' "; $q .= "where username='$username' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); $msg = "Slow Mode diaktifkan"; echo ""; //creatLog $jenis = "slow"; $deskripsi = "Slow MOde On pada total pemakaian $pemakaianBw=$totalUpload(up) + $totalDownload(dl);"; creatLog($logUser, $level, $jenis, $deskripsi); } } elseif (($sisaUptime <= 0) && ($sesLevel == 3)) { $strMain .= "
Waktu online anda sudah berakhir !!!
"; } else { $strMain .= "
Koneksi internet Anda akan otomatis terputus ketika salah satu dari masa aktif, quota bandwith, atau batas waktu online Anda telah habis
"; } $idhot = $sesNama; include_once "../../Pages/Radius/lastRefill.php"; $strNote .= "
$lastRefill"; //creatLog // $jenis="view"; // $deskripsi="melihat pemakaian $pBw $satBw"; //creatL-og($logUser,$level,$jenis,$deskripsi); break; case "Refill0": $strTitle .= "refill"; include "userTraffic.php"; //$strMain.="$habis"; if ($habis == 'EXPIRED') { $strMain .= "
Voucher $username sudah EXPIRED
"; } else { $strMain .= "
Refill Box
"; $strMain .= "
"; $strMain .= "
"; $strMain .= "

"; $strMain .= "

"; $strMain .= ""; $strMain .= "
"; $strMain .= ""; $strMain .= "
"; } if (isset($_POST['submit'])) { $username2 = $_POST['kode']; if ($username2 == $defRef) { $msg = "Masukan dulu kode refill"; die(""); } $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); $num = mysql_num_rows($x); $l = mysql_fetch_array($x); if ($num == 0) { $msg = "Kode refill tidak valid"; $q = "update radcheck set refillProc=refillProc+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); //creatLog $jenis = "refill"; $deskripsi = "gagal merefill dengan kode $username2"; creatLog($logUser, $level, $jenis, $deskripsi); die(""); } else { $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); while ($l2 = mysql_fetch_assoc($x)) { $kode = $l2['username']; $downloadLimit2 = $l2['downloadLimit']; $uploadLimit2 = $l2['uploadLimit']; $masaAktif2 = $l2['onlineLimit']; $speedDownload2 = $l2['speedDownload']; $speedUpload2 = $l2['speedUpload']; $limitUptime2 = $l2['lifetimeLimit']; $limitTotal2 = $l2['totalBw']; } $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute6 = "Mikrotik-Total-Limit"; $attribute4 = "Max-Access-Period-Time"; $attribute5 = "Mikrotik-Rate-Limit"; $op = ":="; //$newPT= if ($limitTotalSlow > 0) { //$limitTotal=$limitTotalSlow; $newMA = $masaAktif + $masaAktif2; //period-time $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; $newLBw = $limitTotalSlow + $limitTotal2; $limitKecepatan2 = "$speedUpload2/$speedDownload2"; $newLK = $limitkecepatan + $limitKecepatan2; } else { $newMA = $masaAktif + $masaAktif2; //period-time $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; $newLBw = $limitTotal + $limitTotal2; $limitKecepatan2 = "$speedUpload2/$speedDownload2"; $newLK = $limitkecepatan + $limitKecepatan2; } if ($newLT <= $limitUptime) { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute1'"; $x = mysql_query($q, $conn) or die(mysql_error()); } else //uptime { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute1'"; $x = mysql_query($q, $conn) or die(mysql_error()); $query = "insert into radcheck (username,attribute,op,value) values ('$username','$attribute1','$op','$newLT')"; $action = mysql_query($query, $conn) or die(mysql_error()); } if ($newMA <= $masaAktif) //periode { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute4'"; $x = mysql_query($q, $conn) or die(mysql_error()); } else { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute4'"; $x = mysql_query($q, $conn) or die(mysql_error()); $query = "insert into radcheck (username,attribute,op,value) values ('$username','$attribute4','$op','$newMA')"; $action = mysql_query($query, $conn) or die(mysql_error()); } if ($newLU) //recv-limit { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute3'"; $x = mysql_query($q, $conn) or die(mysql_error()); $query = "insert into radcheck (username,attribute,op,value) values ('$username','$attribute3','$op','$newLU')"; $action = mysql_query($query, $conn) or die(mysql_error()); } if ($newLD) { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute2'"; $x = mysql_query($q, $conn) or die(mysql_error()); $query = "insert into radcheck (username,attribute,op,value) values ('$username','$attribute2','$op','$newLD')"; $action = mysql_query($query, $conn) or die(mysql_error()); } if ($limitTotalSlow > 0) { $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set username='$username',value='$newLBw' "; $q .= "where username='$username-slow' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); } //if ($newLK > 0) else { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); $query = "insert into radcheck (username,attribute,op,value) values ('$username','$attribute6','$op','$newLBw')"; $action = mysql_query($query, $conn) or die(mysql_error()); } $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radrefill set status='1',tglUsed=CURRENT_TIMESTAMP,user='$username' "; $q .= "where username='$kode'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set refill=refill+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $msg = "Refill Sukses"; echo ""; //mereset log kesalahan refill $q = "update radcheck set refillProc='0' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); //creatLog $jenis = "refill"; //$deskripsi="$username merefill dengan kode $kode, Q-upload $limitUpload + $uploadLimit2 = $newLU, Q-download $limitDownload + $downloadLimit2 = $newLD, Q-Bandw $limitTotal + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA, Uptime $limitUptime+$limitUptime2=$newLT, $speed dari $limitKecepatan jadi $limitKecepatan2 "; $deskripsi = "$username merefill dengan kode $kode, Q-Bandw $limitTotal $limitTotalSlow + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA"; creatLog($logUser, $level, $jenis, $deskripsi); } } break; case "RefillV2": $strTitle .= "refillV2"; include "userTraffic.php"; //$strMain.="$habis"; if ($habis == 'EXPIRED') { $strMain .= "
Voucher $username sudah EXPIRED
"; } else { $strMain .= "
Refill Box
"; $strMain .= "
"; $strMain .= "
"; $strMain .= "

"; $strMain .= "

"; $strMain .= ""; $strMain .= "
"; $strMain .= ""; $strMain .= "
"; if ($refillProc > 0) { $errorRefill = "Salah memasukan kode refill $refillProc kali"; } $strNote .= "

$errorRefill

"; //$strNote.="$errorRefill $sisaQbw $DT"; } // proses refill V2 if (isset($_POST['submit'])) { $username2 = $_POST['kode']; //validasi kode refill if ($username2 == $defRef) { $msg = "Masukan dulu kode refill"; die(""); } $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); $num = mysql_num_rows($x); $l = mysql_fetch_array($x); if ($num == 0) { $msg = "Kode refill tidak valid"; $q = "update radcheck set refillProc=refillProc+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(""); //$x=mysql_query($q,$conn) or die(""); //creatLog $jenis = "refill"; $deskripsi = "gagal merefill dengan kode $username2"; creatLog($logUser, $level, $jenis, $deskripsi); die(""); } else // validasi OK { $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); while ($l2 = mysql_fetch_assoc($x)) { $kode = $l2['username']; $downloadLimit2 = $l2['downloadLimit']; $uploadLimit2 = $l2['uploadLimit']; $masaAktif2 = $l2['onlineLimit']; $speedDownload2 = $l2['speedDownload']; $speedUpload2 = $l2['speedUpload']; $limitUptime2 = $l2['lifetimeLimit']; $limitTotal2 = $l2['totalBw']; } //$strMain.="
$kode $downloadLimit2 $uploadLimit2 $onlineLimit2 $speedDownload2 / $speedUpload2 $lifeTimeLimit2
"; //$strMain.="
$masaAktif $limitUpload $limitDownload $limitUptime $limitKecepatan
"; $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute6 = "Mikrotik-Total-Limit"; $attribute4 = "Max-Access-Period-Time"; $attribute5 = "Mikrotik-Rate-Limit"; $op = ":="; //$newPT= if ($limitTotalSlow > 0) { $q = "SELECT * FROM radtemp where username='$username' order by tanggal desc limit 1"; $x = mysql_query($q, $conn) or die(mysql_error()); if (mysql_num_rows($x) > 0) { $l = mysql_fetch_array($x); // $totalUpload = $l['totalupload']; // $totalDownload = $l['totaldownload']; // $totalBw = $l['totalbw']; // $quotabw = $l['quotabw']; $sisaQbw = $l['sisaquotabw']; } //$limitTotal=$limitTotalSlow; //$newMA=$masaAktif+$masaAktif2; //period-time $newMA = $DT + $masaAktif2; //period-time $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; //$newLBw=$limitTotalSlow+$limitTotal2; $newLBw = $sisaQbw + $limitTotal2; //$newLBw=$sisaQbw+$limitTotal2; $limitKecepatan2 = "$speedUpload2/$speedDownload2"; $newLK = $limitkecepatan + $limitKecepatan2; } else { //$newMA=$masaAktif+$masaAktif2; //period-time $newMA = $DT + $masaAktif2; //period-time //$newLT=$limitUptime+$limitUptime2; //limit-uptime $newLT = $limitUptime + $limitUptime2; //limit-uptime $newLU = $limitUpload + $uploadLimit2; $newLD = $limitDownload + $downloadLimit2; //$newLBw=$limitTotal+$limitTotal2; $newLBw = $sisaQbw + $limitTotal2; $limitKecepatan2 = "$speedUpload2/$speedDownload2"; $newLK = $limitkecepatan + $limitKecepatan2; } if ($newLT <= $limitUptime) { $q = "delete from radcheck "; $q .= "where username='$username' AND attribute='$attribute1'"; $x = mysql_query($q, $conn) or die(mysql_error()); } else //uptime { $q = "update radcheck set value='$newLT' "; $q .= "where username='$username' AND attribute='$attribute1'"; $x = mysql_query($q, $conn) or die(""); } if ($newMA <= $masaAktif) //periode { $q = "update radcheck set value='0' "; $q .= "where username='$username' AND attribute='$attribute4'"; $x = mysql_query($q, $conn) or die(""); } else { $q = "update radcheck set value='$newMA' "; $q .= "where username='$username' AND attribute='$attribute4'"; $x = mysql_query($q, $conn) or die(""); } if ($limitTotalSlow > 0) { $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set username='$username',value='$newLBw' "; $q .= "where username='$username-slow' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); } else { $q = "update radcheck set value='$newLBw' "; $q .= "where username='$username' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(""); } $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); // merername history $q = "update radacct set username='$username-his' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(""); $q = "update radrefill set status='1',tglUsed=CURRENT_TIMESTAMP,user='$username' "; $q .= "where username='$kode'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set refill=refill+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); // mencatat refill pada history $vrefillGb = $limitTotal2 / 1073741824; // Gb $comment = "refill $vrefillGb Gb "; $q = "insert into radacct (username,acctstarttime,acctstoptime,type,comment)"; $q .= "values('$username',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,'1','$comment' )"; $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__)); $msg = "Refill Sukses"; echo ""; //$strMain.= "
$username sudah berhasil di refil!
"; //mereset log kesalahan refill $q = "update radcheck set refillProc='0' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); //creatLog $jenis = "refill"; //$deskripsi="$username merefill dengan kode $kode, Q-upload $limitUpload + $uploadLimit2 = $newLU, Q-download $limitDownload + $downloadLimit2 = $newLD, Q-Bandw $limitTotal + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA, Uptime $limitUptime+$limitUptime2=$newLT, $speed dari $limitKecepatan jadi $limitKecepatan2 "; $deskripsi = "$username merefill dengan kode $kode, Q-Bandw $sisaQbw + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA"; creatLog($logUser, $level, $jenis, $deskripsi); } } break; case "RefillV3": $strTitle .= "refillV2"; include "userTraffic.php"; //$strMain.="$habis"; if ($habis == 'EXPIRED' && $username != "123") { $strMain .= "
Voucher $username sudah EXPIRED
"; } else { $strMain .= "
Refill Box
"; $strMain .= "
"; $strMain .= "
"; $strMain .= "

"; $strMain .= "

"; $strMain .= ""; $strMain .= "
"; $strMain .= ""; $strMain .= "
"; if ($refillProc > 0) { $errorRefill = "Salah memasukan kode refill $refillProc kali"; } $strNote .= "

$errorRefill

"; //$strNote.="$errorRefill $sisaQbw $DT"; } // proses refill V2 if (isset($_POST['submit'])) { $username2 = $_POST['kode']; //validasi kode refill if ($username2 == $defRef) { $msg = "Masukan dulu kode refill"; die(""); } $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); $num = mysql_num_rows($x); $l = mysql_fetch_array($x); if ($num == 0) { $msg = "Kode refill tidak valid"; $q = "update radcheck set refillProc=refillProc+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(""); //$x=mysql_query($q,$conn) or die(""); //creatLog $jenis = "refill"; $deskripsi = "gagal merefill dengan kode $username2"; creatLog($logUser, $level, $jenis, $deskripsi); die(""); } else // validasi OK { $q = "select * from radrefill where username='$username2' and status='0'"; $x = mysql_query($q, $conn) or die(mysql_error()); while ($l2 = mysql_fetch_assoc($x)) { $kode = $l2['username']; $downloadLimit2 = $l2['downloadLimit']; $uploadLimit2 = $l2['uploadLimit']; $masaAktif2 = $l2['onlineLimit']; $speedDownload2 = $l2['speedDownload']; $speedUpload2 = $l2['speedUpload']; $limitUptime2 = $l2['lifetimeLimit']; $limitTotal2 = $l2['totalBw']; } //$strMain.="
$kode $downloadLimit2 $uploadLimit2 $onlineLimit2 $speedDownload2 / $speedUpload2 $lifeTimeLimit2
"; //$strMain.="
$masaAktif $limitUpload $limitDownload $limitUptime $limitKecepatan
"; $attribute0 = "Cleartext-Password"; $attribute1 = "lifetime-limit"; $attribute2 = "Mikrotik-Xmit-Limit"; $attribute3 = "Mikrotik-Recv-Limit"; $attribute4 = "Max-Access-Period-Time"; $attribute5 = "Mikrotik-Rate-Limit"; $attribute6 = "Mikrotik-Total-Limit"; $op = ":="; $q = "update radcheck set value='$masaAktif2' "; $q .= "where username='$username' AND attribute='$attribute4'"; $x = mysql_query($q, $conn) or die(""); $q = "delete from radreply "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set username='$username',value='$limitTotal2' "; $q .= "where username='$username-slow' AND attribute='$attribute6'"; $x = mysql_query($q, $conn) or die(mysql_error()); // merername history $q = "update radacct set username='$username-his' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(""); $q = "update radrefill set status='1',tglUsed=CURRENT_TIMESTAMP,user='$username' "; $q .= "where username='$kode'"; $x = mysql_query($q, $conn) or die(mysql_error()); $q = "update radcheck set refill=refill+1 "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); // mencatat refill pada history $vrefillGb = $limitTotal2 / 1073741824; // Gb $comment = "refill $vrefillGb Gb "; $q = "insert into radacct (username,acctstarttime,acctstoptime,type,comment)"; $q .= "values('$username',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,'1','$comment' )"; $x = mysql_query($q, $conn) or die(toAlert(mysql_error() . " on " . __FUNCTION__ . " line " . __LINE__ . " file " . __FILE__)); $msg = "Refill Sukses"; echo ""; //$strMain.= "
$username sudah berhasil di refil!
"; //mereset log kesalahan refill $q = "update radcheck set refillProc='0' "; $q .= "where username='$username'"; $x = mysql_query($q, $conn) or die(mysql_error()); //creatLog $jenis = "refill"; //$deskripsi="$username merefill dengan kode $kode, Q-upload $limitUpload + $uploadLimit2 = $newLU, Q-download $limitDownload + $downloadLimit2 = $newLD, Q-Bandw $limitTotal + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA, Uptime $limitUptime+$limitUptime2=$newLT, $speed dari $limitKecepatan jadi $limitKecepatan2 "; $deskripsi = "$username merefill dengan kode $kode, Q-Bandw $sisaQbw + $limitTotal2 = $newLBw, Maxperiode $masaAktif+$masaAktif2=$newMA"; creatLog($logUser, $level, $jenis, $deskripsi); } } break; case "History": $hisNama = $_GET[nama]; if (isset($hisNama)) { if ($hisNama != $sesNama) { $msg = "Illegal operation"; die (toAlert("$msg")); // echo "$msg $sesNama"; } } $historyUser = $_POST['nama']; if (!$historyUser) { $historyUser = $logUser; } $strTitle .= "History Pemakaian"; $strMainTitle = "
history pemakaian anda
"; $sip = "IP Addr"; $sdw = "Download"; $sup = "Upload"; $sdu = "Durasi Online"; include "history.php"; //creatLog $jenis = "view"; $deskripsi = "melihat history"; creatLog($logUser, $level, $jenis, $deskripsi); $idhot = $sesNama; include_once "../../Pages/Radius/lastRefill.php"; $strNote = "$lastRefill"; break; case "History2": $hisNama = $_GET[nama]; if (isset($hisNama)) { if ($hisNama != $sesNama) { $msg = "Illegal operation"; die (toAlert("$msg")); // echo "$msg $sesNama"; } } $historyUser = $_POST['nama']; if (!$historyUser) { $historyUser = $logUser; } $strTitle .= "History Pemakaian sebelum refil"; $strMainTitle = "
history pemakaian anda sebelum refill
"; include "history2.php"; $strNote .= "Untuk melakukan Shorting data, klik pada HEADER TABLE yang berwarna kuning"; //creatLog $jenis = "view"; $deskripsi = "melihat history"; creatLog($logUser, $level, $jenis, $deskripsi); break; default: $m = $_GET[Mode]; //echo "$m"; if ($m == "Refill") { header("location:$_SERVER[PHP_SELF]?Mode=RefillV2"); } $strTitle .= "Vito Spot"; // $strMain .= "
"; $strMain .= "
"; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= ""; $strMain .= "
ID :
Password :
"; $strMain .= "
"; /* $id=$_GET[id]>0?$_GET[id]:7; $q="select * from pages where id='$id' order by urut,id"; $x=mysql_query($q,$conn) or die(mysql_error()); while($l=mysql_fetch_assoc($x)) { $id=$l[id]; $judul=$l[judul]; $isi=$l[isi]; $image=$l[image]; $strMainGambar="$image"; $strMainTitle.="

$judul

"; $strMain.="
$isi
"; } */ break; } } } else { $strTopMenu .= "gunakan ID hotspot untuk login
"; $strMain .= ""; } $strTitle = "$strTitle $judul"; $tmpTemplate = "../../Assets/Templates/View.html"; $t = new clTemplate; $t->defineTheme($tmpTemplate); $t->defineTag("{appTemplate}", $appTemplate); $t->defineTag("{title}", $strTitle); $t->defineTag("{sesNama}", $strSesNama); $t->defineTag("{gbrHeader}", $strGbrHeader); $t->defineTag("{header}", $strHeader); $t->defineTag("{topMenu}", $strTopMenu); $t->defineTag("{leftMenu}", $strLeftMenu); $t->defineTag("{mainTitle}", $strMainTitle); $t->defineTag("{main}", $strMain); $t->defineTag("{note}", $strNote); $t->defineTag("{mainGambar}", $strMainGambar); $t->defineTag("{ymID}", $strymID); $t->defineTag("{ip}", $strIp); $t->parse(); $t->printTheme(); ?>