This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SendMessages | |
public function sendTelegramMessage() | |
{ | |
$message_text ="Sent Message successfuly"; | |
$chat_id = "receiver_id"; | |
$botTelegram = 'https://api.telegram.org/bot"your_bot_token"/sendMessage'; | |
$url = $botTelegram."?parse_mode=markdown&chat_id=".$chat_id. "&text=" . $message_text; | |
$ch = curl_init(); | |
$optArray = array( | |
CURLOPT_URL => $url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lokasi Awal | |
$my_latitude = $request->get('latitude'); | |
$my_longitude = $request->get('longitude'); | |
// Lokasi Tujuan | |
$my_latitude = $request->get('latitude'); | |
$my_longitude = $request->get('longitude'); | |
$distance = round((((acos(sin(($my_latitude*pi()/180)) * sin(($toko_latitude*pi()/180))+cos(($my_latitude*pi()/180)) * cos(($toko_latitude*pi()/180)) * cos((($my_longitude- $toko_longitude)*pi()/180))))*180/pi())*60*1.1515*1.609344), 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FCM API Url | |
$url = 'https://fcm.googleapis.com/fcm/send'; | |
// Put your Server Response Key here | |
$apiKey = "AAAAVX7ftjo:APA91bEtmlrwt7oeUvIJU6G0_cef2vLXnMpZvqBhnb65dTjgfiSv-jlTvFnXPkHbUHlgMKby3EdOLNquBgkIu2xG_686VIb_Ni2seWeVpPg7g5x_w4boZSoXw5Y48RnFS_qCeWT0VGYZ"; | |
// Compile headers in one variable | |
$headers = array ( | |
'Authorization:key=' . $apiKey, | |
'Content-Type:application/json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PHP_AES_Cipher { | |
private static $OPENSSL_CIPHER_NAME = "aes-128-cbc"; //Name of OpenSSL Cipher | |
private static $CIPHER_KEY_LEN = 16; //128 bits | |
/** | |
* Encrypt data using AES Cipher (CBC) with 128 bit key | |
* | |
* @param type $key - key to use should be 16 bytes long (128 bits) | |
* @param type $iv - initialization vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function callBack(Request $request) | |
{ | |
$data = $request->all(); | |
if($data['api_key'] === env('API_MUTASI_KEY')) | |
{ | |
$toStorage = [ | |
'hostname' => $_SERVER, | |
'header' => getallheaders(), | |
'body' => $request->all() | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^public | |
RewriteRule ^(.*)$ public/$1 [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_Clock() { | |
this.cur_date = new Date(); | |
this.hours = this.cur_date.getHours(); | |
this.minutes = this.cur_date.getMinutes(); | |
this.seconds = this.cur_date.getSeconds(); | |
} | |
my_Clock.prototype.run = function () { | |
setInterval(this.update.bind(this), 1000); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b>Masukkan Nilai</b> | |
<br /> | |
Rp. <input id="nominall" onkeyup="terbilang();" type="text" value="1945" /> | |
<br /> | |
<div id="terbilang"> | |
</div> | |
<script> | |
function terbilang(){ | |
var bilangan=document.getElementById("nominal").value; |