Add SPOTA core PHP application

Add the main admin, dosen, mahasiswa, API, and service code needed to run the core legacy application with configurable upload storage.
This commit is contained in:
Power BI Dev
2026-05-02 10:08:52 +07:00
parent 874dbbe8e8
commit efdb11db3f
221 changed files with 43273 additions and 0 deletions

37
inc/gcm_helper.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
//----------------------------------------------------------------------
//GCM Function- Ridwan Tasa Dirsa (D03109031)
//for SPota Android
function sendPushNotificationToGCM($registation_ids, $message) {
return;
//Google cloud messaging GCM-API url
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' => $registation_ids,
'data' => $message,
);
// Update your Google Cloud Messaging API Key
//GOOGLE_API_KEY defined at konfigurasi.php
$headers = array(
'Authorization: key=' . GOOGLE_API_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
if ($result === FALSE) {
die('Curl failed: ' . curl_error($ch));
}
curl_close($ch);
return $result;
}
//---------------------------------------------------------------------
?>