Compare commits
267 Commits
v0.0.2
...
130c8f8b9c
| Author | SHA1 | Date | |
|---|---|---|---|
| 130c8f8b9c | |||
| 58dad40e54 | |||
| d4ddbd1eda | |||
| aa10f50813 | |||
| ab4f9dc58d | |||
| c042097dd1 | |||
| 777f024021 | |||
| 074379dff1 | |||
| 5e9c1bc3bd | |||
| 1f4933c091 | |||
| fe6f130cfa | |||
| f34632e8db | |||
| 27f9ecf2c4 | |||
| 41283208f8 | |||
| 49c5e94dd5 | |||
| 24c39db3e8 | |||
| c4b4ca7f9d | |||
| ffc45b7d15 | |||
| f42a19c1c0 | |||
| 940c742ff4 | |||
| 01c0d4a417 | |||
| 61bb2a5800 | |||
| da16ee8f06 | |||
| 7f4dbca484 | |||
| 515a5fdd9f | |||
| 353d33ac6f | |||
| d11d99749c | |||
| b237cc1933 | |||
| a76977a44a | |||
| 454900f85b | |||
| a2f8902226 | |||
| 7b82194cfd | |||
| 2d01bbccad | |||
| d51d78eb57 | |||
| b6fdad88c4 | |||
| 4b99c679aa | |||
| 1a6bade648 | |||
| 2f6050fb08 | |||
| 8b03f5b4aa | |||
| ab9dbfad9f | |||
| 4c122e73de | |||
| bdbf938cf8 | |||
| c7c6dbe4c8 | |||
| fb6644d719 | |||
| d1a443ff42 | |||
| a58f91952e | |||
| 666d63a8a2 | |||
| 0548daa058 | |||
| f10243b1a6 | |||
| dc3ca28446 | |||
| 36b4b365ea | |||
| 3d95687b6d | |||
| 6497c6a4a9 | |||
| a4274c5a5a | |||
| 7ae0777c13 | |||
| 01cf6d6fbe | |||
| 939fad23c0 | |||
| 4a87b9f309 | |||
| 1f7482e99b | |||
| 062e30f89b | |||
| b4570e3afc | |||
| a57b701fd9 | |||
| 61e57863c5 | |||
| fd50c9b8c0 | |||
| 387198f669 | |||
| f41740ff78 | |||
| f58c2a8c57 | |||
| 3b21cee578 | |||
| d776643f7e | |||
| 9e8ec9c37e | |||
| 2bb996baff | |||
| 877dc5ba40 | |||
| 8c2c0e56a1 | |||
| c6bd157dcf | |||
| da914bfd93 | |||
| 6bc06fef8b | |||
| 35acf363aa | |||
| 84f3325c46 | |||
| 99794baa11 | |||
| 24baeb5449 | |||
| ab34dd6b82 | |||
| ebe13ef30b | |||
| 07c3425046 | |||
| 268e1b6a54 | |||
| a9380d73e9 | |||
| 9ea25c81c4 | |||
| 019e650090 | |||
| 320cbb11ee | |||
| 6949150647 | |||
| 8f1507548e | |||
| a5e5bafb40 | |||
| b3f7f13d6b | |||
| 97770ffe95 | |||
| e9e1a5fe71 | |||
| a4ba2da5ed | |||
| de6288fc3a | |||
| 5e5f643d9f | |||
| cd8afaf1b1 | |||
| 30f19d771d | |||
| 1c5b0a24c7 | |||
| b866d2a1be | |||
| 3b5eac3d52 | |||
| b6f4adf046 | |||
| 39ec57c10c | |||
| c14ab2a76b | |||
| edd7712ea7 | |||
| fe17055c90 | |||
| 1957c7f1d9 | |||
| 0a9898a69d | |||
| 186ee393a2 | |||
| ee04eaa22c | |||
| 58b12ee874 | |||
| 28cca364a8 | |||
| 2dfbb4ea88 | |||
| 95b7128d91 | |||
| aa0a9789fa | |||
| ecbd702ec5 | |||
| 40a92d844a | |||
| e6f8ba1d0d | |||
| c414318ca8 | |||
| 64b74940b8 | |||
| 699c789714 | |||
| 876c4e29e2 | |||
| 460c4ac9f7 | |||
| 68bbfe9514 | |||
| 4a2f4b8c70 | |||
| 0de7c858a3 | |||
| f5ea90faa0 | |||
| 3b77436210 | |||
| f2c56962a7 | |||
| 766f034ac4 | |||
| 966c611e0e | |||
| a7a4234f79 | |||
| d2442a256e | |||
| 31bdb511bb | |||
| a542184759 | |||
| f97a7c54ab | |||
| 886379b0f7 | |||
| a1eac4a91f | |||
| 95bc611309 | |||
| f6288105fb | |||
| 5692d9f3b2 | |||
| 984df3184f | |||
| 8cb2a9d918 | |||
| 88dd88241d | |||
| e0edf1932d | |||
| ebcb7aef1e | |||
| 432028c088 | |||
| 7d2373a080 | |||
| 2e61b070ba | |||
| a4aee540a6 | |||
| 51812950e3 | |||
| 577995cf03 | |||
| 6596089608 | |||
| 5f5abd0b3e | |||
| 55c06162ef | |||
| 23c4762347 | |||
| 7e220e3b05 | |||
| bc90fb9bb2 | |||
| 62c4444217 | |||
| a0cf3feecc | |||
| aea5fd9f6b | |||
| 50b480d963 | |||
| 59f0e75842 | |||
| 769e1bc7b1 | |||
| 99d7b89ebd | |||
| 9163c8ad84 | |||
| c87494b40e | |||
| fb2034ab97 | |||
| 266b9ddad8 | |||
| a9b09dc416 | |||
| de37aea2c4 | |||
| 92d89d90a3 | |||
| 31d98bddfb | |||
| e25017a25f | |||
| 2e63218e82 | |||
| 928d064fbe | |||
| f62840a450 | |||
| 7865c34b7d | |||
| 4aa313402a | |||
| e22dc706dc | |||
| 0ba0794197 | |||
| b67f736f04 | |||
| 79bb8ed05d | |||
| db39cea49b | |||
| 41fe987f5d | |||
| f391716de4 | |||
| 7f0aff735f | |||
| f08abbe9f6 | |||
| 74f3b1d282 | |||
| 346073b544 | |||
| 81f0c4c233 | |||
| 626f381c1b | |||
| 76024459a9 | |||
| aea41d6ac5 | |||
| 92af9cdd81 | |||
| b9de6b4a98 | |||
| b0747071e9 | |||
| f64576f3e8 | |||
| 9009ec13fb | |||
| dc77c56b43 | |||
| a3bd756566 | |||
| c54974811c | |||
| 3ca0ce7600 | |||
| d323cc274b | |||
| 49e0c1191f | |||
| 862d129d00 | |||
| 615f09399d | |||
| 0c400e3918 | |||
| f2e9e1550e | |||
| 18c2b8668c | |||
| 3c31423bb1 | |||
| e27259dca9 | |||
| b949c910ea | |||
| 944ec49640 | |||
| ae98daa2ec | |||
| 902e0031d4 | |||
| 34406d81fa | |||
| 7e7080f23c | |||
| 10917727a8 | |||
| 4d4c75aa48 | |||
| cf8c2131bd | |||
| dff9b496cf | |||
| 961b003078 | |||
| 44e2295bb7 | |||
| cf2e761c5a | |||
| c2d4a49eb2 | |||
| 1b025a1563 | |||
| 83a246ee6e | |||
| 65e7601bda | |||
| ee4b81e348 | |||
| d88c823b9f | |||
| 7d7f5c00dc | |||
| 31ae9aa725 | |||
| e7f26e9a39 | |||
| 999520c31f | |||
| 285a4c2cfa | |||
| 45193b66b8 | |||
| 8a9df7b1df | |||
| b992d1f9b4 | |||
| 2261ab9d72 | |||
| 7447f7d96e | |||
| 0cc56dd4df | |||
| dabec5c244 | |||
| efc87db1ca | |||
| ad56540080 | |||
| 6d8cdc01ee | |||
| 6c40d4f22e | |||
| ef45fd4b6b | |||
| 76983004a6 | |||
| f3c2c37326 | |||
| 54296bf7d6 | |||
| e122fb93fc | |||
| cff0929205 | |||
| 8b8eaf88f9 | |||
| 46ed530ec1 | |||
| 2b38b02530 | |||
| 90ee3dd46f | |||
| f1e5d7eec7 | |||
| 0cd1f321f9 | |||
| 6956c7f409 | |||
| a456043ced | |||
| 1edcd3ea58 | |||
| 80d5044534 | |||
| f8b262ae54 | |||
| 6cce6a0a45 | |||
| e276b6cb7b |
@@ -1,3 +0,0 @@
|
||||
|
||||
node_modules
|
||||
npm-debug.log
|
||||
@@ -1,209 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"meteor": true,
|
||||
"mocha": true
|
||||
},
|
||||
|
||||
"plugins": [],
|
||||
|
||||
"ecmaFeatures": {
|
||||
"arrowFunctions": true,
|
||||
"binaryLiterals": true,
|
||||
"blockBindings": true,
|
||||
"classes": true,
|
||||
"defaultParams": true,
|
||||
"destructuring": true,
|
||||
"experimentalObjectRestSpread": true,
|
||||
"forOf": true,
|
||||
"generators": true,
|
||||
"globalReturn": true,
|
||||
"jsx": true,
|
||||
"modules": true,
|
||||
"objectLiteralComputedProperties": true,
|
||||
"objectLiteralDuplicateProperties": true,
|
||||
"objectLiteralShorthandMethods": true,
|
||||
"objectLiteralShorthandProperties": true,
|
||||
"octalLiterals": true,
|
||||
"regexUFlag": true,
|
||||
"regexYFlag": true,
|
||||
"restParams": true,
|
||||
"spread": true,
|
||||
"superInFunctions": true,
|
||||
"templateStrings": true,
|
||||
"unicodeCodePointEscapes": true
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"array-bracket-spacing": [2, "always"],
|
||||
"arrow-spacing": 2,
|
||||
"block-scoped-var": 0,
|
||||
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
|
||||
"callback-return": 2,
|
||||
"comma-dangle": 0,
|
||||
"comma-spacing": 0,
|
||||
"comma-style": [2, "last"],
|
||||
"complexity": 0,
|
||||
"computed-property-spacing": [2, "never"],
|
||||
"consistent-return": 0,
|
||||
"consistent-this": 0,
|
||||
"curly": [2, "all"],
|
||||
"default-case": 0,
|
||||
"dot-location": [2, "property"],
|
||||
"dot-notation": 0,
|
||||
"eol-last": 2,
|
||||
"eqeqeq": 2,
|
||||
"func-names": 0,
|
||||
"func-style": 0,
|
||||
"generator-star-spacing": [0, {"before": true, "after": false}],
|
||||
"guard-for-in": 2,
|
||||
"handle-callback-err": [2, "error"],
|
||||
"id-length": 0,
|
||||
"id-match": [2, "^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$"],
|
||||
"indent": [2, 2, {"SwitchCase": 1}],
|
||||
"init-declarations": 0,
|
||||
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
|
||||
"linebreak-style": 2,
|
||||
"lines-around-comment": 0,
|
||||
"max-depth": 0,
|
||||
"max-len": [2, 300, 4],
|
||||
"max-nested-callbacks": 0,
|
||||
"max-params": 0,
|
||||
"max-statements": 0,
|
||||
"new-cap": 0,
|
||||
"new-parens": 2,
|
||||
"newline-after-var": 0,
|
||||
"no-array-constructor": 2,
|
||||
"no-bitwise": 0,
|
||||
"no-caller": 2,
|
||||
"no-catch-shadow": 0,
|
||||
"no-class-assign": 2,
|
||||
"no-cond-assign": 2,
|
||||
"no-console": 1,
|
||||
"no-const-assign": 2,
|
||||
"no-constant-condition": 2,
|
||||
"no-continue": 0,
|
||||
"no-control-regex": 0,
|
||||
"no-debugger": 1,
|
||||
"no-delete-var": 2,
|
||||
"no-div-regex": 2,
|
||||
"no-dupe-args": 2,
|
||||
"no-dupe-keys": 2,
|
||||
"no-duplicate-case": 2,
|
||||
"no-else-return": 2,
|
||||
"no-empty": 2,
|
||||
"no-empty-character-class": 2,
|
||||
"no-empty-label": 2,
|
||||
"no-eq-null": 0,
|
||||
"no-eval": 2,
|
||||
"no-ex-assign": 2,
|
||||
"no-extend-native": 2,
|
||||
"no-extra-bind": 2,
|
||||
"no-extra-boolean-cast": 2,
|
||||
"no-extra-parens": 0,
|
||||
"no-extra-semi": 2,
|
||||
"no-fallthrough": 2,
|
||||
"no-floating-decimal": 2,
|
||||
"no-func-assign": 2,
|
||||
"no-implicit-coercion": 2,
|
||||
"no-implied-eval": 2,
|
||||
"no-inline-comments": 0,
|
||||
"no-inner-declarations": [2, "functions"],
|
||||
"no-invalid-regexp": 2,
|
||||
"no-invalid-this": 0,
|
||||
"no-irregular-whitespace": 2,
|
||||
"no-iterator": 2,
|
||||
"no-label-var": 2,
|
||||
"no-labels": 0,
|
||||
"no-lone-blocks": 2,
|
||||
"no-lonely-if": 2,
|
||||
"no-loop-func": 0,
|
||||
"no-mixed-requires": [2, true],
|
||||
"no-mixed-spaces-and-tabs": 2,
|
||||
"no-multi-spaces": 2,
|
||||
"no-multi-str": 2,
|
||||
"no-multiple-empty-lines": 0,
|
||||
"no-native-reassign": 0,
|
||||
"no-negated-in-lhs": 2,
|
||||
"no-nested-ternary": 0,
|
||||
"no-new": 1,
|
||||
"no-new-func": 0,
|
||||
"no-new-object": 2,
|
||||
"no-new-require": 2,
|
||||
"no-new-wrappers": 2,
|
||||
"no-obj-calls": 2,
|
||||
"no-octal": 2,
|
||||
"no-octal-escape": 2,
|
||||
"no-param-reassign": 2,
|
||||
"no-path-concat": 2,
|
||||
"no-plusplus": 0,
|
||||
"no-process-env": 0,
|
||||
"no-process-exit": 0,
|
||||
"no-proto": 2,
|
||||
"no-redeclare": 2,
|
||||
"no-regex-spaces": 2,
|
||||
"no-restricted-modules": 0,
|
||||
"no-return-assign": 2,
|
||||
"no-script-url": 2,
|
||||
"no-self-compare": 0,
|
||||
"no-sequences": 2,
|
||||
"no-shadow": 2,
|
||||
"no-shadow-restricted-names": 2,
|
||||
"no-spaced-func": 2,
|
||||
"no-sparse-arrays": 2,
|
||||
"no-sync": 0,
|
||||
"no-ternary": 0,
|
||||
"no-this-before-super": 2,
|
||||
"no-throw-literal": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-undef": 2,
|
||||
"no-undef-init": 2,
|
||||
"no-undefined": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-unexpected-multiline": 2,
|
||||
"no-unneeded-ternary": 2,
|
||||
"no-unreachable": 2,
|
||||
"no-unused-expressions": 0,
|
||||
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
|
||||
"no-use-before-define": 0,
|
||||
"no-useless-call": 2,
|
||||
"no-var": 0,
|
||||
"no-void": 2,
|
||||
"no-warning-comments": 0,
|
||||
"no-with": 2,
|
||||
"object-curly-spacing": [0, "always"],
|
||||
"object-shorthand": [2, "properties"],
|
||||
"one-var": [2, "never"],
|
||||
"operator-assignment": [2, "always"],
|
||||
"operator-linebreak": [0, "after"],
|
||||
"padded-blocks": 0,
|
||||
"prefer-const": 0,
|
||||
"prefer-reflect": 0,
|
||||
"prefer-spread": 0,
|
||||
"quote-props": [2, "as-needed"],
|
||||
"quotes": [2, "single"],
|
||||
"radix": 2,
|
||||
"require-yield": 2,
|
||||
"semi": [2, "always"],
|
||||
"semi-spacing": [2, {"before": false, "after": true}],
|
||||
"sort-vars": 0,
|
||||
"space-after-keywords": [2, "always"],
|
||||
"space-before-blocks": [2, "always"],
|
||||
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
|
||||
"space-in-parens": 0,
|
||||
"space-infix-ops": [2, {"int32Hint": false}],
|
||||
"space-return-throw-case": 2,
|
||||
"space-unary-ops": [2, {"words": true, "nonwords": false}],
|
||||
"spaced-comment": [2, "always"],
|
||||
"strict": 0,
|
||||
"use-isnan": 2,
|
||||
"valid-jsdoc": 0,
|
||||
"valid-typeof": 2,
|
||||
"vars-on-top": 0,
|
||||
"wrap-iife": 2,
|
||||
"wrap-regex": 0,
|
||||
"yoda": [2, "never", {"exceptRange": true}]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
node_modules
|
||||
*.log
|
||||
config.json
|
||||
.queues
|
||||
*.txt
|
||||
docs
|
||||
@@ -1,14 +0,0 @@
|
||||
FROM node:boron
|
||||
|
||||
# Create app directory
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install app dependencies
|
||||
COPY package.json /usr/src/app/
|
||||
RUN npm install
|
||||
|
||||
COPY . /usr/src/app
|
||||
|
||||
CMD [ "npm", "start" ]
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# flutterwave-transfer-micro
|
||||
A microservice to handle flitterware payment services
|
||||
|
||||
# Installation
|
||||
* `git clone` this repository
|
||||
* `cd` into the repository
|
||||
* Build the docker image by `docker build -t flutterwave-transfer-micro .`
|
||||
|
||||
# Run
|
||||
* Set environment variables like `PORT` and `POSTGRE_URL`. Full list in the wiki.
|
||||
* `docker run -p <BINDING> -e PORT=<app_port> -e POSTGRE_URL=<postgre_url> -e FLUTTERWAVE_API=<flutterwave_config> -i -t flutterwave-transfer-micro`
|
||||
|
||||
## Example configurations
|
||||
* binding: 127.0.0.1:3000:3000/tcp
|
||||
* app_port: 3000
|
||||
* postgre_url: postgresql://wrenchboard:wrenchboard@10.10.10.23:5432/wrenchboard
|
||||
* flutterwave_config: eyJCYXNlQXBpVXJsIjoiaHR0cHM6Ly9hcGkuZmx1dHRlcndhdmUuY29tIiwiUHVibGljS2V5IjoiRkxXUFVCS19URVNULTU0YzkwMTQxYjAyODc4OWQ2NzEwNjdiZDcyZjc4MWE5LVgiLCJTZWNyZXRLZXkiOiJGTFdTRUNLX1RFU1QtYzdiYmM4NmQ3ZTcxMDAyNTRjNWU1YmJmMTYyYmYyYjItWCIsIkVuY3J5cHRpb25LZXkiOiJGTFdTRUNLX1RFU1RlOTQ3NGQ0ZTJjZTYifQ==
|
||||
|
||||
## Example command
|
||||
|
||||
```
|
||||
docker run -p 127.0.0.1:3000:3000/tcp \
|
||||
-e PORT=3000 \
|
||||
-e POSTGRE_URL='postgresql://wrenchboard:wrenchboard@10.10.10.23:5432/wrenchboard' \
|
||||
-e FLUTTERWAVE_API='eyJCYXNlQXBpVXJsIjoiaHR0cHM6Ly9hcGkuZmx1dHRlcndhdmUuY29tIiwiUHVibGljS2V5IjoiRkxXUFVCS19URVNULTU0YzkwMTQxYjAyODc4OWQ2NzEwNjdiZDcyZjc4MWE5LVgiLCJTZWNyZXRLZXkiOiJGTFdTRUNLX1RFU1QtYzdiYmM4NmQ3ZTcxMDAyNTRjNWU1YmJmMTYyYmYyYjItWCIsIkVuY3J5cHRpb25LZXkiOiJGTFdTRUNLX1RFU1RlOTQ3NGQ0ZTJjZTYifQ==' \
|
||||
-i -t flutterwave-transfer-micro
|
||||
```
|
||||
|
||||
## Flutterwave config
|
||||
|
||||
Either use a converniece script base64encoder.js or base64 CLI to encode the config:
|
||||
|
||||
```
|
||||
echo '{
|
||||
"BaseApiUrl":"https://api.flutterwave.com",
|
||||
"PublicKey":"FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X",
|
||||
"SecretKey":"FLWSECK_TEST-c7bbc86d7e7100254c5e5bbf162bf2b2-X",
|
||||
"EncryptionKey":"FLWSECK_TESTe9474d4e2ce6"
|
||||
}' | base64
|
||||
```
|
||||
|
||||
# Test
|
||||
`npm test`
|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const properties = require('../package.json')
|
||||
const transfer = require('../service/transfer');
|
||||
|
||||
var controllers = {
|
||||
about: function(req, res) {
|
||||
var aboutInfo = {
|
||||
name: properties.name,
|
||||
version: properties.version
|
||||
}
|
||||
res.json(aboutInfo);
|
||||
},
|
||||
postTransfer: function(req, res) {
|
||||
transfer.create(req, res, function(err, dist) {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
}
|
||||
res.json(dist);
|
||||
});
|
||||
},
|
||||
getStatus: function(req, res) {
|
||||
transfer.get(req, res, function(err, dist) {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
}
|
||||
res.json(dist);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = controllers;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const controller = require('./controller');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.route('/about')
|
||||
.get(controller.about);
|
||||
app.route('/create')
|
||||
.post(controller.postTransfer);
|
||||
app.route('/status/:id')
|
||||
.get(controller.getStatus);
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* Configures the database connection
|
||||
*/
|
||||
|
||||
const { Pool, Client } = require('pg');
|
||||
const logger = require('./logger');
|
||||
//const connectionString = 'postgresql://wrenchboard:wrenchboard@10.10.10.23:5432/wrenchboard';
|
||||
const connectionString = process.env.POSTGRE_URL;
|
||||
const postgres = new Pool({
|
||||
connectionString,
|
||||
});
|
||||
|
||||
postgres.on('connect', client => {
|
||||
logger.info('Connected to Database');
|
||||
});
|
||||
|
||||
postgres.on('acquire', client => {
|
||||
logger.info('Client is checked out from the DB connection pool');
|
||||
});
|
||||
|
||||
postgres.on('remove', client => {
|
||||
logger.info('Client is closed & removed from the DB connection pool');
|
||||
});
|
||||
|
||||
postgres.on('error', (err, client) => {
|
||||
logger.error(err);
|
||||
});
|
||||
|
||||
// Connect to PostgreSQL
|
||||
postgres.connect((err, client, release) => {
|
||||
logger.info(connectionString);
|
||||
if (err) {
|
||||
logger.error('Error acquiring client', err.stack);
|
||||
return null;
|
||||
}
|
||||
client.query('SELECT NOW()', (err, result) => {
|
||||
release();
|
||||
if (err) {
|
||||
logger.error('Error executing query', err.stack);
|
||||
return nul;
|
||||
}
|
||||
logger.info(result.rows);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = postgres;
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* Set up the app
|
||||
*/
|
||||
var _ = require('underscore');
|
||||
var db = require('./db');
|
||||
|
||||
module.exports = function () {
|
||||
db();
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* Defines logger for the microservice
|
||||
*/
|
||||
|
||||
var winston = require('winston');
|
||||
var Papertrail = require('winston-papertrail').Papertrail;
|
||||
var serviceIdentifier = require('../package.json').name;
|
||||
|
||||
var host = process.env.LOG_SERVICE_HOST;
|
||||
var port = process.env.LOG_SERVICE_PORT;
|
||||
|
||||
/**
|
||||
* Class to provide logging facilities for the microservice
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
var Logger = function () {
|
||||
|
||||
// Try to route logs to third party service
|
||||
if (host && port) {
|
||||
// Define our transport
|
||||
var transport = new Papertrail({
|
||||
levels: {
|
||||
debug: 0,
|
||||
info: 1,
|
||||
error: 3
|
||||
},
|
||||
colors: {
|
||||
debug: 'blue',
|
||||
info: 'green',
|
||||
error: 'red'
|
||||
},
|
||||
host,
|
||||
port,
|
||||
json: true,
|
||||
colorize: true,
|
||||
logFormat: (level, message) => {
|
||||
return `[${serviceIdentifier}] ${level} : ${message}`;
|
||||
}
|
||||
});
|
||||
|
||||
// Handle exceptions
|
||||
transport.exceptionsLevel = 'error';
|
||||
winston.handleExceptions(transport);
|
||||
}
|
||||
|
||||
this.info = winston.info;
|
||||
this.error = winston.error;
|
||||
this.debug = winston.debug;
|
||||
};
|
||||
|
||||
module.exports = new Logger();
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Logger
|
||||
* @property {function} info - Log in level `info`
|
||||
* @property {function} error - Log in level `error`
|
||||
* @property {function} debug - Log in level `debug`
|
||||
*/
|
||||
@@ -1,9 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
let data = 'eyJQdWJsaWNLZXkiOiJGTFdQVUJLX1RFU1QtNTRjOTAxNDFiMDI4Nzg5ZDY3MTA2N2JkNzJmNzgxYTktWCIsIlNlY3JldEtleSI6IkZMV1NFQ0tfVEVTVC1jN2JiYzg2ZDdlNzEwMDI1NGM1ZTViYmYxNjJiZjJiMi1YIiwiRW5jcnlwdGlvbktleSI6IkZMV1NFQ0tfVEVTVGU5NDc0ZDRlMmNlNiJ9';
|
||||
let buff = new Buffer(data, 'base64');
|
||||
let text = buff.toString('ascii');
|
||||
let json = JSON.parse(text);
|
||||
|
||||
console.log('"' + data + '" converted from Base64 to ASCII is "' + text + '"');
|
||||
console.log(json);
|
||||
@@ -1,13 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
let json = {
|
||||
"BaseApiUrl":"https://api.flutterwave.com",
|
||||
"PublicKey":"FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X",
|
||||
"SecretKey":"FLWSECK_TEST-c7bbc86d7e7100254c5e5bbf162bf2b2-X",
|
||||
"EncryptionKey":"FLWSECK_TESTe9474d4e2ce6"
|
||||
};
|
||||
let data = JSON.stringify(json);
|
||||
let buff = new Buffer(data);
|
||||
let base64data = buff.toString('base64');
|
||||
|
||||
console.log('"' + data + '" converted to Base64 is "' + base64data + '"');
|
||||
-2953
File diff suppressed because it is too large
Load Diff
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "flutterwave-transfer-micro",
|
||||
"version": "0.0.2",
|
||||
"description": "A microservice to handle flutterware payment services",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"generate-docs": "jsdoc ./api/*.js ./api/**/*.js ./app/*.js ./app/**/*.js ./service/*.js ./service/**/*.js -d docs",
|
||||
"lint": "eslint ./ --ext .js",
|
||||
"start": "node server.js",
|
||||
"start:dev": "nodemon server.js",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
"author": "Anatolii Okhotnikov <acidumirae@gmail.com>",
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"express": "^4.17.1",
|
||||
"pg": "8.7.1",
|
||||
"request": "^2.88.2",
|
||||
"underscore": "^1.8.3",
|
||||
"winston": "^2.3.1",
|
||||
"winston-papertrail": "^1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^1.10.3",
|
||||
"jsdoc": "^3.4.3",
|
||||
"nodemon": "^1.11.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@gitlab.chiefsoft.net:10222/WrenchBoard/WrenchBoradWeb.git"
|
||||
},
|
||||
"keywords": [
|
||||
"microservice",
|
||||
"flutterwave",
|
||||
"transfer"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://gitlab.chiefsoft.net/WrenchBoard/WrenchBoradWeb/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.chiefsoft.net/WrenchBoard/WrenchBoradWeb/src/master/microservices/flutterwave-transfer-micro/README.md"
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
const express = require('express');
|
||||
const logger = require('./app/logger');
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded());
|
||||
|
||||
const routes = require('./api/routes');
|
||||
routes(app);
|
||||
|
||||
app.listen(port, function() {
|
||||
logger.info('***** Server started on port: ' + port + ' *****');
|
||||
});
|
||||
@@ -1,98 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const axios = require('axios');
|
||||
const request = require('request');
|
||||
const db = require('../app/db')
|
||||
const logger = require('../app/logger');
|
||||
|
||||
// https://developer.flutterwave.com/reference/create-a-transfer
|
||||
const flutterwaveConfigBuffer = new Buffer(process.env.FLUTTERWAVE_API, 'base64');
|
||||
const flutterwaveConfig = JSON.parse(flutterwaveConfigBuffer.toString('ascii'));
|
||||
|
||||
var transfer = {
|
||||
create: function(req, res, next) {
|
||||
var url = flutterwaveConfig.BaseApiUrl + '/v3/transfers';
|
||||
var headersOpt = {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer " + flutterwaveConfig.SecretKey,
|
||||
};
|
||||
var data = {
|
||||
"account_bank": req.body.account_bank,
|
||||
"account_number": req.body.account_number,
|
||||
"amount": req.body.amount,
|
||||
"narration": req.body.narration,
|
||||
"currency": req.body.currency,
|
||||
"reference": req.body.reference,
|
||||
"debit_currency": req.body.debit_currency
|
||||
};
|
||||
var options = {
|
||||
headers: headersOpt
|
||||
};
|
||||
logger.info(url);
|
||||
logger.info(options);
|
||||
logger.info(data);
|
||||
// https://blog.logrocket.com/5-ways-to-make-http-requests-in-node-js/
|
||||
// https://stackoverflow.com/questions/53846709/how-do-i-use-axios-within-expressjs
|
||||
axios.post(url, data, options)
|
||||
.then(data => {
|
||||
res.json(data);
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error(err.message);
|
||||
//logger.error(err.stack);
|
||||
logger.error(err.response.data);
|
||||
//logger.error(err.response.headers);
|
||||
res.send({
|
||||
status: "failure",
|
||||
message: "Invalid response",
|
||||
details: err.message,
|
||||
code: err.response.status,
|
||||
data: err.response.data
|
||||
});
|
||||
});
|
||||
// TODO: Do we save the response in the DB? I assume: YES
|
||||
db.query('SELECT NOW()', (err, res) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
logger.info('time:', res.rows[0])
|
||||
});
|
||||
},
|
||||
get: function(req, res, next) {
|
||||
var url = flutterwaveConfig.BaseApiUrl + '/v3/transfers/' + req.params.id;
|
||||
var headersOpt = {
|
||||
"Authorization": "Bearer " + flutterwaveConfig.SecretKey,
|
||||
};
|
||||
var options = {
|
||||
headers: headersOpt
|
||||
};
|
||||
logger.info(url);
|
||||
axios.get(url, options)
|
||||
.then(data => {
|
||||
res.json(data);
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error(err.message);
|
||||
//logger.error(err.stack);
|
||||
logger.error(err.response.data);
|
||||
//logger.error(err.response.headers);
|
||||
res.send({
|
||||
status: "failure",
|
||||
message: "Invalid response",
|
||||
details: err.message,
|
||||
code: err.response.status,
|
||||
data: err.response.data
|
||||
});
|
||||
});
|
||||
// TODO: Do we save the response in the DB? I assume: YES
|
||||
db.query('SELECT NOW()', (err, res) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
logger.info('time:', res.rows[0])
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = transfer;
|
||||
|
||||
@@ -16,17 +16,16 @@ img {height: auto;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -50,12 +49,12 @@ img {height: auto;}
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -131,13 +130,12 @@ For all support, contact us at <a href="https://{{server_name}}/contact">https:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -150,7 +148,7 @@ You received this email because you subscribe to {{site_name}}. If you get this
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<a href="http://www.twitter.com/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
@@ -171,7 +169,8 @@ You received this email because you subscribe to {{site_name}}. If you get this
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Subject: {{site_name}} - Log in Confirmation
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta charset="utf-8">
|
||||
<title>{{site_name}} - Log in Confirmation</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
@@ -16,17 +16,16 @@ img {height: auto;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -43,18 +42,18 @@ img {height: auto;}
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<td height="30" border="0" style="text-align:center;">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -69,18 +68,7 @@ img {height: auto;}
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
Hello {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
@@ -90,29 +78,22 @@ Hello {{firstname}},
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Hello {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Please be informed that you logged on to {{site_name}} account at <b>{{last_login2}}</b> from <b>{{loc}}</b>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Please be informed that you logged on to {{site_name}} account at <b>{{last_login2}}</b>.
|
||||
If you did not log on to your account at the time detailed above, please contact us immediately.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
@@ -124,7 +105,7 @@ If you did not log on to your account at the time detailed above, please contact
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
For all support, contact us at <a href="https://{{server_name}}/contact">https://{{server_name}}/contact</a>
|
||||
For all support, contact us at <a href="{{server_name}}/contact">https://{{server_name}}/contact</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -149,19 +130,19 @@ Recently added task(s)
|
||||
{{pin}}
|
||||
{{/...}}
|
||||
{{/inv_items}}
|
||||
</table
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</td></tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -195,8 +176,5 @@ You received this email because you subscribe to {{site_name}}. If you get this
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -97,7 +97,7 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
Dear {{firstname}},
|
||||
Dear {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -4,33 +4,28 @@ Subject: {{site_name}} - Pending Signup - Verify {{email}}
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta charset="utf-8">
|
||||
<title>{{site_name}} - Pending Signup - Verify {{email}}</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.h3 {padding: 0 0 15px 0; font-size: 20px; line-height: 20px; font-weight: bold;}
|
||||
.bodycopy {font-size: 16px; line-height: 22px;}
|
||||
.button {text-align: center; font-size: 18px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -47,18 +42,18 @@ img {height: auto;}
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 100%;">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<td height="30" border="0" style="text-align:center;">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -73,17 +68,23 @@ img {height: auto;}
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
Dear {{firstname}},
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Hello {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Welcome to {{site_name}}!. In order to complete your registration , use the number below to complete registration.
|
||||
Welcome to {{site_name}}!. In order to complete your registration , use the number below to complete registration.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -103,25 +104,17 @@ Welcome to {{site_name}}!. In order to complete your registration , use the numb
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
<b>Enter the number to continue :</b> <h2>{{signup_random}}</h2>
|
||||
<br>
|
||||
For app sign up ,enter the number <b>{{signup_random}}</b> to continue.
|
||||
<hr size="1">
|
||||
For Web sign up , <a href="https://{{server_name}}/vemail?vlnk={{verify_link}}">Click here to verify account</a> to continue.
|
||||
<hr size="1">
|
||||
Or
|
||||
<table class="buttonwrapper" bgcolor="#e05443" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="button" height="45" style="align-center;">
|
||||
<a href="https://{{server_name}}/vemail?vlnk={{verify_link}}">Click to Verify Account</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bodycopy" style="color:#ff0033">
|
||||
The Link will expire by {{expire}}
|
||||
Note : The link will expire by:{{expire}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -134,15 +127,10 @@ The Link will expire by {{expire}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
If you did not initiate this account creation or have any further support question, Please contact us at https://{{server_name}}/contact<br>
|
||||
If you did not initiate this account creation or have any further support question, Please contact us at https://www.wrenchboard.com/contact<br>
|
||||
<hr size="1">
|
||||
With <a href="http://{{server_name}}">{{site_name}}</a>, you can enjoy free coordinated skills training section. Empower yourself and be around those that work with latest to update your knowledge.
|
||||
With <a href="http://{{server_name}}">{{site_name}}</a>,you can enjoy free connection to makerplace for all of your ability. We are simply here to empower you..
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -153,12 +141,12 @@ With <a href="http://{{server_name}}">{{site_name}}</a>, you can enjoy free coor
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://www.wrenchboard.com/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -192,8 +180,6 @@ You received this email because you subscribe to {{site_name}}. If you get this
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -16,17 +16,16 @@ img {height: auto;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -44,22 +43,22 @@ img {height: auto;}
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -74,7 +73,7 @@ img {height: auto;}
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="h2">
|
||||
<td class="bodycopy">
|
||||
Hello {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
@@ -107,8 +106,8 @@ img {height: auto;}
|
||||
<td style="padding: 20px 0 0 0;">
|
||||
<table class="buttonwrapper" bgcolor="#e05443" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="button" height="45">
|
||||
<a href="https://{{server_name}}/complereset?passlink={{pass_link}}">Click to Reset Password</a>
|
||||
<td class="button" height="45" style="text-align:center;" >
|
||||
<a href="{{server_name}}/complereset?passlink={{pass_link}}">Click to Reset Password</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -128,7 +127,7 @@ img {height: auto;}
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
If you did not initiate this password reset or have any further support question, please contact us at https://{{server_name}}/contact
|
||||
If you did not initiate this password reset or have any further support question, please contact us at {{server_name}}/contact
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -139,47 +138,47 @@ img {height: auto;}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="http://www.twitter.com/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,42 +6,26 @@ Subject: Welcome to {{site_name}}
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Welcome to {{site_name}}</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 40px 30px 20px 30px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 16px; line-height: 22px;}
|
||||
.button {text-align: center; font-size: 18px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
@media only screen and (max-width: 550px), screen and (max-device-width: 550px) {
|
||||
body[yahoo] .hide {display: none!important;}
|
||||
body[yahoo] .buttonwrapper {background-color: transparent!important;}
|
||||
body[yahoo] .button {padding: 0px!important;}
|
||||
body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;}
|
||||
body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;}
|
||||
}
|
||||
|
||||
/*@media only screen and (min-device-width: 601px) {
|
||||
.content {width: 600px !important;}
|
||||
.col425 {width: 425px!important;}
|
||||
.col380 {width: 380px!important;}
|
||||
}*/
|
||||
|
||||
</style>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -53,42 +37,20 @@ Subject: Welcome to {{site_name}}
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="70" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
<tr>
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -160,11 +122,11 @@ With <a href="http://{{server_name}}">{{site_name}}</a>, you can enjoy free coor
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
@@ -199,8 +161,5 @@ With <a href="http://{{server_name}}">{{site_name}}</a>, you can enjoy free coor
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,192 +1,182 @@
|
||||
Subject: WrenchBoard Signup Report
|
||||
|
||||
Subject: WrenchBoard Report {{site_name}}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>WrenchBoard Signup Report</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 40px 30px 20px 30px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
@media only screen and (max-width: 550px), screen and (max-device-width: 550px) {
|
||||
body[yahoo] .hide {display: none!important;}
|
||||
body[yahoo] .buttonwrapper {background-color: transparent!important;}
|
||||
body[yahoo] .button {padding: 0px!important;}
|
||||
body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;}
|
||||
body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;}
|
||||
}
|
||||
|
||||
/*@media only screen and (min-device-width: 601px) {
|
||||
.content {width: 600px !important;}
|
||||
.col425 {width: 425px!important;}
|
||||
.col380 {width: 380px!important;}
|
||||
}*/
|
||||
|
||||
</style>
|
||||
<meta charset="utf-8">
|
||||
<title>WrenchBoard Report {{site_name}}</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h2, h2 {color: #153643; font-family: sans-serif;}
|
||||
.h1, h1 {font-size: 15px; line-height: 10px; font-weight: bold;}
|
||||
.bodycopy {font-size: 10px; line-height: 10px; text-align: center;}
|
||||
.trColor { background-color:#D2F7F4;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="70" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="380" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;">
|
||||
<tr><td colspan="2"><h2>{{report_date}}</h2></td></tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Today Sign-up</td>
|
||||
<td class="bodycopy"><h1>{{today_signup}}</h1>People that completed the sign-up</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Pending Sign-up</td>
|
||||
<td class="bodycopy"><h2>{{today_pending_signup}}</h2>-People still in the process not completed</td>
|
||||
</tr>
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="30" border="0" style="text-align:center;">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td colspan="2"><h2>{{report_date}}</h2></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Today Sign-up - <span>People that completed the sign-up</span></td>
|
||||
<td class="bodycopy"><h1>{{today_signup}}</h1></td>
|
||||
</tr>
|
||||
<tr class="trColor">
|
||||
<td class="left" style="width:250px">Pending Sign-up - <span>People still in the process not completed</span></td>
|
||||
<td class="bodycopy"><h1>{{today_pending_signup}}</h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Public Active Jobs - <span>Jobs total shown to public now</span></td>
|
||||
<td class="bodycopy"><h1>{{total_active_public_jobs}}</h1></td>
|
||||
</tr>
|
||||
<tr class="trColor">
|
||||
<td class="left" style="width:250px">Interest Contats - <span>Total Show of interest today</span></td>
|
||||
<td class="bodycopy"><h1>{{total_task_interest}}</h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Session - <span>Session total created today</span></td>
|
||||
<td class="bodycopy"><h1>{{total_login}}</h1></td>
|
||||
</tr>
|
||||
<tr class="trColor">
|
||||
<td class="left" style="width:250px">Private Tasks - <span>Private Task now</span></td>
|
||||
<td class="bodycopy"><h1>{{total_private_tasks}}</h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Mobile App Login - <span>Log in tracked from the mobile app</span></td>
|
||||
<td class="bodycopy"><h1>{{count_mobile_login}}</h1></td>
|
||||
</tr>
|
||||
|
||||
<tr class="trColor">
|
||||
<td class="left" style="width:250px">-------------------</span></td>
|
||||
<td class="bodycopy"><h1>-----</h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">--------<span>--------</span></td>
|
||||
<td class="bodycopy"><h1>-----</h1></td>
|
||||
</tr>
|
||||
|
||||
<tr class="trColor">
|
||||
<td class="left" style="width:250px">-------------------</span></td>
|
||||
<td class="bodycopy"><h1>-----</h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">--------<span>--------</span></td>
|
||||
<td class="bodycopy"><h1>-----</h1></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
{{site_name}} Support Team
|
||||
<br>
|
||||
{{server_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you are a member of {{site_name}} support team. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>Please <a href ="https://{{server_name}}/bko">login</a> into BackOffice from authorized system to support the user.</h4>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
{{site_name}} Team
|
||||
<br>
|
||||
{{server_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
You received this email because you are a support user for {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,20 +11,17 @@ body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -52,8 +49,8 @@ img {height: auto;}
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -75,13 +72,6 @@ img {height: auto;}
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="380" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
@@ -94,8 +84,10 @@ img {height: auto;}
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed; background-color:#e6f9ff;">
|
||||
<tr >
|
||||
<td colspan="2"><h3>Signup Pending-{{added}}</h3></td>
|
||||
<td class="left" style="width:100px">Signup Pending</td>
|
||||
<td class="bodycopy">{{added}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Firstname</td>
|
||||
@@ -125,15 +117,14 @@ img {height: auto;}
|
||||
<td class="bodycopy">{{verify_link}}</td>
|
||||
</tr>
|
||||
|
||||
<tr >
|
||||
<td class="left" colspan="2">Please <a href ="https://{{server_name}}/bko">login</a> into BackOffice from authorized system to support the user.</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>Please <a href ="https://{{server_name}}/bko">login</a> into BackOffice from authorized system to support the user.</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
@@ -144,7 +135,7 @@ img {height: auto;}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
<img class="fix" src="https://dashboard.wrenchboard.com/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -156,11 +147,11 @@ img {height: auto;}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you are a support user for {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -196,6 +187,5 @@ You received this email because you are a support user for {{site_name}}. If you
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,220 +1,212 @@
|
||||
Subject: WrenchBoard Completed Signup ALERT
|
||||
Subject: {{site_name}} - Completed Signup ALERT
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>WrenchBoard Completed Signup ALERT</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 40px 30px 20px 30px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{site_name}} - Completed Signup ALERT {{email}}</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 40px 30px 20px 30px;}
|
||||
.innerpadding {padding: 30px 30px 30px 30px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.h3 {padding: 0 0 15px 0; font-size: 20px; line-height: 20px; font-weight: bold;}
|
||||
.bodycopy {font-size: 16px; line-height: 22px;}
|
||||
.button {text-align: center; font-size: 18px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
@media only screen and (max-width: 550px), screen and (max-device-width: 550px) {
|
||||
body[yahoo] .hide {display: none!important;}
|
||||
body[yahoo] .buttonwrapper {background-color: transparent!important;}
|
||||
body[yahoo] .button {padding: 0px!important;}
|
||||
body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;}
|
||||
body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;}
|
||||
}
|
||||
@media only screen and (max-width: 550px), screen and (max-device-width: 550px) {
|
||||
body[yahoo] .hide {display: none!important;}
|
||||
body[yahoo] .buttonwrapper {background-color: transparent!important;}
|
||||
body[yahoo] .button {padding: 0px!important;}
|
||||
body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;}
|
||||
body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;}
|
||||
}
|
||||
|
||||
/*@media only screen and (min-device-width: 601px) {
|
||||
.content {width: 600px !important;}
|
||||
.col425 {width: 425px!important;}
|
||||
.col380 {width: 380px!important;}
|
||||
}*/
|
||||
/*@media only screen and (min-device-width: 601px) {
|
||||
.content {width: 600px !important;}
|
||||
.col425 {width: 425px!important;}
|
||||
.col380 {width: 380px!important;}
|
||||
}*/
|
||||
|
||||
</style>
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="70" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="50" style="padding: 0 10px 10px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed; background-color:#e6f9ff;">
|
||||
<tr >
|
||||
<td colspan="2"><h3>Signup Pending-{{added}}</h3></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="380" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;">
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Firstname</td>
|
||||
<td class="bodycopy">{{firstname}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Lastname</td>
|
||||
<td class="bodycopy">{{lastname}}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed; background-color:#e6f9ff;">
|
||||
<tr >
|
||||
<td colspan="2"><h3>Signup Pending-{{added}}</h3></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Email</td>
|
||||
<td class="bodycopy">{{email2}}</td>
|
||||
</tr>
|
||||
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Firstname</td>
|
||||
<td class="bodycopy">{{firstname}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Lastname</td>
|
||||
<td class="bodycopy">{{lastname}}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Location</td>
|
||||
<td class="bodycopy"><a href="https://www.chiefsoft.com/tools/iplocator?ip={{loc}}">{{loc}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Created</td>
|
||||
<td class="bodycopy">{{added}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Email</td>
|
||||
<td class="bodycopy">{{email2}}</td>
|
||||
</tr>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Location</td>
|
||||
<td class="bodycopy"><a href="https://www.chiefsoft.com/tools/iplocator?ip={{loc}}">{{loc}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:100px">Created</td>
|
||||
<td class="bodycopy">{{added}}</td>
|
||||
</tr>
|
||||
|
||||
<tr >
|
||||
<td class="left" style="width:100px">Link</td>
|
||||
<td class="bodycopy">{{verify_link}}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>Please <a href ="https://{{server_name}}/bko">login</a> into BackOffice from authorized system to support the user.</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
{{site_name}} Team
|
||||
<br>
|
||||
{{server_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
You received this email because you are a support user for {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="http://www.twitter.com/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
Subject: {{site_name}} - Coupon Allocated
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{site_name}} - Coupon Allocated</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="30" border="0" style="text-align:center;">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Hello {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
Please be informed that you logged on to {{site_name}} account at <b>{{last_login2}}</b>.
|
||||
If you did not log on to your account at the time detailed above, please contact us immediately.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
For all support, contact us at <a href="{{server_name}}/contact">https://{{server_name}}/contact</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
{{site_name}} Team
|
||||
<br>
|
||||
{{server_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
<br>
|
||||
Recently added task(s)
|
||||
<table border="0" width='100%;' id="table1" style="font-family: Trebuchet MS; font-size: 10pt ">
|
||||
{{\inv_items}}
|
||||
{{...}}
|
||||
{{pin}}
|
||||
{{/...}}
|
||||
{{/inv_items}}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</td></tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="https://{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://twitter.com/wrenchboard">
|
||||
<img src="https://{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
Subject: {{subject}}
|
||||
Subject: {{subject}}
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
@@ -10,155 +10,88 @@ Subject: {{subject}}
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 40px 30px 20px 30px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
@media only screen and (max-width: 550px), screen and (max-device-width: 550px) {
|
||||
body[yahoo] .hide {display: none!important;}
|
||||
body[yahoo] .buttonwrapper {background-color: transparent!important;}
|
||||
body[yahoo] .button {padding: 0px!important;}
|
||||
body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;}
|
||||
body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;}
|
||||
}
|
||||
|
||||
/*@media only screen and (min-device-width: 601px) {
|
||||
.content {width: 600px !important;}
|
||||
.col425 {width: 425px!important;}
|
||||
.col380 {width: 380px!important;}
|
||||
}*/
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<body bgcolor="#f6f8f1">
|
||||
<tr>
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="70" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="h3">
|
||||
<td class="h2">
|
||||
<b>Dear {{firstname}}</b>,
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
You now have <b>{{preview_count}} task(s)</b> at <a href="https://{{server_name}}/">{{site_name}}</a> in <b>"Preview"</b> status and your attention is needed.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
You now have <b>{{preview_count}} task(s)</b> at <a href="https://{{server_name}}/">{{site_name}}</a> in <b>"Preview"</b> status and your attention is needed.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="380" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed; background-color:#e6f9ff;">
|
||||
<tr>
|
||||
<td>
|
||||
<td class="bodycopy">
|
||||
<hr size="1">
|
||||
It is essential that you login and process the task(s) appropriately. In the event of no response from you, <a href="https://{{server_name}}/">{{site_name}}</a> will automatically pay the client and close the task for you in few hours.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>Delivery Date: </b>
|
||||
|
||||
{{delivery_date}}
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
<hr size="1">
|
||||
<b>Delivery Date: </b> {{delivery_date}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
<hr size="1">
|
||||
<h4>Please <a href ="https://{{server_name}}/eoffer?offerID={{offer_code}}">login</a> into your account to manage this task.</h4>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>Please <a href ="https://{{server_name}}/eoffer?offerID={{offer_code}}">login</a> into your account to manage this task.</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
Please contact us at https://{{server_name}}/contact if you have any question about this email.
|
||||
@@ -172,12 +105,13 @@ Please contact us at https://{{server_name}}/contact if you have any question a
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2017<br/>
|
||||
You received this email because a subscriber to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -210,8 +144,5 @@ You received this email because a subscriber to {{site_name}}. If you get this e
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -162,7 +162,7 @@ You have received a job message from <a href="https://{{server_name}}/eoffer?off
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
Please contact us at https://{{server_name}}/contact if you have any question about this email.
|
||||
Please contact us at https://www.wrenchboard.com/contact if you have any question about this email.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -177,7 +177,7 @@ Please contact us at https://{{server_name}}/contact if you have any question a
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -211,8 +211,5 @@ You received this email because a user sent a job to you from {{site_name}}. If
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -184,7 +184,7 @@ Please contact us at https://{{server_name}}/contact if you have any question a
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
® {{site_name}} 2024<br/>
|
||||
You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -218,8 +218,5 @@ You received this email because a user sent a job to you from {{site_name}}. If
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,16 +16,12 @@ img {height: auto;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
|
||||
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
|
||||
.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;}
|
||||
.bodycopy {font-size: 14px; line-height: 20px;}
|
||||
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
|
||||
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
|
||||
|
||||
</style>
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -47,18 +43,18 @@ img {height: auto;}
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
<td style="padding: 1px 0 1px 0; text-align:center;">
|
||||
<a href="https://www.wrenchboard.com/"><img src="https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -77,7 +73,7 @@ img {height: auto;}
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="h2">
|
||||
<td class="bodycopy">
|
||||
Dear {{firstname}},
|
||||
</td>
|
||||
</tr>
|
||||
@@ -95,7 +91,7 @@ You have posted a job offer at <a href="https://{{server_name}}">{{site_name}}</
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
<img class="fix" src="https://dashboard.wrenchboard.com/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -186,7 +182,7 @@ Offer Expire
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="https://{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
<img class="fix" src="https://dashboard.wrenchboard.com/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -202,12 +198,12 @@ Please contact us at https://{{server_name}}/contact if you have any question a
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="footer" bgcolor="#44525f">
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} 2018<br/>
|
||||
You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contactus" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
® {{site_name}} 2022<br/>
|
||||
You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please <a href="https://{{server_name}}/contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -242,6 +238,5 @@ Please contact us at https://{{server_name}}/contact if you have any question a
|
||||
</table>
|
||||
|
||||
<!--analytics-->
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -46,13 +46,16 @@ Paypal:
|
||||
|
||||
stripe:
|
||||
{
|
||||
publishable_key = "pk_test_X7TylEk9BkZCarcj0FyKRYXc";
|
||||
secret_key = "sk_test_MA2ltfGlT70Nu7uWlmHowBRB";
|
||||
publishable_key = "pk_test_51JwvOXCMmfol61TL2IlTEWytKObMLrZTAxJRHdepqWggXm4ENMyrrnR5dxfd5cPeflvCUG1HsErQI43BjOAmUEh500N0FWOZoE";
|
||||
old_publishable_key ="pk_test_X7TylEk9BkZCarcj0FyKRYXc";
|
||||
secret_key = "sk_test_51JwvOXCMmfol61TLadZlDf2rxq6Q1IC50JITRixcbyig8T2zdqpO8HY2NEcwNHacRQKQpTf6JGh7haqUVEH0rccA00eFht1ewi";
|
||||
old_secret_key = "sk_test_MA2ltfGlT70Nu7uWlmHowBRB";
|
||||
};
|
||||
|
||||
database:
|
||||
{
|
||||
host = "127.0.0.1";
|
||||
#- using docker 10.23 host = "127.0.0.1";
|
||||
host = "10.10.10.23";
|
||||
name = "wrenchboard";
|
||||
user = "wrenchboard";
|
||||
pass = "wrenchboard";
|
||||
@@ -105,10 +108,10 @@ paylid:
|
||||
|
||||
transnotif:
|
||||
{
|
||||
contact = "ses66181@gmail.com,support@wrenchboard.com,ameye@fluxtra.net";
|
||||
topupemail = "ses66181@gmail.com,ameye@chiefsoft.com";
|
||||
signupreport ="ses66181+signup@gmail.com";
|
||||
topalert = "demo@myexperiencenow.com";
|
||||
contact = "ses66181+contact@gmail.com,support+contact@wrenchboard.com,tokslaw+contact@chiefsoft.com";
|
||||
topupemail = "ses66181@gmail.com,ameye@chiefsoft.com,tokslaw+signup@chiefsoft.com";
|
||||
signupreport ="ses66181+signup@gmail.com,tokslaw+signup@chiefsoft.com";
|
||||
topalert = "ses66181+alert@gmail.com,tokslaw+alert@chiefsoft.com";
|
||||
};
|
||||
|
||||
webpay:
|
||||
|
||||
@@ -12,7 +12,7 @@ ZEND_EXT_TYPE = zend_extension
|
||||
RE2C = exit 0;
|
||||
AWK = gawk
|
||||
WRENCHBOARD_API_OAMEYE_SHARED_LIBADD = -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lpq -lstdc++ -lcurl -lconfig++ -ljson-c -lssl -lz -lpcrecpp -lgcc_s
|
||||
shared_objects_wrenchboard_api_oameye = core/XmlElements.lo core/XmlParser.lo core/cfg.lo core/cgi.lo core/clog.lo core/cvariables.lo core/exceptions.lo core/hmac_sha2.lo core/input.lo core/list.lo core/pgsql.lo core/pgsql_wrapper.lo core/safestring.lo core/sha2.lo core/sha512.lo core/smtp.lo core/timer.lo core/util.lo core/vars.lo core/wrenchboard.lo core/wrenchboard_api.lo shared_tool/account.lo shared_tool/account_mngt.lo shared_tool/bko.lo shared_tool/common_tool.lo shared_tool/contract.lo shared_tool/creditcards.lo shared_tool/email.lo shared_tool/groups.lo shared_tool/jobs.lo shared_tool/login.lo shared_tool/mobile.lo shared_tool/namespaces.lo shared_tool/payments.lo shared_tool/site_crons.lo shared_tool/smoney.lo shared_tool/stripe.lo shared_tool/stripe_charge.lo shared_tool/topups.lo shared_tool/twilo.lo shared_tool/wrenchboard_api_main.lo
|
||||
shared_objects_wrenchboard_api_oameye = core/XmlElements.lo core/XmlParser.lo core/cfg.lo core/cgi.lo core/clog.lo core/cvariables.lo core/exceptions.lo core/hmac_sha2.lo core/input.lo core/list.lo core/pgsql.lo core/pgsql_wrapper.lo core/safestring.lo core/sha2.lo core/sha512.lo core/smtp.lo core/timer.lo core/util.lo core/vars.lo core/wrenchboard.lo core/wrenchboard_api.lo shared_tool/account.lo shared_tool/account_mngt.lo shared_tool/bko.lo shared_tool/cards.lo shared_tool/common_tool.lo shared_tool/contract.lo shared_tool/coupons.lo shared_tool/creditcards.lo shared_tool/email.lo shared_tool/groups.lo shared_tool/jobs.lo shared_tool/login.lo shared_tool/mobile.lo shared_tool/namespaces.lo shared_tool/payments.lo shared_tool/reco_egine.lo shared_tool/site_crons.lo shared_tool/smoney.lo shared_tool/stripe.lo shared_tool/stripe_charge.lo shared_tool/topups.lo shared_tool/twilo.lo shared_tool/wrenchboard_api_main.lo
|
||||
PHP_PECL_EXTENSION = wrenchboard_api_oameye
|
||||
PHP_MODULES = $(phplibdir)/wrenchboard_api_oameye.la
|
||||
PHP_ZEND_EX =
|
||||
@@ -238,10 +238,14 @@ shared_tool/account_mngt.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_too
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/account_mngt.cc -o shared_tool/account_mngt.lo
|
||||
shared_tool/bko.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/bko.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/bko.cc -o shared_tool/bko.lo
|
||||
shared_tool/cards.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/cards.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/cards.cc -o shared_tool/cards.lo
|
||||
shared_tool/common_tool.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/common_tool.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/common_tool.cc -o shared_tool/common_tool.lo
|
||||
shared_tool/contract.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/contract.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/contract.cc -o shared_tool/contract.lo
|
||||
shared_tool/coupons.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/coupons.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/coupons.cc -o shared_tool/coupons.lo
|
||||
shared_tool/creditcards.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/creditcards.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/creditcards.cc -o shared_tool/creditcards.lo
|
||||
shared_tool/email.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/email.cc
|
||||
@@ -258,6 +262,8 @@ shared_tool/namespaces.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/namespaces.cc -o shared_tool/namespaces.lo
|
||||
shared_tool/payments.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/payments.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/payments.cc -o shared_tool/payments.lo
|
||||
shared_tool/reco_egine.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/reco_egine.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/reco_egine.cc -o shared_tool/reco_egine.lo
|
||||
shared_tool/site_crons.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/site_crons.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/site_crons.cc -o shared_tool/site_crons.lo
|
||||
shared_tool/smoney.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/smoney.cc
|
||||
|
||||
@@ -46,10 +46,14 @@ shared_tool/account_mngt.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_too
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/account_mngt.cc -o shared_tool/account_mngt.lo
|
||||
shared_tool/bko.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/bko.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/bko.cc -o shared_tool/bko.lo
|
||||
shared_tool/cards.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/cards.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/cards.cc -o shared_tool/cards.lo
|
||||
shared_tool/common_tool.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/common_tool.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/common_tool.cc -o shared_tool/common_tool.lo
|
||||
shared_tool/contract.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/contract.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/contract.cc -o shared_tool/contract.lo
|
||||
shared_tool/coupons.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/coupons.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/coupons.cc -o shared_tool/coupons.lo
|
||||
shared_tool/creditcards.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/creditcards.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/creditcards.cc -o shared_tool/creditcards.lo
|
||||
shared_tool/email.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/email.cc
|
||||
@@ -66,6 +70,8 @@ shared_tool/namespaces.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/namespaces.cc -o shared_tool/namespaces.lo
|
||||
shared_tool/payments.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/payments.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/payments.cc -o shared_tool/payments.lo
|
||||
shared_tool/reco_egine.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/reco_egine.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/reco_egine.cc -o shared_tool/reco_egine.lo
|
||||
shared_tool/site_crons.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/site_crons.cc
|
||||
$(LIBTOOL) --mode=compile $(CXX) -I/home/oameye/wrenchboard/wrenchboard/src/libconfig-1.0.1 -I. -I/home/oameye/wrenchboard/wrenchboard/src $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c /home/oameye/wrenchboard/wrenchboard/src/shared_tool/site_crons.cc -o shared_tool/site_crons.lo
|
||||
shared_tool/smoney.lo: /home/oameye/wrenchboard/wrenchboard/src/shared_tool/smoney.cc
|
||||
|
||||
@@ -10,11 +10,11 @@ generated by GNU Autoconf 2.69. Invocation command line was
|
||||
## Platform. ##
|
||||
## --------- ##
|
||||
|
||||
hostname = localhost.localdomain
|
||||
hostname = WrenchBoardDev
|
||||
uname -m = x86_64
|
||||
uname -r = 4.18.0-193.el8.x86_64
|
||||
uname -r = 4.18.0-358.el8.x86_64
|
||||
uname -s = Linux
|
||||
uname -v = #1 SMP Fri May 8 10:59:10 UTC 2020
|
||||
uname -v = #1 SMP Mon Jan 10 13:11:20 UTC 2022
|
||||
|
||||
/usr/bin/uname -p = x86_64
|
||||
/bin/uname -X = unknown
|
||||
@@ -50,7 +50,7 @@ configure:2566: found /usr/bin/cc
|
||||
configure:2577: result: cc
|
||||
configure:2608: checking for C compiler version
|
||||
configure:2617: cc --version >&5
|
||||
cc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
|
||||
cc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-13)
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
@@ -65,7 +65,7 @@ OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-redhat-linux
|
||||
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
|
||||
Thread model: posix
|
||||
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
|
||||
gcc version 8.5.0 20210514 (Red Hat 8.5.0-13) (GCC)
|
||||
configure:2628: $? = 0
|
||||
configure:2617: cc -V >&5
|
||||
cc: error: unrecognized command line option '-V'
|
||||
@@ -216,7 +216,7 @@ configure:4113: found /usr/bin/g++
|
||||
configure:4124: result: g++
|
||||
configure:4151: checking for C++ compiler version
|
||||
configure:4160: g++ --version >&5
|
||||
g++ (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
|
||||
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-13)
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
@@ -231,7 +231,7 @@ OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-redhat-linux
|
||||
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
|
||||
Thread model: posix
|
||||
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
|
||||
gcc version 8.5.0 20210514 (Red Hat 8.5.0-13) (GCC)
|
||||
configure:4171: $? = 0
|
||||
configure:4160: g++ -V >&5
|
||||
g++: error: unrecognized command line option '-V'
|
||||
@@ -534,7 +534,7 @@ generated by GNU Autoconf 2.69. Invocation command line was
|
||||
CONFIG_COMMANDS =
|
||||
$ ./config.status
|
||||
|
||||
on localhost.localdomain
|
||||
on WrenchBoardDev
|
||||
|
||||
config.status:944: creating config.h
|
||||
config.status:1034: config.h is unchanged
|
||||
|
||||
@@ -662,7 +662,7 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
|
||||
finish_eval=''
|
||||
hardcode_into_libs='yes'
|
||||
sys_lib_search_path_spec='/usr/lib/gcc/x86_64-redhat-linux/8 /usr/lib64 /lib64 /usr/lib /lib '
|
||||
configure_time_dlsearch_path='/lib64 /usr/lib64 /lib /usr/lib /usr/lib64//bind9-export/ /usr/lib64/dyninst '
|
||||
configure_time_dlsearch_path='/lib64 /usr/lib64 /lib /usr/lib /usr/lib64//bind9-export/ /usr/lib64/dyninst '
|
||||
configure_time_lt_sys_library_path=''
|
||||
hardcode_action='immediate'
|
||||
enable_dlopen='unknown'
|
||||
|
||||
@@ -117,7 +117,7 @@ int SMTP2( const char * _server, const char * _from, char * _to, char * _body, c
|
||||
}
|
||||
|
||||
// Google
|
||||
snprintf( name, BUF_SIZE, EMAIL_PREFIX"/../src/modules/mailsend -smtp %s -f %s -t %s -domain %s -name '%s' +cc +bcc -v -starttls -port 587 -auth-plain -user %s -pass %s -sub '%s' -content-type 'text/html' -mime-type 'text/html' -M '%s'",
|
||||
snprintf( name, BUF_SIZE, EMAIL_PREFIX"/../src/modules/mailsend -smtp %s -f %s -t %s -domain %s -name '%s' +cc +bcc -v -starttls -port 587 -auth-plain -user %s -pass %s -sub '%s' -content-type 'multipart/mixed' -mime-type 'text/html' -disposition inline -M '%s'",
|
||||
_server, _from, _to, _domain, _name, _user, _pass, subject, body != NULL ? body : _body );
|
||||
/*
|
||||
// Virtualmail
|
||||
|
||||
@@ -8,6 +8,9 @@ long account_calls(CVars in, CVars &out);
|
||||
|
||||
long LoginWrenchBoardAccount( CVars in, CVars &out );
|
||||
long LoginWrenchBoardFacebook( CVars in, CVars &out );
|
||||
long LoginWrenchBoardGoogle( CVars in, CVars &out );
|
||||
long LoginWrenchBoardApple( CVars in, CVars &out );
|
||||
long LoginWrenchBoardExternal( CVars in, CVars &out );
|
||||
long SessionCheck(long uid, const char *sessionid, int create );
|
||||
long account_session_check(CVars in, CVars out);
|
||||
long VerifySession(CVars in, CVars &out);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __mx_cards_h__
|
||||
#define __mx_cards_h__
|
||||
|
||||
#include "vars.h"
|
||||
|
||||
long card_calls(CVars in, CVars &out);
|
||||
|
||||
long card_calls(CVars in, CVars &out);
|
||||
long getMembercards(CVars in, CVars &out);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __mx_coupons_h__
|
||||
#define __mx_coupons_h__
|
||||
|
||||
#include "vars.h"
|
||||
|
||||
long coupons_calls(CVars in, CVars &out);
|
||||
|
||||
long CreateCoupon( CVars in, CVars &out );
|
||||
long AssignCoupon( CVars in, CVars &out );
|
||||
long RedeemCoupon( CVars in, CVars &out );
|
||||
|
||||
#endif
|
||||
@@ -38,6 +38,7 @@ long sendmoney_email(long mailtype, CVars in, CVars &out);
|
||||
long alert_email(long mailtype, CVars in, CVars &out) ;
|
||||
long SendmarketMessage(CVars in, CVars &out);
|
||||
long cron_email(long mailtype, CVars in, CVars &out);
|
||||
long coupon_email(long mailtype, CVars in, CVars &out);
|
||||
|
||||
long SignupPendingAlertMailfile(CVars in);
|
||||
long SignupCompletedAlertMailfile(CVars in);
|
||||
|
||||
@@ -9,5 +9,12 @@ long WrenchRefundoffer( CVars in, CVars &out );
|
||||
long WrenchContractPayment( CVars in, CVars &out );
|
||||
long WrenchCanceContractPayment( CVars in, CVars &out );
|
||||
|
||||
|
||||
long WrenchNewCardPayment( CVars in, CVars &out );
|
||||
long WrenchCardRechargePayment( CVars in, CVars &out );
|
||||
long CheckWallet(long member_id,CVars in);
|
||||
long DeductMemberWallet(long member_id,long wallet_id,long amount, long payment_id);
|
||||
long WrenchMemberCouponPayment( CVars in, CVars &out );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __mx_reco_engine_h__
|
||||
#define __mx_reco_engine_h__
|
||||
|
||||
#include "vars.h"
|
||||
|
||||
long recommendation_engine(long action , CVars in, CVars &out);
|
||||
|
||||
#endif
|
||||
@@ -20,6 +20,11 @@ enum { PARTNER_STRIPE };
|
||||
#define OFFER_EXPIRE 444
|
||||
#define OFFER_SENDTOME 777
|
||||
|
||||
#define WEBSITE_LOGIN 1100
|
||||
#define MOBILE_LOGIN 1101
|
||||
#define FACEBOOK_LOGIN 1102
|
||||
#define APPLE_LOGIN 1103
|
||||
#define GOOGLE_LOGIN 1104
|
||||
|
||||
#define CONTRACT_CANCEL_CONTRACT 7
|
||||
#define CONTRACT_EXTEND_TIMELINE 9
|
||||
@@ -99,7 +104,12 @@ enum { PARTNER_STRIPE };
|
||||
#define ACCOUNT_AGREE_REFER 200
|
||||
|
||||
//========================
|
||||
|
||||
#define RECOMMEND_COUPON 1000
|
||||
#define RECOMMEND_BLOG 1005
|
||||
#define RECOMMEND_NEWTASK 1010
|
||||
#define RECOMMEND_TOKEN 1015
|
||||
#define RECOMMEND_OFFERS 1020
|
||||
//========================
|
||||
|
||||
#define WRENCHBOARD_SESSION_CHECK 299
|
||||
#define WRENCHBOARD_USER_LOGIN 300
|
||||
@@ -113,7 +123,8 @@ enum { PARTNER_STRIPE };
|
||||
|
||||
#define WRB_CRONJOB_SIGNUP_ALERT 773
|
||||
#define WRB_CRONJOB_PASTDUE_ALERT 774
|
||||
|
||||
#define WRB_CRONJOB_OFFER_REFUND_ALERT 775
|
||||
#define WRB_CRONJOB_PENDOFFER_ALERT 776
|
||||
|
||||
//**************************************************************
|
||||
#define WRENCHBOARD_BKO_START 10000
|
||||
@@ -144,6 +155,8 @@ enum { PARTNER_STRIPE };
|
||||
#define WRENCHBOARD_ACCOUNT_CREATEACC 11020
|
||||
#define WRENCHBOARD_ACCOUNT_LOGIN 11025
|
||||
#define WRENCHBOARD_FACEBOOK_LOGIN 11026
|
||||
#define WRENCHBOARD_GOOGLE_LOGIN 11027
|
||||
#define WRENCHBOARD_APPLE_LOGIN 11031
|
||||
#define WRENCHBOARD_START_JOBLIST 11028
|
||||
#define WRENCHBOARD_ACCOUNT_DASHDATA 11029
|
||||
|
||||
@@ -167,6 +180,13 @@ enum { PARTNER_STRIPE };
|
||||
#define WRENCHBOARD_USER_SENDMONEY 11051
|
||||
#define WRENCHBOARD_USER_SENDJOBINT 11052
|
||||
|
||||
#define WRENCHBOARD_USER_ADNEWCC 11054
|
||||
#define WRENCHBOARD_USER_USESAVEDCC 11056
|
||||
#define WRENCHBOARD_USER_SETTINGS 11058
|
||||
|
||||
#define WRENCHBOARD_ACCOUNT_WALLETS 11060
|
||||
|
||||
#define WRENCHBOARD_USER_DELETEACC 11990
|
||||
#define WRENCHBOARD_ACCOUNT_END 11999
|
||||
//**************************************************************
|
||||
#define WRENCHBOARD_GROUP_START 12000
|
||||
@@ -229,9 +249,16 @@ enum { PARTNER_STRIPE };
|
||||
#define WRENCHBOARD_SMONEY_BKOPROC 33030
|
||||
|
||||
#define WRENCHBOARD_SMONEY_END 33999
|
||||
|
||||
//**************************************************************
|
||||
#define WRENCHBOARD_CARDS_START 40000
|
||||
|
||||
#define WRENCHBOARD_CARDS_GETCARDLIST 40010
|
||||
#define WRENCHBOARD_CARDS_UPDATECARD 40015
|
||||
#define WRENCHBOARD_CARDS_CREATECARD 40020
|
||||
|
||||
#define WRENCHBOARD_CARDS_END 49999
|
||||
//**************************************************************
|
||||
|
||||
#define WRENCHBOARD_LOGIN_SHOP 50501
|
||||
#define WRENCHBOARD_LOGIN_ADMIN 50502
|
||||
@@ -241,6 +268,18 @@ enum { PARTNER_STRIPE };
|
||||
#define WRENCHBOARD_ADD_SURVEY 55050
|
||||
#define WRENCHBOARD_LOAD_SURVEY 55055
|
||||
|
||||
//**************************************************************
|
||||
#define WRENCHBOARD_COUPON_START 85000
|
||||
|
||||
#define WRENCHBOARD_COUPON_CREATE 85010
|
||||
#define WRENCHBOARD_COUPON_ACTIVATE 85015
|
||||
#define WRENCHBOARD_COUPON_REDEEM 85020
|
||||
#define WRENCHBOARD_COUPON_MEMLIST 85025
|
||||
#define WRENCHBOARD_COUPON_PENDLIST 85030
|
||||
#define WRENCHBOARD_COUPON_END 85999
|
||||
//**************************************************************
|
||||
|
||||
|
||||
#define WRENCHBOARD_STRIPE_CHARGE_ONE 90004
|
||||
#define WRENCHBOARD_STRIPE_CHARGE_NEW 90005
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Generated automatically by config.status ()
|
||||
# Libtool was configured on host localhost.localdomain:
|
||||
# Libtool was configured on host WrenchBoardDev:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
|
||||
# Provide generalized library-building support services.
|
||||
@@ -285,7 +285,7 @@ hardcode_into_libs=yes
|
||||
sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/8 /usr/lib64 /lib64 /usr/lib /lib "
|
||||
|
||||
# Detected run-time system search path for libraries.
|
||||
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64//bind9-export/ /usr/lib64/dyninst "
|
||||
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64//bind9-export/ /usr/lib64/dyninst "
|
||||
|
||||
# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
|
||||
configure_time_lt_sys_library_path=""
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <curl/curl.h>
|
||||
#include "smoney.h"
|
||||
#include "account_mngt.h"
|
||||
#include "creditcards.h"
|
||||
#include "payments.h"
|
||||
|
||||
#include "jobs.h"
|
||||
|
||||
@@ -106,9 +108,11 @@ status INT DEFAULT 1,
|
||||
created timestamp without time zone DEFAULT now()
|
||||
);
|
||||
*/
|
||||
long LoginLogger( long member_id, long login_mode);
|
||||
long WrenchBoardMobileSendMoney(CVars in, CVars &out);
|
||||
long WrenchBoardMobileSendJobInterest(CVars in, CVars &out);
|
||||
long WrenchReturnPendingJobList(CVars in, CVars &out);
|
||||
long WrenchBoardMobileSendUserWallet(CVars in, CVars &out);
|
||||
|
||||
long test() {
|
||||
FILE* oldFile = Output2FILE::Stream();
|
||||
@@ -130,8 +134,10 @@ long account_calls(CVars in, CVars &out) {
|
||||
CVars x;
|
||||
long ret = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
|
||||
test();
|
||||
const PGresult *res;
|
||||
logfmt(logINFO, "action = %ld", action);
|
||||
logfmt(logINFO, "google = %ld", WRENCHBOARD_GOOGLE_LOGIN);
|
||||
//test();
|
||||
|
||||
switch (action) {
|
||||
case WRENCHBOARD_CREATE_MOBILEUSER:
|
||||
@@ -143,7 +149,7 @@ test();
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_RESET_PASSWORD:
|
||||
|
||||
return WrenchResetMemberPass(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_MOBILE_MESSAGE:
|
||||
@@ -172,7 +178,7 @@ test();
|
||||
REQ_STRING(in, "email", 5, 49, "(.*)");
|
||||
REQ_STRING(in, "firstname", 1, 49, "(.*)");
|
||||
REQ_STRING(in, "lastname", 1, 40, "(.*)");
|
||||
REQ_STRING(in, "your_message", 4, 400, "(.*)");
|
||||
REQ_STRING(in, "your_message", 4, 400, "(.*)");
|
||||
//OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
|
||||
|
||||
in["loc"] = loc;
|
||||
@@ -209,6 +215,14 @@ test();
|
||||
return LoginWrenchBoardFacebook(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_GOOGLE_LOGIN:
|
||||
return LoginWrenchBoardGoogle(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_APPLE_LOGIN:
|
||||
return LoginWrenchBoardApple(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_PENDING:
|
||||
return CreateWrenchBoardAccountPending(in, out);
|
||||
break;
|
||||
@@ -294,18 +308,62 @@ test();
|
||||
return WrenchLoadDashData(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_GETBANKLIST:
|
||||
return WrenchReturnMemberBankAccount(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_SENDMONEY:
|
||||
return WrenchBoardMobileSendMoney(in, out);
|
||||
case WRENCHBOARD_USER_GETBANKLIST:
|
||||
return WrenchReturnMemberBankAccount(in, out);
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_SENDJOBINT:
|
||||
return WrenchBoardMobileSendJobInterest(in, out);
|
||||
break;
|
||||
case WRENCHBOARD_USER_SENDMONEY:
|
||||
return WrenchBoardMobileSendMoney(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_SENDJOBINT:
|
||||
return WrenchBoardMobileSendJobInterest(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_ADNEWCC:
|
||||
return WrenchNewCardPayment(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_USESAVEDCC:
|
||||
return WrenchCardRechargePayment(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_SETTINGS:
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_STRING(in, "pref_id", 4, 6, "(.*)");
|
||||
REQ_LONG(in, "status", 1, -1);
|
||||
|
||||
res = pgsql_query("SELECT id FROM members_settings WHERE member_id=%lu AND pref_id='%s' ", in["member_id"].Long(), in["pref_id"].c_str());
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
pgsql_exec("UPDATE members_settings SET status=%lu WHERE member_id=%lu AND pref_id='%s' ",in["status"].Long(), in["member_id"].Long(), in["pref_id"].c_str());
|
||||
}
|
||||
else{
|
||||
CVars xx;
|
||||
xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
xx["pref_id"] = in["pref_id"]; xx["pref_id"].set_valid(true);
|
||||
xx["status"] = in["status"]; xx["status"].set_valid(true);
|
||||
insert_db_record(DBS_VALID, "members_settings", "members_settings_id_seq", xx);
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_WALLETS:
|
||||
logfmt(logINFO, "/account_calls()");
|
||||
return WrenchBoardMobileSendUserWallet(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_DELETEACC:
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_STRING(in, "reason", 2, 149, "(.*)");
|
||||
CVars xx;
|
||||
xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
xx["reason"] = in["reason"]; xx["reason"].set_valid(true);
|
||||
out["delete_id"] = insert_db_record(DBS_VALID, "members_delete", "members_delete_id_seq", xx);
|
||||
ret = PHP_API_OK;
|
||||
/*
|
||||
DO THE DELETE HERE NOW
|
||||
*/
|
||||
break;
|
||||
|
||||
}
|
||||
logfmt(logINFO, "/account_calls()");
|
||||
@@ -314,6 +372,56 @@ test();
|
||||
|
||||
#define PHP_API_TRANSFER_COMPLETE 200
|
||||
|
||||
long WrenchBoardMobileSendUserWallet(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "WrenchBoardMobileSendUserWallet()");
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT w.amount,c.*,w.amount AS current_balance FROM members_wallet w LEFT JOIN currency c ON c.code=w.currency WHERE w.member_id =%lu ORDER BY c.lorder DESC", in["member_id"].Long());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "amount_%05d", i);
|
||||
out[vname] = rec["amount"];
|
||||
snprintf(vname, sizeof (vname), "currency_%05d", i);
|
||||
out[vname] = rec["currency"];
|
||||
|
||||
// amount | id | code | description | symbol | action_type | lorder | current_balance
|
||||
snprintf(vname, sizeof (vname), "description_%05d", i);
|
||||
out[vname] = rec["description"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "symbol_%05d", i);
|
||||
out[vname] = rec["symbol"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "action_type_%05d", i);
|
||||
out[vname] = rec["action_type"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "code_%05d", i);
|
||||
out[vname] = rec["code"];
|
||||
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long WrenchBoardMobileSendUserWallet(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/WrenchBoardMobileSendUserWallet()");
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
long WrenchBoardMobileSendJobInterest(CVars in, CVars &out) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
try {
|
||||
@@ -363,6 +471,7 @@ long WrenchBoardMobileSendJobInterest(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
long WrenchBoardMobileSendMoney(CVars in, CVars &out){
|
||||
logfmt(logINFO, "long *************** WrenchBoardMobileSendMoney(CVars in, CVars out)");
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try{
|
||||
@@ -377,7 +486,7 @@ long WrenchBoardMobileSendMoney(CVars in, CVars &out){
|
||||
sprintf(send_trxid, "T%04lu", r1);
|
||||
|
||||
logfmt(logINFO, "Recipient ID =====() %lu",in["bankid"].Long() );
|
||||
out["sendmoney_message"] ="Processing...";
|
||||
out["sendmoney_message"] ="Processing...";
|
||||
|
||||
|
||||
REQ_LONG(in, "bankid", 1, -1);
|
||||
@@ -655,6 +764,7 @@ long WrenchReturnStartJobList(CVars in, CVars &out) {
|
||||
"WHERE m.status = 1 AND m.client_id=0 "
|
||||
"AND m.expire IS NOT NULL "
|
||||
"AND m.public_view = 1 "
|
||||
"AND m.expire > now() "
|
||||
"ORDER BY m.expire DESC LIMIT %lu", in["limit"].Long());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
@@ -672,6 +782,9 @@ long WrenchReturnStartJobList(CVars in, CVars &out) {
|
||||
snprintf(vname, sizeof (vname), "description_%05d", i);
|
||||
out[vname] = rec["description"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "expire_%05d", i);
|
||||
out[vname] = rec["expire"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||
out[vname] = rec["job_id"];
|
||||
}
|
||||
@@ -877,6 +990,7 @@ long WrenchUpdateAccountDescription(CVars in, CVars &out) {
|
||||
long WrenchUpdateAccountTerms(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "long WrenchUpdateAccountTerms(CVars in, CVars out)");
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
out["terms_update"] = "";
|
||||
try {
|
||||
long action_item = REQ_LONG(in, "action_item", 1, -1);
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
@@ -885,18 +999,15 @@ long WrenchUpdateAccountTerms(CVars in, CVars &out) {
|
||||
case ACCOUNT_AGREE_JOBS:
|
||||
pgsql_exec("UPDATE members SET post_jobs=NOW() WHERE id=%lu ", member_id);
|
||||
ret = PHP_API_OK;
|
||||
out["terms_update"] = "completed";
|
||||
break;
|
||||
|
||||
case ACCOUNT_AGREE_REFER:
|
||||
pgsql_exec("UPDATE members SET refer=NOW() WHERE id=%lu ", member_id);
|
||||
ret = PHP_API_OK;
|
||||
out["terms_update"] = "completed";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (bad_parameter) {
|
||||
out["status"] = "Invalid Parameters";
|
||||
}
|
||||
@@ -1128,6 +1239,46 @@ long SessionCheck(long uid, const char *sessionid, int create) {
|
||||
return 0L; // No route
|
||||
}
|
||||
|
||||
/*
|
||||
CREATE TABLE mobile_login (
|
||||
id SERIAL,
|
||||
member_id INT REFERENCES members(id) UNIQUE NOT NULL,
|
||||
added timestamp without time zone DEFAULT now(),
|
||||
updated timestamp without time zone DEFAULT now()
|
||||
);
|
||||
ALTER TABLE ONLY mobile_login
|
||||
ADD CONSTRAINT mobile_login_id_key UNIQUE (id);
|
||||
*/
|
||||
long LoginLogger( long member_id, long login_mode){
|
||||
CVars sess;
|
||||
long ret = 0;
|
||||
try {
|
||||
switch( login_mode ){
|
||||
case MOBILE_LOGIN:
|
||||
if (load_db_record(sess, "SELECT * FROM mobile_login WHERE member_id=%lu", member_id) > 0) {
|
||||
pgsql_exec("UPDATE mobile_login SET updated=NOW() WHERE member_id=%ld", member_id);
|
||||
}else{
|
||||
sess["member_id"] = member_id;
|
||||
sess["member_id"].set_valid(true);
|
||||
insert_db_record(DBS_VALID, "mobile_login", "mobile_login_id_seq", sess); //members_session_id_seq
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
} catch (bad_parameter) {
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
#define WEBSITE_LOGIN 1100
|
||||
#define MOBILE_LOGIN 1101
|
||||
#define FACEBOOK_LOGIN 1102
|
||||
#define APPLE_LOGIN 1103
|
||||
#define GOOGLE_LOGIN 1104
|
||||
*/
|
||||
|
||||
long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "LoginWrenchBoardAccount()");
|
||||
@@ -1135,6 +1286,8 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
REQ_STRING(in, "password", 5, 49, "(.*)");
|
||||
REQ_STRING(in, "sessionid", 4, 140, "(.*)");
|
||||
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
|
||||
// $in["login_mode"] = MOBILE_LOGIN;
|
||||
long login_mode = REQ_LONG(in, "login_mode", 0, -1);
|
||||
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
in["loc"] = loc;
|
||||
@@ -1146,6 +1299,13 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id , to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str());
|
||||
if (ret) {
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(out["member_id"].Long(),vw);
|
||||
|
||||
load_db_record( out, "SELECT amount AS balance FROM members_wallet WHERE member_id = %lu AND currency='%s' ", out["member_id"].Long(), vw["currency"].c_str());
|
||||
|
||||
|
||||
pgsql_exec("DELETE FROM members_session WHERE member_id=%ld ", out["member_id"].Long());
|
||||
// remove all existing session
|
||||
@@ -1158,6 +1318,7 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
pgsql_query("UPDATE members SET last_login = now() , loc='%s' WHERE id = %lu",loc, out["member_id"].Long());
|
||||
account_email(ACCOUNT_LOGIN_ALERT, out, out); // ALERT CUSTOMER OF LOGIN
|
||||
ret = PHP_LOGIN_OK;
|
||||
LoginLogger(out["member_id"].Long(),login_mode);
|
||||
} else {
|
||||
out["status"] = "Session check failed";
|
||||
}
|
||||
@@ -1174,6 +1335,9 @@ long LoginWrenchBoardFacebook(CVars in, CVars &out) {
|
||||
long res = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "LoginWrenchBoardFacebook()");
|
||||
REQ_STRING(in, "fb_id", 5, 49, "(.*)");
|
||||
in["external_idp_provider_id"] = in["fb_id"].Long();
|
||||
in["external_idp_provider"] = 1L; // Facebook
|
||||
in["fb_id"].set_valid(false);
|
||||
REQ_STRING(in, "email", 6, 49, "(.*)");
|
||||
OPTIONAL(in, "firstname") REQ_STRING(in, "firstname", 1, 49, "(.*)");
|
||||
else in["firstname"] = "";
|
||||
@@ -1181,8 +1345,53 @@ long LoginWrenchBoardFacebook(CVars in, CVars &out) {
|
||||
else in["lastname"] = "";
|
||||
REQ_STRING(in, "sessionid", 4, 40, "(.*)");
|
||||
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
|
||||
res = LoginWrenchBoardExternal(in, out);
|
||||
logfmt(logINFO, "/LoginWrenchBoardFacebook()");
|
||||
return res;
|
||||
}
|
||||
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
long LoginWrenchBoardGoogle(CVars in, CVars &out) {
|
||||
long res = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "LoginWrenchBoardGoogle()");
|
||||
REQ_STRING(in, "google_id", 5, 49, "(.*)");
|
||||
in["external_idp_provider_id"] = in["google_id"].Long();
|
||||
in["external_idp_provider"] = 2L; // Google
|
||||
in["google_id"].set_valid(false);
|
||||
REQ_STRING(in, "email", 6, 49, "(.*)");
|
||||
OPTIONAL(in, "firstname") REQ_STRING(in, "firstname", 1, 49, "(.*)");
|
||||
else in["firstname"] = "";
|
||||
OPTIONAL(in, "lastname") REQ_STRING(in, "lastname", 1, 49, "(.*)");
|
||||
else in["lastname"] = "";
|
||||
REQ_STRING(in, "sessionid", 4, 40, "(.*)");
|
||||
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
|
||||
res = LoginWrenchBoardExternal(in, out);
|
||||
logfmt(logINFO, "/LoginWrenchBoardGoogle()");
|
||||
return res;
|
||||
}
|
||||
|
||||
long LoginWrenchBoardApple(CVars in, CVars &out) {
|
||||
long res = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "LoginWrenchBoardApple()");
|
||||
REQ_STRING(in, "apple_id", 5, 49, "(.*)");
|
||||
in["external_idp_provider_id"] = in["apple_id"];
|
||||
in["external_idp_provider"] = 3L; // Apple
|
||||
in["apple_id"].set_valid(false);
|
||||
REQ_STRING(in, "email", 6, 49, "(.*)");
|
||||
OPTIONAL(in, "firstname") REQ_STRING(in, "firstname", 1, 49, "(.*)");
|
||||
else in["firstname"] = "";
|
||||
OPTIONAL(in, "lastname") REQ_STRING(in, "lastname", 1, 49, "(.*)");
|
||||
else in["lastname"] = "";
|
||||
REQ_STRING(in, "sessionid", 4, 40, "(.*)");
|
||||
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
|
||||
res = LoginWrenchBoardExternal(in, out);
|
||||
logfmt(logINFO, "/LoginWrenchBoardApple()");
|
||||
return res;
|
||||
}
|
||||
|
||||
long LoginWrenchBoardExternal(CVars in, CVars &out) {
|
||||
long res = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "LoginWrenchBoardExternal()");
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
in["loc"] = loc;
|
||||
in["loc"].set_valid(true);
|
||||
|
||||
@@ -1190,9 +1399,9 @@ long LoginWrenchBoardFacebook(CVars in, CVars &out) {
|
||||
if (ret > 0) {
|
||||
out["status"] = "Email is already registered";
|
||||
} else {
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id FROM members WHERE LOWER(email)=LOWER('%s') AND fb_id='%s'", in["email"].c_str(), in["fb_id"].c_str());
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id FROM members WHERE LOWER(email)=LOWER('%s') AND external_idp_provider_id='%s' AND external_idp_provider=%ld", in["email"].c_str(), in["external_idp_provider_id"].c_str(), in["external_idp_provider"].Long());
|
||||
if (ret > 0) {
|
||||
logfmt(logINFO, "FB account already exists");
|
||||
logfmt(logINFO, "External account already exists");
|
||||
} else {
|
||||
logfmt(logINFO, "Create new FB account");
|
||||
CVars xx;
|
||||
@@ -1206,8 +1415,10 @@ long LoginWrenchBoardFacebook(CVars in, CVars &out) {
|
||||
xx["email"].set_valid(true);
|
||||
xx["loc"] = in["loc"];
|
||||
xx["loc"].set_valid(true);
|
||||
xx["fb_id"] = in["fb_id"];
|
||||
xx["fb_id"].set_valid(true);
|
||||
xx["external_idp_provider"] = in["external_idp_provider"];
|
||||
xx["external_idp_provider"].set_valid(true);
|
||||
xx["external_idp_provider_id"] = in["external_idp_provider_id"];
|
||||
xx["external_idp_provider_id"].set_valid(true);
|
||||
out["member_id"] = insert_db_record(DBS_VALID, "members", "members_id_seq", xx);
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id FROM members WHERE id='%ld'", out["member_id"].Long());
|
||||
}
|
||||
@@ -1227,7 +1438,7 @@ long LoginWrenchBoardFacebook(CVars in, CVars &out) {
|
||||
}
|
||||
}
|
||||
}
|
||||
logfmt(logINFO, "/LoginWrenchBoardFacebook()");
|
||||
logfmt(logINFO, "/LoginWrenchBoardExternal()");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "pgsql_wrapper.h"
|
||||
#include "cfg.h"
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "payments.h"
|
||||
#include "account.h"
|
||||
|
||||
|
||||
@@ -508,12 +508,26 @@ long CreateWrenchBoardAccount(CVars in, CVars &out) {
|
||||
ret = insert_db_record(DBS_VALID, "members", "members_id_seq", x);
|
||||
|
||||
if (ret > 0) {
|
||||
|
||||
|
||||
out["member_id"] = ret;
|
||||
out["member_id"].set_valid(true);
|
||||
x["member_id"] = ret;
|
||||
x["member_id"].set_valid(true);
|
||||
x["pending_id"] = out["pending_id"];
|
||||
x["pending_id"].set_valid(true);
|
||||
|
||||
CVars u;
|
||||
load_db_record(u,"SELECT code AS currency FROM currency WHERE country = '%s'", x["country"].c_str() );
|
||||
logfmt(logINFO, " The Currency code = %s", u["currency"].c_str());
|
||||
out["wallet_id"] = CheckWallet( x["member_id"].Long() , u);
|
||||
logfmt(logINFO, " The wallet_id = %lu", out["wallet_id"].Long());
|
||||
|
||||
CVars vw;
|
||||
// vw["currency"] = "NAIRA"; // this will become a variable based on the country
|
||||
// vw["currency"].set_valid( true );
|
||||
// out["wallet_id"] = CheckWallet(out["member_id"].Long(),vw); // initial wallet
|
||||
|
||||
// - password already set pgsql_query("UPDATE members SET password = md5('%s') WHERE id = %lu",in["pass1"].c_str(),ret);
|
||||
pgsql_query("UPDATE members_pending SET status = 5 WHERE id = %lu", out["pending_id"].Long());
|
||||
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
// Twillo management toosl
|
||||
#include "clog.h"
|
||||
#include "cgi.h"
|
||||
#include "input.h"
|
||||
#include "wrenchboard_api.h"
|
||||
#include "cards.h"
|
||||
#include "email.h"
|
||||
#include "safestring.h"
|
||||
#include <string>
|
||||
#include "pgsql.h"
|
||||
#include "pgsql_wrapper.h"
|
||||
#include <curl/curl.h>
|
||||
#include "account.h"
|
||||
#include "reco_engine.h"
|
||||
|
||||
#include "twilo.h"
|
||||
|
||||
long createMembercard(CVars in, CVars &out);
|
||||
long card_calls(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "card_calls()");
|
||||
out["result"] = "YES I GET TO BACK END";
|
||||
long action = REQ_LONG(in, "action", 0, -1);
|
||||
CVars x;
|
||||
long ret = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
const PGresult *res;
|
||||
logfmt(logINFO, "action = %ld", action);
|
||||
//test();
|
||||
|
||||
switch (action) {
|
||||
case WRENCHBOARD_CARDS_GETCARDLIST:
|
||||
return getMembercards(in, out);
|
||||
break;
|
||||
case WRENCHBOARD_CARDS_CREATECARD:
|
||||
return createMembercard(in, out);
|
||||
break;
|
||||
case WRENCHBOARD_CARDS_UPDATECARD:
|
||||
return 0; //CompleteMobileAccountCreation(in, out);
|
||||
break;
|
||||
}
|
||||
logfmt(logINFO, "/card_calls()");
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
CREATE TABLE members_cards (
|
||||
id SERIAL,
|
||||
card_type VARCHAR(15) REFERENCES card_type( code ) NOT NULL,
|
||||
card_style VARCHAR(15) REFERENCES card_style( style ) NOT NULL,
|
||||
card_icon VARCHAR(15) REFERENCES card_icon( icon ) NOT NULL,
|
||||
member_id INT REFERENCES members(id) NOT NULL,
|
||||
title VARCHAR(35) NOT NULL,
|
||||
description VARCHAR(55) NOT NULL,
|
||||
blog_id INT DEFAULT 0,
|
||||
added timestamp without time zone DEFAULT now(),
|
||||
expire timestamp without time zone DEFAULT now(),
|
||||
active timestamp DEFAULT NULL,
|
||||
loc INET,
|
||||
status INT DEFAULT 0
|
||||
);
|
||||
*/
|
||||
long createMembercard(CVars in, CVars &out){
|
||||
CVars y;
|
||||
long card_id = PHP_API_BAD_PARAM;
|
||||
try {
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_STRING(in, "card_type", 5, 14, "(.*)");
|
||||
REQ_STRING(in, "card_style", 2, 14, "(.*)");
|
||||
REQ_STRING(in, "card_icon", 2, 14, "(.*)");
|
||||
REQ_STRING(in, "title", 5, 34, "(.*)");
|
||||
REQ_STRING(in, "description", 5, 54, "(.*)");
|
||||
OPTIONAL(in, "blog_id") REQ_LONG(in, "blog_id", 1, -1);
|
||||
OPTIONAL(in, "offer_id") REQ_LONG(in, "offer_id", 1, -1);
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
|
||||
bool continue_insert = false;
|
||||
//const PGresult *res = pgsql_query("SELECT id FROM members_cards WHERE member_id=%lu AND card_type = '%s'", in["member_id"].Long(), in["card_type"].c_str());
|
||||
if (load_db_record(y, "SELECT * FROM members_cards WHERE member_id=%lu AND card_type = '%s' LIMIT 1", in["member_id"].Long(), in["card_type"].c_str()) > 0) {
|
||||
card_id = y["id"].Long();
|
||||
pgsql_exec("UPDATE members_cards SET active=NOW(),status =1,expire = now()+'2 days' WHERE member_id=%lu AND card_type = '%s' AND id = %lu", member_id,in["card_type"].c_str(),card_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue_insert= true;
|
||||
}
|
||||
|
||||
if(continue_insert){
|
||||
CVars x;
|
||||
x["member_id"] = member_id;
|
||||
x["member_id"].set_valid(true);
|
||||
x["card_type"] = in["card_type"];
|
||||
x["card_type"].set_valid(true);
|
||||
x["card_style"] = in["card_style"];
|
||||
x["card_style"].set_valid(true);
|
||||
x["card_icon"] = in["card_icon"];
|
||||
x["card_icon"].set_valid(true);
|
||||
x["title"] = in["title"];
|
||||
x["title"].set_valid(true);
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
x["blog_id"] = in["blog_id"];
|
||||
x["blog_id"].set_valid(true);
|
||||
x["offer_id"] = in["offer_id"];
|
||||
x["offer_id"].set_valid(true);
|
||||
x["loc"] = loc;
|
||||
x["loc"].set_valid(true);
|
||||
x["status"] = "1";
|
||||
x["status"].set_valid(true);
|
||||
|
||||
card_id = insert_db_record(DBS_VALID, "members_cards", "members_cards_id_seq", x);
|
||||
pgsql_exec("UPDATE members_cards SET active = now(),expire = now()+'2 days' WHERE id = %lu",card_id);
|
||||
// pgsql_exec("UPDATE members_cards SET expire = now()+'2 days' WHERE id = %lu",card_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long createMembercard");
|
||||
}
|
||||
logfmt(logINFO, "/createMembercard()");
|
||||
return card_id;
|
||||
}
|
||||
long getMembercards(CVars in, CVars &out){
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT * FROM members_cards WHERE member_id =%lu AND expire > now() AND status = 1 ORDER BY added DESC", in["member_id"].Long());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "assign_id_%05d", i);
|
||||
out[vname] = rec["id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "title_%05d", i);
|
||||
out[vname] = rec["title"];
|
||||
|
||||
// amount | id | code | description | symbol | action_type | lorder | current_balance
|
||||
snprintf(vname, sizeof (vname), "description_%05d", i);
|
||||
out[vname] = rec["description"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_type_%05d", i);
|
||||
out[vname] = rec["card_type"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_style_%05d", i);
|
||||
out[vname] = rec["card_style"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_icon_%05d", i);
|
||||
out[vname] = rec["card_icon"];
|
||||
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long getMembercards(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/getMembercards()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
['title'=>'This is your coupon',
|
||||
'description'=>'This is the description of the description',
|
||||
'card_type'=>'COUPON',
|
||||
'card_style' =>'card1',
|
||||
'card_icon' =>'icon1',
|
||||
'assign_id'=> 0,
|
||||
'Nigeria'],
|
||||
['title'=>'A Recommended S
|
||||
*/
|
||||
@@ -0,0 +1,256 @@
|
||||
// Account management toosl
|
||||
#include "clog.h"
|
||||
#include "cgi.h"
|
||||
#include "input.h"
|
||||
#include "wrenchboard_api.h"
|
||||
#include "coupons.h"
|
||||
#include "email.h"
|
||||
#include "safestring.h"
|
||||
#include <string>
|
||||
#include "pgsql.h"
|
||||
#include "pgsql_wrapper.h"
|
||||
#include "cfg.h"
|
||||
#include <curl/curl.h>
|
||||
#include "smoney.h"
|
||||
#include "account_mngt.h"
|
||||
#include "creditcards.h"
|
||||
#include "payments.h"
|
||||
#include "reco_engine.h"
|
||||
|
||||
/*
|
||||
#define WRENCHBOARD_COUPON_START 85000
|
||||
|
||||
#define WRENCHBOARD_COUPON_CREATE 85010
|
||||
#define WRENCHBOARD_COUPON_ACTIVATE 85015
|
||||
#define WRENCHBOARD_COUPON_REDEEM 85020
|
||||
|
||||
#define WRENCHBOARD_COUPON_MEMLIST 85025
|
||||
#define WRENCHBOARD_COUPON_PENDLIST 85030
|
||||
|
||||
#define WRENCHBOARD_COUPON_END 85999
|
||||
****** */
|
||||
long MemberCouponList( CVars in, CVars &out );
|
||||
|
||||
|
||||
long coupons_calls(CVars in, CVars &out){
|
||||
logfmt(logINFO, "coupons_calls()");
|
||||
out["result"] = "YES I GET TO BACK END";
|
||||
long action = REQ_LONG(in, "action", 0, -1);
|
||||
CVars x;
|
||||
long ret = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
const PGresult *res;
|
||||
logfmt(logINFO, "action = %ld", action);
|
||||
|
||||
|
||||
switch (action) {
|
||||
case WRENCHBOARD_COUPON_CREATE:
|
||||
return CreateCoupon(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_COUPON_ACTIVATE:
|
||||
return AssignCoupon(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_COUPON_REDEEM:
|
||||
return RedeemCoupon(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_COUPON_MEMLIST: // member list
|
||||
in["mode"] = 100; in["mode"].set_valid( true );
|
||||
return MemberCouponList(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_COUPON_PENDLIST: // member list
|
||||
in["mode"] = 200; in["mode"].set_valid( true );
|
||||
return MemberCouponList(in, out);
|
||||
break;
|
||||
|
||||
}
|
||||
logfmt(logINFO, "/coupons_calls()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
long RedeemCoupon( CVars in, CVars &out ){
|
||||
logfmt(logINFO, "long RedeemCoupon( CVars in, CVars &out )()");
|
||||
long ret = 0;
|
||||
|
||||
const PGresult *res;
|
||||
|
||||
try{
|
||||
REQ_STRING(in, "code", 5, 49, "(.*)");
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "code_id", 1, -1);
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
|
||||
long payment_id = WrenchMemberCouponPayment( in, out );
|
||||
|
||||
|
||||
} catch (bad_parameter) {
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// for coupon table
|
||||
#define COUPON_ALLOC_STARTED 100
|
||||
#define COUPON_ALLOC_ALLOCATED 200
|
||||
|
||||
|
||||
// for allocation table
|
||||
#define COUPON_ACTIVE 500
|
||||
|
||||
|
||||
long AssignCoupon( CVars in, CVars &out ){
|
||||
long ret = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
const PGresult *res;
|
||||
|
||||
try{
|
||||
|
||||
REQ_STRING(in, "code", 5, 49, "(.*)");
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
long coupon_id = 0;
|
||||
|
||||
res = pgsql_query("SELECT * FROM coupons WHERE code='%s' AND status = 0", in["code"].c_str());
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
pgsql_exec("UPDATE coupons SET status=%lu WHERE code='%s' AND status=%lu",COUPON_ALLOC_ALLOCATED,in["code"].c_str(),COUPON_ALLOC_STARTED);
|
||||
// Now We start
|
||||
/*
|
||||
CREATE TABLE coupons_allocation (
|
||||
id SERIAL,
|
||||
code VARCHAR(15) UNIQUE REFERENCES coupons( code ) NOT NULL,
|
||||
amount INT DEFAULT 0,
|
||||
member_id INT REFERENCES members(id) NOT NULL,
|
||||
added timestamp without time zone DEFAULT now(),
|
||||
active timestamp DEFAULT NULL,
|
||||
loc INET,
|
||||
status INT DEFAULT 0
|
||||
);
|
||||
|
||||
wrenchboard=> SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.email,m.firstname FROM coupons_allocation ca LEFT JOIN members m ON m.id=ca.member_id;
|
||||
code | amount | email | firstname
|
||||
-------------+--------+----------------------+-----------
|
||||
1M5XXXXXXXX | 0 | ses66181+1@gmail.com | Olusesan
|
||||
*/
|
||||
CVars xx;
|
||||
xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
xx["code"] = rec["code"]; xx["code"].set_valid(true);
|
||||
xx["amount"] = rec["amount"]; xx["amount"].set_valid(true);
|
||||
xx["status"] = COUPON_ACTIVE; xx["status"].set_valid(true);
|
||||
|
||||
coupon_id = insert_db_record(DBS_VALID, "coupons_allocation", "coupons_allocation_id_seq", xx);
|
||||
if (coupon_id > 0 ){
|
||||
CVars inx;
|
||||
inx["member_id"] = xx["member_id"]; inx["member_id"].set_valid(true);
|
||||
inx["coupon_id"] = coupon_id; inx["coupon_id"].set_valid(true);
|
||||
// mark status on coupon
|
||||
pgsql_exec("UPDATE coupons SET active=now(), status=%lu WHERE code='%s' AND status=0",COUPON_ALLOC_STARTED,in["code"].c_str());
|
||||
// send allocation email
|
||||
coupon_email(WRENCHBOARD_COUPON_ACTIVATE, inx, out);
|
||||
recommendation_engine(RECOMMEND_COUPON , inx, out); // trigger the card interaction in apps
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
CVars xx;
|
||||
// xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
// xx["pref_id"] = in["pref_id"]; xx["pref_id"].set_valid(true);
|
||||
// xx["status"] = in["status"]; xx["status"].set_valid(true);
|
||||
// insert_db_record(DBS_VALID, "members_settings", "members_settings_id_seq", xx);
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
|
||||
|
||||
} catch (bad_parameter) {
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
long MemberCouponList( CVars in, CVars &out ){
|
||||
logfmt(logINFO, "MemberCouponList()");
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
long mode = REQ_LONG(in, "mode", 1, -1);
|
||||
|
||||
in["active_q"] = "ca.active IS NOT NULL";
|
||||
if ( mode == 200 ){
|
||||
in["active_q"] = "ca.active IS NULL";
|
||||
}
|
||||
in["active_q"].set_valid( true );
|
||||
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
|
||||
res = pgsql_query("SELECT id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status FROM coupons_allocation ca WHERE ca.member_id = %lu AND %s ORDER BY ca.id DESC", in["member_id"].Long(),in["active_q"].c_str());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "coupon_id_%05d", i);
|
||||
out[vname] = rec["coupon_id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "code_%05d", i);
|
||||
out[vname] = rec["code"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "added_%05d", i);
|
||||
out[vname] = rec["added"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "amount_%05d", i);
|
||||
out[vname] = rec["amount"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "status_%05d", i);
|
||||
out[vname] = rec["status"];
|
||||
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long MemberCouponList(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/MemberCouponList()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
long CreateCoupon( CVars in, CVars &out ){
|
||||
long ret = 0;
|
||||
logfmt(logINFO, "CreateCoupon()");
|
||||
REQ_STRING(in, "code", 5, 49, "(.*)");
|
||||
REQ_LONG(in, "amount", 1, -1);
|
||||
CVars x;
|
||||
x["code"] = in["code"];
|
||||
x["code"].set_valid(true);
|
||||
x["amount"] = in["amount"];
|
||||
x["amount"].set_valid(true);
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
|
||||
ret = insert_db_record(DBS_VALID, "coupons", "coupons_id_seq", x);
|
||||
if (ret > 0) {
|
||||
x["coupon_id"] = ret;
|
||||
x["coupon_id"].set_valid(true);
|
||||
|
||||
// account_email(ACCOUNT_CONTACT_ALERT, x, out);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -22,14 +22,14 @@ long save_creditcard(CVars in, CVars &out) {
|
||||
try {
|
||||
CVars v;
|
||||
|
||||
REQ_LONG(in, "member_id", 1, -1); // Does not make any sence without member persitence
|
||||
REQ_LONG(in, "member_id", 1, -1); // Does not make any sence without member persitence
|
||||
REQ_STRING(in, "cardnumber", 12, 16, "(.*)"); //4111111111111111"
|
||||
REQ_STRING(in, "cvc", 3, 4, "(.*)"); //234"
|
||||
REQ_LONG(in, "paymenttype", 0, -1);
|
||||
REQ_STRING(in, "exp_month", 2, 2, "(.*)");
|
||||
REQ_STRING(in, "exp_year", 4, 4, "(.*)");
|
||||
|
||||
if ( load_db_record( v, "SELECT a.id AS member_id,a.firstname,a.lastname,'' AS street1,'' AS street2,a.city,'' AS postal,a.state,a.country FROM members a WHERE a.id=%lu", in["member_id"].Long()) > 0) {
|
||||
if ( load_db_record( v, "SELECT a.id AS member_id,a.firstname,a.lastname,'' AS street1,'' AS street2,a.city,zip_code AS postal,a.state,a.country FROM members a WHERE a.id=%lu", in["member_id"].Long()) > 0) {
|
||||
|
||||
logfmt(logDEBUG, "Loaded member %s %s", v["firstname"].c_str(), v["lastname"].c_str());
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ long alert_email(long mailtype, CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
switch (mailtype) {
|
||||
|
||||
case WRB_CRONJOB_SIGNUP_ALERT:
|
||||
@@ -57,10 +57,10 @@ long SendmarketMessage(CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
// form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
vars2form(in, form);
|
||||
|
||||
in["server_name"] = "https://www.wrenchboard.com";
|
||||
in["server_name"] = "https://dashboard.wrenchboard.com";
|
||||
|
||||
int c = 0;
|
||||
|
||||
@@ -144,7 +144,7 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
try {
|
||||
|
||||
@@ -157,7 +157,7 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
if (load_db_record(x, "SELECT *,email as email2,to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
|
||||
|
||||
|
||||
in["server_name"] = "https://www.wrenchboard.com";
|
||||
in["server_name"] = "https://dashboard.wrenchboard.com";
|
||||
|
||||
int c = 0;
|
||||
|
||||
@@ -210,7 +210,11 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case WRB_CRONJOB_PENDOFFER_ALERT:
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", in["email"].c_str());
|
||||
form.Email("REMINDER/offer_pending_reminder.mailfile");
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@@ -222,6 +226,52 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long coupon_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
//REQ_LONG( in, "member_id", 1, -1 );
|
||||
CVars x;
|
||||
C_CGI_Form form("", "");
|
||||
|
||||
CGIList * inv_list = new CGIList(&form, "inv_items");
|
||||
char listing_items[1024];
|
||||
const PGresult *res;
|
||||
bool exclude_email = true;
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
try {
|
||||
|
||||
switch (mailtype) {
|
||||
/*
|
||||
|
||||
wrenchboard=> SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.email,m.firstname FROM coupons_allocation ca LEFT JOIN members m ON m.id=ca.member_id;
|
||||
code | amount | email | firstname
|
||||
-------------+--------+----------------------+-----------
|
||||
1M5XXXXXXXX | 0 | ses66181+1@gmail.com | Olusesan
|
||||
*/
|
||||
case WRENCHBOARD_COUPON_ACTIVATE:
|
||||
REQ_LONG(in, "coupon_id", 1, -1);
|
||||
if (load_db_record(x, "SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.email,m.firstname FROM coupons_allocation ca LEFT JOIN members m ON m.id=ca.member_id WHERE ca.id = %lu ", in["coupon_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", x["email"].c_str());
|
||||
form.Email("COUPON/member_coupon_allocated.mailfile");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
long account_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
//REQ_LONG( in, "member_id", 1, -1 );
|
||||
@@ -231,11 +281,12 @@ long account_email(long mailtype, CVars in, CVars &out) {
|
||||
CGIList * inv_list = new CGIList(&form, "inv_items");
|
||||
char listing_items[1024];
|
||||
const PGresult *res;
|
||||
|
||||
bool exclude_email = true;
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
|
||||
try {
|
||||
|
||||
@@ -272,10 +323,17 @@ long account_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
case ACCOUNT_LOGIN_ALERT:
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
if (load_db_record(x, "SELECT *,email as email2,to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
|
||||
|
||||
// testing exclusion first
|
||||
res = pgsql_query("SELECT * FROM members_settings WHERE member_id = %lu AND pref_id='S0001' AND status=100", in["member_id"].Long());
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
exclude_email = false;
|
||||
}
|
||||
|
||||
if (!exclude_email && load_db_record(x, "SELECT *,email as email2,to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
|
||||
|
||||
|
||||
in["server_name"] = "https://www.wrenchboard.com";
|
||||
in["server_name"] = "https://dashboard.wrenchboard.com";
|
||||
|
||||
int c = 0;
|
||||
|
||||
@@ -303,7 +361,7 @@ long account_email(long mailtype, CVars in, CVars &out) {
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
sprintf(listing_items, "<TR><td style='background-color:#%s'><a href='%s/plb/viewjob/%s'>%s</a> - %s<br><b>Duration:</b>%s Day(s)</td></TR>", in["color"].c_str(), in["server_name"].c_str(), rec["offer_code"].c_str(), rec["title"].c_str(), rec["description"].c_str(), rec["timeline_days"].c_str());
|
||||
sprintf(listing_items, "<TR><td style='background-color:#%s; font-size:12px;'><a href='%s/plb/viewjob/%s'>%s</a> - %s<br><b>Duration:</b>%s Day(s)</td></TR>", in["color"].c_str(), in["server_name"].c_str(), rec["offer_code"].c_str(), rec["title"].c_str(), rec["description"].c_str(), rec["timeline_days"].c_str());
|
||||
inv_list->LetStr("pin", listing_items);
|
||||
inv_list->CloseElement();
|
||||
//<hr size=1 color=#FF0000>
|
||||
@@ -321,6 +379,7 @@ long account_email(long mailtype, CVars in, CVars &out) {
|
||||
break;
|
||||
|
||||
case ACCOUNT_PASSWORD_RESET:
|
||||
|
||||
REQ_LONG(in, "password_reset_id", 1, -1);
|
||||
if (load_db_record(x, "select p.*,m.firstname,m.lastname,m.email, "
|
||||
" TO_CHAR(expired :: TIMESTAMP, 'Day Mon dd, yyyy HH:MI AM') AS long_expired , "
|
||||
@@ -328,6 +387,7 @@ long account_email(long mailtype, CVars in, CVars &out) {
|
||||
" FROM password_reset p "
|
||||
" LEFT JOIN members m ON m.id =p.member_id WHERE p.id = %lu ", in["password_reset_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("server_name", server_name);
|
||||
form.Email("ACCOUNT/member_resetpass.mailfile");
|
||||
}
|
||||
break;
|
||||
@@ -379,7 +439,7 @@ long job_email(long mailtype, CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
switch (mailtype) {
|
||||
|
||||
case WRENCHBOARD_JOB_REPLY_QUESTION:
|
||||
@@ -417,7 +477,7 @@ long job_email(long mailtype, CVars in, CVars &out) {
|
||||
vars2form(y, form);
|
||||
// FOR CRON JOBS SET SERVER NAME
|
||||
form.LetStr("preview_count", in["preview_count"].c_str());
|
||||
form.LetStr("server_name", "www.wrenchboard.com");
|
||||
form.LetStr("server_name", "dashboard.wrenchboard.com");
|
||||
vars2form(x, form);
|
||||
form.LetStr("subject", "Completed Task Processing Past Due");
|
||||
form.LetStr("email", y["email"].c_str());
|
||||
@@ -431,7 +491,7 @@ long job_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
if (load_db_record(x, "SELECT m.firstname,m.email,mj.title,c.* FROM members_jobs_contract c LEFT JOIN members m ON m.id=c.client_id LEFT JOIN members_jobs mj ON mj.id = c.job_id WHERE c.id=%lu AND c.due_remind IS NULL", in["contract_id"].Long())) {
|
||||
// FOR CRON JOBS SET SERVER NAME
|
||||
form.LetStr("server_name", "www.wrenchboard.com");
|
||||
form.LetStr("server_name", "dashboard.wrenchboard.com");
|
||||
vars2form(x, form);
|
||||
form.LetStr("subject", "Task Due Date Approaching");
|
||||
form.LetStr("email", x["email"].c_str());
|
||||
@@ -662,7 +722,7 @@ long sendmoney_email(long mailtype, CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
long sendmoney_id = REQ_LONG(in, "sendmoney_id", 1, -1);
|
||||
logfmt(logINFO, "sendmoney_email() sendmoney_id = %lu", sendmoney_id);
|
||||
@@ -723,7 +783,7 @@ long project_email(long mailtype, CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
|
||||
load_db_record(out, "SELECT ms.firstname AS member_firstaname,ms.email AS member_email, j.*,js.title,js.description,js.price AS amount FROM members_jobs_contract j LEFT JOIN members_jobs js ON js.id=j.job_id LEFT JOIN members ms ON ms.id=j.member_id WHERE j.id=%lu", contract_id);
|
||||
@@ -835,7 +895,7 @@ long test_email(CVars in, CVars &out) {
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
if (load_db_record(x, "select p.*,m.firstname,m.lastname,m.email from password_reset p LEFT JOIN members m ON m.id =p.member_id WHERE p.id = 8 ")) {
|
||||
vars2form(x, form);
|
||||
@@ -897,7 +957,7 @@ long SignupPendingAlertMailfile(CVars in) {
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("subject", "WrenchBoard Contact Us Alert");
|
||||
|
||||
if (load_db_record(x, "SELECT *,email as email2 FROM members_pending WHERE id = %lu ", in["pending_id"].Long())) {
|
||||
if (load_db_record(x, "SELECT *,email as email2,to_char(expire, 'Day Mon dd, yyyy HH:MI AM') AS expire,to_char(added, 'Day Mon dd, yyyy HH:MI AM') AS added FROM members_pending WHERE id = %lu ", in["pending_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", out["alertemail"].c_str());
|
||||
form.Email("ALERT/alert_signup.mailfile");
|
||||
@@ -971,16 +1031,16 @@ long AccountPendingMail(CVars in) //TESTED
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Experts with Clients");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
if (load_db_record(x, "SELECT * FROM members_pending WHERE id = %lu ", in["pending_id"].Long())) {
|
||||
if (load_db_record(x, "SELECT *,to_char(expire, 'Day Mon dd, yyyy HH:MI AM') AS expire FROM members_pending WHERE id = %lu ", in["pending_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", x["email"].c_str());
|
||||
if (x["signup_random"] != "" && x["signup_random"].Long() > 0 && in["mobile_email"].Long() == 100) {
|
||||
form.Email("ACCOUNT/member_pending_mobile.mailfile");
|
||||
|
||||
} else {
|
||||
form.Email("ACCOUNT/member_pending.mailfile");
|
||||
form.Email("ACCOUNT/member_pending_mobile.mailfile");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,8 +1048,6 @@ long AccountPendingMail(CVars in) //TESTED
|
||||
in["message"] = "Account Pending";
|
||||
in["title"].set_valid(true);
|
||||
in["message"].set_valid(true);
|
||||
//AlertActions(in);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1001,7 +1059,7 @@ long WelcomeAccountMail(CVars in) // TESTED
|
||||
C_CGI_Form form("", "");
|
||||
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
|
||||
if (load_db_record(x, "SELECT * FROM members WHERE id = %lu ", in["member_id"].Long())) {
|
||||
@@ -1020,16 +1078,30 @@ long WelcomeAccountMail(CVars in) // TESTED
|
||||
|
||||
long JobAddedMail(CVars in) //TESTED
|
||||
{
|
||||
|
||||
|
||||
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "job_id", 1, -1);
|
||||
CVars x;
|
||||
CVars out;
|
||||
C_CGI_Form form("", "");
|
||||
const PGresult *res;
|
||||
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
|
||||
// testing exclusion first
|
||||
res = pgsql_query("SELECT * FROM members_settings WHERE member_id = %lu AND pref_id='S0008' AND status=100", in["member_id"].Long());
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
|
||||
}
|
||||
else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (load_db_record(x, "SELECT j.*,j.title as title2,m.email,m.firstname FROM members_jobs j LEFT JOIN members m ON m.id = j.member_id WHERE j.id = %lu AND j.member_id = %lu", in["job_id"].Long(), in["member_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", x["email"].c_str());
|
||||
@@ -1040,7 +1112,7 @@ long JobAddedMail(CVars in) //TESTED
|
||||
vars2form(x, form2);
|
||||
out["alertemail"] = CfgReadChar("transnotif.contact");
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form2.LetStr("server_name", server_name);
|
||||
form2.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form2.LetStr("site_name", "WrenchBoard");
|
||||
in["title"] = "Job Added Alert";
|
||||
in["message"] = "Job Added Alert";
|
||||
@@ -1063,7 +1135,7 @@ long CreateWrenchBoardGroupMail(CVars in) {
|
||||
C_CGI_Form form("", "");
|
||||
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
|
||||
if (load_db_record(x, "select g.*,m.email,m.firstname,m.lastname from members_groups g LEFT JOIN members m ON m.id = g.member_id WHERE g.id = %lu ", in["group_id"].Long())) {
|
||||
@@ -1082,7 +1154,7 @@ long GroupCreateMemberMail(CVars in) {
|
||||
C_CGI_Form form("", "");
|
||||
|
||||
char * server_name = getenv("SERVER_NAME");
|
||||
form.LetStr("server_name", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
|
||||
if (load_db_record(x, "SELECT gm.*,m.*,e.email FROM group_members gm LEFT JOIN members_groups m ON m.id=gm.group_id LEFT JOIN members e ON e.id=gm.member_id WHERE gm.id = %lu", in["group_member_id"].Long())) {
|
||||
@@ -1117,7 +1189,7 @@ long EmailCustBalUpdt(CVars in) {
|
||||
CVars x;
|
||||
|
||||
vars2form(x, form);
|
||||
form.LetStr("site", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.Email("test.mailfile");
|
||||
return 0;
|
||||
}
|
||||
@@ -1209,7 +1281,7 @@ long StartPassResetEmail(CVars in) {
|
||||
vars2form(x, form);
|
||||
|
||||
|
||||
form.LetStr("site", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
/*
|
||||
CREATE TABLE lostpass (
|
||||
id serial NOT NULL,
|
||||
@@ -1245,7 +1317,7 @@ long CompletePassResetEmail(CVars in) {
|
||||
vars2form(x, form);
|
||||
|
||||
|
||||
form.LetStr("site", server_name);
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
|
||||
|
||||
|
||||
@@ -1296,7 +1368,7 @@ long CustomerAirSalePayment(CVars in) {
|
||||
form.LetStr("paymode", "Payment with card");
|
||||
}
|
||||
|
||||
|
||||
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
|
||||
form.LetStr("site", server_name);
|
||||
form.LetStr("email", x["email2"].c_str());
|
||||
form.Email("topup_payment.mailfile"); //customer notification
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "cfg.h"
|
||||
#include <curl/curl.h>
|
||||
#include "common_tool.h"
|
||||
#include "reco_engine.h"
|
||||
|
||||
long WrenchJobsQuestion(CVars in, CVars &out);
|
||||
long WrenchMarketInterestQuestion(CVars in, CVars &out);
|
||||
@@ -171,14 +172,14 @@ long WrenchMarketInterestQuestion(CVars in, CVars &out) {
|
||||
ret = PHP_CREATED_OK;
|
||||
|
||||
} catch (bad_parameter) {
|
||||
out["log_status"] = "Invalid Log Action";
|
||||
out["log_status"] = "Error WrenchMarketInterestQuestion";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
long WrenchJobsQuestion(CVars in, CVars &out) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
out = in;
|
||||
//out = in;
|
||||
try {
|
||||
out["status"] = "Recieved";
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
@@ -207,8 +208,14 @@ long WrenchJobsQuestion(CVars in, CVars &out) {
|
||||
x["memo"].set_valid(true);
|
||||
long msg_id = insert_db_record(DBS_VALID, "members_messages", "members_messages_id_seq", x);
|
||||
if (msg_id > 0) {
|
||||
|
||||
x["msg_id"] = msg_id;
|
||||
x["msg_id"].set_valid(true);
|
||||
//x["offer_id"] = out["offer_id"];
|
||||
//x["offer_id"].set_valid(true);
|
||||
job_email(WRENCHBOARD_JOB_SEND_QUESTION, x, out);
|
||||
}
|
||||
out = x;
|
||||
out["status"] = "";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -500,9 +507,9 @@ TABLE "jobs_contract_message" CONSTRAINT "jobs_contract_message_contract_fkey" F
|
||||
break;
|
||||
|
||||
case OFFER_EXPIRE: // note status 4
|
||||
logfmt(logINFO, "WrenchConcludeJobsOffer() rc=OFFER_CANCEL");
|
||||
if (load_db_record(out, " SELECT id AS offer_id,* FROM members_jobs_offer WHERE offer_code ='%s' AND status = 1", in["offer_code"].c_str())) {
|
||||
// valid load of offer needed
|
||||
logfmt(logINFO, "WrenchConcludeJobsOffer() rc=OFFER_EXPIRE");
|
||||
if (load_db_record(out, "SELECT id AS offer_id,* FROM members_jobs_offer WHERE offer_code ='%s' AND status = 1", in["offer_code"].c_str())) {
|
||||
// valid load of offer needed
|
||||
CVars y;
|
||||
y["member_id"] = out["member_id"];
|
||||
y["member_id"].set_valid(true);
|
||||
@@ -514,7 +521,6 @@ TABLE "jobs_contract_message" CONSTRAINT "jobs_contract_message_contract_fkey" F
|
||||
y["dir"].set_valid(true);
|
||||
y["payment_id"] = out["payment_id"];
|
||||
y["payment_id"].set_valid(true);
|
||||
|
||||
if (WrenchRefundoffer(y, out) == PHP_CREATED_OK) {
|
||||
pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", out["offer_id"].Long(), in["offer_code"].c_str());
|
||||
// REFUND THE MONEY
|
||||
@@ -660,6 +666,7 @@ long WrenchSendJobsOfferIndividual(CVars in, CVars &out) {
|
||||
job_email(JOBS_INDIVIDUAL_OFFER_MAIL, x, out);
|
||||
load_db_record(out, "SELECT *,id AS offer_id FROM members_jobs_offer WHERE id = %lu ", offer_id);
|
||||
out["status"] = "Offer sent to recipient";
|
||||
recommendation_engine(RECOMMEND_OFFERS , y, out); // trigger the card interaction in apps
|
||||
|
||||
} else {
|
||||
out["status"] = "Unable to create this offer";
|
||||
@@ -699,7 +706,7 @@ long WrenchSendJobsOfferPublic(CVars in, CVars &out) {
|
||||
CVars x;
|
||||
CVars y;
|
||||
CVars z;
|
||||
|
||||
CVars u;
|
||||
|
||||
|
||||
// we need this job id
|
||||
@@ -710,6 +717,10 @@ long WrenchSendJobsOfferPublic(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
load_db_record(u,"SELECT code AS currency FROM currency WHERE country = '%s'", y["country"].c_str() );
|
||||
logfmt(logINFO, " The Currency code = %s", u["currency"].c_str());
|
||||
long wallet_id = CheckWallet( in["member_id"].Long() , u);
|
||||
logfmt(logINFO, " The wallet_id = %lu", wallet_id);
|
||||
|
||||
if (y["price"].Long() > 0) {
|
||||
} else {
|
||||
@@ -720,20 +731,20 @@ long WrenchSendJobsOfferPublic(CVars in, CVars &out) {
|
||||
// Now do you have money to do this ....
|
||||
z["balance"] = "0";
|
||||
z["balance"].set_valid(true); // just initialize it
|
||||
if (load_db_record(z, " SELECT * FROM members WHERE id =%lu AND balance >= %lu", in["member_id"].Long(), y["price"].Long())) {
|
||||
if (load_db_record(z, " SELECT * FROM members_wallet WHERE id =%lu AND member_id =%lu AND amount >= %lu",wallet_id, in["member_id"].Long(), y["price"].Long())) {
|
||||
|
||||
} else {
|
||||
out["status"] = "Insuficient balancde to create this offer";
|
||||
logfmt(logINFO, "Price2 = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
out["status"] = "Insufficient balance to create this offer";
|
||||
logfmt(logINFO, "Price2 = %lu Balance = %lu", y["price"].Long(), z["amount"].Long());
|
||||
}
|
||||
|
||||
if (y["price"].Long() >= z["balance"].Long()) {
|
||||
out["status"] = "Insuficient balancde to create this offer";
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
if (y["price"].Long() >= z["amount"].Long()) {
|
||||
out["status"] = "Insufficient balance to create this offer";
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["amount"].Long());
|
||||
return ret;
|
||||
}
|
||||
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["amount"].Long());
|
||||
|
||||
try {
|
||||
// if ( load_db_record( out, "SELECT count(id) AS duplicate_name FROM members_jobs_offer WHERE LOWER(group_name)=LOWER('%s') AND member_id =%lu AND status = 1",in["group_name"].c_str(), in["member_id"].Long() ))
|
||||
@@ -805,6 +816,7 @@ long WrenchSendJobsOfferGroup(CVars in, CVars &out) {
|
||||
CVars x;
|
||||
CVars y;
|
||||
CVars z;
|
||||
CVars u;
|
||||
|
||||
long total_member = 0;
|
||||
load_db_record(out, "SELECT count(id) AS m_count FROM members_job_groupmember WHERE group_id = %lu AND member_id= %lu", in["group_id"].Long(), in["member_id"].Long());
|
||||
@@ -819,6 +831,7 @@ long WrenchSendJobsOfferGroup(CVars in, CVars &out) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// we need this job id
|
||||
if (load_db_record(y, " SELECT * FROM members_jobs WHERE id =%lu", in["job_id"].Long())) {
|
||||
// valid load of job needed
|
||||
@@ -827,6 +840,10 @@ long WrenchSendJobsOfferGroup(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
load_db_record(u,"SELECT code AS currency FROM currency WHERE country = '%s'", y["country"].c_str() );
|
||||
logfmt(logINFO, " The Currency code = %s", u["currency"].c_str());
|
||||
long wallet_id = CheckWallet( in["member_id"].Long() , u);
|
||||
logfmt(logINFO, " The wallet_id = %lu", wallet_id);
|
||||
|
||||
if (y["price"].Long() > 0) {
|
||||
} else {
|
||||
@@ -835,20 +852,32 @@ long WrenchSendJobsOfferGroup(CVars in, CVars &out) {
|
||||
} // no price zero for job on this path
|
||||
|
||||
// Now do you have money to do this ....
|
||||
if (load_db_record(z, " SELECT * FROM members WHERE id =%lu AND balance >= %lu", in["member_id"].Long(), y["price"].Long())) {
|
||||
z["balance"] = "0";
|
||||
z["balance"].set_valid(true); // just initialize it
|
||||
if (load_db_record(z, " SELECT * FROM members_wallet WHERE id =%lu AND member_id =%lu AND amount >= %lu",wallet_id, in["member_id"].Long(), y["price"].Long())) {
|
||||
|
||||
} else {
|
||||
|
||||
out["status"] = "Insufficient balance to create this offer";
|
||||
logfmt(logINFO, "Price2 = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
}
|
||||
|
||||
if (y["price"].Long() * total_member >= z["balance"].Long()) // note that we have all members here for the price
|
||||
{
|
||||
out["status"] = "Insuficient balancde to create this offer";
|
||||
if (y["price"].Long() >= z["amount"].Long()) {
|
||||
out["status"] = "Insufficient balance to create this offer";
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
return ret;
|
||||
}
|
||||
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long() * total_member, z["balance"].Long());
|
||||
|
||||
/*
|
||||
|
||||
if (y["price"].Long() * total_member >= z["balance"].Long()) // note that we have all members here for the price
|
||||
{
|
||||
out["status"] = "Insufficient balance to create this offer";
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long(), z["balance"].Long());
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
logfmt(logINFO, "Price = %lu Balance = %lu", y["price"].Long() * total_member, z["amount"].Long());
|
||||
|
||||
|
||||
try {
|
||||
@@ -1065,11 +1094,15 @@ long WrenchCreateJobs(CVars in, CVars &out) {
|
||||
REQ_LONG(in, "timeline_days", 1, -1);
|
||||
REQ_STRING(in, "title", 5, 149, "(.*)");
|
||||
REQ_STRING(in, "description", 5, 299, "(.*)");
|
||||
//REQ_STRING (in, "job_detail", 4, 40, "(.*)");
|
||||
REQ_STRING (in, "job_detail", 4, 1440, "(.*)");
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
in["loc"] = loc;
|
||||
in["loc"].set_valid(true);
|
||||
|
||||
if (in["price"].Long()<=0){
|
||||
out["status"] = "Unable to create job, price cannot be zero";
|
||||
return ret;
|
||||
}
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = in["member_id"];
|
||||
@@ -1086,6 +1119,10 @@ long WrenchCreateJobs(CVars in, CVars &out) {
|
||||
x["loc"].set_valid(true);
|
||||
x["job_detail"] = in["job_detail"];
|
||||
x["job_detail"].set_valid(true);
|
||||
//country added
|
||||
x["country"] = in["country"];
|
||||
x["country"].set_valid(true);
|
||||
|
||||
job_id = insert_db_record(DBS_VALID, "members_jobs", "members_jobs_id_seq", x);
|
||||
|
||||
if (job_id) {
|
||||
@@ -1095,7 +1132,7 @@ long WrenchCreateJobs(CVars in, CVars &out) {
|
||||
JobAddedMail(x);
|
||||
load_db_record(out, "SELECT *,id AS job_id FROM members_jobs WHERE id = %lu ", job_id);
|
||||
} else {
|
||||
out["status"] = "Uanble to create job";
|
||||
out["status"] = "Unable to create job";
|
||||
}
|
||||
|
||||
logfmt(logINFO, "/WrenchCreateJobs()");
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "input.h"
|
||||
#include "wrenchboard_api.h"
|
||||
#include "payments.h"
|
||||
#include "creditcards.h"
|
||||
#include "common_tool.h"
|
||||
#include "email.h"
|
||||
#include "safestring.h"
|
||||
@@ -27,6 +28,272 @@ CREATE TABLE payment_types (
|
||||
INSERT INTO payment_types(type_code,code,dir) VALUES('OFFER_PYM_DEPOSIT','OFDPS',0);
|
||||
INSERT INTO payment_types(type_code,code,dir) VALUES('OFFER_PYM_REFUND','OFRFD',1); -- // refund if offer was rejected or not accepted
|
||||
*/
|
||||
long UpdateMemberWallet(long member_id,long wallet_id,long amount, long payment_id);
|
||||
|
||||
long WrenchMemberCouponPayment( CVars in, CVars &out )
|
||||
{
|
||||
logfmt(FLOG_MAX, "long WrenchMemberCouponPayment(CVars in, CVars &out)" );
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
ULONG payment_id = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
in["loc"] = loc; in["loc"].set_valid(true);
|
||||
|
||||
long member_id = REQ_LONG( in, "member_id", 1, -1 );
|
||||
REQ_STRING (in, "code", 4, 15, "(.*)");
|
||||
long code_id = REQ_LONG( in, "code_id", 1, -1 );
|
||||
|
||||
// let us make sure you have the wallet
|
||||
// do we have a wallet for this action
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(member_id,vw);
|
||||
if(!wallet_id || wallet_id == 0 ){
|
||||
return -1; // no wallet
|
||||
}
|
||||
in["curr_balance"] ="0";
|
||||
|
||||
long retDb = load_db_record( out, "SELECT amount AS curr_balance FROM members_wallet WHERE member_id = %lu AND currency='%s' ", member_id, vw["currency"].c_str());
|
||||
if (retDb)
|
||||
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true );
|
||||
logfmt(FLOG_MAX, "Current balance Read ********************" );
|
||||
}
|
||||
else { return -1; /* unable to read wallet*/ }
|
||||
|
||||
|
||||
long retDb2 = load_db_record( out, "SELECT * FROM coupons_allocation WHERE member_id = %lu AND code ='%s' AND id = %lu AND active IS NULL", in["member_id"].Long(), in["code"].c_str(),code_id );
|
||||
if (retDb2)
|
||||
{
|
||||
in["coupon_amount"] =out["amount"]; in["coupon_amount"].set_valid( true );
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = member_id; x["member_id"].set_valid( true );
|
||||
x["code"] = "COUP"; x["code"].set_valid( true );
|
||||
x["dir"] = "1"; x["dir"].set_valid( true );
|
||||
x["loc"] = in["loc"]; x["loc"].set_valid( true );
|
||||
|
||||
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
|
||||
x["amount"] = in["coupon_amount"]; x["amount"].set_valid( true );
|
||||
x["fee"] = "0"; x["fee"].set_valid( true );
|
||||
|
||||
// x["what_offer"] = offer_id; x["what_offer"].set_valid( true );
|
||||
x["what_coupon"] = code_id; x["what_coupon"].set_valid( true ); // assign coupon id
|
||||
|
||||
|
||||
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
|
||||
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
|
||||
|
||||
if (payment_id) {
|
||||
ret = PHP_CREATED_OK;
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
|
||||
UpdateMemberWallet( x["member_id"].Long(), wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
|
||||
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
pgsql_exec("UPDATE coupons_allocation SET active = now() WHERE id = %lu AND CODE='%s' ",code_id,in["code"].c_str() );
|
||||
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
||||
} else {
|
||||
out["status"] = "Unable to create payment";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{ out["status"] = "Invalid coupon";
|
||||
ret= PHP_API_BAD_PARAM;
|
||||
}
|
||||
|
||||
logfmt(FLOG_MAX, "/long WrenchMemberCouponPayment(CVars in, CVars &out)" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
call to verify the user have the wallet in place - or create it
|
||||
if this fail , dont continue with collecting money , no place to put it.
|
||||
*/
|
||||
long CheckWallet(long member_id,CVars in){
|
||||
logfmt(FLOG_MAX, "long CheckWallet()" );
|
||||
long wallet_id = 0;
|
||||
CVars y;
|
||||
if ( load_db_record( y, "SELECT * FROM members_wallet WHERE currency ='%s' AND member_id =%lu",in["currency"].c_str(),member_id ) > 0 )
|
||||
{
|
||||
wallet_id = y["id"].Long();
|
||||
}
|
||||
else{
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = member_id; x["member_id"].set_valid( true );
|
||||
x["currency"] = in["currency"]; x["currency"].set_valid( true );
|
||||
wallet_id = insert_db_record( DBS_VALID, "members_wallet", "members_wallet_id_seq", x );
|
||||
}
|
||||
return wallet_id;
|
||||
}
|
||||
|
||||
long UpdateMemberWallet(long member_id,long wallet_id,long amount, long payment_id){
|
||||
CVars y;
|
||||
if ( load_db_record( y, "SELECT * FROM members_wallet WHERE id = %lu AND member_id =%lu", wallet_id,member_id ) > 0 )
|
||||
{
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = member_id; x["member_id"].set_valid( true ); //
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true ); //
|
||||
x["amount"] = amount; x["amount"].set_valid( true ); //
|
||||
x["balance"] = y["amount"]; x["balance"].set_valid( true ); //
|
||||
insert_db_record( DBS_VALID, "members_wallet_detail", "members_wallet_detail_id_seq", x );
|
||||
|
||||
|
||||
pgsql_exec("UPDATE members_wallet SET amount=amount + %lu,prev_amount=%lu WHERE member_id = %lu AND id=%lu",amount,y["amount"].Long(),member_id , wallet_id); // pay attention to who you pay here
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
long DeductMemberWallet(long member_id,long wallet_id,long amount, long payment_id){
|
||||
logfmt(FLOG_MAX, "DeductMemberWallet ************************" );
|
||||
logfmt(FLOG_MAX, "Review this design so as not to loose money ");
|
||||
logfmt(FLOG_MAX, "DeductMemberWallet ************************" );
|
||||
|
||||
CVars y;
|
||||
if ( load_db_record( y, "SELECT * FROM members_wallet WHERE id = %lu AND member_id =%lu", wallet_id,member_id ) > 0 )
|
||||
{
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = member_id; x["member_id"].set_valid( true ); //
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true ); //
|
||||
x["amount"] = amount; x["amount"].set_valid( true ); //
|
||||
x["balance"] = y["amount"]; x["balance"].set_valid( true ); //
|
||||
insert_db_record( DBS_VALID, "members_wallet_detail", "members_wallet_detail_id_seq", x );
|
||||
pgsql_exec("UPDATE members_wallet SET amount=amount - %lu,prev_amount=%lu WHERE member_id = %lu AND id=%lu",amount,y["amount"].Long(),member_id , wallet_id); // pay attention to who you pay here
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
long WrenchNewCardPayment( CVars in, CVars &out )
|
||||
{
|
||||
long payment_return = 0; // just return 0 if not okay , payment_id is all okay
|
||||
logfmt(FLOG_MAX, "long WrenchNewCardPayment(CVars in, CVars &out)" );
|
||||
long member_id = REQ_LONG( in, "member_id", 1, -1 );
|
||||
long amount = REQ_LONG( in, "amount", 1, -1 );
|
||||
OPTIONAL(in, "WHAT_CHARGE_TYPE") REQ_STRING(in, "WHAT_CHARGE_TYPE", 3, 15, "(.*)");
|
||||
long card_id = 0;
|
||||
|
||||
if ( in["WHAT_CHARGE_TYPE"] == "USE_CARD_ID"){
|
||||
card_id = REQ_LONG( in, "card_id", 1, -1 );
|
||||
in["what_purhcase"] = "MEMBER_RETCARD_PAYM"; in["what_purhcase"].set_valid( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
REQ_STRING(in, "cardnumber", 12, 16, "(.*)"); //4111111111111111"
|
||||
REQ_STRING(in, "cvc", 3, 4, "(.*)"); //234"
|
||||
REQ_LONG(in, "paymenttype", 0, -1);
|
||||
REQ_STRING(in, "exp_month", 2, 2, "(.*)");
|
||||
REQ_STRING(in, "exp_year", 4, 4, "(.*)");
|
||||
in["what_purhcase"] = "MEMBER_NEWCARD_PAYM"; in["what_purhcase"].set_valid( true );
|
||||
}
|
||||
|
||||
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
in["loc"] = loc; in["loc"].set_valid(true);
|
||||
|
||||
long payment_id =0;
|
||||
|
||||
// do we have a wallet for this action
|
||||
CVars vw;
|
||||
vw["currency"] = "USD"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(member_id,vw);
|
||||
if(!wallet_id || wallet_id == 0 ){
|
||||
return -1; // no wallet
|
||||
}
|
||||
in["curr_balance"] ="0";
|
||||
long retDb = load_db_record( out, "SELECT amount AS curr_balance FROM members_wallet WHERE member_id = %lu AND currency='%s' ", member_id, vw["currency"].c_str());
|
||||
if (retDb)
|
||||
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true );
|
||||
logfmt(FLOG_MAX, "Current balance Read ********************" );
|
||||
}
|
||||
else { return -1; /* unable to read wallet*/ }
|
||||
|
||||
// verify if allowed
|
||||
|
||||
// take in sessionid to verify if allaowed too
|
||||
|
||||
// Get the code and dir contruct
|
||||
long retTc = load_db_record( out, "SELECT * FROM payment_types WHERE type_code = '%s' ",in["what_purhcase"].c_str());
|
||||
if (retTc)
|
||||
{
|
||||
in["code"] = out["code"]; in["code"].set_valid( true );
|
||||
in["dir"] = out["dir"]; in["dir"].set_valid( true );
|
||||
}
|
||||
else { return -1; /* unable to get payment type*/ }
|
||||
|
||||
CVars x;
|
||||
x["member_id"] = member_id; x["member_id"].set_valid( true ); //
|
||||
x["loc"] = in["loc"]; x["loc"].set_valid( true ); //
|
||||
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true ); //
|
||||
x["amount"] = amount; x["amount"].set_valid( true );
|
||||
x["fee"] = "0"; x["fee"].set_valid( true );
|
||||
x["code"] = in["code"]; x["code"].set_valid( true );
|
||||
x["dir"] = in["dir"]; x["dir"].set_valid( true );
|
||||
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
|
||||
x["currency"] = vw["currency"]; x["currency"].set_valid( true );
|
||||
|
||||
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
|
||||
// ALL STRIPE COMPATIBLE
|
||||
if ( card_id == 0 ){
|
||||
card_id = save_creditcard(in, out);
|
||||
}
|
||||
|
||||
|
||||
if (card_id && card_id> 0){
|
||||
pgsql_exec("UPDATE members_payments SET account_id = %lu WHERE id = %lu",card_id,payment_id );
|
||||
}
|
||||
else{
|
||||
return -1;
|
||||
}
|
||||
|
||||
CVars yx;
|
||||
yx["member_id"] = member_id; yx["member_id"].set_valid( true );
|
||||
yx["payment_id"] = payment_id; yx["payment_id"].set_valid( true );
|
||||
long stripe_payment = stripe_charge_member_paymentid(yx, out); // go for stripe now
|
||||
|
||||
if (stripe_payment==PHP_API_OK) {
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
//pgsql_exec("UPDATE members_wallet SET amount=amount + %lu,prev_amount=%lu WHERE member_id = %lu AND id=%lu",x["amount"].Long(),x["curr_balance"].Long(),x["member_id"].Long() , wallet_id); // pay attention to who you pay here
|
||||
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
UpdateMemberWallet( member_id, wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
||||
payment_return = payment_id;
|
||||
} else {
|
||||
out["status"] = "Unable to create payment";
|
||||
}
|
||||
|
||||
logfmt(FLOG_MAX, "/long WrenchNewCardPayment(CVars in, CVars &out)" );
|
||||
return payment_return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
long WrenchCardRechargePayment( CVars in, CVars &out )
|
||||
{
|
||||
logfmt(FLOG_MAX, "long WrenchCardRechargePayment(CVars in, CVars &out)" );
|
||||
long member_id = REQ_LONG( in, "member_id", 1, -1 );
|
||||
long amount = REQ_LONG( in, "amount", 1, -1 );
|
||||
long card_id = REQ_LONG( in, "card_id", 1, -1 );
|
||||
in["WHAT_CHARGE_TYPE"] = "USE_CARD_ID"; in["WHAT_CHARGE_TYPE"].set_valid( true ); //
|
||||
return WrenchNewCardPayment( in, out );
|
||||
logfmt(FLOG_MAX, "/long WrenchCardRechargePayment(CVars in, CVars &out)" );
|
||||
}
|
||||
|
||||
long WrenchCanceContractPayment( CVars in, CVars &out )
|
||||
{
|
||||
@@ -95,7 +362,11 @@ long WrenchCanceContractPayment( CVars in, CVars &out )
|
||||
|
||||
|
||||
|
||||
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
|
||||
|
||||
|
||||
/*
|
||||
// TEST FOR DUPLICATE
|
||||
@@ -133,9 +404,12 @@ long WrenchCanceContractPayment( CVars in, CVars &out )
|
||||
ret = PHP_CREATED_OK;
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
|
||||
//- Retired this method pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
|
||||
UpdateMemberWallet( x["member_id"].Long(), wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
|
||||
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
@@ -200,7 +474,11 @@ Foreign-key constraints:
|
||||
REQ_LONG( in, "dir", 1, -1 );
|
||||
REQ_LONG( in, "offer_id", 1, -1 );
|
||||
|
||||
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
|
||||
|
||||
|
||||
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
|
||||
|
||||
@@ -251,7 +529,8 @@ Foreign-key constraints:
|
||||
ret = PHP_CREATED_OK;
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
|
||||
//pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
|
||||
DeductMemberWallet(in["member_id"].Long(), wallet_id,in["amount"].Long(), payment_id);
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
@@ -269,6 +548,7 @@ Foreign-key constraints:
|
||||
|
||||
long WrenchRefundoffer( CVars in, CVars &out )
|
||||
{
|
||||
logfmt( logINFO, "WrenchRefundoffer" );
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
//ULONG payment_id = 0;
|
||||
|
||||
@@ -280,7 +560,12 @@ long WrenchRefundoffer( CVars in, CVars &out )
|
||||
REQ_LONG( in, "dir", 1, -1 );
|
||||
long offer_id = REQ_LONG( in, "offer_id", 1, -1 );
|
||||
long payment_id = REQ_LONG( in, "payment_id", 1, -1 );
|
||||
|
||||
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
|
||||
|
||||
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
|
||||
|
||||
if (retDb)
|
||||
@@ -312,9 +597,10 @@ long WrenchRefundoffer( CVars in, CVars &out )
|
||||
ret = PHP_CREATED_OK;
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long() + x["fee"].Long(),in["member_id"].Long() );
|
||||
// pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long() + x["fee"].Long(),in["member_id"].Long() );
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
UpdateMemberWallet( member_id, wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
@@ -326,7 +612,7 @@ long WrenchRefundoffer( CVars in, CVars &out )
|
||||
|
||||
}
|
||||
|
||||
|
||||
logfmt( logINFO, "/WrenchRefundoffer" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -393,8 +679,11 @@ long WrenchContractPayment( CVars in, CVars &out )
|
||||
return PHP_API_BAD_PARAM; }
|
||||
|
||||
|
||||
|
||||
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
|
||||
|
||||
|
||||
/*
|
||||
// TEST FOR DUPLICATE
|
||||
@@ -432,9 +721,12 @@ long WrenchContractPayment( CVars in, CVars &out )
|
||||
ret = PHP_CREATED_OK;
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
|
||||
//pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
|
||||
UpdateMemberWallet( x["member_id"].Long(), wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
|
||||
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
@@ -496,6 +788,11 @@ Foreign-key constraints:
|
||||
REQ_LONG( in, "dir", 1, -1 );
|
||||
REQ_LONG( in, "sendmoney_id", 1, -1 );
|
||||
|
||||
CVars vw;
|
||||
vw["currency"] = "NAIRA"; // this might become a variable based on the country
|
||||
vw["currency"].set_valid( true );
|
||||
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
|
||||
|
||||
|
||||
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
|
||||
|
||||
@@ -553,27 +850,22 @@ Foreign-key constraints:
|
||||
out["status"] = "Failure to create";
|
||||
return PHP_API_BAD_PARAM;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
out["payment_id"] = payment_id; out["payment_id"].set_valid( true );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (payment_id) {
|
||||
ret = PHP_CREATED_OK;
|
||||
|
||||
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
|
||||
// now generate the confirmation
|
||||
pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
|
||||
//pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
|
||||
DeductMemberWallet(in["member_id"].Long(), wallet_id,in["amount"].Long() + in["fee"].Long(), payment_id);
|
||||
char confirmation[15] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
|
||||
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
|
||||
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
|
||||
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
|
||||
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
||||
ret = PHP_CREATED_OK;
|
||||
|
||||
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
||||
} else {
|
||||
out["status"] = "Uanble to create payment";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
// Twillo management toosl
|
||||
#include "clog.h"
|
||||
#include "cgi.h"
|
||||
#include "input.h"
|
||||
#include "wrenchboard_api.h"
|
||||
#include "reco_engine.h"
|
||||
#include "email.h"
|
||||
#include "safestring.h"
|
||||
#include <string>
|
||||
#include "pgsql.h"
|
||||
#include "pgsql_wrapper.h"
|
||||
#include <curl/curl.h>
|
||||
#include "account.h"
|
||||
#include "cards.h"
|
||||
#include "twilo.h"
|
||||
|
||||
/*
|
||||
#define RECOMMEND_COUPON 1000
|
||||
#define RECOMMEND_BLOG 1005
|
||||
#define RECOMMEND_NEWTASK 1010
|
||||
#define RECOMMEND_TOKEN 1015
|
||||
#define RECOMMEND_OFFERS 1020
|
||||
//========================
|
||||
*/
|
||||
long sendOffersRecommendation( CVars in, CVars &out);
|
||||
long sendCouponRecommendation( CVars in, CVars &out);
|
||||
long recommendation_engine(long action , CVars in, CVars &out) {
|
||||
try{
|
||||
|
||||
switch (action) {
|
||||
case RECOMMEND_COUPON:
|
||||
return sendCouponRecommendation( in, out);
|
||||
break;
|
||||
|
||||
case RECOMMEND_BLOG:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case RECOMMEND_NEWTASK:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case RECOMMEND_TOKEN:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case RECOMMEND_OFFERS:
|
||||
return sendOffersRecommendation( in, out);
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long recommendation_engine");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
long sendOffersRecommendation( CVars in, CVars &out){
|
||||
|
||||
try{
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "offer_id", 1, -1);
|
||||
|
||||
if ( load_db_record(out, "SELECT client_id FROM members_jobs_offer WHERE id=%lu", in["offer_id"].Long())> 0){
|
||||
CVars xx;
|
||||
CVars xout;
|
||||
xx["action"] = WRENCHBOARD_CARDS_CREATECARD; xx["action"].set_valid( true );
|
||||
xx["member_id"] = out["client_id"]; xx["member_id"].set_valid( true ); // the card is going to job recipient
|
||||
xx["title"] = "New job offer"; xx["title"].set_valid( true );
|
||||
xx["description"] = "You have received a new Task/Job offer"; xx["description"].set_valid( true );
|
||||
xx["card_type"] = "OFFERS"; xx["card_type"].set_valid( true );
|
||||
xx["card_style"] = "card2"; xx["card_style"].set_valid( true );
|
||||
xx["card_icon"] = "icon1"; xx["card_icon"].set_valid( true );
|
||||
xx["offer_id"] = in["offer_id"]; xx["offer_id"].set_valid( true );
|
||||
xx["blog_id"] = "0"; xx["blog_id"].set_valid( true );
|
||||
card_calls(xx, xout);
|
||||
}
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long sendCouponRecommendation");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long sendCouponRecommendation( CVars in, CVars &out){
|
||||
/*
|
||||
CVars xx;
|
||||
xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
xx["code"] = rec["code"]; xx["code"].set_valid(true);
|
||||
xx["amount"] = rec["amount"]; xx["amount"].set_valid(true);
|
||||
xx["status"] = COUPON_ACTIVE; xx["status"].set_valid(true);
|
||||
coupon_id = insert_db_record(DBS_VALID, "coupons_allocation", "coupons_allocation_id_seq", xx);
|
||||
|
||||
['title'=>'This is your coupon',
|
||||
'description'=>'This is the description of the description',
|
||||
'card_type'=>'COUPON',
|
||||
'card_style' =>'card1',
|
||||
'card_icon' =>'icon1',
|
||||
'assign_id'=> 0,
|
||||
*/
|
||||
|
||||
try{
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "coupon_id", 1, -1);
|
||||
|
||||
CVars xx;
|
||||
CVars xout;
|
||||
xx["action"] = WRENCHBOARD_CARDS_CREATECARD; xx["action"].set_valid( true );
|
||||
xx["member_id"] = member_id; xx["member_id"].set_valid( true );
|
||||
xx["title"] = "This is your coupon"; xx["title"].set_valid( true );
|
||||
xx["description"] = "Click to redeem your coupon to your account"; xx["description"].set_valid( true );
|
||||
xx["card_type"] = "COUPON"; xx["card_type"].set_valid( true );
|
||||
xx["card_style"] = "card1"; xx["card_style"].set_valid( true );
|
||||
xx["card_icon"] = "icon1"; xx["card_icon"].set_valid( true );
|
||||
xx["blog_id"] = "0"; xx["blog_id"].set_valid( true );
|
||||
xx["offer_id"] = "0"; xx["offer_id"].set_valid( true );
|
||||
card_calls(xx, xout);
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long sendCouponRecommendation");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "pgsql_wrapper.h"
|
||||
#include "cfg.h"
|
||||
#include <curl/curl.h>
|
||||
#include "jobs.h"
|
||||
|
||||
long ReviewReminder(CVars in, CVars &out);
|
||||
long OfferPending(CVars in, CVars &out);
|
||||
@@ -20,32 +21,74 @@ long DeadlineLineApprachClient(CVars in, CVars &out);
|
||||
long SignUpPendingReminder(CVars in, CVars &out);
|
||||
long SignUpStats(CVars in, CVars &out);
|
||||
long PastDueWarings(CVars in, CVars &out);
|
||||
long PastDueOffersRefund(CVars in, CVars &out);
|
||||
|
||||
long CronTracker(CVars in, CVars &out);
|
||||
/*
|
||||
CREATE TABLE cron_jobs (
|
||||
id SERIAL,
|
||||
job_type VARCHAR(50) UNIQUE NOT NULL,
|
||||
description VARCHAR(55) NOT NULL,
|
||||
added timestamp without time zone DEFAULT now(),
|
||||
updated timestamp without time zone DEFAULT now(),
|
||||
active INT DEFAULT 0
|
||||
);
|
||||
ALTER TABLE ONLY cron_jobs
|
||||
ADD CONSTRAINT cron_jobs_id_key UNIQUE (id);
|
||||
|
||||
*/
|
||||
long sitecrons_calls(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "sitecrons_calls()");
|
||||
//out["result"] = "YES I GET TO BACK END";
|
||||
long call_action = REQ_LONG(in, "call_action", 0, -1);
|
||||
CVars x;
|
||||
CVars ct,co;
|
||||
long ret = 0;
|
||||
const char * loc = getenv("REMOTE_ADDR");
|
||||
logfmt(logINFO, "sitecrons_calls() action=%lu",call_action);
|
||||
|
||||
switch (call_action) {
|
||||
case WRB_CRONJOB_JOBDUE_REMINDER:
|
||||
ct["job_type"]="WRB_CRONJOB_JOBDUE_REMINDER"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="This is to organize and send job due date remider to client"; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return DeadlineLineApprachClient(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_JOBDUE_PAYMENTS:
|
||||
ct["job_type"]="WRB_CRONJOB_JOBDUE_PAYMENTS"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="This is to organize jonb compleyted remider to owner of task"; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return PaymentPending(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_SIGNUP_ALERT:
|
||||
ct["job_type"]="WRB_CRONJOB_SIGNUP_ALERT"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="General Signup job stats "; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return SignUpStats(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_PASTDUE_ALERT:
|
||||
ct["job_type"]="WRB_CRONJOB_PASTDUE_ALERT"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="This is to organize and send job due date remider to owner of task"; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return PastDueWarings(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_OFFER_REFUND_ALERT:
|
||||
ct["job_type"]="WRB_CRONJOB_OFFER_REFUND_ALERT"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="Offer expired , need to cancel and return deposit for the offer"; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return PastDueOffersRefund(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_PENDOFFER_ALERT:
|
||||
ct["job_type"]="WRB_CRONJOB_PENDOFFER_ALERT"; ct["job_type"].set_valid( true );
|
||||
ct["description"]="Offer is pending remind the client to attend to it before it expires "; ct["description"].set_valid( true );
|
||||
CronTracker(ct, co);
|
||||
return OfferPending(in, out);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +96,32 @@ long sitecrons_calls(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
long CronTracker(CVars in, CVars &out){
|
||||
long ret = 0;
|
||||
const PGresult *res;
|
||||
try {
|
||||
REQ_STRING(in, "job_type", 2, 149, "(.*)");
|
||||
REQ_STRING(in, "description", 2, 149, "(.*)");
|
||||
|
||||
if ( load_db_record(out, "SELECT id AS cron_id,active FROM cron_jobs WHERE job_type ='%s' ", in["job_type"].c_str())> 0){
|
||||
ret = out["active"].Long();
|
||||
res = pgsql_query("UPDATE cron_jobs SET updated=now() WHERE id = %lu", out["cron_id"].Long());
|
||||
}
|
||||
else{
|
||||
CVars xx;
|
||||
xx["job_type"] = in["job_type"];
|
||||
xx["job_type"].set_valid(true);
|
||||
xx["description"] = in["description"];
|
||||
xx["description"].set_valid(true);
|
||||
long cron_id = insert_db_record(DBS_VALID, "cron_jobs", "cron_jobs_id_seq", xx);
|
||||
|
||||
}
|
||||
} catch (bad_parameter) {
|
||||
out["action_status"] = "Invalid CronTracker Action";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ReviewReminder(CVars in, CVars &out) {
|
||||
|
||||
|
||||
@@ -60,9 +129,31 @@ long ReviewReminder(CVars in, CVars &out) {
|
||||
}
|
||||
|
||||
long OfferPending(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "ENTER OfferPending()");
|
||||
long limit = in["one_limit"].Long();
|
||||
const PGresult *res = pgsql_query("SELECT jo.id AS offer_id,jo.added,j.title,jo.expire,jo.email, jo.client_id, "
|
||||
"jo.job_id,jo.reminder_count,jo.reminder_date "
|
||||
"FROM members_jobs_offer jo "
|
||||
"LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
"WHERE now() > jo.added +'6 hrs' "
|
||||
"AND jo.expire > now() AND jo.status = 1 AND jo.public_view =0 "
|
||||
"AND jo.reminder_count =0 AND jo.reminder_date IS NULL LIMIT %lu ",limit);
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
|
||||
cron_email(WRB_CRONJOB_PENDOFFER_ALERT, rec, out); // send the cron email
|
||||
|
||||
pgsql_exec("UPDATE members_jobs_offer SET reminder_count=reminder_count+1, reminder_date=now() "\
|
||||
"WHERE id=%lu AND job_id=%lu ", rec["offer_id"].Long(),rec["job_id"].Long());
|
||||
}
|
||||
}
|
||||
logfmt(logINFO, "/OfferPending()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
long InterestPending(CVars in, CVars &out) {
|
||||
@@ -71,20 +162,58 @@ long InterestPending(CVars in, CVars &out) {
|
||||
|
||||
}
|
||||
|
||||
long PastDueWarings(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "ENTER PastDueWarings()");
|
||||
const PGresult *res = pgsql_query("SELECT mc.member_id "
|
||||
" FROM members_jobs_contract mc "
|
||||
" LEFT JOIN members m ON m.id=mc.client_id "
|
||||
" WHERE mc.status IN (1,2) "
|
||||
"AND delivery_date < now() GROUP BY mc.member_id");
|
||||
long PastDueOffersRefund(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "ENTER PastDueOffersRefund()");
|
||||
long contract_id = 0;
|
||||
const PGresult *res = pgsql_query("SELECT j.* "
|
||||
" FROM members_jobs_offer j "
|
||||
" LEFT JOIN members m1 ON m1.id=j.member_id "
|
||||
" LEFT JOIN members m2 ON m2.id=j.client_id "
|
||||
" WHERE j.expire < now() "
|
||||
" AND j.status = 1 AND j.auto_close IS NULL "
|
||||
" AND j.payment_id IS NOT NULL LIMIT 1");
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
cron_email(WRB_CRONJOB_PASTDUE_ALERT, rec, out); // send the cron email
|
||||
rec["offer_result"] = OFFER_EXPIRE;
|
||||
rec["offer_result"].set_valid( true );
|
||||
|
||||
WrenchConcludeJobsOffer(rec, out);
|
||||
pgsql_exec("UPDATE members_jobs_offer SET auto_close=now() "\
|
||||
"WHERE offer_code='%s' ", rec["offer_code"].c_str());
|
||||
|
||||
}
|
||||
}
|
||||
logfmt(logINFO, "/PastDueOffersRefund()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
long PastDueWarings(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "ENTER PastDueWarings()");
|
||||
long contract_id = 0;
|
||||
const PGresult *res = pgsql_query("SELECT mc.id AS contract_id, mc.member_id,mc.auto_remind "
|
||||
" FROM members_jobs_contract mc "
|
||||
" LEFT JOIN members m ON m.id=mc.client_id "
|
||||
" WHERE mc.status IN (1,2) AND mc.auto_remind < 3 "
|
||||
" AND delivery_date < now() GROUP BY mc.member_id ,mc.auto_remind, contract_id ORDER BY mc.auto_remind DESC");
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
// note we send once in the loop
|
||||
// we need the loop to mar items but wanted to send the email only once
|
||||
if ( contract_id != rec["contract_id"].Long() ){
|
||||
contract_id = rec["contract_id"].Long();
|
||||
cron_email(WRB_CRONJOB_PASTDUE_ALERT, rec, out); // send the cron email
|
||||
}
|
||||
pgsql_exec("UPDATE members_jobs_contract SET auto_remind=auto_remind + 1,due_remind=now() "\
|
||||
"WHERE member_id=%lu AND id = %lu ", rec["member_id"].Long(),rec["contract_id"].Long());
|
||||
|
||||
}
|
||||
}
|
||||
logfmt(logINFO, "/PastDueWarings()");
|
||||
@@ -96,8 +225,15 @@ long SignUpStats(CVars in, CVars &out) {
|
||||
|
||||
load_db_record(out, "SELECT count(id) AS today_signup FROM members WHERE added::date = now()::date");
|
||||
load_db_record(out, "SELECT count(id) AS today_pending_signup FROM members_pending WHERE added::date = now()::date");
|
||||
load_db_record(out, "SELECT TO_CHAR(NOW(), 'Day Mon dd, yyyy hh:mm AM') AS report_date");
|
||||
load_db_record(out, "SELECT count(*) AS total_task_interest FROM members_offer_interest WHERE added::date = now()::date");
|
||||
load_db_record(out, "SELECT count(id) AS total_active_public_jobs FROM members_jobs_offer WHERE status=1 AND public_view= 1 AND expire> now()");
|
||||
load_db_record(out, "SELECT count(*) AS total_login FROM members_session WHERE created::date=now()::date");
|
||||
load_db_record(out, "SELECT count(id) AS total_private_tasks FROM members_jobs_offer WHERE status=1 AND public_view= 0 AND expire> now()");
|
||||
|
||||
load_db_record(out, "SELECT count(*) AS count_mobile_login FROM mobile_login WHERE updated::date = now()::date");
|
||||
|
||||
|
||||
load_db_record(out, "SELECT TO_CHAR(NOW() :: DATE, 'Day Mon dd, yyyy') AS report_date");
|
||||
|
||||
in = out;
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "pgsql.h"
|
||||
#include "pgsql_wrapper.h"
|
||||
#include <curl/curl.h>
|
||||
#include "email.h"
|
||||
#include "payments.h"
|
||||
#include "common_tool.h"
|
||||
|
||||
long smoney_calls(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "smoney_calls()");
|
||||
@@ -130,11 +133,17 @@ long member_sendmoney_fee(CVars in, CVars &out) {
|
||||
return out["processing_fee"].Long();
|
||||
}
|
||||
|
||||
long WRB_doServiceTransferComplete(CVars in, CVars &out);
|
||||
long do_transferPayment(CVars in) ;
|
||||
long INTW_configure(CVars in, CVars &out) ;
|
||||
|
||||
long member_sendmoney(CVars in, CVars &out) {
|
||||
//plog->SetFileName( PREFIX"/logs/member_sendmoney.log" );
|
||||
//return INTW_doServiceTransfer(in, out);
|
||||
return -1L;
|
||||
//return 0;
|
||||
long ret = WRB_doServiceTransferComplete(in, out);
|
||||
|
||||
logfmt(logINFO, "************************ E****** member_sendmoney(CVars in, CVars out) =%lu",ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long member_addrecipient(CVars in, CVars &out) {
|
||||
@@ -233,3 +242,367 @@ Referenced by:
|
||||
|
||||
|
||||
|
||||
long INTW_configure(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "long INTW_configure(CVars in, CVars &out)");
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
try {
|
||||
// Configure Interswitch SSL
|
||||
|
||||
|
||||
out["interswitch_ver"] = CfgReadLong("interswitch.version");
|
||||
out["interswitch_sep"] = CfgReadChar("interswitch.soap_endpoint");
|
||||
out["interswitch_tid"] = CfgReadChar("interswitch.terminal_id");
|
||||
out["interswitch_code"] = CfgReadChar("interswitch.entity_code");
|
||||
out["interswitch_mkey"] = CfgReadChar("interswitch.master_key");
|
||||
out["interswitch_pin"] = CfgReadChar("interswitch.pin");
|
||||
out["interswitch_pfix"] = CfgReadChar("interswitch.prefix");
|
||||
out["interswitch_keyf"] = CfgReadChar("interswitch.keyfile");
|
||||
out["interswitch_pass"] = CfgReadChar("interswitch.password");
|
||||
out["interswitch_cert"] = CfgReadChar("interswitch.cacert");
|
||||
|
||||
ret = PHP_API_OK;
|
||||
|
||||
} catch (bad_parameter) {
|
||||
|
||||
out["status"] = "Bad parameter";
|
||||
|
||||
} catch (...) {
|
||||
|
||||
out["status"] = "Unhandled exception in INTW_configure";
|
||||
|
||||
}
|
||||
logfmt(logINFO, "/long INTW_configure(CVars in, CVars &out)");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
long do_transferPayment(CVars in) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
CVars out;
|
||||
|
||||
long customer_id = REQ_LONG(in, "customer_id", 1, -1);
|
||||
long transfer_id = REQ_LONG(in, "transfer_id", 1, -1);
|
||||
long payMode = REQ_LONG(in, "mode", 1, -1);
|
||||
long payment_id = 0;
|
||||
long amount = 0;
|
||||
long fee = 0;
|
||||
long total = 0;
|
||||
|
||||
|
||||
/*
|
||||
CREATE TABLE sendmoney_payment
|
||||
(
|
||||
id serial NOT NULL,
|
||||
transfer_mode integer NOT NULL,
|
||||
customer_id INT REFERENCES customer(id),
|
||||
transfer_id INT REFERENCES interswitch_money_transfer(id),
|
||||
amount integer DEFAULT 0,
|
||||
fee integer DEFAULT 0,
|
||||
total integer DEFAULT 0,
|
||||
current_balance integer DEFAULT 0,
|
||||
new_balance integer DEFAULT 0,
|
||||
status integer DEFAULT 1,
|
||||
added TIMESTAMP DEFAULT NOW()
|
||||
);
|
||||
*/
|
||||
|
||||
ret = load_db_record(out, "SELECT balance FROM members WHERE id = %lu AND status = 1", customer_id);
|
||||
if (ret < 1L) {
|
||||
throw new bad_parameter(out, "senderid");
|
||||
}
|
||||
|
||||
if (payMode == PAYMENT_MODE) {
|
||||
amount = REQ_LONG(in, "amount", 1, -1);
|
||||
fee = REQ_LONG(in, "fee", 1, -1);
|
||||
total = amount + fee; // make sure you are cent here
|
||||
|
||||
if (out["balance"].Long() >= total) // do you have this money
|
||||
{
|
||||
CVars x;
|
||||
x["transfer_mode"] = PAYMENT_MODE;
|
||||
x["transfer_mode"].set_valid(true);
|
||||
x["member_id"] = customer_id;
|
||||
x["member_id"].set_valid(true);
|
||||
x["transfer_id"] = transfer_id;
|
||||
x["transfer_id"].set_valid(true);
|
||||
x["amount"] = amount;
|
||||
x["amount"].set_valid(true);
|
||||
x["fee"] = fee;
|
||||
x["fee"].set_valid(true);
|
||||
x["total"] = total;
|
||||
x["total"].set_valid(true);
|
||||
x["current_balance"] = out["balance"];
|
||||
x["current_balance"].set_valid(true);
|
||||
payment_id = 0;
|
||||
|
||||
out["payment_id"] = insert_db_record(DBS_VALID, "sendmoney_payment", "sendmoney_payment_id_seq", x);
|
||||
char confirmation[20] = "";
|
||||
Confirmation(payment_id, confirmation, sizeof (confirmation));
|
||||
|
||||
|
||||
|
||||
|
||||
ret = PHP_API_BAD_PARAM; // it is still a failure if we get here and did not take the money out of the balance
|
||||
|
||||
CVars y;
|
||||
y["member_id"] = x["member_id"];
|
||||
y["member_id"].set_valid(true);
|
||||
y["sendmoney_id"] = x["transfer_id"];
|
||||
y["sendmoney_id"].set_valid(true);
|
||||
y["code"] = "SMPAY";
|
||||
y["code"].set_valid(true);
|
||||
y["dir"] = DIR_TARGET;
|
||||
y["dir"].set_valid(true);
|
||||
//y["payment_id"] = out["payment_id"]; y["payment_id"].set_valid( true );
|
||||
|
||||
ret = WrenchSendMoneyPayment(y, out);
|
||||
|
||||
if (ret == PHP_CREATED_OK) {
|
||||
load_db_record(out, "SELECT balance AS new_balance FROM members WHERE id = %lu", customer_id);
|
||||
pgsql_exec("UPDATE sendmoney_payment SET new_balance=%lu WHERE id=%lu", out["new_balance"].Long(), out["payment_id"].Long());
|
||||
ret = PHP_API_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (payMode == REFUND_MODE) {
|
||||
if (load_db_record(out, "SELECT * FROM sendmoney_payment WHERE transfer_id = %lu AND member_id = %lu", transfer_id, customer_id)) {
|
||||
logfmt(logINFO, "*****WE RE DO VERIFICATION and NO DUPLICATES)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
logfmt(logINFO, "**)");
|
||||
CVars out;
|
||||
/*REQ_STRING( in, "TransferCode", 3, 30, "(.*)" );
|
||||
REQ_STRING( in, "requestReference", 3, 30, "(.*)" );*/
|
||||
|
||||
//int vRet = INTW_querySendMoneyTransaction(in, out);
|
||||
ret = PHP_API_OK;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//PAYMENT_MODE
|
||||
//REFUND_MODE
|
||||
|
||||
return ret;
|
||||
}
|
||||
//*****************************************************************************/
|
||||
|
||||
long WRB_doServiceTransferComplete(CVars in, CVars &out) {
|
||||
//plog->SetFileName( PREFIX"/logs/send_money.log" );
|
||||
|
||||
logfmt(logINFO, "long WRB_doServiceTransferComplete(CVars in, CVars &out)");
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
try {
|
||||
|
||||
out = in;
|
||||
// Initiate interswitch session
|
||||
CVars setup;
|
||||
INTW_configure(in, setup);
|
||||
|
||||
|
||||
in["action"].set_valid(false);
|
||||
REQ_STRING(in, "InitiatingEntityCode", 3, 3, "(.*)");
|
||||
REQ_LONG(in, "InitiatingAmount", 1, -1);
|
||||
REQ_LONG(in, "Fee", 1, -1);
|
||||
REQ_LONG(in, "InitiatingChannel", 1, -1);
|
||||
REQ_STRING(in, "InitiatingPaymentMethodCode", 2, 2, "(.*)");
|
||||
REQ_STRING(in, "InitiatingCurrencyCode", 3, 3, "(.*)");
|
||||
REQ_STRING(in, "TerminatingPaymentMethodCode", 2, 2, "(.*)");
|
||||
REQ_LONG(in, "TerminatingAmount", 1, -1);
|
||||
REQ_STRING(in, "TerminatingCurrencyCode", 3, 3, "(.*)");
|
||||
REQ_STRING(in, "TerminatingCountryCode", 2, 2, "(.*)");
|
||||
|
||||
//REQ_STRING( in, "TerminatingEntityCode", 1, 5, "(.*)" );
|
||||
//REQ_STRING( in, "TerminatingAccountNumber", 1, 50, "(.*)" );
|
||||
//REQ_STRING( in, "TerminatingAccountType", 2, 2, "(.*)" );
|
||||
|
||||
long senderid = REQ_LONG(in, "senderid", 1, -1);
|
||||
long recipientid = REQ_LONG(in, "recipientid", 1, -1);
|
||||
|
||||
in["InitiatingEntityCode"] = "MBA";
|
||||
in["InitiatingEntityCode"].set_valid(true);
|
||||
|
||||
|
||||
CVars sender; // Load sender
|
||||
ret = load_db_record(sender, "SELECT firstname,lastname,balance FROM members WHERE id = %lu AND status = 1", senderid);
|
||||
if (ret < 1L) {
|
||||
throw new bad_parameter(out, "senderid");
|
||||
}
|
||||
|
||||
long LongTotalCost = in["Fee"].Long() + in["TerminatingAmount"].Long() + 0;
|
||||
|
||||
if (sender["balance"].Long() < LongTotalCost) {
|
||||
throw new bad_parameter(out, "insufficient balance for transaction");
|
||||
}
|
||||
|
||||
|
||||
|
||||
CVars recipient; // Load recipient
|
||||
/*recipient["firstname"] = in["firstname"]; recipient["firstname"].set_valid( true );
|
||||
recipient["lastname"] = in["lastname"]; recipient["lastname"].set_valid( true );
|
||||
recipient["account_no"] = in["account_no"]; recipient["account_no"].set_valid( true );
|
||||
recipient["bank_code"] = in["bank_code"]; recipient["bank_code"].set_valid( true );
|
||||
recipient["account_type"] = in["account_type"]; recipient["account_type"].set_valid( true );*/
|
||||
ret = load_db_record(recipient, "SELECT firstname,lastname,account_no,bank_code,account_type FROM sendmoney_recipient WHERE id = %lu AND member_id = %lu AND status = 1", recipientid, senderid);
|
||||
if (ret < 1L) {
|
||||
throw new bad_parameter(out, "recipientid");
|
||||
}
|
||||
|
||||
in["TerminatingEntityCode"] = recipient["bank_code"];
|
||||
in["TerminatingEntityCode"].set_valid(true);
|
||||
in["TerminatingAccountNumber"] = recipient["account_no"];
|
||||
in["TerminatingAccountNumber"].set_valid(true);
|
||||
in["transactionID"] = in["transaction_id"];
|
||||
in["transactionID"].set_valid(true);
|
||||
|
||||
CVars inx;
|
||||
inx["Fee"] = in["Fee"];
|
||||
inx["Fee"].set_valid(true);
|
||||
inx["InitiatingAmount"] = in["InitiatingAmount"];
|
||||
inx["InitiatingAmount"].set_valid(true);
|
||||
|
||||
inx["InitiatingChannel"] = in["InitiatingChannel"];
|
||||
inx["InitiatingChannel"].set_valid(true);
|
||||
inx["InitiatingCurrencyCode"] = in["InitiatingCurrencyCode"];
|
||||
inx["InitiatingCurrencyCode"].set_valid(true);
|
||||
|
||||
inx["InitiatingEntityCode"] = in["InitiatingEntityCode"];
|
||||
inx["InitiatingEntityCode"].set_valid(true);
|
||||
inx["InitiatingPaymentMethodCode"] = in["InitiatingPaymentMethodCode"];
|
||||
inx["InitiatingPaymentMethodCode"].set_valid(true);
|
||||
|
||||
inx["TerminatingAccountNumber"] = in["TerminatingAccountNumber"];
|
||||
inx["TerminatingAccountNumber"].set_valid(true);
|
||||
inx["TerminatingAmount"] = in["TerminatingAmount"];
|
||||
inx["TerminatingAmount"].set_valid(true);
|
||||
|
||||
inx["TerminatingCountryCode"] = in["TerminatingCountryCode"];
|
||||
inx["TerminatingCountryCode"].set_valid(true);
|
||||
inx["TerminatingCurrencyCode"] = in["TerminatingCurrencyCode"];
|
||||
inx["TerminatingCurrencyCode"].set_valid(true);
|
||||
|
||||
inx["TerminatingEntityCode"] = in["TerminatingEntityCode"];
|
||||
inx["TerminatingEntityCode"].set_valid(true);
|
||||
inx["TerminatingPaymentMethodCode"] = in["TerminatingPaymentMethodCode"];
|
||||
inx["TerminatingPaymentMethodCode"].set_valid(true);
|
||||
|
||||
inx["recipientid"] = in["recipientid"];
|
||||
inx["recipientid"].set_valid(true);
|
||||
inx["member_id"] = in["senderid"];
|
||||
inx["member_id"].set_valid(true);
|
||||
inx["transactionID"] = in["transactionID"];
|
||||
inx["transactionID"].set_valid(true);
|
||||
|
||||
inx["transfer_code"] = "";
|
||||
inx["transfer_code"].set_valid(true);
|
||||
|
||||
|
||||
out["money_transfer_id"] = insert_db_record(DBS_VALID, "money_transfer", " money_transfer_id_seq", inx);
|
||||
if (out["money_transfer_id"].Long() < 1L) {
|
||||
throw new runtime_error("Failed to create money transfer record");
|
||||
}
|
||||
|
||||
const PGresult *res = pgsql_query("SELECT * FROM money_transfer WHERE id=%lu AND member_id = %lu", out["money_transfer_id"].Long(), in["member_id"].Long());
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
|
||||
} else {
|
||||
throw new runtime_error("Failed to create money_transfer record");
|
||||
}
|
||||
|
||||
CVars transaction;
|
||||
transaction["detail_id"] = out["money_transfer_id"];
|
||||
transaction["detail_id"].set_valid(true);
|
||||
transaction["type"] = 2L;
|
||||
/* DoTransfer */ transaction["type"].set_valid(true);
|
||||
out["transaction_id"] = insert_db_record(DBS_VALID, "money_transfer_transaction", "money_transfer_transaction_id_seq", transaction);
|
||||
if (out["transaction_id"].Long() < 1L) {
|
||||
throw new runtime_error("Failed to create money_transfer_transaction record");
|
||||
}
|
||||
CVars transaction_final;
|
||||
|
||||
char xtid[12], uniqueRef[20];
|
||||
memset(uniqueRef, 0, 20);
|
||||
// TransferCode - RequestReference - UniqueRef => request prefix for terminal owner + ID
|
||||
sprintf(uniqueRef, "%s%s000000", setup["interswitch_pfix"].c_str(), out["transaction_id"].c_str());
|
||||
//sprintf( uniqueRef, "%s%-09lu", setup["interswitch_pfix"].c_str(), out["transaction_id"].Long() );
|
||||
|
||||
transaction["transfer_code"] = uniqueRef;
|
||||
transaction["transfer_code"].set_valid(true);
|
||||
transaction_final["transfer_code"] = transaction["transfer_code"];
|
||||
transaction_final["transfer_code"].set_valid(true);
|
||||
|
||||
pgsql_exec("UPDATE money_transfer SET transfer_code='%s' WHERE id=%lu", transaction_final["transfer_code"].c_str(), out["money_transfer_id"].Long());
|
||||
|
||||
//sprintf( xtid, "%s", setup["interswitch_tid"].c_str() );
|
||||
sprintf(xtid, "%s", setup["interswitch_tid"].c_str());
|
||||
|
||||
|
||||
//in["SenderEmail"] = sender["email"]; in["SenderEmail"].set_valid(true);
|
||||
//in["BeneficiaryEmail"] = recipient["email"]; in["BeneficiaryEmail"].set_valid(true);
|
||||
|
||||
//*TAKE THE MONEY NOW
|
||||
CVars pm;
|
||||
pm["customer_id"] = senderid;
|
||||
pm["customer_id"].set_valid(true);
|
||||
pm["transfer_id"] = out["money_transfer_id"];
|
||||
pm["transfer_id"].set_valid(true);
|
||||
pm["amount"] = in["InitiatingAmount"];
|
||||
pm["amount"].set_valid(true);
|
||||
pm["fee"] = in["Fee"];
|
||||
pm["fee"].set_valid(true);
|
||||
pm["mode"] = PAYMENT_MODE;
|
||||
pm["mode"].set_valid(true);
|
||||
|
||||
/*
|
||||
#define SM_PENDING 1
|
||||
#define SM_CANCEL 3
|
||||
#define SM_FAILED 4
|
||||
#define SM_COMPLETED 5
|
||||
*/
|
||||
if (do_transferPayment(pm) == PHP_API_OK) {
|
||||
out["sendmoney_status"] = SM_PENDING;
|
||||
in["sendmoney_id"] = out["money_transfer_id"];
|
||||
ret = PHP_API_OK;
|
||||
sendmoney_email(SM_PENDING, in, out);
|
||||
// all is good on money side
|
||||
logfmt(logINFO, "*** ALL Good ------ ****** ");
|
||||
} else {
|
||||
out["sendmoney_status"] = SM_FAILED;
|
||||
throw new runtime_error("Failed to create payment record");
|
||||
}
|
||||
|
||||
load_db_record(out, "SELECT r.firstname, r.lastname, m.*,mp.confirmation,r.firstname||' '||r.lastname AS Recitient,r.account_no,b.name AS bank_name FROM money_transfer m LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid LEFT JOIN bank_entity_codes b ON b.code = r.bank_code WHERE m.id=%lu", out["money_transfer_id"].Long());
|
||||
|
||||
} catch (runtime_error& ex) {
|
||||
|
||||
out["status"] = ex.what();
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
|
||||
} catch (bad_parameter) {
|
||||
|
||||
out["status"] = "Invalid input";
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
|
||||
} catch (...) {
|
||||
|
||||
out["status"] = "Unhandled exception in INTW_doTransfer";
|
||||
ret = PHP_API_BAD_PARAM;
|
||||
|
||||
}
|
||||
|
||||
//out["wallet"].set_valid( false );
|
||||
|
||||
logfmt(logINFO, "/long WRB_doServiceTransferComplete(CVars in, CVars &out)");
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -294,10 +294,9 @@ long stripe_charge_member_paymentid(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "stripe_charge_member_paymentid()");
|
||||
out["result"] = "stripe_charge_member_paymentid() call in progress...";
|
||||
long res, ret = PHP_API_BAD_PARAM;
|
||||
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "service_id", 0, -1);
|
||||
// REQ_LONG(in, "service_id", 0, -1);
|
||||
// REQ_LONG(in, "payment_id", 0, -1);
|
||||
REQ_LONG(in, "member_id", 0, -1);
|
||||
long payment_id = REQ_LONG(in, "payment_id", 0, -1);
|
||||
|
||||
@@ -318,7 +317,7 @@ long stripe_charge_member_paymentid(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
in["description"] = "Laundry Pickup";
|
||||
in["description"] = "Account Recharge";
|
||||
in["invoice_id"] = in["payment_id"];
|
||||
|
||||
|
||||
@@ -350,7 +349,10 @@ long stripe_charge_member_paymentid(CVars in, CVars &out) {
|
||||
ret = PHP_API_OK;
|
||||
out["id"] = id;
|
||||
pgsql_exec("UPDATE members_payments SET stripe_confirm='%s',dt_confirmed=now() WHERE id = %lu", id, payment_id);
|
||||
//pgsql_exec("UPDATE members_service_request SET payment_id=%lu,dt_confirmed=now(),flags=%lu WHERE id = %lu",payment_id, CONFIRMED , in["service_id"].Long());
|
||||
/*
|
||||
|
||||
|
||||
*/
|
||||
|
||||
out["result"] = "Charge success";
|
||||
} else {
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "pgsql_wrapper.h"
|
||||
#include "stripe_charge.h"
|
||||
#include "account_mngt.h"
|
||||
#include "coupons.h"
|
||||
#include "cards.h"
|
||||
|
||||
#include "twilo.h"
|
||||
//extern CSQL *sql;
|
||||
@@ -56,6 +58,16 @@ long wrenchboard_api_main(CVars in, CVars &out) {
|
||||
return sitecrons_calls(in, out);
|
||||
}
|
||||
|
||||
if (action >= WRENCHBOARD_CARDS_START && action <= WRENCHBOARD_CARDS_END) {
|
||||
logfmt(logINFO, "card_calls");
|
||||
return card_calls(in, out);
|
||||
}
|
||||
|
||||
if (action >= WRENCHBOARD_COUPON_START && action <= WRENCHBOARD_COUPON_END) {
|
||||
logfmt(logINFO, "coupons_calls");
|
||||
return coupons_calls(in, out);
|
||||
}
|
||||
|
||||
if (action >= WRENCHBOARD_ACCOUNT_START && action <= WRENCHBOARD_ACCOUNT_END) {
|
||||
logfmt(logINFO, "account calls");
|
||||
return account_calls(in, out);
|
||||
|
||||
+474
@@ -0,0 +1,474 @@
|
||||
##### Windows
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
##### Linux
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
##### MacOS
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
##### Backup
|
||||
*.bak
|
||||
*.gho
|
||||
*.ori
|
||||
*.orig
|
||||
*.tmp
|
||||
|
||||
##### GPG
|
||||
secring.*
|
||||
|
||||
##### Dropbox
|
||||
# Dropbox settings and caches
|
||||
.dropbox
|
||||
.dropbox.attr
|
||||
.dropbox.cache
|
||||
|
||||
##### SynopsysVCS
|
||||
# Waveform formats
|
||||
*.vcd
|
||||
*.vpd
|
||||
*.evcd
|
||||
*.fsdb
|
||||
|
||||
# Default name of the simulation executable. A different name can be
|
||||
# specified with this switch (the associated daidir database name is
|
||||
# also taken from here): -o <path>/<filename>
|
||||
simv
|
||||
|
||||
# Generated for Verilog and VHDL top configs
|
||||
simv.daidir/
|
||||
simv.db.dir/
|
||||
|
||||
# Infrastructure necessary to co-simulate SystemC models with
|
||||
# Verilog/VHDL models. An alternate directory may be specified with this
|
||||
# switch: -Mdir=<directory_path>
|
||||
csrc/
|
||||
|
||||
# Log file - the following switch allows to specify the file that will be
|
||||
# used to write all messages from simulation: -l <filename>
|
||||
*.log
|
||||
|
||||
# Coverage results (generated with urg) and database location. The
|
||||
# following switch can also be used: urg -dir <coverage_directory>.vdb
|
||||
simv.vdb/
|
||||
urgReport/
|
||||
|
||||
# DVE and UCLI related files.
|
||||
DVEfiles/
|
||||
ucli.key
|
||||
|
||||
# When the design is elaborated for DirectC, the following file is created
|
||||
# with declarations for C/C++ functions.
|
||||
vc_hdrs.h
|
||||
|
||||
##### SVN
|
||||
.svn/
|
||||
|
||||
##### Mercurial
|
||||
.hg/
|
||||
.hgignore
|
||||
.hgsigs
|
||||
.hgsub
|
||||
.hgsubstate
|
||||
.hgtags
|
||||
|
||||
##### Bazaar
|
||||
.bzr/
|
||||
.bzrignore
|
||||
|
||||
##### CVS
|
||||
/CVS/*
|
||||
**/CVS/*
|
||||
.cvsignore
|
||||
*/.cvsignore
|
||||
|
||||
##### TortoiseGit
|
||||
# Project-level settings
|
||||
/.tgitconfig
|
||||
|
||||
##### PuTTY
|
||||
# Private key
|
||||
*.ppk
|
||||
|
||||
##### Vim
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
!*.svg # comment out if you don't need vector files
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-rt-v][a-z]
|
||||
[._]ss[a-gi-z]
|
||||
[._]sw[a-p]
|
||||
|
||||
# Session
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
|
||||
# Temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# Auto-generated tag files
|
||||
tags
|
||||
# Persistent undo
|
||||
[._]*.un~
|
||||
|
||||
##### Emacs
|
||||
# -*- mode: gitignore; -*-
|
||||
*~
|
||||
\#*\#
|
||||
/.emacs.desktop
|
||||
/.emacs.desktop.lock
|
||||
*.elc
|
||||
auto-save-list
|
||||
tramp
|
||||
.\#*
|
||||
|
||||
# Org-mode
|
||||
.org-id-locations
|
||||
*_archive
|
||||
|
||||
# flymake-mode
|
||||
*_flymake.*
|
||||
|
||||
# eshell files
|
||||
/eshell/history
|
||||
/eshell/lastdir
|
||||
|
||||
# elpa packages
|
||||
/elpa/
|
||||
|
||||
# reftex files
|
||||
*.rel
|
||||
|
||||
# AUCTeX auto folder
|
||||
/auto/
|
||||
|
||||
# cask packages
|
||||
.cask/
|
||||
dist/
|
||||
|
||||
# Flycheck
|
||||
flycheck_*.el
|
||||
|
||||
# server auth directory
|
||||
/server/
|
||||
|
||||
# projectiles files
|
||||
.projectile
|
||||
|
||||
# directory configuration
|
||||
.dir-locals.el
|
||||
|
||||
# network security
|
||||
/network-security.data
|
||||
|
||||
##### SublimeText
|
||||
# Cache files for Sublime Text
|
||||
*.tmlanguage.cache
|
||||
*.tmPreferences.cache
|
||||
*.stTheme.cache
|
||||
|
||||
# Workspace files are user-specific
|
||||
*.sublime-workspace
|
||||
|
||||
# Project files should be checked into the repository, unless a significant
|
||||
# proportion of contributors will probably not be using Sublime Text
|
||||
# *.sublime-project
|
||||
|
||||
# SFTP configuration file
|
||||
sftp-config.json
|
||||
sftp-config-alt*.json
|
||||
|
||||
# Package control specific files
|
||||
Package Control.last-run
|
||||
Package Control.ca-list
|
||||
Package Control.ca-bundle
|
||||
Package Control.system-ca-bundle
|
||||
Package Control.cache/
|
||||
Package Control.ca-certs/
|
||||
Package Control.merged-ca-bundle
|
||||
Package Control.user-ca-bundle
|
||||
oscrypto-ca-bundle.crt
|
||||
bh_unicode_properties.cache
|
||||
|
||||
# Sublime-github package stores a github token in this file
|
||||
# https://packagecontrol.io/packages/sublime-github
|
||||
GitHub.sublime-settings
|
||||
|
||||
##### Notepad++
|
||||
# Notepad++ backups #
|
||||
*.bak
|
||||
|
||||
##### TextMate
|
||||
*.tmproj
|
||||
*.tmproject
|
||||
tmtags
|
||||
|
||||
##### VisualStudioCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
##### NetBeans
|
||||
**/nbproject/private/
|
||||
**/nbproject/Makefile-*.mk
|
||||
**/nbproject/Package-*.bash
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
##### JetBrains
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
##### Eclipse
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
.apt_generated_test/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
# Uncomment this line if you wish to ignore the project description file.
|
||||
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||
#.project
|
||||
|
||||
##### Dreamweaver
|
||||
# DW Dreamweaver added files
|
||||
_notes
|
||||
_compareTemp
|
||||
configs/
|
||||
dwsync.xml
|
||||
dw_php_codehinting.config
|
||||
*.mno
|
||||
|
||||
##### CodeKit
|
||||
# General CodeKit files to ignore
|
||||
config.codekit
|
||||
config.codekit3
|
||||
/min
|
||||
|
||||
##### Gradle
|
||||
.gradle
|
||||
**/build/
|
||||
!src/**/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||
# gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
##### Composer
|
||||
composer.phar
|
||||
/vendor/
|
||||
|
||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||
composer.lock
|
||||
|
||||
##### PHP CodeSniffer
|
||||
# gitignore for the PHP Codesniffer framework
|
||||
# website: https://github.com/squizlabs/PHP_CodeSniffer
|
||||
#
|
||||
# Recommended template: PHP.gitignore
|
||||
|
||||
/wpcs/*
|
||||
|
||||
##### SASS
|
||||
.sass-cache/
|
||||
*.css.map
|
||||
*.sass.map
|
||||
*.scss.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,43 +0,0 @@
|
||||
<?
|
||||
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
|
||||
|
||||
$randd = rand(1, 5) * 1000;
|
||||
$data['member_id'] = 1;
|
||||
$data['group_id'] = 1;
|
||||
$data['firstname'] = "Firstnme" . $randd;
|
||||
$data['lastname'] = "Lastname" . $randd;
|
||||
$data['email'] = "ses66181+$randd@gmail.com";
|
||||
|
||||
$data['action'] = WRENCHBOARD_JOB_GROUP_MEMBER;
|
||||
print_r($data);
|
||||
$out = array();
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
//phpinfo();
|
||||
|
||||
/*
|
||||
*
|
||||
* //**************************************************************
|
||||
#define WRENCHBOARD_JOBS_START 13000
|
||||
|
||||
#define WRENCHBOARD_JOB_CREATEJOB 13010
|
||||
|
||||
#define WRENCHBOARD_JOBS_END 13999
|
||||
//**************************************************************
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
|
||||
$email = 'ses66181+1@gmail.com';
|
||||
$email = 'ameye@chiefsoft.com';
|
||||
$data['email'] = $email;
|
||||
$data['username'] = 'admin'; //$email;
|
||||
$data['password'] = 'may12002';
|
||||
$data['terms'] = 1; // $terms;
|
||||
$data['news'] = 1; //$news;
|
||||
$data['loc'] = "38.101.241.200";
|
||||
$data['sessionid'] = rand(10000,99999)."A".rand(10000,99999);
|
||||
$data['action'] = 10010;
|
||||
|
||||
$out = array();
|
||||
$ret = $wrenchboard->wrenchboard_api($data,$out);
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
//phpinfo();
|
||||
?>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
include '../backend.php';
|
||||
$base_url = 'https://fluxtra:fl0xtra!@oameye.works.wrenchboard.com/svs/user';
|
||||
$local_url = 'https://fluxtra:fl0xtra!@oameye.works.wrenchboard.com/svs/user';
|
||||
|
||||
$base_url = 'http://fluxtra:fl0xtra!@oameye.works.wrenchboard.com/svs/user';
|
||||
$local_url = 'http://fluxtra:fl0xtra!@oameye.works.wrenchboard.com/svs/user';
|
||||
|
||||
//$base_url = 'https://www.wrenchboard.com/svs/user';
|
||||
//$local_url = 'https://www.wrenchboard.com/svs/user';
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,47 +0,0 @@
|
||||
<?
|
||||
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
$data['title'] = rand(100,999).'Job Title Job Title Job Title Job Title'.rand(100,999);
|
||||
|
||||
for ($i=0; $i<= rand(2,5); $i++){
|
||||
$data['description'] .= 'Job description';
|
||||
}
|
||||
|
||||
for ($i=0; $i<= rand(5,15); $i++){
|
||||
$data['job_detail'] .= 'Job job_detail ';
|
||||
}
|
||||
$data['timeline_days'] = rand(1,3);
|
||||
$data['price'] = rand(1,5)*1000;
|
||||
$data['member_id'] = 1;
|
||||
$data['action'] = 13010;
|
||||
print_r($data);
|
||||
$out = array();
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
//phpinfo();
|
||||
|
||||
/*
|
||||
*
|
||||
* //**************************************************************
|
||||
#define WRENCHBOARD_JOBS_START 13000
|
||||
|
||||
#define WRENCHBOARD_JOB_CREATEJOB 13010
|
||||
|
||||
#define WRENCHBOARD_JOBS_END 13999
|
||||
//**************************************************************
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
define('PHP_API_OK', 0);
|
||||
define('PHP_API_BAD_PARAM', -1);
|
||||
|
||||
define('WRENCHBOARD_SESSION_CHECK', 299);
|
||||
define('WRENCHBOARD_USER_LOGIN', 300);
|
||||
define('WRENCHBOARD_USER_LOGOUT', 301);
|
||||
define('WRENCHBOARD_CREATE_ACCOUNT', 320);
|
||||
|
||||
//**************************************************************
|
||||
define('WRENCHBOARD_BKO_START', 10000);
|
||||
|
||||
define('WRENCHBOARD_BKO_LOGIN', 10010);
|
||||
define('WRENCHBOARD_BKO_CREATEUSER', 10015);
|
||||
define('WRENCHBOARD_BKO_UPDATEUSER', 10020);
|
||||
|
||||
define('WRENCHBOARD_BKO_END', 10999);
|
||||
//**************************************************************
|
||||
define('WRENCHBOARD_ACCOUNT_START', 11000);
|
||||
|
||||
define('WRENCHBOARD_ACCOUNT_TESTEMAIL', 11001);
|
||||
define('WRENCHBOARD_ACCOUNT_PENDING', 11010);
|
||||
define('WRENCHBOARD_VERIFY_PENDING_LINK', 11015);
|
||||
define('WRENCHBOARD_ACCOUNT_CREATEACC', 11020);
|
||||
define('WRENCHBOARD_ACCOUNT_LOGIN', 11025);
|
||||
|
||||
define('WRENCHBOARD_ACCOUNT_END', 11999);
|
||||
//**************************************************************
|
||||
|
||||
define('WRENCHBOARD_JOB_GROUP_MEMBER', 13015) ;
|
||||
define('WRENCHBOARD_JOB_DELETE_GROUPMEMBER',13017);
|
||||
define('WRENCHBOARD_JOB_CREATE_GROUP', 13020);
|
||||
define('WRENCHBOARD_JOB_DELETE_GROUP',13023);
|
||||
|
||||
define('WRENCHBOARD_GROUP_START', 12000);
|
||||
|
||||
define('WRENCHBOARD_GROUP_CREATEGROUP', 12010);
|
||||
define('WRENCHBOARD_GROUP_INVITEGROUP', 12015);
|
||||
define('WRENCHBOARD_GROUP_ACCEPTGROUP', 12020);
|
||||
|
||||
define('WRENCHBOARD_GROUP_END', 12999);
|
||||
//**************************************************************
|
||||
|
||||
define('WRENCHBOARD_LOGIN_SHOP', 50501);
|
||||
define('WRENCHBOARD_LOGIN_ADMIN', 50502);
|
||||
define('WRENCHBOARD_LOGIN_MANAGER', 50503);
|
||||
|
||||
define('WRENCHBOARD_SURVEY_DATA', 55000);
|
||||
define('WRENCHBOARD_ADD_SURVEY', 55050);
|
||||
define('WRENCHBOARD_LOAD_SURVEY', 55055);
|
||||
|
||||
|
||||
define('WRENCHBOARD_COMPLETE_SENDMONEY_INTERSW', 555);
|
||||
define('WRENCHBOARD_GETBILLER_INTERSW', 556);
|
||||
define('WRENCHBOARD_BILL_PAYMENT_ADVICE_INTERSW', 557);
|
||||
|
||||
define('WRENCHBOARD_INTERSW_GETBILLER', 556);
|
||||
define('WRENCHBOARD_INTERSW_BILL_PAYMENT_ADVICE', 557);
|
||||
define('WRENCHBOARD_INTERSW_GETBILLERPAYMENTINTEMS', 558);
|
||||
define('WRENCHBOARD_INTERSW_GETBILLERCATEGORIES', 559);
|
||||
define('WRENCHBOARD_INTERSW_DO_TRANSFER', 560);
|
||||
define('WRENCHBOARD_INTERSW_QUERY_TRANSACTION', 561);
|
||||
|
||||
define('WRENCHBOARD_ADD_MONEYRECIPIENT', 600);
|
||||
|
||||
define('WRENCHBOARD_CREATE_USER_ACCOUNT', 700);
|
||||
define('WRENCHBOARD_USER_ACCOUNT_LOGIN', 710);
|
||||
define('WRENCHBOARD_START_PASSWORDRESET', 720);
|
||||
define('WRENCHBOARD_COMPLETE_PASSWORDRESET', 730);
|
||||
|
||||
//#define WRENCHBOARD_START_ADDMONEY', 770 );
|
||||
//#define WRENCHBOARD_COMPLETE_ADDMONEY' 775 );
|
||||
|
||||
define('WRENCHBOARD_ADD_MOBILE_TOPUPNUM', 900);
|
||||
define('WRENCHBOARD_PROMO_CALL', 990);
|
||||
|
||||
|
||||
define('WRENCHBOARD_STOREFACE_GET_ACCOUNT_BALANCE', 891);
|
||||
|
||||
define('WRENCHBOARD_LOG_ENTRY', 900000);
|
||||
define('WRENCHBOARD_CREDIT_TOPUP', 900010);
|
||||
|
||||
define('WRENCHBOARD_TOPUP_ORDER', 900020);
|
||||
define('WRENCHBOARD_TOPUP_ORDER_PURCHASE', 900030);
|
||||
define('WRENCHBOARD_PAYPAL_IPNMSG', 900090);
|
||||
|
||||
define('WRENCHBOARD_BULKTOPUP_ORDER', 700010);
|
||||
define('WRENCHBOARD_BULKTOPUP_ITEM', 700020);
|
||||
define('WRENCHBOARD_BULKTOPUP_ITEMUPDATE', 700030);
|
||||
define('WRENCHBOARD_BULKTOPUP_DELIVER', 700040);
|
||||
|
||||
define('WRENCHBOARD_BALANCE_TOPUP_ORDER', 800020);
|
||||
define('WRENCHBOARD_BALANCE_TOPUP_PURCHASE', 800030);
|
||||
define('WRENCHBOARD_BALANCE_TOPUP_PAYMENT', 800040);
|
||||
|
||||
define('VIRTUAL_AIRTOPUP', 70011);
|
||||
define('PAY_MODE_BALANCE', 0);
|
||||
define('PAY_MODE_CCARD', 1);
|
||||
define('PAY_MODE_BONUS', 9);
|
||||
define('APPROVED_BALANCE', 5);
|
||||
define('DISAPROVE_BALANCE', 3);
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
// Include and instantiate the class.
|
||||
require_once 'Mobile_Detect.php';
|
||||
$detect = new Mobile_Detect;
|
||||
|
||||
// Any mobile device (phones or tablets).
|
||||
if ( $detect->isMobile() ) {
|
||||
echo 'mobile -> '.$detect->isMobile();
|
||||
}
|
||||
|
||||
// Any tablet device.
|
||||
if( $detect->isTablet() ){
|
||||
|
||||
}
|
||||
|
||||
// Exclude tablets.
|
||||
if( $detect->isMobile() && !$detect->isTablet() ){
|
||||
|
||||
}
|
||||
|
||||
// Check for a specific platform with the help of the magic methods:
|
||||
if( $detect->isiOS() ){
|
||||
|
||||
}
|
||||
|
||||
if( $detect->isAndroidOS() ){
|
||||
|
||||
}
|
||||
|
||||
// Alternative method is() for checking specific properties.
|
||||
// WARNING: this method is in BETA, some keyword properties will change in the future.
|
||||
$detect->is('Chrome');
|
||||
$detect->is('iOS');
|
||||
$detect->is('UC Browser');
|
||||
// [...]
|
||||
|
||||
// Batch mode using setUserAgent():
|
||||
$userAgents = array(
|
||||
'Mozilla/5.0 (Linux; Android 4.0.4; Desire HD Build/IMM76D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19',
|
||||
'BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103',
|
||||
// [...]
|
||||
);
|
||||
foreach($userAgents as $userAgent){
|
||||
|
||||
$detect->setUserAgent($userAgent);
|
||||
$isMobile = $detect->isMobile();
|
||||
$isTablet = $detect->isTablet();
|
||||
// Use the force however you want.
|
||||
|
||||
}
|
||||
|
||||
// Get the version() of components.
|
||||
// WARNING: this method is in BETA, some keyword properties will change in the future.
|
||||
$detect->version('iPad'); // 4.3 (float)
|
||||
$detect->version('iPhone'); // 3.1 (float)
|
||||
$detect->version('Android'); // 2.1 (float)
|
||||
$detect->version('Opera Mini'); // 5.0 (float)
|
||||
// [...]
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
$ret = $wrenchboard->wrenchboard_api($in,$out);
|
||||
var_dump($ret);
|
||||
phpinfo();
|
||||
?>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
|
||||
Array ( [title] => Re:Week 1 CAT 2: “Muddiest” Point [description] => sffss [timeline] => 3 [job_detail] => sgsagsagashas [price] => 5000 [action] => 0 )
|
||||
|
||||
|
||||
$data['firstname'] = 'Olu';
|
||||
$data['lastname'] = 'Amey';
|
||||
|
||||
$email = 'ses66181+1@gmail.com';
|
||||
$data['email'] = $email;
|
||||
$data['username'] = $email;
|
||||
$data['password'] = 'may12002';
|
||||
$data['terms'] = 1; // $terms;
|
||||
$data['news'] = 1; //$news;
|
||||
$data['loc'] = "38.101.241.200";
|
||||
$data['sessionid'] = rand(10000,99999)."A".rand(10000,99999);
|
||||
$data['action'] = WRENCHBOARD_ACCOUNT_LOGIN;
|
||||
|
||||
$out = array();
|
||||
$ret = $wrenchboard->wrenchboard_api($data,$out);
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
//phpinfo();
|
||||
?>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
|
||||
$data['action'] = 11040;
|
||||
$data['mlog'] = "Account login";
|
||||
$data['member_id'] = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data,$out);
|
||||
var_dump($ret);
|
||||
phpinfo();
|
||||
?>
|
||||
@@ -1,104 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
echo "TEST - SEND OFFER<br>";
|
||||
define('WRENCHBOARD_JOB_OFFER_INDVI',13030);
|
||||
define('WRENCHBOARD_JOB_OFFER_GROUP',13031);
|
||||
|
||||
//#define WRENCHBOARD_JOB_OFFER_INDVI 13030
|
||||
//#define WRENCHBOARD_JOB_OFFER_GROUP 13031
|
||||
define('WRENCHBOARD_JOB_OFFER_CONCLUDE',13035);
|
||||
|
||||
if ($_POST) {
|
||||
$data["offer_code"] = $_POST['offer_code'];
|
||||
$data["offer_result"] = 100;
|
||||
$data['action'] = WRENCHBOARD_JOB_OFFER_CONCLUDE; // test EMAIL
|
||||
$data["member_id"]=3;
|
||||
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
}
|
||||
|
||||
//$data['email'] = "ameye+".rand(100,999)."@chiefsoft.com";
|
||||
$data['offer_code'] = "2R89783R2B";
|
||||
// $data['ses66181+2@gmail.com'] = "ses66181+2@gmail.com";
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Offer Test Page</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-left: 11em;
|
||||
font-family: Georgia, "Times New Roman",
|
||||
Times, serif;
|
||||
color: purple;
|
||||
background-color: #d8da3d }
|
||||
ul.navbar {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
left: 1em;
|
||||
width: 9em }
|
||||
h1 {
|
||||
font-family: Helvetica, Geneva, Arial,
|
||||
SunSans-Regular, sans-serif }
|
||||
ul.navbar li {
|
||||
background: white;
|
||||
margin: 0.5em 0;
|
||||
padding: 0.3em;
|
||||
border-right: 1em solid black }
|
||||
ul.navbar a {
|
||||
text-decoration: none }
|
||||
a:link {
|
||||
color: blue }
|
||||
a:visited {
|
||||
color: purple }
|
||||
address {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
border-top: thin dotted }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Site navigation menu -->
|
||||
<ul class="navbar">
|
||||
<li><a href="#">Home page</a>
|
||||
</ul>
|
||||
|
||||
<!-- Main content -->
|
||||
<h1>Manage Offer Test Page</h1>
|
||||
|
||||
<p>Welcome to my test page!
|
||||
<form action="#" method="POST">
|
||||
<div>
|
||||
<input type="text" name="offer_code" value="<?echo $data["offer_code"]?>" style="width: 300px;">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<p>
|
||||
<!-- Sign and date the page, it's only polite! -->
|
||||
<address>Made 5 March 2017<br>
|
||||
by myself.</address>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,62 +0,0 @@
|
||||
<?
|
||||
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
$data['member_id'] = 3;
|
||||
$data['action'] = 33020;
|
||||
|
||||
|
||||
$data["InitiatingEntityCode"] = "MBA"; //isset($_POST["InitiatingEntityCode"])?$_POST["InitiatingEntityCode"]:"";
|
||||
// $data["senderid"] = 1;
|
||||
$data["senderid"] = "1"; // isset($_POST["customerid"])?((int)$_POST["customerid"]):0;
|
||||
$data["InitiatingAmount"] = 120000 + rand(999, 99999);
|
||||
$data["Fee"] = 120;
|
||||
$data["InitiatingChannel"] = 7;
|
||||
$data["InitiatingPaymentMethodCode"] = "CA";
|
||||
$data["InitiatingCurrencyCode"] = '566'; // 566 - NRN - Naira
|
||||
|
||||
$data["recipientid"] = 1;
|
||||
$data["TerminatingPaymentMethodCode"] = "AC";
|
||||
$data["TerminatingAmount"] = $data["InitiatingAmount"];
|
||||
$data["TerminatingCurrencyCode"] = '566'; // 566 - NRN - Naira
|
||||
$data["TerminatingCountryCode"] = 'NG'; // NG - Nigeria
|
||||
$data["TerminatingAccountNumber"] = "";
|
||||
// $data["TerminatingAccountType"] = isset($_POST["TerminatingAccountType"])?$_POST["TerminatingAccountType"]:"";
|
||||
$data["TerminatingEntityCode"] = "";
|
||||
|
||||
$data["transaction_id"] = "T".rand(120000,999999);
|
||||
print_r($data);
|
||||
$out = array();
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
echo "<hr>";
|
||||
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* //**************************************************************
|
||||
#define WRENCHBOARD_SMONEY_START 33000
|
||||
|
||||
#define WRENCHBOARD_SMONEY_ADDRECIPIENT 33010
|
||||
#define WRENCHBOARD_SMONEY_MEMBER 33020
|
||||
|
||||
#define WRENCHBOARD_SMONEY_END 33999
|
||||
//**************************************************************
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
$data['firstname'] = 'Olu';
|
||||
$data['lastname'] = 'Amey';
|
||||
|
||||
$email = 'ses66181+'.rand(1000,9999).'@gmail.com';
|
||||
$email = 'ameye+'.rand(1000,9999).'@chiefsoft.com';
|
||||
$data['email'] = $email;
|
||||
$data['username'] = $email;
|
||||
$data['password'] = 'may12002';
|
||||
$data['terms'] = 1; // $terms;
|
||||
$data['news'] = 1; //$news;
|
||||
$data['loc'] = "38.101.241.200";
|
||||
|
||||
$data['action'] = WRENCHBOARD_ACCOUNT_PENDING;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data,$out);
|
||||
var_dump($ret);
|
||||
phpinfo();
|
||||
?>
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/account";
|
||||
|
||||
/*
|
||||
* 9 | ses66181+3215@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
8 | ses66181+2566@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
7 | ses66181+13@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
6 | obaxnoma@gmail.com | 7c539a49b2bad0570cd0f5dc1cf28df0
|
||||
5 | ses66181+9478@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
4 | ses66181+6018@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
3 | ses66181+3@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
2 | ses66181+2@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
1 | ses66181+1@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
|
||||
*/
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/activejoblist";
|
||||
|
||||
$username = urlencode("support+ademo".rand(1,3000)."@medtransgo.net");
|
||||
$username = "ses66181+1@gmail.com";
|
||||
|
||||
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP",
|
||||
"limit" => 10,
|
||||
"page" => "1"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/createuser";
|
||||
|
||||
$username = urlencode("ses66181+" . rand(1000, 9999) . "@gmail.com");
|
||||
|
||||
$username = "ses66181+" . rand(1000, 9999) . "@gmail.com";
|
||||
$phone = (rand(1, 2) > 1) ? "770222" . rand(2222, 9999) : '';
|
||||
|
||||
include 'sample_data.php'; // just for sample data
|
||||
$firstname = random_name(); //
|
||||
$lastname = random_name(); //
|
||||
|
||||
$data = array(
|
||||
"country" => 'NG',
|
||||
"username" => $username,
|
||||
"password" => "wrenchboard",
|
||||
"email" => $username,
|
||||
"firstname" => $firstname,
|
||||
"lastname" => $lastname,
|
||||
"phone" => $phone,
|
||||
"news" =>0 ,
|
||||
"terms" => 1
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ($status != 200) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
var_dump($response);
|
||||
|
||||
echo "<hr/>";
|
||||
var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/createuser";
|
||||
|
||||
$username = urlencode("ses66181+" . rand(1000, 9999) . "@gmail.com");
|
||||
|
||||
$username = "ses66181+" . rand(1000, 9999) . "@gmail.com";
|
||||
$phone = (rand(1, 2) > 1) ? "770222" . rand(2222, 9999) : '';
|
||||
|
||||
include 'sample_data.php'; // just for sample data
|
||||
$firstname = random_name(); //
|
||||
$lastname = random_name(); //
|
||||
|
||||
$data = array(
|
||||
"country" => 'NG',
|
||||
"username" => $username,
|
||||
"password" => "wrenchboard",
|
||||
"email" => $username,
|
||||
"firstname" => $firstname,
|
||||
"lastname" => $lastname,
|
||||
"phone" => $phone,
|
||||
"login" => 1
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ($status != 200) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
|
||||
//var_dump($response);
|
||||
|
||||
echo "<hr/>";
|
||||
var_dump($data);
|
||||
|
||||
echo "<hr/><pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,89 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
echo "TEST - EMAIL<br>";
|
||||
|
||||
if ($_POST) {
|
||||
$data["email"] = $_POST['email'];
|
||||
$data['action'] = 9999099; // test EMAIL
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>My first styled page</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-left: 11em;
|
||||
font-family: Georgia, "Times New Roman",
|
||||
Times, serif;
|
||||
color: purple;
|
||||
background-color: #d8da3d }
|
||||
ul.navbar {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
left: 1em;
|
||||
width: 9em }
|
||||
h1 {
|
||||
font-family: Helvetica, Geneva, Arial,
|
||||
SunSans-Regular, sans-serif }
|
||||
ul.navbar li {
|
||||
background: white;
|
||||
margin: 0.5em 0;
|
||||
padding: 0.3em;
|
||||
border-right: 1em solid black }
|
||||
ul.navbar a {
|
||||
text-decoration: none }
|
||||
a:link {
|
||||
color: blue }
|
||||
a:visited {
|
||||
color: purple }
|
||||
address {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
border-top: thin dotted }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Site navigation menu -->
|
||||
<ul class="navbar">
|
||||
<li><a href="#">Home page</a>
|
||||
</ul>
|
||||
|
||||
<!-- Main content -->
|
||||
<h1>Email Test Page</h1>
|
||||
|
||||
<p>Welcome to my test page!
|
||||
<form action="#" method="POST">
|
||||
<div>
|
||||
<input type="text" name="email" value="ameye@fluxtra.net">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<p>
|
||||
<!-- Sign and date the page, it's only polite! -->
|
||||
<address>Made 55 March 2017<br>
|
||||
by myself.</address>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/dashdata";
|
||||
|
||||
/*
|
||||
* 9 | ses66181+3215@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
8 | ses66181+2566@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
7 | ses66181+13@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
6 | obaxnoma@gmail.com | 7c539a49b2bad0570cd0f5dc1cf28df0
|
||||
5 | ses66181+9478@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
4 | ses66181+6018@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
3 | ses66181+3@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
2 | ses66181+2@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
1 | ses66181+1@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
|
||||
*/
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/loadprofile";
|
||||
|
||||
/*
|
||||
* 9 | ses66181+3215@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
8 | ses66181+2566@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
7 | ses66181+13@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
6 | obaxnoma@gmail.com | 7c539a49b2bad0570cd0f5dc1cf28df0
|
||||
5 | ses66181+9478@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
4 | ses66181+6018@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
3 | ses66181+3@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
2 | ses66181+2@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
1 | ses66181+1@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
|
||||
*/
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?
|
||||
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
|
||||
|
||||
$email = 'ses66181+1@gmail.com';
|
||||
$data['email'] = 'ses66181@gmail.com';
|
||||
|
||||
$data['action'] = 9090919;
|
||||
|
||||
$out = array();
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
print_r($out);
|
||||
var_dump($ret);
|
||||
//phpinfo();
|
||||
?>
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/message";
|
||||
|
||||
/*
|
||||
* 9 | ses66181+3215@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
8 | ses66181+2566@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
7 | ses66181+13@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
6 | obaxnoma@gmail.com | 7c539a49b2bad0570cd0f5dc1cf28df0
|
||||
5 | ses66181+9478@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
4 | ses66181+6018@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
3 | ses66181+3@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
2 | ses66181+2@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
1 | ses66181+1@gmail.com | d0fbea2563b377ea7074bced45c88dcb
|
||||
|
||||
*/
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,104 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
echo "TEST - SEND OFFER<br>";
|
||||
define('WRENCHBOARD_JOB_OFFER_INDVI',13030);
|
||||
define('WRENCHBOARD_JOB_OFFER_GROUP',13031);
|
||||
|
||||
//#define WRENCHBOARD_JOB_OFFER_INDVI 13030
|
||||
//#define WRENCHBOARD_JOB_OFFER_GROUP 13031
|
||||
|
||||
if ($_POST) {
|
||||
$data["email"] = $_POST['email'];
|
||||
$data['action'] = WRENCHBOARD_JOB_OFFER_INDVI; // test EMAIL
|
||||
$data["job_id"]=35;
|
||||
// $data["email"]="ameye@chiefsoft.com";
|
||||
$data["job_description"]= "Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail";
|
||||
$data["member_id"] = 1;
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
}
|
||||
|
||||
$data['email'] = "ameye+".rand(100,999)."@chiefsoft.com";
|
||||
$data['email'] = "ses66181+".rand(1,9)."@gmail.com";
|
||||
$data['ses66181+2@gmail.com'] = "ses66181+2@gmail.com";
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Offer Test Page</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-left: 11em;
|
||||
font-family: Georgia, "Times New Roman",
|
||||
Times, serif;
|
||||
color: purple;
|
||||
background-color: #d8da3d }
|
||||
ul.navbar {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
left: 1em;
|
||||
width: 9em }
|
||||
h1 {
|
||||
font-family: Helvetica, Geneva, Arial,
|
||||
SunSans-Regular, sans-serif }
|
||||
ul.navbar li {
|
||||
background: white;
|
||||
margin: 0.5em 0;
|
||||
padding: 0.3em;
|
||||
border-right: 1em solid black }
|
||||
ul.navbar a {
|
||||
text-decoration: none }
|
||||
a:link {
|
||||
color: blue }
|
||||
a:visited {
|
||||
color: purple }
|
||||
address {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
border-top: thin dotted }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Site navigation menu -->
|
||||
<ul class="navbar">
|
||||
<li><a href="#">Home page</a>
|
||||
</ul>
|
||||
|
||||
<!-- Main content -->
|
||||
<h1>Offer Test Page</h1>
|
||||
|
||||
<p>Welcome to my test page!
|
||||
<form action="#" method="POST">
|
||||
<div>
|
||||
<input type="text" name="email" value="<?echo $data["email"]?>" style="width: 300px;">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<p>
|
||||
<!-- Sign and date the page, it's only polite! -->
|
||||
<address>Made 5 March 2017<br>
|
||||
by myself.</address>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/offerslist";
|
||||
|
||||
$username = urlencode("support+ademo".rand(1,3000)."@medtransgo.net");
|
||||
$username = "ses66181+1@gmail.com";
|
||||
|
||||
|
||||
|
||||
$data = array(
|
||||
"member_id" => 1,
|
||||
"sessionid" => "ABCDEFGHIJKLMNOP",
|
||||
"limit" => 10,
|
||||
"page" => "1"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
echo "TEST - SKILL<br>";
|
||||
define('WRENCHBOARD_ACCOUNT_SAVESKILL', 11038);
|
||||
|
||||
//#define WRENCHBOARD_JOB_OFFER_INDVI 13030
|
||||
//#define WRENCHBOARD_JOB_OFFER_GROUP 13031
|
||||
|
||||
|
||||
$data["member_id"] = 1;
|
||||
$data["skill_id"] = 1;
|
||||
$data['category_id'] = 1;
|
||||
$data['action'] = WRENCHBOARD_ACCOUNT_SAVESKILL;
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
|
||||
$data["skill_id"] = 2;
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
|
||||
$data["skill_id"] = 3;
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/startjoblist";
|
||||
|
||||
$username = urlencode("support+ademo".rand(1,3000)."@medtransgo.net");
|
||||
$username = "ses66181+1@gmail.com";
|
||||
|
||||
|
||||
|
||||
$data = array(
|
||||
"limit" => 10,
|
||||
"page" => "1"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,31 +0,0 @@
|
||||
<pre>
|
||||
<?php
|
||||
|
||||
include('../backend.php');
|
||||
$hostname = $wrenchboard->cfgReadChar("database.host");
|
||||
$username = $wrenchboard->cfgReadChar("database.user");
|
||||
$password = $wrenchboard->cfgReadChar("database.pass");
|
||||
$database = $wrenchboard->cfgReadChar("database.name");
|
||||
$dbconn = pg_connect("host=${hostname} dbname=${database} user=${username} password=${password}");
|
||||
|
||||
$q = "SELECT * FROM members WHERE stripe_customer_id IS NULL ORDER BY id LIMIT 1";
|
||||
$r = pg_query($q);
|
||||
$f = pg_fetch_assoc($r);
|
||||
|
||||
$in=array(
|
||||
"action" => 90005, /* WRENCHBOARD_STRIPE_CHARGE_NEW */
|
||||
"ccnum" => "4242424242424242",
|
||||
"ccexpm" => "12",
|
||||
"ccexpy" => "18",
|
||||
"cccvc" => "123",
|
||||
"amount" => "100",
|
||||
"customer_id" => $f["id"],
|
||||
"email" => $f["email"],
|
||||
"description" => "This is a test charge for new stripe account"
|
||||
);
|
||||
$out=array();
|
||||
$ret = $wrenchboard->wrenchboard_api($in, $out);
|
||||
var_dump($ret);
|
||||
var_dump($out);
|
||||
|
||||
pg_close($dbconn);
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/userlogin";
|
||||
|
||||
$username = urlencode("support+ademo".rand(1,3000)."@medtransgo.net");
|
||||
$username = "ses66181+1@gmail.com";
|
||||
|
||||
|
||||
|
||||
$data = array(
|
||||
"username" => $username,
|
||||
"password" => "may12002",
|
||||
"sessionid" => "DUMMYSESSION"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
//echo "<hr/>";
|
||||
//var_dump($data);
|
||||
|
||||
//echo "<hr/><pre>";
|
||||
echo "<pre>";
|
||||
echo str_replace(array("{","}",","),array("{\n\t","}\n",",\n\t"),$json_response);
|
||||
echo "</pre>";
|
||||
|
||||
//echo "</pre><hr/>";
|
||||
|
||||
//echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
//echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
$url = $local_url . "/userlogin";
|
||||
|
||||
$username = urlencode("support+ademo".rand(1,3000)."@medtransgo.net");
|
||||
|
||||
// NOTE - THIS TEST RANDOMLY PICK ACCOUNTS - Some will be invalid
|
||||
|
||||
|
||||
$data = array(
|
||||
"username" => $username,
|
||||
"password" => "medtransgoBAD",
|
||||
"sessionid" => "DUMMYSESSION"
|
||||
);
|
||||
|
||||
$content = json_encode($data);
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
||||
array("Content-type" => "application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
|
||||
$json_response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ( $status != 200 ) {
|
||||
echo ("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response = json_decode($json_response, true);
|
||||
|
||||
echo "<b>RESPONSE</b><br>";
|
||||
var_dump($response);
|
||||
echo "<hr/><b>INPUT</b><br>";
|
||||
var_dump($data);
|
||||
echo "<hr/>";
|
||||
|
||||
echo "<hr/>";
|
||||
|
||||
// saving the session in a file for other call use
|
||||
$myfile = fopen("fl/sample_session.txt", "w") ;
|
||||
$txt = $response['sessionid']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = $response['member_id']."\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
|
||||
echo highlight_string(file_get_contents(__FILE__));
|
||||
?>
|
||||
@@ -1,101 +0,0 @@
|
||||
<?
|
||||
include('def.php');
|
||||
|
||||
$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$USER = str_replace('/home', '', $USER);
|
||||
$USER = strtok($USER, '/');
|
||||
//echo $USER;
|
||||
// Load API class
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $USER . '\\WrenchBoard';
|
||||
$wrenchboard = new $wrenchboard_class();
|
||||
|
||||
echo "TEST - SEND SMS<br>";
|
||||
|
||||
|
||||
//#define WRENCHBOARD_JOB_OFFER_INDVI 13030
|
||||
//#define WRENCHBOARD_JOB_OFFER_GROUP 13031
|
||||
|
||||
if ($_POST) {
|
||||
$data["phone"] = $_POST['phone'];
|
||||
$data['action'] = 9090909; // test EMAIL
|
||||
$data["job_id"]=35;
|
||||
// $data["phone"]="ameye@chiefsoft.com";
|
||||
$data["job_description"]= "Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail Job job_detail";
|
||||
$data["member_id"] = 1;
|
||||
|
||||
|
||||
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||
var_dump($out);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Offer Test Page</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-left: 11em;
|
||||
font-family: Georgia, "Times New Roman",
|
||||
Times, serif;
|
||||
color: purple;
|
||||
background-color: #d8da3d }
|
||||
ul.navbar {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
left: 1em;
|
||||
width: 9em }
|
||||
h1 {
|
||||
font-family: Helvetica, Geneva, Arial,
|
||||
SunSans-Regular, sans-serif }
|
||||
ul.navbar li {
|
||||
background: white;
|
||||
margin: 0.5em 0;
|
||||
padding: 0.3em;
|
||||
border-right: 1em solid black }
|
||||
ul.navbar a {
|
||||
text-decoration: none }
|
||||
a:link {
|
||||
color: blue }
|
||||
a:visited {
|
||||
color: purple }
|
||||
address {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
border-top: thin dotted }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Site navigation menu -->
|
||||
<ul class="navbar">
|
||||
<li><a href="#">Home page</a>
|
||||
</ul>
|
||||
|
||||
<!-- Main content -->
|
||||
<h1>Offer Test Page</h1>
|
||||
|
||||
<p>Welcome to my test page!
|
||||
<form action="#" method="POST">
|
||||
<div>
|
||||
<input type="text" name="phone" value="<?echo $data["phone"]?>" style="width: 300px;">
|
||||
<input type="submit" name="submit" value="Send">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<p>
|
||||
<!-- Sign and date the page, it's only polite! -->
|
||||
<address>Made 5 March 2017<br>
|
||||
by myself.</address>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ define('PHP_API_OK', 0);
|
||||
define('PHP_LOGIN_OK', 100);
|
||||
define('PHP_CREATED_OK', 10);
|
||||
define('PHP_API_BAD_PARAM', -1);
|
||||
define('SESSION_TIMEOUT_LOGOUT',72000);
|
||||
define('SESSION_TIMEOUT_LOGOUT',900000);
|
||||
|
||||
define('SUPPORT_PHONE','+234 (818)-3866434');
|
||||
|
||||
@@ -105,6 +105,8 @@ define('OFFER_EXPIRE',444);
|
||||
|
||||
define('OFFER_SENDTOME',777);
|
||||
|
||||
define('WEBSITE_LOGIN', 1100);
|
||||
|
||||
|
||||
define('JOB_INTEREST_ACCEPT',100);
|
||||
define('JOB_INTEREST_REJECT',200);
|
||||
@@ -155,6 +157,8 @@ define('WRENCHBOARD_RESEND_PENDING_LINK', 11019);
|
||||
define('WRENCHBOARD_ACCOUNT_CREATEACC', 11020);
|
||||
define('WRENCHBOARD_ACCOUNT_LOGIN', 11025);
|
||||
define('WRENCHBOARD_FACEBOOK_LOGIN', 11026);
|
||||
define('WRENCHBOARD_GOOGLE_LOGIN', 11027);
|
||||
define('WRENCHBOARD_APPLE_LOGIN', 11031);
|
||||
define('WRENCHBOARD_SEND_CONTACTUS', 11030);
|
||||
define('WRENCHBOARD_ACCOUNT_SENDREFER',11032);
|
||||
define('WRENCHBOARD_ACCOUNT_REFERLINK',11033);
|
||||
@@ -169,6 +173,13 @@ define('WRENCHBOARD_LOG_MEMBER', 11040);
|
||||
define('WRENCHBOARD_DELETE_RECACC', 11041);
|
||||
define('WRENCHBOARD_SAVE_GALLERY', 11042);
|
||||
|
||||
define('WRENCHBOARD_USER_ADNEWCC', 11054);
|
||||
define('WRENCHBOARD_USER_USESAVEDCC', 11056);
|
||||
|
||||
define('WRENCHBOARD_USER_SETTINGS', 11058);
|
||||
|
||||
|
||||
define('WRENCHBOARD_USER_DELETEACC', 11990);
|
||||
define('WRENCHBOARD_ACCOUNT_END', 11999);
|
||||
//**************************************************************
|
||||
define('WRENCHBOARD_JOB_CREATEJOB',13010 );
|
||||
@@ -269,3 +280,11 @@ define('PAY_MODE_BONUS', 9);
|
||||
define('APPROVED_BALANCE', 5);
|
||||
define('DISAPROVE_BALANCE', 3);
|
||||
|
||||
// define('WRENCHBOARD_COUPON_CREATE', 85010);
|
||||
// define('WRENCHBOARD_COUPON_ACTIVATE',85015);
|
||||
define('WRENCHBOARD_COUPON_REDEEM', 85020);
|
||||
|
||||
|
||||
define('WRENCHBOARD_USER_SENDMONEY', 11051);
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
| Examples: my-controller/index -> my_controller/index
|
||||
| my-controller/my-method -> my_controller/my_method
|
||||
*/
|
||||
$route['default_controller'] = 'site';
|
||||
$route['default_controller'] = 'login';
|
||||
$route['404_override'] = 'Wrb404';
|
||||
$route['translate_uri_dashes'] = FALSE;
|
||||
$route['auth/(.+)'] = 'home/auth/$1';
|
||||
|
||||
$route['cardreciepts/(.+)'] = 'paymnt/cardreciepts/$1';
|
||||
|
||||
@@ -6,7 +6,8 @@ class Bko extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$data["username"] = "";
|
||||
$this->load->view('bko/view_bko_login', $data);
|
||||
//$this->load->view('bko/view_bko_login', $data);
|
||||
echo '';
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
|
||||
@@ -25,7 +25,8 @@ class Bkotransaction extends Bko_Controller {
|
||||
$mysql = "SELECT m.id,mp.confirmation, m.added,me.firstname||' '||me.lastname||'<br>'||me.email AS Sender,"
|
||||
. "sr.firstname||' '||sr.lastname||'<br>ACC:'||sr.account_no||'-'||be.name AS recipient, m.initiatingamount*0.01 AS Amount,m.fee*0.01 AS Fee, "
|
||||
. "'<input type=submit id=\"accs'||m.id||'\" onclick=\"return smoneyDetail('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Detail\">' As Detail, "
|
||||
. "'<input type=submit id=\"acc'||m.id||'\" onclick=\"return smoneyProcess('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Process\">' As Process "
|
||||
. "'<input type=submit id=\"acc'||m.id||'\" onclick=\"return smoneyProcess('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Process\">' As Process, "
|
||||
. "m.initiatingamount AS raw_amount, m.fee AS raw_fee, sr.bank_code, sr.account_no "
|
||||
. "FROM money_transfer m "
|
||||
. "LEFT JOIN members me ON me.id=m.member_id "
|
||||
. "LEFT JOIN sendmoney_recipient sr ON sr.id=m.recipientid "
|
||||
@@ -39,7 +40,7 @@ class Bkotransaction extends Bko_Controller {
|
||||
|
||||
break;
|
||||
|
||||
case 'TRANSDETAIL':
|
||||
case 'TRANSDETAIL':
|
||||
|
||||
$mysql = "SELECT m.id,mp.confirmation, m.added,me.firstname||' '||me.lastname||'<br>'||me.email AS Sender,"
|
||||
. "sr.firstname||' '||sr.lastname||'<br>ACC:'||sr.account_no||'-'||be.name AS recipient, m.initiatingamount*0.01 AS Amount,m.fee*0.01 AS Fee "
|
||||
@@ -65,93 +66,155 @@ class Bkotransaction extends Bko_Controller {
|
||||
|
||||
case 'COMPLETE':
|
||||
//echo 'complete 1';
|
||||
// url: "/bkotransaction/smprocess?proc=COMPLETE&sendmoney_id="+link_id+'&tcode='+tcode+'&tref='+tref
|
||||
// url: "/bkotransaction/smprocess?proc=COMPLETE&sendmoney_id="+link_id+'&tcode='+tcode+'&tref='+tref
|
||||
$data["trans_code"] = $this->input->get('tcode');
|
||||
$data["trans_tref"] = $this->input->get('tref');
|
||||
$data["sendmoney_id"] = $sendmoney_id;
|
||||
$data['action'] = WRENCHBOARD_SMONEY_BKOPROC;
|
||||
$data['action_mode'] = SMONEY_PROCC_MANUAL;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$this->backend_model->wrenchboard_api($data, $out);
|
||||
echo $out['status'];
|
||||
|
||||
|
||||
echo $this->sendmoneyCompletePage($data);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
protected function sendmoneyCompletePage($data) {
|
||||
$data['action'] = WRENCHBOARD_SMONEY_BKOPROC;
|
||||
$data['action_mode'] = SMONEY_PROCC_MANUAL;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$this->backend_model->wrenchboard_api($data, $out);
|
||||
return $out['status'];
|
||||
}
|
||||
|
||||
|
||||
public function smTransmitProcess() {
|
||||
// url: "/bkotransaction/smprocess?proc=PROCESS&sendmoney_id="+link_id
|
||||
$proc = $this->input->get('proc');
|
||||
$sendmoney_id = $this->input->get('sendmoney_id');
|
||||
// url: "/bkotransaction/smprocess?proc=PROCESS&sendmoney_id="+link_id
|
||||
$proc = $this->input->get('proc');
|
||||
$sendmoney_id = $this->input->get('sendmoney_id');
|
||||
|
||||
switch ($proc) {
|
||||
case 'PROCESS':
|
||||
$mysql = "SELECT m.id,mp.confirmation, m.added,me.firstname||' '||me.lastname||'<br>'||me.email AS Sender,"
|
||||
. "sr.firstname||' '||sr.lastname||'<br>ACC:'||sr.account_no||'-'||be.name AS recipient, m.initiatingamount*0.01 AS Amount,m.fee*0.01 AS Fee, "
|
||||
. "'<input type=submit id=\"accs'||m.id||'\" onclick=\"return smoneyDetail('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Detail\">' As Detail, "
|
||||
. "'<input type=submit id=\"acc'||m.id||'\" onclick=\"return smoneyProcess('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Process\">' As Process "
|
||||
. "FROM money_transfer m "
|
||||
. "LEFT JOIN members me ON me.id=m.member_id "
|
||||
. "LEFT JOIN sendmoney_recipient sr ON sr.id=m.recipientid "
|
||||
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
|
||||
. "LEFT JOIN bank_entity_codes be ON be.code=sr.bank_code WHERE m.id=" . $sendmoney_id;
|
||||
switch ($proc) {
|
||||
case 'PROCESS':
|
||||
$mysql = "SELECT m.id,mp.confirmation, m.added,me.firstname||' '||me.lastname||'<br>'||me.email AS Sender,"
|
||||
. "sr.firstname||' '||sr.lastname||'<br>ACC:'||sr.account_no||'-'||be.name AS recipient, m.initiatingamount*0.01 AS Amount,m.fee*0.01 AS Fee, "
|
||||
. "'<input type=submit id=\"accs'||m.id||'\" onclick=\"return smoneyDetail('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Detail\">' As Detail, "
|
||||
. "'<input type=submit id=\"acc'||m.id||'\" onclick=\"return smoneyProcess('||m.id||')\" name=\"manage\" class=\"btn btn-info btn-sm\" value=\"Process\">' As Process, "
|
||||
. "m.initiatingamount AS raw_amount, m.fee AS raw_fee, sr.bank_code, sr.account_no "
|
||||
. "FROM money_transfer m "
|
||||
. "LEFT JOIN members me ON me.id=m.member_id "
|
||||
. "LEFT JOIN sendmoney_recipient sr ON sr.id=m.recipientid "
|
||||
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
|
||||
. "LEFT JOIN bank_entity_codes be ON be.code=sr.bank_code WHERE m.id=" . $sendmoney_id;
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
$row = $query->row_array();
|
||||
$query = $this->db->query($mysql);
|
||||
$row = $query->row_array();
|
||||
|
||||
echo $this->sendmoneyProcessPage($row);
|
||||
echo $this->sendmoneyProcessPage($row);
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'DETAIL':
|
||||
case 'DETAIL':
|
||||
|
||||
echo 'detail';
|
||||
echo 'detail';
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'TRANSMIT':
|
||||
//echo 'complete 1';
|
||||
// url: "/bkotransaction/smprocess?proc=COMPLETE&sendmoney_id="+link_id+'&tcode='+tcode+'&tref='+tref
|
||||
$data["trans_code"] = $this->input->get('tcode');
|
||||
$data["trans_tref"] = $this->input->get('tref');
|
||||
$data["sendmoney_id"] = $sendmoney_id;
|
||||
$data['action'] = WRENCHBOARD_SMONEY_BKOPROC;
|
||||
$data['action_mode'] = SMONEY_PROCC_INTERSWITCH;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$this->backend_model->wrenchboard_api($data, $out);
|
||||
echo $out['status'];
|
||||
|
||||
|
||||
|
||||
break;
|
||||
case 'TRANSMIT':
|
||||
//echo 'complete 1';
|
||||
// url: "/bkotransaction/smprocess?proc=COMPLETE&sendmoney_id="+link_id+'&tcode='+tcode+'&tref='+tref
|
||||
$data["trans_code"] = $this->input->get('tcode');
|
||||
$data["trans_tref"] = $this->input->get('tref');
|
||||
$data["sendmoney_id"] = $sendmoney_id;
|
||||
$mysql = "SELECT m.id,mp.confirmation, m.added,me.firstname||' '||me.lastname||'<br>'||me.email AS sender,
|
||||
sr.firstname||' '||sr.lastname||'<br>ACC:'||sr.account_no||'-'||be.name AS recipient,
|
||||
m.initiatingamount*0.01 AS amount, m.fee*0.01 AS fee,
|
||||
m.initiatingamount AS raw_amount, m.fee AS raw_fee, sr.bank_code, sr.account_no
|
||||
FROM money_transfer m
|
||||
LEFT JOIN members me ON me.id=m.member_id
|
||||
LEFT JOIN sendmoney_recipient sr ON sr.id=m.recipientid
|
||||
LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id
|
||||
LEFT JOIN bank_entity_codes be ON be.code=sr.bank_code WHERE m.id=" . $sendmoney_id;
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
$row = $query->row_array();
|
||||
|
||||
echo $this->sendmoneyProcessPage($row, $data);
|
||||
/*
|
||||
$data['action'] = WRENCHBOARD_SMONEY_BKOPROC;
|
||||
$data['action_mode'] = SMONEY_PROCC_INTERSWITCH;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$this->backend_model->wrenchboard_api($data, $out);
|
||||
echo $out['status'];
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function TransmitSendmoneyProcessPage($out) {
|
||||
|
||||
$myTable = "<form id='sendmoneyProcessPage" . $out['id'] . "' name='sendmoneyProcessPage" . $out['id'] . "'><table class='table table-striped table-hover table-bordered table-condensed'>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Confirmation</b></td><td>" . $out['confirmation'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Trx. Date</b></td><td>" . $out['added'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Sender</b></td><td>" . $out['sender'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Recipient</b></td><td>" . $out['recipient'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Amount</b></td><td>" . $out['amount'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Fee</b></td><td>" . $out['fee'] . "</td></tr>";
|
||||
|
||||
$myTable .="<tr><td style='width:100px;'><b></b></td><td></td></tr>";
|
||||
$myTable .="</table></form> ";
|
||||
$myTable = "<form id='sendmoneyProcessPage" . $out['id'] . "' name='sendmoneyProcessPage" . $out['id'] . "'><table class='table table-striped table-hover table-bordered table-condensed'>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Confirmation</b></td><td>" . $out['confirmation'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Trx. Date</b></td><td>" . $out['added'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Sender</b></td><td>" . $out['sender'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Recipient</b></td><td>" . $out['recipient'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Amount</b></td><td>" . $out['amount'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Fee</b></td><td>" . $out['fee'] . "</td></tr>";
|
||||
|
||||
$myTable .="<tr><td style='width:100px;'><b></b></td><td></td></tr>";
|
||||
$myTable .="</table></form> ";
|
||||
|
||||
return $myTable;
|
||||
}
|
||||
return $myTable;
|
||||
}
|
||||
|
||||
private function sendmoneyProcessPage($out) {
|
||||
private function sendmoneyProcessPage($out, $page=array()) {
|
||||
$data = array(
|
||||
"account_bank" => $out['bank_code'],
|
||||
"account_number" => $out['account_no'],
|
||||
"amount" => $out['raw_amount'],
|
||||
"narration" => $out['sender'],
|
||||
"currency" => "NGN",
|
||||
"reference" => $out['id'],
|
||||
"debit_currency" => "NGN"
|
||||
);
|
||||
$url = "http://localhost:3000/create";
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch,CURLOPT_URL, $url);
|
||||
curl_setopt($ch,CURLOPT_POST, count($data));
|
||||
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($data));
|
||||
curl_setopt($ch,CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$myTable = "<form id='sendmoneyProcessPage" . $out['id'] . "' name='sendmoneyProcessPage" . $out['id'] . "'><table class='table table-striped table-hover table-bordered table-condensed'>";
|
||||
$data = json_decode($result, true);
|
||||
// Error
|
||||
// {"status":"failure","message":"Invalid response","details":"Request failed with status code 400","code":400,"data":{"status":"error","code":"UNAUTHORIZED_ACCESS","message":"Unauthorized access. Compliance approval required to use this feature"}}
|
||||
// Success
|
||||
// ???
|
||||
$page["message"] = "";
|
||||
if ($data == null || $data == "" || (array_key_exists("status",$data) && $data["status"]=="failure")) {
|
||||
if ($data == null || $data == "") {
|
||||
// Invalid response, not clear what is going on (non-JSON response from the payment API)
|
||||
$page["message"] = "Invalid payment API respose: ".htmlentities($result);
|
||||
} else if (array_key_exists("data",$data) && array_key_exists("message",$data["data"])) {
|
||||
// Payment processor message
|
||||
$page["message"] = $data["data"]["message"];
|
||||
} else if (array_key_exists("message",$data)) {
|
||||
// Payment API message
|
||||
$page["message"] = $data["message"];
|
||||
} else {
|
||||
// Not clear what is going on (failure with no messages?)
|
||||
$page["message"] = "Invalid payment API respose: ".htmlentities($result);
|
||||
}
|
||||
} else {
|
||||
// TODO: success
|
||||
}
|
||||
// $page['confirmation']
|
||||
// $page['trans_code']
|
||||
// $data['trans_tref']
|
||||
|
||||
$myTable = "<form id='sendmoneyProcessPage" . $out['id'] . "' name='sendmoneyProcessPage" . $out['id'] . "'>";
|
||||
$myTable .="<span style='font-weight:bold;color:red'>".$page["message"]."</span>";
|
||||
$myTable .="<table class='table table-striped table-hover table-bordered table-condensed'>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Confirmation</b></td><td>" . $out['confirmation'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Trx. Date</b></td><td>" . $out['added'] . "</td></tr>";
|
||||
$myTable .="<tr><td style='width:100px;'><b>Sender</b></td><td>" . $out['sender'] . "</td></tr>";
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Coupons extends Users_Controller {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
||||
redirect(home);
|
||||
}
|
||||
}
|
||||
|
||||
public function index(){
|
||||
|
||||
$data = $this->getSessionArray();
|
||||
$this->load->model('coupon_model');
|
||||
$activeCouponResult = $this->coupon_model->loadMemberActiveCoupons($_SESSION['member_id'] ,$fliters=[]);
|
||||
$_SESSION['coupon'] = $activeCouponResult->num_rows();
|
||||
$data['coupon_table_row'] = $activeCouponResult->result();
|
||||
|
||||
$redeemCouponResult = $this->coupon_model->loadMemberRedeemCoupons($_SESSION['member_id'] ,$fliters=[]);
|
||||
$data['coupon_redeem_row'] = $redeemCouponResult->result();
|
||||
|
||||
|
||||
|
||||
$data['page_title'] ="Coupons";
|
||||
$this->renderSecurePage('users/view_coupon', $data);
|
||||
}
|
||||
|
||||
public function redeem(){
|
||||
|
||||
$what = $this->input->get('what');
|
||||
$value = $this->input->get('value');
|
||||
|
||||
if ($what !='' && $value!=''){
|
||||
$data = $this->getSessionArray();
|
||||
$in=[];
|
||||
|
||||
$in['code_id'] = $what;
|
||||
$in['code'] = $value; // just maing sure
|
||||
$in['member_id'] = $_SESSION['member_id'];
|
||||
$in['action'] = WRENCHBOARD_COUPON_REDEEM;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($in, $out);
|
||||
if ( $res == 0 ){
|
||||
echo 'Completed';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Redeem fail';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,11 @@ class Dash extends Users_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function help(){
|
||||
$data = $this->getSessionArray();
|
||||
$data['page_title'] ="Help";
|
||||
$this->renderSecurePage('users/view_help', $data);
|
||||
}
|
||||
public function index() {
|
||||
|
||||
$data['username'] = $_SESSION['username']; // = $this->input->post('username');
|
||||
@@ -25,6 +30,12 @@ class Dash extends Users_Controller {
|
||||
redirect(home);
|
||||
} else {
|
||||
// load the Dash model now
|
||||
|
||||
$this->load->model('coupon_model');
|
||||
$activeCouponResult = $this->coupon_model->loadMemberActiveCoupons($_SESSION['member_id'] ,$fliters=[]);
|
||||
$_SESSION['coupon'] = $activeCouponResult->num_rows();
|
||||
|
||||
// print_r($_SESSION);
|
||||
$this->load->model('dash_model');
|
||||
$out = $this->dash_model->getDashData($data);
|
||||
|
||||
@@ -68,7 +79,7 @@ class Dash extends Users_Controller {
|
||||
//======================= move it
|
||||
/* Table Slider Data */
|
||||
|
||||
$jbx = "''/proj/thisjob''";
|
||||
/* $jbx = "''/proj/thisjob''";
|
||||
$mysql = "SELECT '<b>ID:</b><a href=\"#\" onclick=\"showJobModal('''||mc.contract||''');\" >'||mc.contract||'</a><br><b>Timeline:</b>'||mc.timeline_days||' day(s)<br><b>Price:</b>'||mc.price*0.01 AS Project,"
|
||||
. " '<b>Title: </b>'||mc.title||'<br><b>Description: </b>'||mc.description AS description,"
|
||||
. " (CASE WHEN mc.status=4 THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"Review\">' "
|
||||
@@ -87,82 +98,42 @@ class Dash extends Users_Controller {
|
||||
$this->table->set_heading(array('data' => 'Job', 'style' => 'width:180px'), 'Title/Description', array('data' => '', 'style' => 'width:100px; cellpadding:0px;'));
|
||||
|
||||
$data['job_table'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$data['job_table_result'] = $query->result(); // used in new impl.
|
||||
*/
|
||||
$x = $this->dashTaskMessage();
|
||||
$data['job_message_table'] = $x['job_message_table'];
|
||||
$data['job_message_table_result'] = $x['job_message_table_result'];
|
||||
$data['message_found'] = $x['message_found'];
|
||||
/// End table data ===========================
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
//$this->table->set_heading('Job', 'Client', 'Terms', 'Description', 'Manage', 'Status');
|
||||
$mysql = 'SELECT jo.added::date,jo.member_id,j.title,'
|
||||
. 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status'
|
||||
. 'FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id LIMIT 5';
|
||||
// $sqb =" ,'<button type=\"button\" class=\"btn btn-primary btn-xs\">View</button>' As View ";
|
||||
$jbx = "''jobs/viewjob''";
|
||||
$mysql = "SELECT jo.added::date,j.title,"
|
||||
. 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status,'
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View "
|
||||
. "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
. "AND jo.client_id = " . $_SESSION['member_id'] . "LIMIT 4";
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$num = $query->num_rows();
|
||||
|
||||
$data["dash_title"] = "Pending Offer(s)";
|
||||
if ($num > 0) {
|
||||
$this->table->set_heading('Added', 'Title', 'Status', '');
|
||||
$data['offer_dash'] = $this->table->generate($query);
|
||||
} else {
|
||||
$data["offer_dash"] = "<div class=\"thumb\"><img src='assets/images/notask.png' alt=\"Active Projects\"></div>";
|
||||
}
|
||||
*/
|
||||
$acp = array();
|
||||
$acp = $this->activeProjects();
|
||||
$data['job_table'] = $acp['job_table'];
|
||||
$data['job_table_result'] = $acp['job_table_result'];
|
||||
|
||||
$ya = array();
|
||||
$ya = $this->dash_title();
|
||||
$ya = $this->dash_title( 4 );
|
||||
$data["dash_title"] = $ya["dash_title"];
|
||||
$data["offer_dash"] = $ya["offer_dash"];
|
||||
$data["offer_dash_result"] = $ya["offer_dash_result"];
|
||||
$data["offer_found"] = $ya["offer_found"];
|
||||
|
||||
$_SESSION['secure_data'] = $data; // all data needed for secure page
|
||||
// print_r($_SESSION);
|
||||
//var_dump( $_SESSION);
|
||||
//exit;
|
||||
$data['page_title'] ="Dashboard";
|
||||
$this->renderSecurePage('users/view_dash', $data);
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('users/view_dash', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function dashTaskMessage() {
|
||||
$data = array();
|
||||
/*
|
||||
wrenchboard=> select s.created,j.contract,j.title,j.id,j.status,j.delivery_date,substring(s.message,0,100) FROM members_jobs_contract j RIGHT JOIN jobs_contract_message s ON s.contract=j.contract WHERE j.member_id=3 or j.client_id = 3 AND j.status IN (1,4);
|
||||
created | contract | title | id | status | delivery_date | substring
|
||||
----------------------------+------------+-----------------------------------------------+----+--------+----------------------------+-----------------------------------------------------------------------------------------------------
|
||||
2017-05-18 11:53:20.569399 | 7BW9B9R8BB | five thousand naira | 13 | 1 | 2017-08-02 14:19:38.711257 | This is a test of ajax send message
|
||||
2017-05-18 12:03:30.685328 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | dldldldldldl
|
||||
2017-05-18 12:03:44.137005 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | This is an empty list test
|
||||
2017-05-18 12:04:00.228586 | 7B27RRBRB7 | 595Job Title Job Title Job Title Job Title932 | 15 | 4 | 2017-05-10 19:23:26.115394 | List should be populated now
|
||||
2017-05-18 20:49:12.996077 | 7BW9B9R8BB | five thousand naira | 13 | 1 | 2017-08-02 14:19:38.711257 | About PayQuic\r +
|
||||
| | | | | | PayQuic is global payments and airtime top-up company. Open for business 24/7, 365 d
|
||||
2017-06-12 10:28:32.720786 | 601BBWRW48 | 595Job Title Job Title Job Title Job Title932 | 10 | 1 | 2017-08-09 16:08:43.503739 | <table><tbody><tr><td><div><span><br>can you share your controller method and did you tried <c
|
||||
2017-06-12 10:28:41.932836 | 601BBWRW48 | 595Job Title Job Title Job Title Job Title932 | 10 | 1 | 2017-08-09 16:08:43.503739 | <table><tbody><tr><td><div><span><br>can you share your controller method and did you tried <c
|
||||
|
||||
*/
|
||||
$jbx = "''/proj/thisjob''";
|
||||
|
||||
$mysql = " SELECT s.created,j.contract,j.title,j.id,j.status,j.delivery_date,substring(s.message,0,100),"
|
||||
. " '<input type=submit onclick=\"return post_nav_find_action($jbx, '||j.id||')\" name=\"manage\" class=\"btn btn-success btn-xs btn-block\" value=\"View\">' "
|
||||
. " FROM members_jobs_contract j "
|
||||
. " RIGHT JOIN jobs_contract_message s ON s.contract=j.contract "
|
||||
. " WHERE j.member_id=" . $_SESSION['member_id'] . " OR j.client_id = " . $_SESSION['member_id'] . " AND j.status IN (1,4)";
|
||||
|
||||
$mysql = " SELECT s.created::date ||'<br>'||j.contract AS date_contract,'<b>Title:</b>'||j.title||'<br>'||substring(s.message,0,90) as title_message,"
|
||||
$mysql = " SELECT s.created::date ||'<br>'||j.contract AS date_contract,j.title AS title,substring(s.message,0,90) as title_message,'\/proj\/thisjob' AS qpath,j.id AS offer_code,"
|
||||
. " '<input type=submit onclick=\"return post_nav_find_action($jbx, '||j.id||')\" name=\"manage\" class=\"btn btn-success btn-xs btn-block\" value=\"View\">' "
|
||||
. " FROM members_jobs_contract j "
|
||||
. " RIGHT JOIN jobs_contract_message s ON s.contract=j.contract "
|
||||
@@ -170,45 +141,42 @@ class Dash extends Users_Controller {
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$this->table->set_heading(array('data' => 'Date', 'style' => 'width:180px'), 'Title/Message', array('data' => '', 'style' => 'width:100px; cellpadding:0px;'));
|
||||
|
||||
$data['job_message_table'] = $this->table->generate($query);
|
||||
|
||||
$data['job_message_table_result'] = $query->result(); // used in new impl.
|
||||
$data['message_found'] = true;
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function dash_title() {
|
||||
private function dash_title($listLimit) {
|
||||
|
||||
$offer_found = false;
|
||||
|
||||
$data = array();
|
||||
$data['offer_dash'] = '';
|
||||
$data['offer_dash'] = $data['offer_dash_result'] ='';
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$jbx = "''/jobs/viewjob''";
|
||||
$mysql = "SELECT jo.added::date,j.title,"
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View "
|
||||
$mysql = "SELECT jo.added::date AS pdate,j.title,(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewjob' AS qpath,"
|
||||
. 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,'
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View ,jo.offer_code AS offer_code "
|
||||
. "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
. "AND jo.client_id = " . $_SESSION['member_id'] . " LIMIT 4";
|
||||
// . 'CASE WHEN jo.status = 1 THEN \'Pending\' ELSE \'Other\' END AS status,'
|
||||
. "AND jo.client_id = " . $_SESSION['member_id'] . " LIMIT $listLimit";
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$num = $query->num_rows();
|
||||
|
||||
$data["dash_title"] = "Pending Offer(s)";
|
||||
if ($num > 0) {
|
||||
|
||||
|
||||
|
||||
// array('data' => 'Added', 'style' => 'width:80px')
|
||||
|
||||
$this->table->set_heading(array('data' => 'Added', 'style' => 'width:80px'), 'Title', array('data' => '', 'style' => 'width:80px'));
|
||||
$data['offer_dash'] = $this->table->generate($query);
|
||||
$data['offer_dash_result'] = $query->result();
|
||||
$offer_found = true;
|
||||
} else {
|
||||
$data["offer_dash"] = "<div class=\"thumb\"><img src='assets/images/notask.png' alt=\"Active Projects\"></div>";
|
||||
@@ -216,17 +184,16 @@ class Dash extends Users_Controller {
|
||||
|
||||
|
||||
if ($offer_found == false) {
|
||||
$data["dash_title"] = "<a href='/jobs/pendingoffer'>My Pending Offer(s)</a>";
|
||||
$data["dash_title"] = "<a href='/jobs/pendingoffer'>Offer(s)</a>";
|
||||
$jbx = "''/jobs/viewmyjob''";
|
||||
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date,j.title||'<br><b>To :</b>'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,"
|
||||
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date AS pdate,j.title, (CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewmyjob' AS qpath,"
|
||||
. 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,'
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View "
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View,jo.offer_code AS offer_code "
|
||||
. "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
. "AND jo.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 4";
|
||||
. "AND jo.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT $listLimit";
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$num = $query->num_rows();
|
||||
|
||||
if ($num > 0) {
|
||||
@@ -236,10 +203,12 @@ class Dash extends Users_Controller {
|
||||
|
||||
$this->table->set_heading(array('data' => 'Added/Expire', 'style' => 'width:120px'), 'Title/Recipient', array('data' => 'Status', 'style' => 'width:100px'), array('data' => '', 'style' => 'width:100px'));
|
||||
$data['offer_dash'] = $this->table->generate($query);
|
||||
$data['offer_dash_result'] = $query->result();
|
||||
$offer_found = true;
|
||||
}
|
||||
}
|
||||
|
||||
$data["offer_found"] = $offer_found;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@ class Eoffer extends CI_Controller {
|
||||
$data['title'] = "Login"; // Capitalize the first letter
|
||||
$data['page_title'] = "Login WrenchBoard";
|
||||
//$this->load->view('templates/header_boxed', $data);
|
||||
$this->load->view('users/view_login', $data);
|
||||
$this->load->view('users/view_external_footer');
|
||||
// $this->load->view('users/view_login', $data);
|
||||
// $this->load->view('users/view_external_footer');
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,16 +2,48 @@
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//Import Hybridauth's namespace
|
||||
use Hybridauth\Hybridauth;
|
||||
|
||||
class Home extends WRB_Controller {
|
||||
|
||||
public function index() {
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//Load URL helper
|
||||
$this->load->helper('url');
|
||||
|
||||
//Load session library
|
||||
$this->load->library('session');
|
||||
}
|
||||
|
||||
$this->home1('');
|
||||
//Displays social login links
|
||||
public function index() {
|
||||
// Load Hybridauth's helper
|
||||
$this->load->helper('hybridauth');
|
||||
|
||||
/*
|
||||
// Instantiate Hybridauth's classes
|
||||
$hybrid = new Hybridauth(get_hybridauth_config());
|
||||
|
||||
// Get login links
|
||||
$login_links = get_hybridauth_links($hybrid, $this->router);
|
||||
*/
|
||||
$login_links = array(
|
||||
'Google' => get_google_login_link(),
|
||||
'Apple' => get_apple_login_link()
|
||||
);
|
||||
// Pass login links to html template
|
||||
$data['login_links'] = $login_links;
|
||||
|
||||
// Render html template
|
||||
$this->load->view('site3/external/view_home', $data);
|
||||
}
|
||||
|
||||
public function about() {
|
||||
|
||||
$this->home2('home2/about');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,71 @@ class Jobs extends Users_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function startcreate(){
|
||||
$data = $this->getSessionArray();
|
||||
$this->load->model('dash_model');
|
||||
$out = $this->dash_model->getDashData($data);
|
||||
$data['active_task'] = $out['active_task'];
|
||||
$data['active_pass_due'] = $out['active_pass_due'];
|
||||
$data['current_balance'] = $out['current_balance'];
|
||||
$data['new_message'] = $out['new_message'];
|
||||
$data['template_data'] = $this->jobsTemplates();
|
||||
$this->renderSecurePage('jobs/view_startcreate', $data);
|
||||
}
|
||||
|
||||
private function jobsTemplates(){
|
||||
|
||||
return [
|
||||
[
|
||||
'ID'=>'FACEBOOKSHARE',
|
||||
'name'=>'Share my article on your FaceBook Page',
|
||||
'description'=>'Pick from the articles on my blog and share on your FaceBook page',
|
||||
'delivery'=>'You will need to have a minimum of 100 friends on your profile',
|
||||
'img'=>'/site3/assets/media/jobs/share-stories.jpg',
|
||||
'timeline_days'=>'7',
|
||||
'price'=> 2000
|
||||
],
|
||||
[
|
||||
'ID'=>'TESTMYAPP',
|
||||
'name'=>'Test my App and give feedback',
|
||||
'description'=>'Download install and go through my app, upload feedback as part of my testing',
|
||||
'delivery'=>'You will have to capture and upload up to 12 screens',
|
||||
'img'=>'/site3/assets/media/jobs/test-app.jpg',
|
||||
'timeline_days'=>'7',
|
||||
'price'=> 2000
|
||||
],
|
||||
[
|
||||
'ID'=>'REVIEWFEEDBACK',
|
||||
'name'=>'Review My Blog Story with feedback',
|
||||
'description'=>'View my Blog or Site stories, review and provide feedbacks or comments',
|
||||
'delivery'=>'',
|
||||
'img'=>'/site3/assets/media/jobs/review-stories.jpg',
|
||||
'timeline_days'=>'7',
|
||||
'price'=> 2000
|
||||
],
|
||||
[
|
||||
'ID'=>'PROPOSEBLOG',
|
||||
'name'=>'Propose new articles tiltles for my blog',
|
||||
'description'=>'Look at my site stories, propose 5 new articles for my contents line',
|
||||
'delivery'=>'Proposed items myst be relvant to the site and not currenlty present in any form',
|
||||
'img'=>'/site3/assets/media/jobs/propose-new.jpg',
|
||||
'timeline_days'=>'7',
|
||||
'price'=> 2000
|
||||
],
|
||||
[
|
||||
'ID'=>'WEBSITEREVIEW',
|
||||
'name'=>'Visit and review my Website provide feedback',
|
||||
'description'=>'Visit my website,browse througn the pages and provide feedback',
|
||||
'delivery'=>'Capture 10 screen shots and upload',
|
||||
'img'=>'/site3/assets/media/jobs/review-site.jpg',
|
||||
'timeline_days'=>'7',
|
||||
'price'=> 2000
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function active() {
|
||||
|
||||
$data['username'] = $_SESSION['username']; // = $this->input->post('username');
|
||||
@@ -138,9 +203,12 @@ class Jobs extends Users_Controller {
|
||||
|
||||
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
/* $this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_pendinginterest', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
$this->load->view('users/view_footer_user', $data); */
|
||||
|
||||
$this->renderSecurePage('jobs/view_pendinginterest', $data);
|
||||
|
||||
}
|
||||
|
||||
public function jobinterest() {
|
||||
@@ -212,11 +280,8 @@ class Jobs extends Users_Controller {
|
||||
$this->table->set_heading(array('data' => 'Added', 'style' => 'width:120px'), 'Interested Client', array('data' => 'Status', 'style' => 'width:90px'), array('data' => '', 'style' => 'width:90px'));
|
||||
$data['job_others_interest_table'] = $this->table->generate($query2);
|
||||
|
||||
$this->renderSecurePage('jobs/view_manageinterest', $data);
|
||||
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_manageinterest', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
}
|
||||
|
||||
private function getMarketInterestMessage($offer_code, $client_id) {
|
||||
@@ -389,28 +454,30 @@ class Jobs extends Users_Controller {
|
||||
// url: "/jobs/procinterest?proc=REJECT&interest_id=" + interest_id
|
||||
// url: "/jobs/procinterest?proc=CANCEL&interest_id=" + interest_id
|
||||
$data = $this->getSessionArray();
|
||||
$data['interest_id'] = $this->input->get('interest_id');
|
||||
$inx= [];
|
||||
$inx['interest_id'] = $this->input->get('interest_id');
|
||||
$proc = $this->input->get('proc');
|
||||
$data['interest'] = 0;
|
||||
$inx['interest'] = 0;
|
||||
$inx['member_id'] = $_SESSION['member_id'];
|
||||
switch ($proc) {
|
||||
case 'ACCEPT':
|
||||
$data['interest'] = JOB_INTEREST_ACCEPT;
|
||||
$inx['interest'] = JOB_INTEREST_ACCEPT;
|
||||
break;
|
||||
|
||||
case 'REJECT':
|
||||
$data['interest'] = JOB_INTEREST_REJECT;
|
||||
$inx['interest'] = JOB_INTEREST_REJECT;
|
||||
break;
|
||||
|
||||
case 'CANCEL':
|
||||
$data['interest'] = JOB_INTEREST_CANCEL;
|
||||
$inx['interest'] = JOB_INTEREST_CANCEL;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($data['interest'] > 0) {
|
||||
$data['action'] = WRENCHBOARD_JOB_PROC_INTEREST;
|
||||
if ($inx['interest'] > 0) {
|
||||
$inx['action'] = WRENCHBOARD_JOB_PROC_INTEREST;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($data, $out);
|
||||
$res = $this->backend_model->wrenchboard_api($inx, $out);
|
||||
if ($res == PHP_CREATED_OK) {
|
||||
echo 'Success - ' . $out['status'];
|
||||
} else {
|
||||
@@ -453,13 +520,20 @@ class Jobs extends Users_Controller {
|
||||
|
||||
public function viewjob() {
|
||||
$data = $this->getSessionArray();
|
||||
|
||||
//-----------------active job
|
||||
$acp = array();
|
||||
$acp = $this->activeProjects();
|
||||
$data['job_table'] = $acp['job_table'];
|
||||
$data['job_table_result'] = $acp['job_table_result'];
|
||||
//------------------------------------------
|
||||
|
||||
$jobOfferID = $this->input->post('jobOfferID');
|
||||
$data['jobOfferID'] = $jobOfferID;
|
||||
if ($jobOfferID != '') {
|
||||
$this->load->model('job_model');
|
||||
$out = $this->job_model->loadJobOffer($_SESSION['member_id'], $jobOfferID);
|
||||
|
||||
// print_r($out);
|
||||
if ($out['result'] == 1) {
|
||||
|
||||
$data["added_date"] = $out["added_date"];
|
||||
@@ -473,9 +547,7 @@ class Jobs extends Users_Controller {
|
||||
$out["expire"] = date_format($date, 'Y-m-d H:i');
|
||||
$data["expire"] = $out["expire"];
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_viewjoboffer', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
$this->renderSecurePage('jobs/view_viewjoboffer', $data);
|
||||
} else {
|
||||
redirect('dash'); // go back to dash if not valid
|
||||
}
|
||||
@@ -500,8 +572,8 @@ class Jobs extends Users_Controller {
|
||||
. ' AND expire> now() AND public_view > 0';
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$num = $query->num_rows();
|
||||
$data['market_table_result'] = $query->result(); // used in new impl.
|
||||
|
||||
if ($num > 0) {
|
||||
$myTable = "<table class='table table-striped table-hover table-bordered table-condensed'>";
|
||||
@@ -520,9 +592,13 @@ class Jobs extends Users_Controller {
|
||||
|
||||
$_SESSION['secure_data'] = $data; // all data needed for secure page
|
||||
$data['page_title'] = "Available Jobs & Tasks";
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
/* $this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_market', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
*/
|
||||
// var_dump( $data['market_table_result']);
|
||||
// exit;
|
||||
$this->renderSecurePage('jobs/view_market', $data);
|
||||
}
|
||||
|
||||
private function makeMarketTableRow($row) {
|
||||
@@ -532,13 +608,14 @@ class Jobs extends Users_Controller {
|
||||
|
||||
public function showinterest() {
|
||||
$data = $this->getSessionArray();
|
||||
$data['offer_code'] = $this->input->get('job_contract');
|
||||
$data['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
$in=[];
|
||||
$in['offer_code'] = $this->input->get('job_contract');
|
||||
$in['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
|
||||
$data['action'] = WRENCHBOARD_JOB_SEND_INTEREST;
|
||||
$in['action'] = WRENCHBOARD_JOB_SEND_INTEREST;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($data, $out);
|
||||
$res = $this->backend_model->wrenchboard_api($in, $out);
|
||||
if ($res == PHP_CREATED_OK) {
|
||||
echo 'Success - ' . $out['status'];
|
||||
} else {
|
||||
@@ -550,15 +627,16 @@ class Jobs extends Users_Controller {
|
||||
$data = $this->getSessionArray();
|
||||
|
||||
// echo 'Ameye';
|
||||
$data['offer_code'] = $this->input->get('offer_code');
|
||||
$data['yourmessage'] = $this->input->get('yourmessage');
|
||||
$data['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
$data['msg_type'] = 'JOB';
|
||||
$data['action'] = WRENCHBOARD_JOB_SEND_QUESTION;
|
||||
$in=[];
|
||||
$in['offer_code'] = $this->input->get('offer_code');
|
||||
$in['yourmessage'] = $this->input->get('yourmessage');
|
||||
$in['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
$in['msg_type'] = 'JOB';
|
||||
$in['action'] = WRENCHBOARD_JOB_SEND_QUESTION;
|
||||
// $this->load->model('backend_model');
|
||||
$out = array();
|
||||
$out['status'] = '';
|
||||
$res = $this->wrenchboard_api($data, $out);
|
||||
$res = $this->wrenchboard_api($in, $out);
|
||||
if ($res == PHP_CREATED_OK) {
|
||||
echo 'Success - Message sent' . $out['status'];
|
||||
} else {
|
||||
@@ -571,22 +649,23 @@ class Jobs extends Users_Controller {
|
||||
$data = $this->getSessionArray();
|
||||
|
||||
// echo 'Ameye';
|
||||
$data['offer_code'] = $this->input->get('offer_code');
|
||||
$data['yourmessage'] = $this->input->get('yourmessage');
|
||||
$data['interest_id'] = $this->input->get('interest_id');
|
||||
$data['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
$data['msg_type'] = 'MRKTINT'; // MARKET INTEREST
|
||||
$in =[];
|
||||
$in['offer_code'] = $this->input->get('offer_code');
|
||||
$in['yourmessage'] = $this->input->get('yourmessage');
|
||||
$in['interest_id'] = $this->input->get('interest_id');
|
||||
$in['member_id'] = $_SESSION['member_id']; // just maing sure
|
||||
$in['msg_type'] = 'MRKTINT'; // MARKET INTEREST
|
||||
|
||||
$data['action'] = WRENCHBOARD_JOB_MRKTINT_QUEST;
|
||||
$in['action'] = WRENCHBOARD_JOB_MRKTINT_QUEST;
|
||||
// $this->load->model('backend_model');
|
||||
$out = array();
|
||||
$out['status'] = '';
|
||||
$res = $this->wrenchboard_api($data, $out);
|
||||
$res = $this->wrenchboard_api($in, $out);
|
||||
// print_r($out);
|
||||
if ($res == PHP_CREATED_OK) {
|
||||
|
||||
//echo rand(100,999)." " .$out['client_id'];
|
||||
echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] ); //'Success - Message sent' . $out['status'];
|
||||
echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); //'Success - Message sent' . $out['status'];
|
||||
} else {
|
||||
echo 'Error - ' . $out['status'];
|
||||
}
|
||||
@@ -606,9 +685,9 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
|
||||
if ($num > 0) {
|
||||
$row = $query->row_array();
|
||||
$myTable = "<table class='table table-sm table-hover table-bordered table-condensed' style=' background-color: #ebf1e8;'>";
|
||||
$myTable = " <div class='card card-xl-stretch mb-5 mb-xl-8'>";
|
||||
$myTable .= $this->makeMarketDetailTableRow($row);
|
||||
$myTable .="</table>";
|
||||
$myTable .="</div>";
|
||||
}
|
||||
|
||||
echo $myTable;
|
||||
@@ -625,35 +704,30 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
|
||||
|
||||
|
||||
return "<tr><td colspan='2' ><b>" . $row['offer_code'] . "</b> Timeline:" . $row['timeline_days'] . " day(s) - <b>Budget: </b> " . $row['price'] * 0.01 . " Naira</td></tr>"
|
||||
. "<tr><td style='width:100px;'><b>Title</b></td><td>" . $row['title'] . "</td></tr>"
|
||||
. "<tr><td><b>Description</b></td><td>" . $row['description'] . "</td></tr>"
|
||||
. "<tr><td><b>Detail</b></td><td>" . $row['job_description'] . "</td></tr>"
|
||||
. "<tr><td colspan='2' >Interests : <b>" . $data['interest'] . "</b> Expire:<b> " . $row['expire']."</b> </td></tr>"
|
||||
. "<tr><td><b></b></td><td style='text-align:right;'><input type=submit id='submit_interest_" . $row['offer_code'] . "' name=\"mview\" onclick=\"return SInterest('" . $row['offer_code'] . "');\" class=\"btn btn-success btn-xs\" value=\"Send Interest Request
|
||||
\"></td></tr>"
|
||||
. "<tr><td colspan='2'>If you have any questions about this task :"
|
||||
. "<div id='msg_result_" . $row['offer_code'] . "'><form name=\"job_message\"><table class='table table-striped table-hover table-bordered table-condensed'>"
|
||||
. "<tr><td><textarea name='yourmessage' cols=\"5\" rows=\"3\" class=\"textarea form-control\" class=\"btn btn-success btn-xs\" placeholder=\"Enter message here ...\"></textarea></td></tr>"
|
||||
. "<tr><td style='text-align:right;'><button id='submit_yourmessage_" . $row['offer_code'] . "' onclick=\"return OMessage('" . $row['offer_code'] . "');\" class=\"btn btn-info btn-xs\">Send Message</button></td></tr></table></form></div>"
|
||||
. "</td></tr>"
|
||||
. " ";
|
||||
return "<div class='card-body'><table class='table table-sm table-hover table-bordered table-condensed' style='background-color: #ffffff;'><tr><td colspan='2' ><b>" . $row['offer_code'] . "</b> Timeline:" . $row['timeline_days'] . " day(s) - <b>Budget: </b> " . $row['price'] * 0.01 . " Naira</td></tr>"
|
||||
. "<tr><td style='width:100px;'><b>Title</b></td><td>" . $row['title'] . "</td></tr>"
|
||||
. "<tr><td><b>Description</b></td><td>" . $row['description'] . "</td></tr>"
|
||||
. "<tr><td><b>Detail</b></td><td>" . $row['job_description'] . "</td></tr>"
|
||||
. "<tr><td colspan='2' >Interests : <b>" . $data['interest'] . "</b> Expire:<b> " . $row['expire']."</b> </td></tr>"
|
||||
. "<tr><td colspan='2' style='text-align:center; padding-bottom: 10px;'><b>If you are interested in this task, send message to the owner </b><input type=submit id='submit_interest_" . $row['offer_code'] . "' name=\"mview\" onclick=\"return SInterest('" . $row['offer_code'] . "');\" class=\"btn btn-success btn-xs\" value=\"Send Interest Request\"></td></tr>"
|
||||
. "<tr><td colspan='2'><div id='" . $row['offer_code'] . "'></div><hr size='1'></td></tr>"
|
||||
."<tr><td colspan='2'>If you have any questions about this task :"
|
||||
. "<div id='msg_result_" . $row['offer_code'] . "'><form name=\"job_message\"><table class='table table-striped table-hover table-bordered table-condensed'>"
|
||||
. "<tr><td><textarea name='yourmessage' cols=\"5\" rows=\"3\" class=\"textarea form-control\" class=\"btn btn-warning btn-xs\" placeholder=\"Enter message here ...\"></textarea></td></tr>"
|
||||
. "<tr><td style='text-align:right;'><button id='submit_yourmessage_" . $row['offer_code'] . "' onclick=\"return OMessage('" . $row['offer_code'] . "');\" class=\"btn btn-warning btn-sm\">Send Message</button></td></tr></table></form></div>"
|
||||
. "</td></tr>"
|
||||
. " </table></div>";
|
||||
}
|
||||
|
||||
public function viewmyjob() {
|
||||
|
||||
$data = $this->getSessionArray();
|
||||
$jobOfferID = $this->input->post('jobOfferID');
|
||||
$data['jobOfferID'] = $jobOfferID;
|
||||
if ($jobOfferID != '') {
|
||||
$this->load->model('job_model');
|
||||
$out = $this->job_model->readMyloadJobOffer($_SESSION['member_id'], $jobOfferID);
|
||||
|
||||
// print_r($out);
|
||||
if ($out['result'] == 1) {
|
||||
|
||||
$data["job_sent_to"] = $out["job_sent_to"];
|
||||
|
||||
$data["added_date"] = $out["added_date"];
|
||||
$data["title"] = $out["title"];
|
||||
$data["description"] = $out["description"];
|
||||
@@ -664,12 +738,9 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$date = date_create($out["expire"]);
|
||||
$out["expire"] = date_format($date, 'Y-m-d H:i');
|
||||
$data["expire"] = $out["expire"];
|
||||
|
||||
$data['job_link'] = 'https://'.$_SERVER['HTTP_HOST']."/plb/viewjob/".$out['offer_code'];
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_viewmyjoboffer', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
$data['page_title'] = 'View Job - '.$out["offer_code"];
|
||||
$this->RenderUserPage('jobs/view_viewmyjoboffer', $data);
|
||||
} else {
|
||||
redirect('dash'); // go back to dash if not valid
|
||||
}
|
||||
@@ -678,6 +749,21 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
}
|
||||
}
|
||||
|
||||
public function myoffer() {
|
||||
// $data = array();
|
||||
$data = $this->getSessionArray();
|
||||
$this->load->model('offers_model');
|
||||
$out = $this->offers_model->getUserPendingOffers($_SESSION['member_id']);
|
||||
|
||||
$data['my_offer_rows'] = $out["query"]->result();
|
||||
|
||||
|
||||
|
||||
$data['page_title'] = "Pending";
|
||||
$this->renderSecurePage('jobs/view_myoffer', $data);
|
||||
|
||||
}
|
||||
|
||||
public function pendingoffer() {
|
||||
$data = array();
|
||||
$data = $this->getSessionArray();
|
||||
@@ -696,7 +782,7 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
. "AND jo.member_id = " . $_SESSION['member_id'] . "LIMIT 400";
|
||||
|
||||
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date,j.title||'<br><b>To :</b>'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,"
|
||||
$mysql = "SELECT jo.added::date||'<br>'||jo.expire::date AS job_dates,j.title||'<br><b>To :</b>'||(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,"
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View "
|
||||
. "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
@@ -705,6 +791,14 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$mysql2 = "SELECT jo.added::date AS start_job_date, jo.expire::date AS end_job_date, j.title, (CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS job_to,jo.offer_code AS offer_code,"
|
||||
. "'<input type=submit onclick=\"return post_nav_find_action($jbx,'''||jo.offer_code||''')\" name=\"manage\" class=\"btn btn-primary btn-xs\" value=\"View\">' AS View "
|
||||
. "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
. "WHERE jo.expire > now() AND jo.status = 1 "
|
||||
. "AND jo.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 400";
|
||||
$query2 = $this->db->query($mysql2);
|
||||
$data['offer_dash_rows'] = $query2->result();
|
||||
|
||||
$num = $query->num_rows();
|
||||
|
||||
if ($num > 0) {
|
||||
@@ -712,15 +806,20 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
|
||||
$this->table->set_heading(array('data' => 'Added/Expire', 'style' => 'width:100px'), 'Title/Recipient', array('data' => ' ', 'style' => 'width:80px'));
|
||||
$data['offer_dash'] = $this->table->generate($query);
|
||||
|
||||
$offer_found = true;
|
||||
}
|
||||
|
||||
$_SESSION['secure_data'] = $data; // all data needed for secure page
|
||||
$data['page_title'] = "my Market Job(s)";
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
/* $this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_pendingoffer', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
*/
|
||||
$data['page_title'] = "My Pending Offer(s)";
|
||||
$this->renderSecurePage('jobs/view_pendingoffer', $data);
|
||||
|
||||
}
|
||||
|
||||
public function jobgrp() {
|
||||
@@ -777,9 +876,10 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$data["group_name"] = "";
|
||||
$data["group_member_table"] = "Please add a group";
|
||||
}
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_jobgroup', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
// $this->load->view('users/view_header_user', $data);
|
||||
// $this->load->view('jobs/view_jobgroup', $data);
|
||||
// $this->load->view('users/view_footer_user', $data);
|
||||
$this->renderSecurePage('jobs/view_jobgroup', $data);
|
||||
}
|
||||
|
||||
public function jobgrp_members() {
|
||||
@@ -830,20 +930,75 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
return $this->job_model->addGroupMemberForm($group_id);
|
||||
}
|
||||
|
||||
private function getJobTemplateFill($template_page){
|
||||
$templateList = $this->jobsTemplates();
|
||||
|
||||
foreach ($templateList as $row){
|
||||
if ( $row['ID'] == trim($template_page)){
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
public function create() {
|
||||
|
||||
$data = $this->getSessionArray();
|
||||
|
||||
$template_page = ($this->uri->segment(3)) ? $this->uri->segment(3) : '';
|
||||
$preFill = $this->getJobTemplateFill($template_page);
|
||||
if(!empty($preFill))
|
||||
{
|
||||
$title = $preFill['name'];
|
||||
$description = $preFill['description'];
|
||||
$job_detail = $preFill['delivery'];
|
||||
$timeline = $preFill['timeline_days'];
|
||||
$price = $preFill['price'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = NULL;
|
||||
$description = NULL;
|
||||
$timeline = NULL;
|
||||
$price = 0;
|
||||
$job_detail = NULL;
|
||||
}
|
||||
|
||||
$mybalance = 0;
|
||||
$data['job_message'] = '';
|
||||
// print_r($_SESSION);
|
||||
|
||||
$title = NULL;
|
||||
$description = NULL;
|
||||
$job_detail = NULL;
|
||||
$timeline = NULL;
|
||||
// $timeline_days = NULL;
|
||||
$price = NULL;
|
||||
$country = 'NG';
|
||||
$submit = NULL;
|
||||
$country_job ='NG';
|
||||
$amountArray = [];
|
||||
|
||||
for ($i = 2000; $i <= 10000; $i = $i + 1000) {
|
||||
$amountArray[] = [$i,$i,'Naira'];
|
||||
}
|
||||
|
||||
$marketArray = [];
|
||||
for ($i = 2; $i <= 6; $i = $i + 1) {
|
||||
$marketArray[] = [$i,$i,'Days'];
|
||||
}
|
||||
|
||||
for ($i = 7; $i <= 21; $i = $i + 7) {
|
||||
$marketArray[] = [$i,$i,'Week(s)'];
|
||||
}
|
||||
|
||||
for ($i = 30; $i <= 90; $i = $i + 30) {
|
||||
$marketArray[] = [$i,$i,'Month(s)'];
|
||||
}
|
||||
|
||||
$data['amount_array'] = $amountArray;
|
||||
$data['timeline_array'] = $marketArray;
|
||||
|
||||
|
||||
$mysqlJ = "SELECT id, title,created::date FROM members_jobs WHERE
|
||||
member_id = " . $_SESSION['member_id'] . "
|
||||
AND status = 1
|
||||
ORDER BY id DESC LIMIT 5";
|
||||
|
||||
$query = $this->db->query($mysqlJ);
|
||||
$data['recentjobs'] = $query->result();
|
||||
$data['recentjobs_count'] = $query->num_rows();
|
||||
|
||||
extract($_POST);
|
||||
$redirected = false;
|
||||
@@ -851,10 +1006,12 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$in = array();
|
||||
$in['title'] = $title;
|
||||
$in['description'] = $description;
|
||||
$in['timeline_days'] = $timeline;
|
||||
$in['job_detail'] =$this->input->post('job_detail'); // Somehow this doesnt show when large $job_detail;
|
||||
$in['price'] = $price * 100;
|
||||
$in['timeline_days'] = $this->input->post('timeline') ; //$timeline;
|
||||
$in['job_detail'] = trim( $this->input->post('job_detail') ); // Somehow this doesnt show when large $job_detail;
|
||||
$price = $this->input->post('price');
|
||||
$in['price'] = $price * 100; // (is_int($price)? $price:0) * 100;
|
||||
$in['member_id'] = $_SESSION['member_id'];
|
||||
$in['country'] = $country_job;
|
||||
|
||||
$this->load->model('job_model');
|
||||
if ($this->job_model->verifyJobInputs($in) == true) {
|
||||
@@ -865,7 +1022,6 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
if ($res == PHP_CREATED_OK) {
|
||||
// print_r($out);
|
||||
if ($out['job_id'] > 0) {
|
||||
|
||||
$this->processingJob($out['job_id']);
|
||||
$redirected = true;
|
||||
}
|
||||
@@ -878,6 +1034,21 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
|
||||
}
|
||||
|
||||
$this->load->model('combo_model');
|
||||
$this->combo_model->defaultComboMessage = 'Select Job Country';
|
||||
$data['country_job'] = $this->combo_model->getCountryJobCombo('country', $country);
|
||||
$data['job_price'] = $this->combo_model->getJobPriceCombo('price','Naira', $price);
|
||||
$data['timeline_combo'] = $this->combo_model->marketTimeline('timeline', $timeline);
|
||||
|
||||
$data['title'] = $title;
|
||||
$data['description'] = $description;
|
||||
$data['timeline_days'] = $timeline;
|
||||
$data['job_detail'] = trim( $job_detail );
|
||||
$data['price'] = $price;
|
||||
$data['country'] = $country_job;
|
||||
|
||||
$data['page_title'] = "Create Job";
|
||||
|
||||
if ($redirected == false) {
|
||||
$this->load->model('dash_model');
|
||||
$out = $this->dash_model->getDashData($data);
|
||||
@@ -885,13 +1056,13 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$data['active_pass_due'] = $out['active_pass_due'];
|
||||
$data['current_balance'] = $out['current_balance'];
|
||||
$data['new_message'] = $out['new_message'];
|
||||
$this->renderSecurePage('jobs/view_create', $data);
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_create', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function processjob() {
|
||||
$jobID = $this->input->post('jobID');
|
||||
if ($jobID > 0) {
|
||||
@@ -902,12 +1073,28 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
}
|
||||
}
|
||||
|
||||
public function agreejobterms(){
|
||||
$data = $this->getSessionArray();
|
||||
$in = array();
|
||||
$in['action'] = WRENCHBOARD_ACCOUNT_TERMS;
|
||||
$in['action_item'] = ACCOUNT_AGREE_JOBS;
|
||||
$in['member_id'] = $_SESSION['member_id'];
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($in, $out);
|
||||
//echo $res;
|
||||
//exit;
|
||||
if ($res == PHP_API_OK || $out["terms_update"]=='completed') {
|
||||
redirect('/jobs/create',$data);
|
||||
}
|
||||
}
|
||||
|
||||
public function jobagree() {
|
||||
$data = $this->getSessionArray();
|
||||
//echo 'Ameye-- '. rand(100,999);
|
||||
//print_r($this->input->post());
|
||||
|
||||
if ($_POST) {
|
||||
echo "Ameye";
|
||||
exit;
|
||||
|
||||
$in = array();
|
||||
$in['action'] = WRENCHBOARD_ACCOUNT_TERMS;
|
||||
@@ -917,21 +1104,14 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($in, $out);
|
||||
|
||||
|
||||
if ($res == PHP_API_OK) {
|
||||
if ($res == PHP_API_OK || $out["terms_update"]=='completed') {
|
||||
redirect('/jobs/create');
|
||||
}
|
||||
}
|
||||
|
||||
$data['page_key'] = 'WRB_POST_JOB_TERM';
|
||||
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
||||
|
||||
|
||||
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_jobagree', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
$this->renderSecurePage('jobs/view_jobagree', $data);
|
||||
}
|
||||
|
||||
private function processingJob($jobID) {
|
||||
@@ -948,20 +1128,29 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$mysql = "SELECT title,description,timeline_days||' day(s)', price*0.01||'Naira' AS price, created::date"
|
||||
$mysql = "SELECT title,description,timeline_days||' day(s)' AS day_timeline, price*0.01||'Naira' AS price, created::date AS create_date, job_detail"
|
||||
. " FROM members_jobs WHERE id =" . $jobID . " AND member_id = " . $_SESSION['member_id'];
|
||||
$query = $this->db->query($mysql);
|
||||
$data['job_table_row'] = $query->row();
|
||||
$this->table->set_heading('Title', 'Description', 'Timeline', 'Price', 'Created');
|
||||
$data['job_table'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$this->load->model('job_model'); // too bad I have to run again
|
||||
$jobData = $this->job_model->getJob($jobID);
|
||||
$data['job_description'] = $jobData->job_detail;
|
||||
$data['jobID'] = $jobID;
|
||||
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_joboffer', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
$activeJobData = $this->job_model->selectMarketJob($jobID);
|
||||
$data['active_job_data'] = $activeJobData;
|
||||
|
||||
// var_dump( $activeJobData );
|
||||
// $this->load->view('users/view_header_user', $data);
|
||||
// $this->load->view('jobs/view_joboffer', $data);
|
||||
// $this->load->view('users/view_footer_user', $data);
|
||||
$data['page_title'] ="View Job";
|
||||
$this->renderSecurePage('jobs/view_joboffer', $data);
|
||||
|
||||
} else {
|
||||
redirect('/jobs/manage');
|
||||
}
|
||||
@@ -1111,7 +1300,7 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
$out = array();
|
||||
|
||||
$res = $this->backend_model->wrenchboard_api($in, $out);
|
||||
$out["status"] = '';
|
||||
//$out["status"] = '';
|
||||
//$res = $this->wrenchboard_api($in, $out);
|
||||
// print_r($out);
|
||||
|
||||
@@ -1187,64 +1376,56 @@ echo $this->getMarketInterestMessage( $data['offer_code'], $out['client_id'] )
|
||||
public function manage() {
|
||||
|
||||
$data = $this->getSessionArray();
|
||||
$this->load->library('table');
|
||||
|
||||
$this->table->set_template($this->template);
|
||||
$jbx = "''/jobs/processjob''";
|
||||
$mysql = "SELECT '<b>Date: </b>'||created::date||'<br><b>Timeline: </b>'||timeline_days||' day(s)'||'<br><b>Price: </b>'||price*0.01||' ' AS Job,"
|
||||
. " '<b>Title: </b>'||title||'<br><b>Description: </b>'||description AS detail, "
|
||||
. " '<table><tr><td><input type=button onclick=\"return post_nav_find_action($jbx, '||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"View\"></td><td><div id=\"subdel'||id||'\" ><input type=button id=\"dacc'||id||'\" onclick=\"return deleteJob('||id||')\" name=\"manage\" class=\"btn btn-warning btn-xs\" value=\"Del\"></td></tr></table>' AS manage"
|
||||
. " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC";
|
||||
|
||||
|
||||
|
||||
$this->load->library('pagination');
|
||||
$config = array();
|
||||
$query = $this->db->query($mysql);
|
||||
$config["total_rows"] = $query->num_rows();
|
||||
$_SESSION['total_job_count'] = $config["total_rows"];
|
||||
$config["base_url"] = base_url() . "/jobs/manage";
|
||||
$config["per_page"] = 5;
|
||||
$config["per_page"] = 10;
|
||||
$config["uri_segment"] = 3;
|
||||
$config["num_links"] = 5;
|
||||
|
||||
$config['full_tag_open'] = "<ul class='pagination'>";
|
||||
$config['full_tag_close'] = "</ul>";
|
||||
$config['num_tag_open'] = '<li>';
|
||||
$config['num_tag_open'] = "<li class='page-item'>";
|
||||
$config['num_tag_close'] = '</li>';
|
||||
$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
|
||||
$config['cur_tag_open'] = "<li class='page-item previous'><li class='page-item active'><a class='page-link' href='#'>";
|
||||
$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
|
||||
$config['next_tag_open'] = "<li>";
|
||||
$config['next_tag_open'] = "<li class='page-item'>";
|
||||
$config['next_tagl_close'] = "</li>";
|
||||
$config['prev_tag_open'] = "<li>";
|
||||
$config['prev_tag_open'] ="<li class='page-item'>";
|
||||
$config['prev_tagl_close'] = "</li>";
|
||||
$config['first_tag_open'] = "<li>";
|
||||
$config['first_tag_open'] = "<li class='page-item'>";
|
||||
$config['first_tagl_close'] = "</li>";
|
||||
$config['last_tag_open'] = "<li>";
|
||||
$config['last_tag_open'] = "<li class='page-item'>";
|
||||
$config['last_tagl_close'] = "</li>";
|
||||
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
|
||||
|
||||
$mysql = "SELECT '<b>Date: </b>'||created::date||'<br><b>Timeline: </b>'||timeline_days||' day(s)'||'<br><b>Price: </b>'||price*0.01||' ' AS Job,"
|
||||
/*
|
||||
$mysql = "SELECT '<b>Date: </b>'||created::date||'<br><b>Timeline: </b>'||timeline_days||' day(s)'||'<br><b>Price: </b>'||price*0.01||' ' AS Job,"
|
||||
. " '<b>Title: </b>'||title||'<br><b>Description: </b>'||description AS detail, "
|
||||
. " '<table><tr><td><input type=button onclick=\"return post_nav_find_action($jbx, '||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"View\"><div id=\"subdel'||id||'\" ></td><td><input type=button id=\"dacc'||id||'\" onclick=\"return deleteJob('||id||')\" name=\"manage\" class=\"btn btn-warning btn-xs\" value=\"Del\"></td></tr></table>' AS manage"
|
||||
. " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page;
|
||||
|
||||
|
||||
*/
|
||||
$mysql = "SELECT id AS job_id, '<b>Date: </b>'||created::date||'<br><b>Timeline: </b>'||timeline_days||' day(s)'||'<br><b>Price: </b>'||price*0.01||' ' AS Job,"
|
||||
. " title, description,timeline_days, price*0.01 AS amount,"
|
||||
. " '<table><tr><td><input type=button onclick=\"return post_nav_find_action($jbx, '||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"View\"><div id=\"subdel'||id||'\" ></td><td><input type=button id=\"dacc'||id||'\" onclick=\"return deleteJob('||id||')\" name=\"manage\" class=\"btn btn-warning btn-xs\" value=\"Del\"></td></tr></table>' AS manage"
|
||||
. " FROM members_jobs WHERE member_id = " . $_SESSION['member_id'] . " AND status=1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page;
|
||||
|
||||
$query = $this->db->query($mysql);
|
||||
$this->table->set_heading(array('data' => 'Job/Task', 'style' => 'width:150px'), 'Title/Description', array('data' => 'Manage', 'style' => 'width:120px'));
|
||||
$data["links"] = $this->pagination->create_links();
|
||||
|
||||
// array('data' => 'Del.', 'style' => 'width:80px')
|
||||
|
||||
$data['page_title'] = "Manage Job(s)";
|
||||
$data['job_table_rows'] = $query->result();
|
||||
$this->renderSecurePage('jobs/view_manage', $data);
|
||||
|
||||
$data['job_table'] = $this->table->generate($query);
|
||||
$this->load->view('users/view_header_user', $data);
|
||||
$this->load->view('jobs/view_manage', $data);
|
||||
$this->load->view('users/view_footer_user', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//Import Hybridauth's namespace
|
||||
use Hybridauth\Hybridauth;
|
||||
|
||||
class Login extends WRB_Controller {
|
||||
|
||||
public function __construct() {
|
||||
@@ -10,8 +15,28 @@ class Login extends WRB_Controller {
|
||||
$this->load->library(array('session', 'lib_login'));
|
||||
}
|
||||
|
||||
private function excudedEmails(){
|
||||
$ecData= [
|
||||
'ses66181+1@gmail.com',
|
||||
'tokslawus@gmail.com',
|
||||
'ses6681+3@gmail.com',
|
||||
'ameye@chiefsoft.com',
|
||||
'ses66181@gmail.com',
|
||||
];
|
||||
|
||||
if (in_array($_SESSION['username'], $ecData))
|
||||
{
|
||||
$_SESSION['allow_payment_features'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['allow_payment_features'] = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$data["login_message"] = "";
|
||||
$data["login_message"] = $this->session->flashdata('login_message');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('username', 'Username', 'required');
|
||||
$this->form_validation->set_rules('password', 'Password', 'required');
|
||||
@@ -24,11 +49,12 @@ class Login extends WRB_Controller {
|
||||
|
||||
$data['sessionid'] = rand(10000, 99999) . "A" . rand(10000, 99999);
|
||||
$data['action'] = WRENCHBOARD_ACCOUNT_LOGIN;
|
||||
$data['login_mode'] = WEBSITE_LOGIN;
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->wrenchboard_api($data, $out);
|
||||
$is_live = $this->backend_model->cfgReadChar("system.live");
|
||||
// print_r($out);
|
||||
// print_r($out);
|
||||
if ($res == PHP_LOGIN_OK) {
|
||||
$this->load->model('account_model');
|
||||
$ret = $this->account_model->username_data($data);
|
||||
@@ -59,7 +85,11 @@ class Login extends WRB_Controller {
|
||||
$this->logUser('Account login');
|
||||
$this->refreshAccountDetail($_SESSION['member_id']);
|
||||
$this->getSessionArray();
|
||||
redirect('dash');
|
||||
$this->excudedEmails();
|
||||
$this->load->model('autopref_model');
|
||||
|
||||
$prefArray = $this->autopref_model->afterLoginPage();
|
||||
redirect($prefArray['returnPage']);
|
||||
}
|
||||
} else {
|
||||
$data["login_message"] = "Invalid username or password";
|
||||
@@ -69,30 +99,15 @@ class Login extends WRB_Controller {
|
||||
} else {
|
||||
echo validation_errors();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->lib_login->is_authenticated()) {
|
||||
$fb_data = $this->lib_login->getData($this->lib_login->get_access_token());
|
||||
if (isset($fb_data['me'])) {
|
||||
$user = $fb_data['me'];
|
||||
$proceed = false;
|
||||
//$data["login_message"] = $user["id"]."/".$user["name"]."/".$user["email"]."<a href='".$this->lib_login->getLogoutUrl()."'>Logout</a>";
|
||||
$q = "SELECT * FROM members WHERE lower(email)=lower('" . $user["name"] . "') AND password IS NULL AND fb_id='" . $user["id"] . "'";
|
||||
$query = $this->db->query($q);
|
||||
if (count($query->result_array)) {
|
||||
// Account exists
|
||||
$proceed = true;
|
||||
} else {
|
||||
$q = "SELECT * FROM members WHERE lower(email)=lower('" . $user["name"] . "')";
|
||||
$query = $this->db->query($q);
|
||||
if (count($query->result_array)) {
|
||||
$data["login_message"] = "The e-mail " . $user["email"] . " is already registered. You should login with your username and password.";
|
||||
} else {
|
||||
// Create account
|
||||
$proceed = true;
|
||||
}
|
||||
}
|
||||
$user['facebook'] = 1;
|
||||
|
||||
list($proceed, $data) = $this->checkUserExists($user, $data);
|
||||
|
||||
if ($proceed) {
|
||||
$name = (string) $user["name"];
|
||||
if (trim($name) == "")
|
||||
@@ -123,10 +138,13 @@ class Login extends WRB_Controller {
|
||||
$_SESSION['mesaage_count'] = 0;
|
||||
$this->findOffers($_SESSION['email']);
|
||||
$_SESSION['message_snapshot'] = $this->myMessagesSnapshot();
|
||||
|
||||
$_SESSION['profile_picture'] = "../smedia/DEFAULTS/default-profile.png";
|
||||
$this->logUser('Account login');
|
||||
$this->refreshAccountDetail($_SESSION['member_id']);
|
||||
$this->getSessionArray();
|
||||
|
||||
$this->excudedEmails();
|
||||
|
||||
redirect('dash');
|
||||
}
|
||||
}
|
||||
@@ -138,30 +156,369 @@ class Login extends WRB_Controller {
|
||||
|
||||
if( strlen( $data["login_message"]) > 0 )
|
||||
{
|
||||
$data["login_message"] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $data["login_message"] . "</div></div>";
|
||||
$data["login_message"] = "<div class=\"text-left\">
|
||||
<div class=\"alert alert-danger no-border\">" . $data["login_message"] . "- Please <a href=\"/password_recovery\">reset your password</a> or create a <a href='/signup'>new account</a> </div></div>";
|
||||
}
|
||||
$data['title'] = "Login"; // Capitalize the first letter
|
||||
$data['page_title'] = "Login WrenchBoard";
|
||||
//$this->load->view('templates/header_boxed', $data);
|
||||
$this->load->view('users/view_login', $data);
|
||||
$this->load->view('users/view_external_footer');
|
||||
//----- long out $this->load->view('templates/header_boxed', $data);
|
||||
//$this->load->view('users/view_login', $data);
|
||||
//$this->load->view('users/view_external_footer');
|
||||
|
||||
// Load Hybridauth's helper
|
||||
$this->load->helper('hybridauth');
|
||||
|
||||
/*
|
||||
// Instantiate Hybridauth's classes
|
||||
$hybrid = new Hybridauth(get_hybridauth_config());
|
||||
|
||||
// Get login links
|
||||
$login_links = get_hybridauth_links($hybrid, $this->router);
|
||||
*/
|
||||
$login_links = array(
|
||||
'Google' => get_google_login_link(),
|
||||
'Apple' => get_apple_login_link()
|
||||
);
|
||||
// Pass login links to html template
|
||||
$data['login_links'] = $login_links;
|
||||
|
||||
// Render html template
|
||||
$this->load->view('site3/external/view_home',$data);
|
||||
}
|
||||
|
||||
//<a href="/password_recovery">Forgot Password ?</a>
|
||||
|
||||
|
||||
public function refreshAccountDetail($member_id) {
|
||||
public function refreshAccountDetail($member_id) {
|
||||
$this->load->model('account_model');
|
||||
$qr = $this->account_model->loadAccountData($member_id);
|
||||
// print_r($qr);
|
||||
$_SESSION['current_balance'] = $qr[0]['balance'];
|
||||
$this->load->model('account_model');
|
||||
|
||||
$_SESSION['current_balance'] = $this->account_model->getUserWallet($member_id,$currency='NAIRA'); // $out['current_balance'];
|
||||
// $_SESSION['current_balance'] = $qr[0]['balance'];
|
||||
$_SESSION['active_task'] = $this->account_model->loadActiveTaskCount($member_id);
|
||||
}
|
||||
|
||||
|
||||
private function checkUserExists($user, $data)
|
||||
{
|
||||
$proceed = false;
|
||||
$q = " AND external_idp_provider=1";
|
||||
if (is_array($user) && array_key_exists('google',$user)) {
|
||||
$q = " AND external_idp_provider=2";
|
||||
}
|
||||
//$data["login_message"] = $user["id"]."/".$user["name"]."/".$user["email"]."<a href='".$this->lib_login->getLogoutUrl()."'>Logout</a>";
|
||||
$q = "SELECT * FROM members WHERE lower(email)=lower('" . $user["name"] . "') AND password IS NULL AND external_idp_provider_id='" . $user["id"] . "'" . $q;
|
||||
$query = $this->db->query($q);
|
||||
if (count($query->result_array)) {
|
||||
// Account exists
|
||||
$proceed = true;
|
||||
} else {
|
||||
$q = "SELECT * FROM members WHERE lower(email)=lower('" . $user["name"] . "')";
|
||||
$query = $this->db->query($q);
|
||||
if (count($query->result_array)) {
|
||||
$data["login_message"] = "The e-mail " . $user["email"] . " is already registered. You should login with your username and password.";
|
||||
} else {
|
||||
// Create account
|
||||
$proceed = true;
|
||||
}
|
||||
}
|
||||
return array($proceed, $data);
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$this->lib_login->destroy_session();
|
||||
redirect('login', redirect);
|
||||
}
|
||||
|
||||
//Processes social login
|
||||
function auth($provider = NULL)
|
||||
{
|
||||
$data = array();
|
||||
// Load Hybridauth's helper
|
||||
$this->load->helper('hybridauth');
|
||||
$code = $this->input->get('code');
|
||||
$apple_code = '';
|
||||
if ($provider == 'apple') {
|
||||
$apple_code = $this->input->post('code');
|
||||
}
|
||||
if ($code!='') {
|
||||
$client = get_google_client();
|
||||
$token = $client->fetchAccessTokenWithAuthCode($code);
|
||||
if (is_array($token) && array_key_exists('access_token',$token)) {
|
||||
$client->setAccessToken($token['access_token']);
|
||||
|
||||
// get profile info
|
||||
$google_oauth = new Google_Service_Oauth2($client);
|
||||
$google_account_info = $google_oauth->userinfo->get();
|
||||
$id = $google_account_info->id;
|
||||
$email = $google_account_info->email;
|
||||
$name = $google_account_info->name;
|
||||
|
||||
//var_dump($google_account_info);
|
||||
//exit();
|
||||
|
||||
if ($id !='' && $email != '') {
|
||||
$user = array(
|
||||
'id' => $id,
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'google' => 1
|
||||
);
|
||||
list($proceed, $data) = $this->checkUserExists($user, $data);
|
||||
|
||||
if ($proceed) {
|
||||
|
||||
$this->provisionAccount($user, $data);
|
||||
|
||||
} else {
|
||||
// Cannot proceed - duplicate email?
|
||||
$this->session->set_flashdata('login_message','Cannot proceed - duplicate email');
|
||||
redirect('login');
|
||||
}
|
||||
} else {
|
||||
// Invalid or missing id and/or email - login failed?
|
||||
$this->session->set_flashdata('login_message','Invalid or missing id and/or email - login failed!');
|
||||
redirect('login');
|
||||
}
|
||||
} else {
|
||||
// Missing access token / invalid grant - expired credentials?
|
||||
$this->session->set_flashdata('login_message','Missing access token / invalid grant - expired credentials!');
|
||||
redirect('login');
|
||||
}
|
||||
} else if ($apple_code != '') {
|
||||
// Handle Apple
|
||||
if($_SESSION['apple_state'] != $this->input->post('state')) {
|
||||
// Invalid or missing state - login failed?
|
||||
$this->session->set_flashdata('login_message','Authorization server returned an invalid state parameter'
|
||||
.$_SESSION['apple_state'].'/'.$this->input->post('state'));
|
||||
unset($_SESSION['apple_state']);
|
||||
redirect('login');
|
||||
return;
|
||||
}
|
||||
// Token endpoint docs:
|
||||
// https://developer.apple.com/documentation/signinwithapplerestapi/generate_and_validate_tokens
|
||||
list($clientId, $clientSecret, $redirectUri) = get_apple_config();
|
||||
$data = [
|
||||
'grant_type' => 'authorization_code',
|
||||
'code' => $apple_code,
|
||||
'redirect_uri' => $redirectUri,
|
||||
'client_id' => $clientId,
|
||||
'client_secret' => $clientSecret,
|
||||
];
|
||||
$url = "https://appleid.apple.com/auth/token";
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch,CURLOPT_URL, $url);
|
||||
curl_setopt($ch,CURLOPT_POST, true);
|
||||
curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
curl_setopt($ch,CURLOPT_HTTPHEADER, [
|
||||
'Accept: application/json',
|
||||
'Content-type: application/x-www-form-urlencoded',
|
||||
'User-Agent: curl', # Apple requires a user agent header at the token endpoint
|
||||
]);
|
||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
/*
|
||||
{
|
||||
"access_token": "adg61...67Or9",
|
||||
"token_type": "Bearer",
|
||||
"expires_in": 3600,
|
||||
"refresh_token": "rca7...lABoQ"
|
||||
"id_token": "eyJra...96sZg"
|
||||
}
|
||||
*/
|
||||
|
||||
$response = json_decode($result);
|
||||
|
||||
if(!isset($response->access_token)) {
|
||||
$this->session->set_flashdata('login_message','Error getting an access token');
|
||||
//echo '<pre>'; print_r($response); echo '</pre>';
|
||||
//echo $result; die();
|
||||
redirect('login');
|
||||
return;
|
||||
}
|
||||
|
||||
$claims = explode('.', $response->id_token)[1];
|
||||
$claims = json_decode(base64_decode($claims));
|
||||
|
||||
//echo '<h3>Access Token Response</h3>';
|
||||
//echo '<pre>'; print_r($response); echo '</pre>';
|
||||
|
||||
//echo '<h3>Parsed ID Token</h3>';
|
||||
//echo '<pre>'; print_r($claims); echo '</pre>';
|
||||
/*
|
||||
eyJraWQiOiJmaDZCczhDIiwiYWxnIjoiUlMyNTYifQ
|
||||
eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoiY29tLndyZW5jaGJvYXJkLnVzZXJzLmNsaWVudCIsImV4cCI6MTY1NDE3MjM5NywiaWF0IjoxNjU0MDg1OTk3LCJzdWIiOiIwMDE4MTAuMjBlNzUwMjhkNDljNDJkOGI0MzBiNDJkMWQ3NDg3ZjMuMTE1NyIsImF0X2hhc2giOiJPSzNfZlNtLUJZTEMzd3R5QTB4Q2pRIiwiZW1haWwiOiJhY2lkdW1pcmFlQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjoidHJ1ZSIsImF1dGhfdGltZSI6MTY1NDA4NTk2Mywibm9uY2Vfc3VwcG9ydGVkIjp0cnVlfQ
|
||||
jHxcOMAxUYEJx7nlmAXPN6PuqKMxVVcklGU5p6k16UvSS4DOM7nDwduo8D9FrzcjnTMGmLAThBYw2reilKv3vod034iTfBoL-vno_I7Wa-Iig5uTji7leaoDpfWyDAT7kFXpa6LVGdtZ8KdcVfSY-GF58JpKKQtf-sKB4sqnN1HAeCgYKP3EO5sf0zOttA7noZ_i6ITrmFbx5Mndf8Ktw-gb-LM-Ux11TEApByn4FcpL5m3ycvxxyaWsnLrGtraNK2S5N7Sby2imSB0iT9MFQRCL-4ddyD1YUDbpKLQDTlaSQuTPCX09AdMeLpx0wK6TAiTUUrOf93ljYU724Flb4g
|
||||
*/
|
||||
//die();
|
||||
$id = $claims->sub;
|
||||
echo "<h1>${id}</h1>";
|
||||
$email = $claims->email;
|
||||
|
||||
if ($id !='' && $email != '') {
|
||||
$user = array(
|
||||
'id' => $id,
|
||||
'name' => '',
|
||||
'email' => $email,
|
||||
'apple' => 1
|
||||
);
|
||||
list($proceed, $data) = $this->checkUserExists($user, $data);
|
||||
|
||||
if ($proceed) {
|
||||
|
||||
$this->provisionAccount($user, $data);
|
||||
|
||||
} else {
|
||||
// Cannot proceed - duplicate email?
|
||||
$this->session->set_flashdata('login_message','Cannot proceed - duplicate email');
|
||||
redirect('login');
|
||||
}
|
||||
} else {
|
||||
// Invalid or missing id and/or email - login failed?
|
||||
$this->session->set_flashdata('login_message','Invalid or missing id and/or email - login failed!');
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
} else {
|
||||
// Invalid or missing code - login failed?
|
||||
$this->session->set_flashdata('login_message','Invalid or missing code - login failed!');
|
||||
redirect('login');
|
||||
}
|
||||
}
|
||||
|
||||
private function provisionAccount($user, $data)
|
||||
{
|
||||
$name = (string) $user["name"];
|
||||
if (trim($name) == "") {
|
||||
$name = strtok($user["email"], "@");
|
||||
}
|
||||
if (array_key_exists('google',$user)) {
|
||||
$data['google_id'] = $user["id"];
|
||||
$data['action'] = WRENCHBOARD_GOOGLE_LOGIN;
|
||||
} else {
|
||||
$data['apple_id'] = $user["id"];
|
||||
$data['action'] = WRENCHBOARD_APPLE_LOGIN;
|
||||
}
|
||||
$data['firstname'] = strtok($name, " ");
|
||||
$data['lastname'] = strtok(" ");
|
||||
$data['email'] = $user["email"];
|
||||
$data['sessionid'] = rand(10000, 99999) . "A" . rand(10000, 99999);
|
||||
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
|
||||
$res = $this->backend_model->wrenchboard_api($data, $out);
|
||||
if ($res == PHP_LOGIN_OK) {
|
||||
$this->load->model('account_model');
|
||||
$ret = $this->account_model->username_data($out);
|
||||
if ($res !== false) {
|
||||
$data["login_message"] = "Welcome...";
|
||||
// yes person has an account
|
||||
$_SESSION['session_id'] = $out["session"];
|
||||
$_SESSION['username'] = $ret->username;
|
||||
$_SESSION['name'] = $ret->username;
|
||||
$_SESSION['firstname'] = $ret->firstname;
|
||||
$_SESSION['lastname'] = $ret->lastname;
|
||||
$_SESSION['email'] = $ret->email;
|
||||
$_SESSION['member_id'] = $ret->id;
|
||||
$_SESSION['log_count'] = 0;
|
||||
$_SESSION['mesaage_count'] = 0;
|
||||
$this->findOffers($_SESSION['email']);
|
||||
$_SESSION['message_snapshot'] = $this->myMessagesSnapshot();
|
||||
$_SESSION['profile_picture'] = "../smedia/DEFAULTS/default-profile.png";
|
||||
$this->logUser('Account login');
|
||||
$this->refreshAccountDetail($_SESSION['member_id']);
|
||||
$this->getSessionArray();
|
||||
|
||||
$this->excudedEmails();
|
||||
|
||||
redirect('dash');
|
||||
} else {
|
||||
// Cannot proceed - account model error?
|
||||
$this->session->set_flashdata('login_message','Cannot proceed - account error: '.$ret);
|
||||
redirect('login');
|
||||
}
|
||||
} else {
|
||||
// Cannot proceed - backend error?
|
||||
$msg = (is_array($out) && array_key_exists('status',$out) && $out['status']!='')
|
||||
? $out ['status'] : json_encode($out);
|
||||
$this->session->set_flashdata('login_message','Cannot proceed - error: '.$msg);
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Processes social login
|
||||
function authh($provider = NULL)
|
||||
{
|
||||
// Load Hybridauth's helper
|
||||
$this->load->helper('hybridauth');
|
||||
|
||||
$service = NULL;
|
||||
|
||||
try
|
||||
{
|
||||
//Instantiate Hybridauth's classes
|
||||
$hybrid = new Hybridauth(get_hybridauth_config());
|
||||
|
||||
//Check if given provider is enabled
|
||||
if ((isset($provider)) && in_array($provider, $hybrid->getProviders()))
|
||||
{
|
||||
$this->session->set_userdata('provider', $provider);
|
||||
}
|
||||
|
||||
//Update variable with the valid provider
|
||||
$provider = $this->session->userdata('provider');
|
||||
|
||||
if ($provider)
|
||||
{
|
||||
$service = $hybrid->authenticate($provider);
|
||||
var_dump($service);
|
||||
exit();
|
||||
if ($service->isConnected())
|
||||
{
|
||||
//Get user profile
|
||||
$profile = $service->getUserProfile();
|
||||
|
||||
//Get user contacts
|
||||
$contacts = $service->getUserContacts();
|
||||
|
||||
/*
|
||||
Disconnect the service else HA would reuse stored session data
|
||||
rather making a fresh request in case the user has denied permissions
|
||||
in the previous authorization request
|
||||
*/
|
||||
$service->disconnect();
|
||||
|
||||
$this->session->unset_userdata('provider');
|
||||
|
||||
//Display the profile data
|
||||
echo 'Name: ' . $profile->displayName;
|
||||
print_r($profile);
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('showmsg', array('msg' => 'Sorry! We couldn\'t authenticate your identity.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if (isset($service) && $service->isConnected())
|
||||
$service->disconnect();
|
||||
|
||||
$error = 'Sorry! We couldn\'t authenticate you.';
|
||||
$this->session->set_flashdata('showmsg', array('msg' => $error));
|
||||
$error .= '\nError Code: ' . $e->getCode();
|
||||
$error .= '\nError Message: ' . $e->getMessage();
|
||||
|
||||
log_message('error', $error);
|
||||
}
|
||||
|
||||
//redirect();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user