-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id="2ndOcober" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="java-gradle" name="Java-Gradle"> | ||
<configuration> | ||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | ||
<option name="BUILDABLE" value="false" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id="8thOct_NoDelete" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="java-gradle" name="Java-Gradle"> | ||
<configuration> | ||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | ||
<option name="BUILDABLE" value="false" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
class GCM { | ||
|
||
//put your code here | ||
// constructor | ||
function __construct() { | ||
|
||
} | ||
|
||
/** | ||
* Sending Push Notification | ||
*/ | ||
public function send_notification($registatoin_ids, $message) { | ||
// include config | ||
include_once './db_config.php'; | ||
|
||
// Set POST variables | ||
$url = 'https://android.googleapis.com/gcm/send'; | ||
|
||
$fields = array( | ||
'registration_ids' => $registatoin_ids, | ||
'data' => $message, | ||
); | ||
|
||
$headers = array( | ||
'Authorization: key=' . GOOGLE_API_KEY, | ||
'Content-Type: application/json' | ||
); | ||
// Open connection | ||
$ch = curl_init(); | ||
|
||
// Set the url, number of POST vars, POST data | ||
curl_setopt($ch, CURLOPT_URL, $url); | ||
|
||
curl_setopt($ch, CURLOPT_POST, true); | ||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
|
||
// Disabling SSL Certificate support temporarly | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | ||
|
||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); | ||
|
||
// Execute post | ||
$result = curl_exec($ch); | ||
if ($result === FALSE) { | ||
die('Curl failed: ' . curl_error($ch)); | ||
} | ||
|
||
// Close connection | ||
curl_close($ch); | ||
echo $result; | ||
} | ||
|
||
} | ||
|
||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
class DB_Connect { | ||
|
||
// constructor | ||
function __construct() { | ||
|
||
} | ||
|
||
// destructor | ||
function __destruct() { | ||
// $this->close(); | ||
} | ||
|
||
// Connecting to database | ||
public function connect() { | ||
require_once 'db_config.php'; | ||
// connecting to mysql | ||
$con = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD); | ||
// selecting database | ||
mysql_select_db(DB_DATABASE); | ||
|
||
// return database handler | ||
return $con; | ||
} | ||
|
||
// Closing database connection | ||
public function close() { | ||
mysql_close(); | ||
} | ||
|
||
} | ||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
/* | ||
* All database connection variables | ||
*/ | ||
|
||
|
||
define('DB_USER', ""); // db user | ||
define('DB_PASSWORD', ""); // db password (mention your db password here) | ||
define('DB_DATABASE', ""); // database name | ||
define('DB_SERVER', ""); // db server | ||
|
||
define("GOOGLE_API_KEY", ""); // Place your Google API Key | ||
|
||
?> |