Skip to content

Commit

Permalink
Add cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
Collins Onyetube committed May 26, 2019
1 parent 61951d4 commit 2773fa9
Show file tree
Hide file tree
Showing 72 changed files with 2,944 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Controller/attendanceController.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ module.exports = {
}else {
callback(err);
}
})
});
}
}
}
25 changes: 24 additions & 1 deletion Controller/messagingController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const connect= require('../Configuration/DBConfiguration');
const response = require('../models/commonResponse');
const moment = require('moment');
const request = require('request');

module.exports = {
getSentSMS: function(callback) {
Expand All @@ -16,6 +17,28 @@ module.exports = {
if(!err) {
callback(result);
}
})
});
},
sendSMS: function(phone, text, callback) {
var requestData = {
'phone': phone,
'message': text
};
request({
url: 'http://localhost/rccg/messaging/send_sms.php',
method: 'POST',
headers:{
"content-type": "application/json"
},
json: true,
body:requestData
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
callback(body);
// console.log(JSON.parse(body));
}else{
callback(error);
}
});
}
}
6 changes: 5 additions & 1 deletion config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ dbname=rccg

[jwt]
secret=rccgambapi
expire=86400
expire=86400

[cron]
present=0 16 * * 0
absent=0 17 * * 0
1 change: 1 addition & 0 deletions node_modules/.bin/opencollective-postinstall

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/node-cron/.covignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/node-cron/.github/stale.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/node-cron/.hound.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/node-cron/.jshintignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions node_modules/node-cron/.jshintrc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions node_modules/node-cron/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/node-cron/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2773fa9

Please sign in to comment.