265 Commits

Author SHA1 Message Date
ameye d4ddbd1eda fix 2022-07-29 11:45:47 -04:00
ameye aa10f50813 fix 2022-07-29 11:44:47 -04:00
ameye ab4f9dc58d fix 2022-07-29 11:40:42 -04:00
ameye c042097dd1 fix 2022-07-24 21:16:37 -04:00
ameye 777f024021 fix 2022-07-24 19:00:44 -04:00
ameye 074379dff1 Mark WrenchRefundoffer function 2022-07-24 01:06:25 -04:00
ameye 5e9c1bc3bd Fix label 2022-07-24 01:05:25 -04:00
ameye 1f4933c091 Up to date code 2022-07-24 01:04:50 -04:00
ameye fe6f130cfa Fix out aray 2022-07-23 23:47:34 -04:00
ameye f34632e8db Fix loading extension in console 2022-07-23 23:47:15 -04:00
ameye 27f9ecf2c4 fix 2022-07-23 14:34:03 -04:00
ameye 41283208f8 fix 2022-07-23 13:04:52 -04:00
ameye 49c5e94dd5 fix 2022-07-23 12:56:36 -04:00
ameye 24c39db3e8 fix 2022-07-23 10:03:59 -04:00
ameye c4b4ca7f9d fix 2022-07-22 20:08:48 -04:00
ameye ffc45b7d15 fix 2022-07-20 21:04:36 -04:00
ameye f42a19c1c0 fix 2022-07-18 18:51:55 -04:00
ameye 940c742ff4 fix 2022-07-18 18:51:34 -04:00
ameye 01c0d4a417 fix 2022-07-18 18:36:28 -04:00
ameye 61bb2a5800 fix 2022-07-18 13:05:38 -04:00
ameye da16ee8f06 fix 2022-07-18 11:48:07 -04:00
ameye 7f4dbca484 fix 2022-07-18 11:48:03 -04:00
ameye 515a5fdd9f fix 2022-07-17 21:24:06 -04:00
ameye 353d33ac6f fix 2022-07-17 18:25:06 -04:00
ameye d11d99749c fix 2022-07-17 18:17:23 -04:00
ameye b237cc1933 fix 2022-07-17 18:14:27 -04:00
ameye a76977a44a fix 2022-07-17 17:05:16 -04:00
ameye 454900f85b fix 2022-07-17 16:59:46 -04:00
ameye a2f8902226 fix 2022-07-17 16:16:40 -04:00
ameye 7b82194cfd fix 2022-07-17 15:52:57 -04:00
ameye 2d01bbccad fix 2022-07-17 15:16:12 -04:00
ameye d51d78eb57 fix 2022-07-16 21:18:08 -04:00
ameye b6fdad88c4 fix 2022-07-16 21:11:11 -04:00
ameye 4b99c679aa fix 2022-07-16 20:52:54 -04:00
ameye 1a6bade648 fix 2022-07-16 19:22:20 -04:00
ameye 2f6050fb08 fix 2022-07-16 18:31:36 -04:00
ameye 8b03f5b4aa fix 2022-07-13 18:31:13 -04:00
ameye ab9dbfad9f fix 2022-07-09 19:22:51 -04:00
ameye 4c122e73de fix 2022-07-08 22:52:06 -04:00
ameye bdbf938cf8 fix 2022-07-08 22:52:02 -04:00
ameye c7c6dbe4c8 fix 2022-07-04 13:52:55 -04:00
ameye fb6644d719 fix 2022-07-04 13:07:40 -04:00
ameye d1a443ff42 fix 2022-07-04 13:07:37 -04:00
ameye a58f91952e fix 2022-07-02 03:19:52 -04:00
ameye 666d63a8a2 fix 2022-07-02 02:40:07 -04:00
ameye 0548daa058 fix 2022-06-26 19:19:39 -04:00
ameye f10243b1a6 fix 2022-06-26 13:59:09 -04:00
ameye dc3ca28446 fix 2022-06-26 07:54:40 -04:00
ameye 36b4b365ea fix 2022-06-26 07:54:36 -04:00
ameye 3d95687b6d Ignore file that do not neet to be in git 2022-06-25 23:01:46 -04:00
ameye 6497c6a4a9 we should not list directory 2022-06-25 22:57:21 -04:00
ameye a4274c5a5a Removed TEST folder from repository 2022-06-25 21:55:47 -04:00
ameye 7ae0777c13 fix 2022-06-21 07:14:46 -04:00
ameye 01cf6d6fbe fix 2022-06-20 21:22:57 -04:00
ameye 939fad23c0 fix 2022-06-20 14:07:19 -04:00
ameye 4a87b9f309 fix 2022-06-20 11:30:32 -04:00
ameye 1f7482e99b fix 2022-06-20 11:30:27 -04:00
ameye 062e30f89b fix 2022-06-20 10:36:08 -04:00
ameye b4570e3afc fix 2022-06-20 10:04:53 -04:00
ameye a57b701fd9 fix 2022-06-20 10:04:49 -04:00
ameye 61e57863c5 fix 2022-06-14 21:10:47 -04:00
ameye fd50c9b8c0 fix 2022-06-14 18:39:03 -04:00
ameye 387198f669 fix 2022-06-14 13:56:13 -04:00
ameye f41740ff78 fix 2022-06-14 11:38:44 -04:00
ameye f58c2a8c57 fix 2022-06-14 07:21:52 -04:00
ameye 3b21cee578 fix 2022-06-13 21:06:14 -04:00
ameye d776643f7e Added hCaptcha 2022-06-11 23:36:12 -04:00
ameye 9e8ec9c37e fix 2022-06-07 16:50:52 -04:00
ameye 2bb996baff fix 2022-06-06 17:09:33 -04:00
ameye 877dc5ba40 fix 2022-06-05 14:51:18 -04:00
ameye 8c2c0e56a1 fix 2022-06-04 22:20:25 -04:00
ameye c6bd157dcf fix 2022-06-04 21:14:13 -04:00
ameye da914bfd93 fix 2022-06-04 18:05:46 -04:00
ameye 6bc06fef8b fix 2022-06-04 17:50:57 -04:00
ameye 35acf363aa fix 2022-06-03 21:52:57 -04:00
ameye 84f3325c46 missing 2022-06-02 23:19:45 -04:00
ameye 99794baa11 fix 2022-06-02 22:33:30 -04:00
ameye 24baeb5449 fix 2022-06-02 22:01:46 -04:00
ameye ab34dd6b82 fix 2022-06-02 21:34:58 -04:00
ameye ebe13ef30b fix 2022-06-02 21:15:27 -04:00
ameye 07c3425046 fix 2022-06-01 21:11:45 -04:00
ameye 268e1b6a54 fix 2022-06-01 20:58:05 -04:00
ameye a9380d73e9 fix 2022-06-01 20:57:49 -04:00
ameye 9ea25c81c4 Backend support for Apple login 2022-06-01 11:36:29 -04:00
ameye 019e650090 Sigin with Apple 2022-06-01 09:14:47 -04:00
ameye 320cbb11ee Added Firebase JWT and secret generation 2022-06-01 07:45:19 -04:00
ameye 6949150647 fix 2022-05-31 19:47:51 -04:00
ameye 8f1507548e fix 2022-05-31 19:27:24 -04:00
ameye a5e5bafb40 fix 2022-05-31 18:56:33 -04:00
ameye b3f7f13d6b fix 2022-05-31 18:55:14 -04:00
ameye 97770ffe95 fix 2022-05-31 18:02:24 -04:00
ameye e9e1a5fe71 fix 2022-05-31 18:00:41 -04:00
ameye a4ba2da5ed fix 2022-05-31 17:28:07 -04:00
ameye de6288fc3a fix 2022-05-31 17:27:58 -04:00
ameye 5e5f643d9f fix 2022-05-31 17:27:47 -04:00
ameye cd8afaf1b1 fix 2022-05-30 08:59:05 -04:00
ameye 30f19d771d fix 2022-05-22 11:44:05 -04:00
ameye 1c5b0a24c7 fix 2022-05-21 17:10:47 -04:00
ameye b866d2a1be fix 2022-05-21 13:57:25 -04:00
ameye 3b5eac3d52 fix 2022-05-21 13:33:58 -04:00
ameye b6f4adf046 fix 2022-05-21 13:18:45 -04:00
ameye 39ec57c10c fix 2022-05-21 12:58:19 -04:00
ameye c14ab2a76b fix 2022-05-21 12:20:45 -04:00
ameye edd7712ea7 fix 2022-05-21 11:55:31 -04:00
ameye fe17055c90 fix 2022-05-21 11:36:05 -04:00
ameye 1957c7f1d9 fix 2022-05-21 10:40:42 -04:00
ameye 0a9898a69d fix 2022-05-21 10:15:23 -04:00
ameye 186ee393a2 fix 2022-05-14 20:28:30 -04:00
ameye ee04eaa22c fix 2022-05-14 20:28:23 -04:00
ameye 58b12ee874 fix 2022-05-14 13:56:06 -04:00
ameye 28cca364a8 fix 2022-05-14 12:35:25 -04:00
ameye 2dfbb4ea88 fix 2022-05-13 23:57:42 -04:00
ameye 95b7128d91 fix 2022-05-13 23:57:38 -04:00
ameye aa0a9789fa fix 2022-05-12 22:40:56 -04:00
ameye ecbd702ec5 fix 2022-05-12 22:40:49 -04:00
ameye 40a92d844a fix 2022-05-12 21:51:17 -04:00
ameye e6f8ba1d0d fix 2022-05-12 21:48:15 -04:00
ameye c414318ca8 fix 2022-05-12 21:28:21 -04:00
ameye 64b74940b8 fix 2022-05-12 21:15:23 -04:00
ameye 699c789714 fix 2022-05-12 19:21:31 -04:00
ameye 876c4e29e2 Moved flutterwave-transfer-micro to another repository 2022-05-07 23:28:14 -04:00
ameye 460c4ac9f7 fix 2022-05-07 17:13:20 -04:00
ameye 68bbfe9514 fix 2022-05-07 16:56:21 -04:00
ameye 4a2f4b8c70 fix 2022-05-07 16:56:11 -04:00
ameye 0de7c858a3 fix 2022-05-07 16:33:51 -04:00
ameye f5ea90faa0 fix 2022-05-07 16:32:36 -04:00
ameye 3b77436210 fix 2022-05-07 16:13:17 -04:00
ameye f2c56962a7 fix 2022-05-07 12:42:16 -04:00
ameye 766f034ac4 fix 2022-05-07 12:10:54 -04:00
ameye 966c611e0e fix 2022-05-07 10:33:28 -04:00
ameye a7a4234f79 fix 2022-05-07 10:33:17 -04:00
ameye d2442a256e fix 2022-04-24 14:44:55 -04:00
ameye 31bdb511bb fix 2022-04-24 14:13:31 -04:00
ameye a542184759 fix 2022-04-24 13:55:47 -04:00
ameye f97a7c54ab fix 2022-04-24 13:24:12 -04:00
ameye 886379b0f7 fix 2022-04-24 10:53:27 -04:00
ameye a1eac4a91f fix 2022-04-24 10:02:49 -04:00
ameye 95bc611309 fix 2022-04-24 09:17:10 -04:00
ameye f6288105fb fix 2022-04-23 23:19:32 -04:00
ameye 5692d9f3b2 fix 2022-04-23 22:34:57 -04:00
ameye 984df3184f fix 2022-04-23 22:34:31 -04:00
ameye 8cb2a9d918 fix 2022-04-23 22:34:18 -04:00
ameye 88dd88241d fix 2022-04-23 11:39:19 -04:00
ameye e0edf1932d fix 2022-04-23 11:38:57 -04:00
ameye ebcb7aef1e fix 2022-04-21 19:19:05 -04:00
ameye 432028c088 fix 2022-04-21 19:18:44 -04:00
ameye 7d2373a080 fix 2022-04-21 18:58:31 -04:00
ameye 2e61b070ba Update composer to 2.x 2022-04-16 22:45:25 -04:00
ameye a4aee540a6 fix 2022-04-11 20:08:20 -04:00
ameye 51812950e3 fix 2022-04-10 19:04:20 -04:00
ameye 577995cf03 fix 2022-04-10 19:04:17 -04:00
ameye 6596089608 Fix erorrs for missing data 2022-04-10 01:40:02 -04:00
ameye 5f5abd0b3e fix 2022-04-09 13:38:05 -04:00
ameye 55c06162ef fix 2022-04-09 13:38:01 -04:00
ameye 23c4762347 fix 2022-04-09 12:53:16 -04:00
ameye 7e220e3b05 fix 2022-04-09 10:24:04 -04:00
ameye bc90fb9bb2 fix 2022-04-09 00:11:52 -04:00
ameye 62c4444217 fix 2022-04-07 01:26:31 -04:00
ameye a0cf3feecc fix 2022-04-07 01:26:25 -04:00
ameye aea5fd9f6b fix 2022-04-06 23:14:44 -04:00
ameye 50b480d963 Temporary hide Google login option 2022-04-04 01:17:54 -04:00
ameye 59f0e75842 Switch Google login to native client 2022-04-04 01:03:39 -04:00
ameye 769e1bc7b1 Moved HybridAuth to composer 2022-04-04 00:03:03 -04:00
ameye 99d7b89ebd fix 2022-04-03 16:36:08 -04:00
ameye 9163c8ad84 fix 2022-04-03 15:49:38 -04:00
ameye c87494b40e fix 2022-04-03 15:42:25 -04:00
ameye fb2034ab97 fix 2022-04-03 14:19:34 -04:00
ameye 266b9ddad8 fix 2022-04-03 14:10:01 -04:00
ameye a9b09dc416 fix 2022-03-26 19:10:35 -04:00
ameye de37aea2c4 fix 2022-03-26 19:10:30 -04:00
ameye 92d89d90a3 fix 2022-03-25 20:35:16 -04:00
ameye 31d98bddfb fix 2022-03-24 22:16:27 -04:00
ameye e25017a25f fix 2022-03-24 21:40:48 -04:00
ameye 2e63218e82 fix 2022-03-24 21:23:01 -04:00
ameye 928d064fbe fix 2022-03-24 20:54:34 -04:00
ameye f62840a450 fix 2022-03-20 20:11:29 -04:00
ameye 7865c34b7d fix 2022-03-19 12:31:17 -04:00
ameye 4aa313402a fix 2022-03-19 12:10:26 -04:00
ameye e22dc706dc fix 2022-03-19 11:53:50 -04:00
ameye 0ba0794197 fix 2022-03-19 11:36:43 -04:00
ameye b67f736f04 fix 2022-03-19 11:05:21 -04:00
ameye 79bb8ed05d fix 2022-03-19 11:05:18 -04:00
ameye db39cea49b fix 2022-03-12 15:09:14 -05:00
ameye 41fe987f5d fix 2022-03-12 11:19:32 -05:00
ameye f391716de4 fix 2022-03-11 22:48:43 -05:00
ameye 7f0aff735f fix 2022-03-11 22:48:39 -05:00
ameye f08abbe9f6 fix 2022-03-11 00:29:49 -05:00
ameye 74f3b1d282 fix 2022-03-10 22:22:54 -05:00
ameye 346073b544 fix 2022-03-10 12:34:30 -05:00
ameye 81f0c4c233 fix 2022-03-09 21:07:59 -05:00
ameye 626f381c1b fix 2022-03-09 21:07:54 -05:00
ameye 76024459a9 fix 2022-03-08 08:12:55 -05:00
ameye aea41d6ac5 fix 2022-03-07 19:24:52 -05:00
ameye 92af9cdd81 fix 2022-03-07 18:34:01 -05:00
ameye b9de6b4a98 fix 2022-03-07 14:00:36 -05:00
ameye b0747071e9 fix 2022-03-07 14:00:31 -05:00
ameye f64576f3e8 fix 2022-03-03 23:25:53 -05:00
ameye 9009ec13fb fix 2022-03-02 01:58:23 -05:00
ameye dc77c56b43 fix 2022-03-02 01:58:19 -05:00
ameye a3bd756566 fix 2022-03-02 01:30:33 -05:00
ameye c54974811c fix 2022-03-01 13:35:32 -05:00
ameye 3ca0ce7600 fix 2022-02-28 22:56:08 -05:00
ameye d323cc274b fix 2022-02-28 20:00:43 -05:00
ameye 49e0c1191f fix 2022-02-28 19:31:37 -05:00
ameye 862d129d00 fix 2022-02-26 17:01:15 -05:00
ameye 615f09399d fix 2022-02-22 17:14:21 -05:00
ameye 0c400e3918 fix 2022-02-22 16:22:01 -05:00
ameye f2e9e1550e fix 2022-02-22 15:44:56 -05:00
ameye 18c2b8668c fix 2022-02-20 17:58:29 -05:00
ameye 3c31423bb1 fix 2022-02-20 00:28:48 -05:00
ameye e27259dca9 fix 2022-02-19 23:59:57 -05:00
ameye b949c910ea fix 2022-02-19 23:45:05 -05:00
ameye 944ec49640 fix 2022-02-19 23:11:11 -05:00
ameye ae98daa2ec fix 2022-02-19 22:58:46 -05:00
ameye 902e0031d4 fix 2022-02-19 22:58:32 -05:00
ameye 34406d81fa fix 2022-02-19 18:41:09 -05:00
ameye 7e7080f23c fix 2022-02-19 16:58:54 -05:00
ameye 10917727a8 www 2022-02-19 13:14:41 -05:00
ameye 4d4c75aa48 www 2022-02-19 12:47:31 -05:00
ameye cf8c2131bd www 2022-02-19 10:08:54 -05:00
ameye dff9b496cf www 2022-02-19 08:35:09 -05:00
ameye 961b003078 www 2022-02-19 00:09:18 -05:00
ameye 44e2295bb7 www 2022-02-18 23:08:48 -05:00
ameye cf2e761c5a fix 2022-02-18 19:55:18 -05:00
ameye c2d4a49eb2 fix 2022-02-18 19:55:12 -05:00
ameye 1b025a1563 fix 2022-02-18 18:30:32 -05:00
ameye 83a246ee6e fix 2022-02-18 15:52:41 -05:00
ameye 65e7601bda fix 2022-02-18 00:51:47 -05:00
ameye ee4b81e348 fix 2022-02-18 00:17:29 -05:00
ameye d88c823b9f fix 2022-02-14 19:52:29 -05:00
ameye 7d7f5c00dc fix 2022-02-14 19:46:59 -05:00
ameye 31ae9aa725 fix 2022-02-14 19:34:02 -05:00
ameye e7f26e9a39 fix 2022-02-14 19:33:58 -05:00
ameye 999520c31f fix 2022-02-14 18:37:20 -05:00
ameye 285a4c2cfa fix 2022-02-14 18:29:18 -05:00
ameye 45193b66b8 Merge branch 'master' of ssh://gitlab.chiefsoft.net:10222/WrenchBoard/WrenchBoradWeb 2022-02-14 10:23:55 -05:00
ameye 8a9df7b1df fix 2022-02-14 01:33:06 -05:00
ameye b992d1f9b4 fix 2022-02-14 01:21:46 -05:00
ameye 2261ab9d72 fix 2022-02-13 11:35:02 -05:00
ChiefSoft works 7447f7d96e Fix invalid reference format 2022-02-13 05:16:08 +00:00
ChiefSoft works 0cc56dd4df Force https for docker registry url & fix port for flutterwave transfer micro 2022-02-13 04:27:02 +00:00
ameye dabec5c244 fix 2022-02-07 09:56:26 -05:00
ameye efc87db1ca Email boundary workaround 2022-02-05 23:33:32 -05:00
ameye ad56540080 fix 2022-02-05 13:02:33 -05:00
ameye 6d8cdc01ee fix 2022-02-05 11:47:38 -05:00
ameye 6c40d4f22e fix 2022-02-04 23:32:33 -05:00
ameye ef45fd4b6b fix 2022-02-04 21:13:36 -05:00
ameye 76983004a6 ix 2022-02-04 20:44:55 -05:00
ameye f3c2c37326 fix 2022-02-03 20:17:58 -05:00
ameye 54296bf7d6 fix 2022-02-03 19:47:27 -05:00
ameye e122fb93fc fix 2022-02-03 19:29:27 -05:00
ameye cff0929205 fix 2022-02-03 19:22:19 -05:00
ameye 8b8eaf88f9 fix 2022-02-03 19:08:43 -05:00
ameye 46ed530ec1 fix 2022-02-03 12:46:41 -05:00
ameye 2b38b02530 fix 2022-02-03 12:06:19 -05:00
ameye 90ee3dd46f Merge branch 'master' of ssh://gitlab.chiefsoft.net:10222/WrenchBoard/WrenchBoradWeb 2022-02-03 10:37:48 -05:00
ameye f1e5d7eec7 fix 2022-02-02 22:13:20 -05:00
ameye 0cd1f321f9 fix 2022-02-02 21:00:30 -05:00
jenkins 6956c7f409 Remove extra hots 2022-01-30 02:47:32 -05:00
jenkins a456043ced Added docker-compose configuration 2022-01-30 02:43:39 -05:00
ameye 1edcd3ea58 fix 2022-01-21 21:09:48 -05:00
ameye 80d5044534 start job api expire data 2022-01-01 13:57:26 -05:00
ameye f8b262ae54 start job api expire data 2022-01-01 13:57:20 -05:00
ameye 6cce6a0a45 Swagger interface added 2021-12-19 00:37:58 -05:00
ameye e276b6cb7b Tell the app to listen on all interfaces on port PORT to see the connections originating from outside our Docker container 2021-11-28 00:27:29 -05:00
743 changed files with 133753 additions and 20840 deletions
@@ -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 + '"');
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">
&reg; {{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.
&reg; {{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>
+19 -41
View File
@@ -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">
&reg; {{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.
&reg; {{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.
&nbsp;&nbsp;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>
&nbsp;&nbsp;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.
&nbsp;&nbsp;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">
&reg; {{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.
&reg; {{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">
&reg; {{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">
&reg; {{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">
&reg; {{site_name}} 2017<br/>
&reg; {{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>
+160 -170
View File
@@ -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">
&reg; {{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">
&reg; {{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>
+13 -23
View File
@@ -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">
&reg; {{site_name}} 2017<br/>
&reg; {{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">
&reg; {{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">
&reg; {{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">
&reg; {{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">
&reg; {{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.
&reg; {{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>
+11 -16
View File
@@ -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">
&reg; {{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.
&reg; {{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>
+10 -7
View File
@@ -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:
+7 -1
View File
@@ -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
+6
View File
@@ -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
+8 -8
View File
@@ -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
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -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
+3
View File
@@ -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);
+12
View File
@@ -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
+12
View File
@@ -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
+1
View File
@@ -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);
+7
View File
@@ -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
+8
View File
@@ -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
+41 -2
View File
@@ -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
+2 -2
View File
@@ -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=""
+238 -27
View File
@@ -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;
}
+15 -1
View File
@@ -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());
+181
View File
@@ -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
*/
+256
View File
@@ -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;
}
+2 -2
View File
@@ -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());
+105 -33
View File
@@ -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
+60 -23
View File
@@ -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()");
+316 -24
View File
@@ -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";
}
+123
View File
@@ -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;
}
+146 -10
View File
@@ -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;
+376 -3
View File
@@ -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;
}
+7 -5
View File
@@ -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
View File
@@ -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
-43
View File
@@ -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
//**************************************************************
*
*/
?>
-30
View File
@@ -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();
?>
-13
View File
@@ -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';
?>
-47
View File
@@ -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
//**************************************************************
*
*/
?>
-107
View File
@@ -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);
-58
View File
@@ -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)
// [...]
-2
View File
@@ -1,2 +0,0 @@
-12
View File
@@ -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();
?>
-35
View File
@@ -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();
?>
-26
View File
@@ -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();
?>
-104
View 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
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
-62
View File
@@ -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
//**************************************************************
*
*/
?>
-34
View File
@@ -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();
?>
-68
View File
@@ -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__));
?>
-62
View 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__));
?>
-73
View 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__));
?>
-61
View 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__));
?>
-89
View 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>
-68
View File
@@ -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__));
?>
-68
View 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__));
?>
-25
View 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();
?>
-68
View File
@@ -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__));
?>
-104
View 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>
-62
View File
@@ -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__));
?>
-38
View 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);
-60
View File
@@ -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__));
?>
-31
View 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);
-61
View File
@@ -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__));
?>
-57
View 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__));
?>
-101
View 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>
+20 -1
View File
@@ -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);
+3 -1
View File
@@ -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';
+2 -1
View File
@@ -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() {
+126 -63
View File
@@ -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>";
+58
View File
@@ -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';
}
}
}
}
+46 -77
View File
@@ -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&nbsp;<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&nbsp;<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;
}
+35 -3
View File
@@ -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');
}
}
+305 -124
View File
@@ -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);
}
}
+390 -33
View File
@@ -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();
}
}
+296 -96
View File
@@ -26,7 +26,25 @@ class Member extends Users_Controller {
}
}
/*
* Schedule account delete in the backend
*/
public function deleteacc(){
// echo "Please log out of your account, and you will not be able to log in anymore. ";
$data = $this->getSessionArray();
$in = [];
$in['member_id'] = $_SESSION['member_id'];
$in['reason'] = "Not accepted in this version";
$in['action'] = WRENCHBOARD_USER_DELETEACC;
if ($this->wrenchboard_api($in, $outx) == PHP_API_OK) {
$data['delete_message'] = "<div class=\"text-left\"><div class=\"alert alert-info no-border\">Your Account and Information Deleted.</div></div>";
redirect('/logout');
} else {
$data['delete_message'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">Unable to complete account delete at this time. </div></div>";
}
echo $data['delete_message'];
}
public function addreccipient() {
@@ -250,9 +268,12 @@ class Member extends Users_Controller {
//stdClass Object ( [id] => 146 [code] => NG [country] => Nigeria [phone_code] => 234 [allow] => 2017-01-08 10:30:42.259079-05 [status] => 1 [created] => 2017-01-08 10:30:15.087696 [updated] => 2017-01-08 10:30:15.087696 )
$this->load->view('users/view_header_user', $data);
/* $this->load->view('users/view_header_user', $data);
$this->load->view('users/view_profile', $data);
$this->load->view('users/view_footer_user', $data);
$this->load->view('users/view_footer_user', $data);*/
$this->RenderUserPage('users/view_profile', $data);
}
public function picture() {
@@ -438,9 +459,12 @@ class Member extends Users_Controller {
$data['galery_list'] = $this->getGaleryList($_SESSION['member_id']);
$this->load->view('users/view_header_user', $data);
/* $this->load->view('users/view_header_user', $data);
$this->load->view('users/view_yourpage', $data);
$this->load->view('users/view_footer_user', $data);
*/
$data['page_title'] ="My Page";
$this->renderSecurePage('users/view_yourpage', $data);
}
@@ -583,6 +607,25 @@ class Member extends Users_Controller {
public function addfund() {
$data = $this->getSessionArray();
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
. "FROM money_transfer m "
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
. "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4";
$query = $this->db->query($mysql);
$this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status');
$data['sendmoney_table'] = $this->table->generate($query);
$data['sendmoney_table_result'] = $query->result();
$data['page_key'] = 'WRB_FUND_ACCOUNT';
$data['txt_detail'] = $this->readFixedText($data['page_key']);
$data['txt_detail'] = str_replace("[how-it-worked-image-1]", "<img src='/assets/images/howitworks/howitworks-1.jpg' alt=''>", $data['txt_detail']);
@@ -594,35 +637,21 @@ class Member extends Users_Controller {
public function faq() {
$data = $this->getSessionArray();
$data['faq_table'] = '';
$query = $this->db->query('SELECT * FROM faq');
$query = $this->db->query(' SELECT * FROM faq WHERE status = 1');
$data['faq_table_row'] = $query->result();
foreach ($query->result() as $row) {
$data['faq_table'] .= "<div class=\"panel panel-white\"> "
. "<div class=\"panel-heading\"> "
. " <h6 class=\"panel-title\">"
. " <a data-toggle=\"collapse\" data-parent=\"#accordion-control\" href=\"#accordion-control-group" . $row->id . "\">" . $row->title . "</a> "
. " </h6> "
. " </div> "
. " <div id=\"accordion-control-group" . $row->id . "\" class=\"panel-collapse collapse out\"> "
. " <div class=\"panel-body\">" .htmlspecialchars_decode( $row->msg ) . " "
. " </div>"
. " </div> "
. " </div>";
$data['faq_table'] =''; // will filter categories here
}
$data['faq_table'] ='';
$data['page_title'] = "Frequently Asked Questions";
$this->RenderUserPage('users/view_faq', $data);
}
public function balance() {
$data = $this->getSessionArray();
$data['add_error'] = '';
$data['amount'] = 0;
$this->load->model('combo_model');
@@ -632,6 +661,28 @@ class Member extends Users_Controller {
$data['comment'] = '';
// $data['fee'] = 0;
//$data['escrow_balance'] = 0;
$this->load->model('report_model');
$this->load->model('account_model');
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
. "FROM money_transfer m "
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
. "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4";
$query = $this->db->query($mysql);
$this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status');
$data['sendmoney_table'] = $this->table->generate($query);
$data['sendmoney_table_result'] = $query->result();
$data['card_payment_data_result'] = $this->report_model->getCardPurchase(6)['card_payment_data_result'];
$data['card_coupon_data_result'] = $this->report_model->getRedeemCouponsList(6)['card_coupon_data_result'];
$data['wallet'] = $this->account_model->getUserWallet( $_SESSION['member_id']);
if ($_POST) {
$data['comment'] = $this->input->post('comment');
@@ -664,24 +715,84 @@ class Member extends Users_Controller {
}
}
$data['page_title'] ="Wallet";
$this->RenderUserPage('users/view_balance', $data);
}
public function smoney() {
$data = $this->getSessionArray();
//var_dump($data);
//exit();
$data['add_error'] = '';
$data['amount'] = 0;
$this->load->model('combo_model');
$data['recipient_account'] = $this->input->post('recipient_account');
$data['recipient_account_combo'] = $this->combo_model->getUserRecipientCombo('recipient_account', $_SESSION['member_id'], $data['recipient_account']);
$data['fee'] = $data['total'] =0;
$data['comment'] = '';
// $data['fee'] = 0;
//$data['escrow_balance'] = 0;
$this->load->model('account_model');
$data['wallet'] = $this->account_model->getUserWallet($_SESSION['member_id'],$currency='NAIRA'); // $out['current_balance'];
$data['current_balance'] = $data['wallet'][0]['current_balance'];
if ($_POST) {
$data['comment'] = $this->input->post('comment');
$data['amount'] = $this->input->post('amount') + 0; // must be number [still in full will be cents to go to backend latter]
if ($data['amount'] == 0 || $data['amount'] < 0 || $data['amount'] == '' || $data['recipient_account'] == '') {
$out['error'] = 'Amount & Recipient Account Required';
$data['add_error'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
if ($data['amount'] > 0) {
$outx = $this->transactionFee($data['amount'], $_SESSION['member_id']);
$data['total'] = $outx['total_amount'];
$data['fee'] = $outx['processing_fee'];
}
} else {
$outx = $this->transactionFee($data['amount'], $_SESSION['member_id']);
$data['total'] = $outx['total_amount'];
$data['fee'] = $outx['processing_fee'];
$TotalAmount = $data['total'];
// now let us do initial check if you have enough money
if ($data['current_balance'] < $TotalAmount) {
$out['error'] = 'You do not have enough balance for this transfer';
$data['add_error'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
} else {
$this->session->set_flashdata('pending_sendmoney', $data);
redirect('member/confirmwithdraw');
}
}
}
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
. "FROM money_transfer m "
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
. "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4";
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
. "FROM money_transfer m "
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
. "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4";
$query = $this->db->query($mysql);
$this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status');
$data['sendmoney_table'] = $this->table->generate($query);
$data['sendmoney_table_result'] = $query->result();
$data['page_title'] ="Wallet";
$this->RenderUserPage('users/view_balance', $data);
$this->RenderUserPage('users/view_smoney', $data);
}
public function fee() {
$amount = $this->input->get('amount') + 0;
$res = $this->transactionFee($amount, $_SESSION['member_id']);
@@ -705,41 +816,41 @@ class Member extends Users_Controller {
public function confirmwithdraw() {
$final_page = false;
$data = $this->getSessionArray();
//$data = $this->getSessionArray();
if ($_POST) {
$smIn =[];
$smIn['member_id'] = $_SESSION['member_id'];
$smIn['action'] = WRENCHBOARD_SMONEY_MEMBER;
$smIn["senderid"] = $_SESSION['member_id'];
$smIn["InitiatingEntityCode"] = "MBA";
//$data = array();
$data['member_id'] = $_SESSION['member_id'];
$data['action'] = WRENCHBOARD_SMONEY_MEMBER;
$data["senderid"] = $_SESSION['member_id'];
$data["InitiatingEntityCode"] = "MBA";
$smIn['InitiatingAmount'] = $this->input->post('amount') * 100;
$smIn['Fee'] = $this->input->post('fee') * 100;
$data['InitiatingAmount'] = $this->input->post('amount') * 100;
$data['Fee'] = $this->input->post('fee') * 100;
$smIn["InitiatingChannel"] = 7;
$smIn["InitiatingPaymentMethodCode"] = "CA";
$smIn["InitiatingCurrencyCode"] = '566'; // 566 - NRN - Naira
//$smIn["recipientid"] = $this->input->post('recipient_account');
$smIn['recipientid'] = $this->input->post('recipientid');
$smIn["transaction_id"] = "T" . rand(120000, 999999);
$smIn["TerminatingPaymentMethodCode"] = "AC";
$smIn["TerminatingAmount"] = $smIn["InitiatingAmount"];
$smIn["TerminatingCurrencyCode"] = '566'; // 566 - NRN - Naira
$smIn["TerminatingCountryCode"] = 'NG'; // NG - Nigeria
$data["InitiatingChannel"] = 7;
$data["InitiatingPaymentMethodCode"] = "CA";
$data["InitiatingCurrencyCode"] = '566'; // 566 - NRN - Naira
//$data["recipientid"] = $this->input->post('recipient_account');
$data['recipientid'] = $this->input->post('recipientid');
$data["transaction_id"] = "T" . rand(120000, 999999);
$data["TerminatingPaymentMethodCode"] = "AC";
$data["TerminatingAmount"] = $data["InitiatingAmount"];
$data["TerminatingCurrencyCode"] = '566'; // 566 - NRN - Naira
$data["TerminatingCountryCode"] = 'NG'; // NG - Nigeria
$final_page = true;
if ($data['recipientid'] != '' && $data['recipientid'] > 0 && $data['InitiatingAmount'] > 0 && $data['Fee'] >= 0) {
if ($smIn['recipientid'] != '' && $smIn['recipientid'] > 0 && $smIn['InitiatingAmount'] > 0 && $smIn['Fee'] >= 0) {
$this->load->model('backend_model');
$out = array();
$res = $this->backend_model->wrenchboard_api($data, $out);
$res = $this->backend_model->wrenchboard_api($smIn, $out);
// print_r($out);
// exit;
$data = $this->getSessionArray(); // you will need this for new balace
$data["fee"] = $out["Fee"];
$data["amount"] = $out["InitiatingAmount"];
$data["total"] = $data["fee"] + $data["amount"];
$data["recipient_account_detail"] = "Recipient Account Here";
$data["comment"] = "Coment Here";
$data["comment"] = "Comment Here";
$data["rec_firstname"] = $out["firstname"];
$data["rec_lastname"] = $out["lastname"];
@@ -770,7 +881,10 @@ class Member extends Users_Controller {
*/
} else {
$pending_sendmoney = $this->session->flashdata('pending_sendmoney');
$data['amount'] = 0;
// var_dump($pending_sendmoney);
if (!isset($pending_sendmoney)){
redirect('member/balance');
}
$data['amount'] = $pending_sendmoney['amount'];
$data['total'] = $pending_sendmoney['total'];
$data['fee'] = $pending_sendmoney['fee'];
@@ -782,18 +896,45 @@ class Member extends Users_Controller {
$this->load->model('combo_model');
$this->combo_model->setReadOnly(true);
$data['recipient_account_combo'] = $this->combo_model->getUserRecipientCombo('recipient_account', $_SESSION['member_id'], $data['recipient_account']);
// $this->load->view('users/view_header_user', $data);
$this->RenderUserPage('users/view_confirmwithdraw', $data);
// $this->load->view('users/view_footer_user', $data);
$data['sendmoney_table_result'] = $this->getSendMoneyRecent();
$this->RenderUserPage('users/view_confirmwithdraw', $data);
} else {
//$this->load->view('users/view_header_user', $data);
$this->RenderUserPage('users/view_finalwithdraw', $data);
// $this->load->view('users/view_footer_user', $data);
$data['sendmoney_table_result'] = $this->getSendMoneyRecent();
$this->session->set_flashdata('reciept_sendmoney', $data);
redirect('member/sendMoneyReciepts');
// $data['sendmoney_table_result'] = $this->getSendMoneyRecent();
// $this->RenderUserPage('users/view_finalwithdraw', $data);
}
}
public function sendMoneyReciepts(){
$data = $this->session->flashdata('reciept_sendmoney');
// var_dump($pending_sendmoney);
if (!isset($data)){
redirect('member/balance');
}
$data['sendmoney_table_result'] = $this->getSendMoneyRecent();
$this->RenderUserPage('users/view_finalwithdraw', $data);
}
private function getSendMoneyRecent(){
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
. "FROM money_transfer m "
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
. "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4";
$query = $this->db->query($mysql);
return $query->result();
}
public function completewithdraw() {
echo 'Not attached - backend implemented already';
@@ -806,20 +947,21 @@ class Member extends Users_Controller {
$data = $this->getSessionArray();
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT added::date AS msg_date,msg,id AS msg_id FROM members_messages WHERE member_id = " . $_SESSION['member_id'] . " AND reply IS NULL ORDER BY id DESC LIMIT 20";
$mysql = "SELECT added::date AS msg_date,msg,id AS msg_id
FROM members_messages
WHERE member_id = " . $_SESSION['member_id'] . " AND reply IS NULL
ORDER BY id DESC LIMIT 20";
$query = $this->db->query($mysql);
$myTable = "<table class='table table-striped table-hover table-bordered table-condensed'>";
$myTable = "<table class='table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3'>";
foreach ($query->result_array() as $row) {
$myTable .= $this->mesageTableRow($row);
}
$myTable .="</table>";
//$this->table->set_heading(array('data' => 'Date', 'style' => 'width:110px'), 'Message');
$data['message_table'] = $myTable; //$this->table->generate($query);
$data['page_title'] ="Messages";
$data['message_table'] = $myTable;
$this->RenderUserPage('users/view_message', $data);
}
@@ -852,7 +994,7 @@ class Member extends Users_Controller {
if ($num > 0) {
$row = $query->row_array();
$myTable = "<table class='table table-sm table-hover table-bordered table-condensed' style=' background-color: #f1fdd5;'>";
$myTable = "<table class='table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3' style=' background-color: #f1fdd5;'>";
$myTable .= $this->makeMesageDetailTableRow($row);
$myTable .="</table>";
}
@@ -874,15 +1016,16 @@ class Member extends Users_Controller {
public function replymessage() {
$data = $this->getSessionArray();
//url: "/member/replymessage?proc=REPLYMSG&message_code=" + message_code + "&message_id="+message_id+"&yourmessage=" + document.job_message.yourmessage.value
$data["message_id"] = $this->input->get('message_id');
$data["memo"] = trim($this->input->get('message_code'));
$data["yourmessage"] = trim($this->input->get('yourmessage'));
$in = [];
$in["message_id"] = $this->input->get('message_id');
$in["memo"] = trim($this->input->get('message_code'));
$in["yourmessage"] = trim($this->input->get('yourmessage'));
if ($data["message_id"] > 0 && $data["memo"] != '' && $data["yourmessage"] != '') {
$data['action'] = WRENCHBOARD_JOB_REPLY_QUESTION;
if ($in["message_id"] > 0 && $in["memo"] != '' && $in["yourmessage"] != '') {
$in['action'] = WRENCHBOARD_JOB_REPLY_QUESTION;
$this->load->model('backend_model');
$out = array();
$res = $this->wrenchboard_api($data, $out);
$res = $this->wrenchboard_api($in, $out);
if ($res == PHP_API_OK) {
echo 'Replied...';
}
@@ -894,7 +1037,11 @@ class Member extends Users_Controller {
$this->load->library('pagination');
$config = array();
/*
*
* 7 | MEMBER_NEWCARD_PAYM | MNCCD | 0
8 | MEMBER_RETCARD_PAYM | MRCCD | 0
*/
$this->load->library('table');
$this->table->set_template($this->template);
@@ -902,7 +1049,10 @@ class Member extends Users_Controller {
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' "
. "WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC";
$query = $this->db->query($mysql);
@@ -935,20 +1085,25 @@ class Member extends Users_Controller {
$page = is_numeric($page) ? $page : 0;
$mysql = "SELECT added::date,(CASE WHEN code = 'OFDPS' THEN 'Job Offer Deposit' "
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page;
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' "
. "WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "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' => 'Date', 'style' => 'width:110px'), 'Description', array('data' => 'Amount', 'style' => 'width:100px'), array('data' => 'Fee', 'style' => 'width:70px'), array('data' => 'Confirmation', 'style' => 'width:100px'));
$data['payment_result'] = $this->table->generate($query);
$data['payment_data_result'] = $query->result();
$data["links"] = $this->pagination->create_links();
// $this->load->view('users/view_header_user', $data);
$data['page_title'] ="Payments Report";
$this->RenderUserPage('users/view_payment', $data);
// $this->load->view('users/view_footer_user', $data);
}
@@ -966,13 +1121,13 @@ class Member extends Users_Controller {
if ($_POST) {
$in = [];
//$email = $this->input->post('email');
// $firstname = $this->input->post('firstname');
// $lastname = $this->input->post('lastname');
$your_message = $this->input->post('msg');
$data['firstname'] = $_SESSION['firstname']; // $firstname;
$data['lastname'] = $_SESSION['lastname']; // $lastname;
$in['firstname'] = $_SESSION['firstname']; // $firstname;
$in['lastname'] = $_SESSION['lastname']; // $lastname;
// if ($firstname == '' || $lastname == '') {
// $message = 'Both first and last name are required';
// }
@@ -986,14 +1141,14 @@ class Member extends Users_Controller {
// }
if ($message == '') {
$data['email'] = $_SESSION['email']; // $email;
$in['email'] = $_SESSION['email']; // $email;
$data['your_message'] = $your_message;
$data['loc'] = $_SERVER['REMOTE_ADDR']; //'38.101.241.200';
$data['action'] = WRENCHBOARD_SEND_CONTACTUS;
$in['your_message'] = $your_message;
$in['loc'] = $_SERVER['REMOTE_ADDR']; //'38.101.241.200';
$in['action'] = WRENCHBOARD_SEND_CONTACTUS;
$this->load->model('backend_model');
$out = array();
$res = $this->backend_model->wrenchboard_api($data, $out);
$res = $this->backend_model->wrenchboard_api($in, $out);
$message = "Your message was sent";
$email = $firstname = $lastname = $your_message = "";
} else {
@@ -1054,9 +1209,12 @@ class Member extends Users_Controller {
$data["calendar_data"] = $calendar_data;
$this->load->view('users/view_header_user', $data);
$this->load->view('users/view_schedule', $data);
$this->load->view('users/view_footer_user', $data);
// $this->load->view('users/view_header_user', $data);
// $this->load->view('users/view_schedule', $data);
// $this->load->view('users/view_footer_user', $data);
$this->renderSecurePage('users/view_schedule', $data);
}
public function userlog() {
@@ -1079,11 +1237,53 @@ class Member extends Users_Controller {
public function settings() {
$data = $this->getSessionArray();
$this->load->view('users/view_header_user', $data);
$this->load->view('users/view_settings', $data);
$this->load->view('users/view_footer_user', $data);
$q = "SELECT id,title,description,pref_id FROM members_settings_options ORDER BY lorder ASC";
$query = $this->db->query($q);
$data['settings_option'] = $query->result_array();
$q2 = "SELECT pref_id FROM members_settings WHERE member_id = " . $_SESSION['member_id'] . " AND status = 100";
$query2 = $this->db->query($q2);
$selRes = [];
$sel_vals = $query2->result_array();
foreach ($sel_vals as $rw){
$selRes[] =$rw['pref_id'];
}
$data['selected_settings'] = $selRes;
$this->RenderUserPage('users/view_settings', $data);
}
public function accsettings(){
$data = $this->getSessionArray();
if ($_GET) {
$set_type = $this->input->get('set_type');
$seval = $this->input->get('seval');
if ( $set_type !='' && $seval !='' ){
$in = array();
$in['status'] =$seval;
$in['pref_id'] =$set_type;
$in['action'] = WRENCHBOARD_USER_SETTINGS;
$in['sessionid'] = $_SESSION['session_id'];
$in['member_id'] = $_SESSION['member_id'];
$this->load->model('backend_model');
$out = array();
$res = $this->backend_model->wrenchboard_api($in, $out);
if ($res != PHP_API_OK) {
echo '<span style=\"color: green;\">updated</span>';
}
}
}
}
private function AgetSessionArray() {
$data = $_SESSION['secure_data'];
$data['username'] = $_SESSION['username']; // = $this->input->post('username');
+4 -3
View File
@@ -7,9 +7,10 @@ class Outmessage extends CI_Controller {
$data['account_email'] = ''; //$data['username'];
$data['title'] = "Message"; //ucfirst($page); // Capitalize the first letter
$data['page_title'] = "Verify Email.";
$this->load->view('templates/header_boxed', $data);
$this->load->view('users/view_outmessage', $data);
$this->load->view('templates/footer_boxed', $data);
//$this->load->view('templates/header_boxed', $data);
//$this->load->view('users/view_outmessage', $data);
//$this->load->view('templates/footer_boxed', $data);
$this->load->view('site3/external/view_signup_started',$data);
}
}
@@ -5,29 +5,36 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Password_recovery extends CI_Controller {
public function index() {
//echo "ameye kvkgkg";
$data = [];
$data['hcaptcha_site_key'] = "416c2382-9d6e-4131-bb58-e61b33f46a8b";
$data['hcaptcha_secret'] = "0x371da01B1407137aCb0FcCB387753450DFD096BC";
$data['action_message'] = "";
if ($_POST) {
$data['email'] = $this->input->post('email');
if ($data['email'] == '') {
$out['error'] = 'Please specify valid emal to continue';
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
$data['h-captcha-response'] = $this->input->post('h-captcha-response');
if ($this->verifyCaptcha($data)) {
$data['email'] = $this->input->post('email');
if ($data['email'] == '') {
$out['error'] = 'Please specify valid emal to continue';
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
} else {
$this->resetMemberPass($data['email']);
$out['error'] = "&nbsp;&nbsp;If we find your email, you will receive a link to reset your password. Please use or <a
href='https://www.wrenchboard.com/contact'>contact form</a> if you did not get our message after few minutes. ";
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-info no-border\">" . $out['error'] . "</div></div>";
}
} else {
//WRENCHBOARD_ACCOUNT_RESETPASS
$this->resetMemberPass($data['email']);
$out['error'] = "If we find your email, you will receive a link to reset your password. Please use or <a href='/contact'>contact form</a> if you did not get our message after few minutes. ";
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-info no-border\">" . $out['error'] . "</div></div>";
$out['error'] = 'Please verify that you are human';
$data['action_message'] = "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $out['error'] . "</div></div>";
}
}
$data["message"] = "Enter your account username, Email.<br> We will send you an email to reset your password";
$this->load->view('users/view_external_header');
$this->load->view('users/view_password_recovery', $data);
$this->load->view('users/view_external_footer');
// $this->load->view('users/view_external_header');
// $this->load->view('users/view_password_recovery', $data);
// $this->load->view('users/view_external_footer');
$this->load->view('site3/external/view_resetpass',$data);
//
}
var $actionMessage = '';
@@ -52,4 +59,27 @@ class Password_recovery extends CI_Controller {
return $this->actionMessage;
}
private function verifyCaptcha($verify_data) {
if (!is_array($verify_data) || !array_key_exists('hcaptcha_secret',$verify_data) || $verify_data['hcaptcha_secret']==''
|| !array_key_exists('h-captcha-response',$verify_data) || $verify_data['h-captcha-response']=='') {
return false;
}
$data = array(
'secret' => $verify_data['hcaptcha_secret'],
'response' => $verify_data['h-captcha-response']
);
$verify = curl_init();
curl_setopt($verify, CURLOPT_URL, "https://hcaptcha.com/siteverify");
curl_setopt($verify, CURLOPT_POST, true);
curl_setopt($verify, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($verify, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($verify);
// var_dump($response);
$responseData = json_decode($response);
if(is_object($responseData) && property_exists($responseData, 'success') && $responseData->success) {
return true;
}
return false;
}
}

Some files were not shown because too many files have changed in this diff Show More