373 Commits

Author SHA1 Message Date
CHIEFSOFT\ameye 925681b5f5 bank code 2025-08-17 17:08:09 -04:00
CHIEFSOFT\ameye b61ad127b6 clean up bankl c-ded 2025-08-17 16:56:44 -04:00
CHIEFSOFT\ameye 61f91489ca banner count 2025-08-14 21:02:20 -04:00
CHIEFSOFT\ameye 102ed97ed5 getJobsData 2025-08-11 16:12:36 -04:00
CHIEFSOFT\ameye 4a3ddaaff7 Joob list back to c code 2025-08-02 15:12:20 -04:00
CHIEFSOFT\ameye 8d1a22cfa4 notification on interest 2025-08-01 18:57:47 -04:00
CHIEFSOFT\ameye e665f189a9 fix email 2025-07-12 23:14:59 -04:00
CHIEFSOFT\ameye 930049566a fix t 2025-07-12 22:56:13 -04:00
CHIEFSOFT\ameye b7c24f3af4 fix text 2025-07-12 22:48:31 -04:00
CHIEFSOFT\ameye c41bf6d3b4 pening email 2025-07-12 22:45:38 -04:00
CHIEFSOFT\ameye 38163fa5aa BORAD 2025-07-12 22:30:29 -04:00
CHIEFSOFT\ameye e8fdc26641 reduce cache perios 2025-07-12 12:20:34 -04:00
CHIEFSOFT\ameye 4b937d9102 Remove cache 2025-07-12 12:12:30 -04:00
CHIEFSOFT\ameye f5d76fffa4 welcome emsil 2025-07-11 21:54:26 -04:00
CHIEFSOFT\ameye 5cf1b62e50 Flow cleanup 2025-07-11 20:57:43 -04:00
CHIEFSOFT\ameye 7860e6de8c cleanup 2025-07-11 20:46:35 -04:00
CHIEFSOFT\ameye 55b5508370 https://www.wrenchboard.com/contact 2025-07-11 20:18:11 -04:00
CHIEFSOFT\ameye de236cd575 headers 2025-07-11 20:06:31 -04:00
CHIEFSOFT\ameye 18f8801aa6 reach here 2025-07-11 20:04:26 -04:00
CHIEFSOFT\ameye 7a0959f8fc transacrons 2025-07-11 20:02:11 -04:00
CHIEFSOFT\ameye 031cb647dc json_encode( 2025-07-11 19:57:45 -04:00
CHIEFSOFT\ameye 56b416f9f8 local out 2025-07-11 19:55:15 -04:00
CHIEFSOFT\ameye b735b7ed9f startcredit 2025-07-11 19:52:28 -04:00
CHIEFSOFT\ameye 96adf63c97 just out 2025-07-11 19:48:39 -04:00
CHIEFSOFT\ameye 2883c877e8 transaction side 2025-07-11 19:39:01 -04:00
CHIEFSOFT\ameye acf2362961 too much calls on bannes 2025-07-11 19:05:45 -04:00
CHIEFSOFT\ameye 5ff1f79eae send sign up email directly 2025-07-11 18:38:30 -04:00
CHIEFSOFT\ameye c53337a244 smtp.gmail.com replace with 10.10.33.15 2025-07-09 07:53:03 -04:00
CHIEFSOFT\ameye 569d3e7907 Email test 2025-07-05 17:58:00 -04:00
CHIEFSOFT\ameye d9744235da fix email 2025-07-05 17:28:14 -04:00
CHIEFSOFT\ameye ef028e855f Removed banner use cache for nw 2025-07-05 17:20:05 -04:00
CHIEFSOFT\ameye 04c742c7cd test_just_email 2025-07-05 13:08:55 -04:00
CHIEFSOFT\ameye b9c5a6e4f0 fix text 2025-07-05 13:01:01 -04:00
CHIEFSOFT\ameye 1e530c0f0a fix traits 2025-07-05 12:51:58 -04:00
CHIEFSOFT\ameye 53d674f36b Added test 2025-07-05 12:38:24 -04:00
CHIEFSOFT\ameye 4aadf2a084 Banner suspend 2025-06-30 19:54:48 -04:00
CHIEFSOFT\ameye f2035c2b43 flatten missed 2025-06-13 23:11:58 -04:00
CHIEFSOFT\ameye bf5fdb4257 removed checks 2025-06-13 23:09:12 -04:00
CHIEFSOFT\ameye 5758af7483 Routes fix 2025-06-13 22:54:03 -04:00
CHIEFSOFT\ameye f6d12d5272 /generics 2025-06-13 22:50:21 -04:00
CHIEFSOFT\ameye 013da276fb back office gate 2025-06-13 22:40:42 -04:00
CHIEFSOFT\ameye c59de16d04 fix data 2025-06-13 22:10:52 -04:00
CHIEFSOFT\ameye 902448fb36 Header removed 2025-06-07 13:25:40 -04:00
CHIEFSOFT\ameye 75bc4ce27f WrenchFamily::familyList 2025-06-07 12:53:00 -04:00
CHIEFSOFT\ameye 7ef929f45d WrenchJobManager::jobManagerManageOffers 2025-06-07 12:37:33 -04:00
CHIEFSOFT\ameye 7883420948 Proper reopnse on API 2025-06-07 12:29:27 -04:00
CHIEFSOFT\ameye 98d7bb3042 WrenchJobManager::jobManagerActive 2025-06-07 12:20:30 -04:00
CHIEFSOFT\ameye 9050fd6727 Fix API response 2025-06-07 11:42:26 -04:00
CHIEFSOFT\ameye 49ffe92e42 job list 2025-06-07 11:13:05 -04:00
CHIEFSOFT\ameye ea6b377787 loadProfile 2025-06-07 10:59:32 -04:00
CHIEFSOFT\ameye a0ad73c957 job manager list 2025-06-07 10:35:21 -04:00
CHIEFSOFT\ameye 64145ceba3 Json return 2025-06-03 21:35:20 -04:00
CHIEFSOFT\ameye e4c0a011c4 Outpi=ut format 2025-06-03 21:29:19 -04:00
CHIEFSOFT\ameye 9b665e2ae2 Log fix 2025-06-03 21:11:17 -04:00
CHIEFSOFT\ameye 75731f330f loggers 2025-06-03 21:06:35 -04:00
CHIEFSOFT\ameye 08ec032ad2 added logs 2025-06-03 20:57:41 -04:00
CHIEFSOFT\ameye ceb830bf51 Blog wrenchboard 2025-03-31 13:50:13 -04:00
CHIEFSOFT\ameye cf59329534 $res1['blogdata'] 2025-03-31 13:04:26 -04:00
CHIEFSOFT\ameye 2cd96a3820 Remove mongo need + add blog vjevk 2025-03-31 13:00:07 -04:00
CHIEFSOFT\ameye e3add7badd blogdata.chiefsoft.net 2025-03-20 13:50:08 -04:00
CHIEFSOFT\ameye c4bf6f79c3 Blog source 2025-03-20 13:46:05 -04:00
CHIEFSOFT\ameye 94a85d7e2e New server url 2024-12-03 22:11:51 -05:00
CHIEFSOFT\ameye f8beca116f Email teamplate fix 2024-12-02 18:33:59 -05:00
CHIEFSOFT\ameye b83ac18972 refer link in code 2024-12-02 16:42:34 -05:00
CHIEFSOFT\ameye d43927bdc4 Fix Query 2024-12-02 16:06:01 -05:00
CHIEFSOFT\ameye 09eeb9f05a link process 2024-12-02 15:46:41 -05:00
CHIEFSOFT\ameye c5af776524 ref link 2024-12-02 13:43:06 -05:00
CHIEFSOFT\ameye 85aec6336e x["refer_link"] 2024-12-02 12:15:04 -05:00
CHIEFSOFT\ameye 6ab9671355 add link to emsil 2024-12-02 12:03:06 -05:00
CHIEFSOFT\ameye e15fabc436 Read error 2024-12-02 11:42:07 -05:00
CHIEFSOFT\ameye 31b1348b4d query error 2024-12-02 11:29:15 -05:00
CHIEFSOFT\ameye d298ab6f35 added log 2024-12-02 11:12:31 -05:00
CHIEFSOFT\ameye ed334ab4cc refer liks 2024-12-02 10:49:25 -05:00
CHIEFSOFT\ameye e592aa9f6e link parts 2024-12-02 09:43:44 -05:00
CHIEFSOFT\ameye 185d61102e my refer links 2024-12-02 09:26:49 -05:00
CHIEFSOFT\ameye fd7bb073b5 refer link 2024-12-02 08:28:13 -05:00
CHIEFSOFT\ameye 5ff99d0639 New route added 2024-12-02 06:25:18 -05:00
CHIEFSOFT\ameye 1128844537 removed refer linkd 2024-12-02 05:09:53 -05:00
CHIEFSOFT\ameye f08c321a99 refer links 2024-12-02 05:07:11 -05:00
CHIEFSOFT\ameye 7923b44fe9 Query error 2024-11-30 18:02:56 -05:00
CHIEFSOFT\ameye 98fd7bef08 fix qery 2024-11-30 17:49:10 -05:00
CHIEFSOFT\ameye d0bbd2e6f6 cache on the refer links 2024-11-30 13:23:55 -05:00
CHIEFSOFT\ameye 8cfb11fa95 cache added 2024-11-30 12:49:28 -05:00
CHIEFSOFT\ameye 97f4cf6cb4 REFPROMO- 2024-11-30 12:40:09 -05:00
CHIEFSOFT\ameye 633a596f03 load options 2024-11-30 12:03:28 -05:00
CHIEFSOFT\ameye 506d33d2b8 server name 2024-11-30 11:03:42 -05:00
CHIEFSOFT\ameye 8dbcffa379 Fix query 2024-11-30 10:44:09 -05:00
CHIEFSOFT\ameye 783a63ff5f in["promo"].c_str(), in["limit"].Long() 2024-11-30 10:18:27 -05:00
CHIEFSOFT\ameye 1b43a5ec67 status filter 2024-11-30 10:10:38 -05:00
CHIEFSOFT\ameye 4745d2e164 promo admin 2024-11-30 09:58:23 -05:00
CHIEFSOFT\ameye 1640cf763e promo ref test 2024-11-30 09:55:48 -05:00
CHIEFSOFT\ameye 208d7333e7 min names 2024-11-30 08:53:13 -05:00
CHIEFSOFT\ameye 023f7efea0 fix query 2024-11-30 04:52:01 -05:00
CHIEFSOFT\ameye e57abc2c0f firstname | lastname | email 2024-11-30 04:48:50 -05:00
CHIEFSOFT\ameye 9f6e00ce29 added backend calls 2024-11-30 04:45:14 -05:00
CHIEFSOFT\ameye 64681a6c8c load refer 2024-11-30 04:34:17 -05:00
CHIEFSOFT\ameye f944692d03 fix data 2024-11-30 03:17:59 -05:00
CHIEFSOFT\ameye 7916c06255 Dreate data 2024-11-30 03:13:46 -05:00
CHIEFSOFT\ameye 8e8c5d1a3e Create adata 2024-11-30 03:07:31 -05:00
CHIEFSOFT\ameye 9204315d8e raw data 2024-11-30 03:01:20 -05:00
CHIEFSOFT\ameye dea0e63cb6 user contact 2024-11-30 02:22:36 -05:00
CHIEFSOFT\ameye be401f70f5 contacts save 2024-11-30 02:09:04 -05:00
CHIEFSOFT\ameye b1461b7c6c log mode 2024-11-30 01:15:38 -05:00
CHIEFSOFT\ameye 47c61173e8 change font size 2024-11-29 12:21:20 -05:00
CHIEFSOFT\ameye 3310ca7eb2 fix data 2024-11-29 11:08:32 -05:00
CHIEFSOFT\ameye 570c42035b today_signup_7days 2024-11-29 02:48:13 -05:00
CHIEFSOFT\ameye ec5a4d0e90 promo alert emsil 2024-11-29 02:24:10 -05:00
CHIEFSOFT\ameye d5a74f1829 cache save 2024-11-28 17:15:44 -05:00
CHIEFSOFT\ameye eb4bc69a14 fix data add 2024-11-28 16:47:52 -05:00
CHIEFSOFT\ameye a2b3ed4d0c fix data save 2024-11-28 16:34:59 -05:00
CHIEFSOFT\ameye 3adc925c65 raw contents 2024-11-28 16:29:06 -05:00
CHIEFSOFT\ameye 821221f26d $in["raw_contacts_". $in["mmode"]] = $in["raw_contacts"]; // extra store raw 2024-11-28 16:15:09 -05:00
CHIEFSOFT\ameye cfe75be26d contacts data 2024-11-28 16:07:20 -05:00
CHIEFSOFT\ameye e5b1bba16a Fix email template 2024-11-28 14:55:18 -05:00
CHIEFSOFT\ameye 11296ed7b4 refferhx status > 0 2024-11-28 11:16:11 -05:00
CHIEFSOFT\ameye 3766408310 Missing delwcartuon 2024-11-28 10:57:42 -05:00
CHIEFSOFT\ameye bb620b7f83 removed out var 2024-11-28 10:46:43 -05:00
CHIEFSOFT\ameye 2c83410442 long ReferEmailsCleanup() 2024-11-28 10:37:27 -05:00
CHIEFSOFT\ameye b5c9747774 mail fix 2024-11-28 07:43:47 -05:00
CHIEFSOFT\ameye 7a5b6cf31d wreng email 2024-11-28 07:13:29 -05:00
CHIEFSOFT\ameye 364ef07168 email format 2024-11-28 06:51:59 -05:00
CHIEFSOFT\ameye a3285ec9a7 out 2024-11-28 04:35:35 -05:00
CHIEFSOFT\ameye 83852e8c7e duplicate removed 2024-11-28 04:17:46 -05:00
CHIEFSOFT\ameye a504b70d7b fix bug 2024-11-28 03:55:26 -05:00
CHIEFSOFT\ameye ceac9d3f49 missed mail type 2024-11-28 03:48:29 -05:00
CHIEFSOFT\ameye f4ce63f219 fix refer emasil send 2024-11-28 03:42:42 -05:00
CHIEFSOFT\ameye df9ea92d8c Refre email as actions 2024-11-28 03:30:13 -05:00
CHIEFSOFT\ameye 393af7d657 fix refer emsil 2024-11-28 03:02:33 -05:00
CHIEFSOFT\ameye 12d45f37b2 error ctach 2024-11-28 02:16:53 -05:00
CHIEFSOFT\ameye dacc848015 Try catch on get jobs 2024-11-28 02:00:21 -05:00
CHIEFSOFT\ameye 697d6f3f06 fix query 2024-11-27 19:09:44 -05:00
CHIEFSOFT\ameye 27ff4f797e promo actions 2024-11-24 18:07:50 -05:00
CHIEFSOFT\ameye f801da3702 category 2024-11-24 18:02:04 -05:00
CHIEFSOFT\ameye 694531352d category description 2024-11-24 17:31:44 -05:00
CHIEFSOFT\ameye 6f83a9829c promo actions list 2024-11-24 17:22:17 -05:00
CHIEFSOFT\ameye 9b1769193b POINT ADDED 2024-11-24 16:57:31 -05:00
CHIEFSOFT\ameye 3e96733a36 removed blog id 2024-11-24 16:31:01 -05:00
CHIEFSOFT\ameye 8820211fff Missing Data 2024-11-24 16:02:24 -05:00
CHIEFSOFT\ameye 2872a44357 Added logs 2024-11-24 15:57:10 -05:00
CHIEFSOFT\ameye a8af20f330 Missed delarartion 2024-11-23 15:02:24 -05:00
CHIEFSOFT\ameye 1a545646b7 promo action 2024-11-23 12:31:56 -05:00
CHIEFSOFT\ameye d62b9d7899 added admin uid 2024-11-23 12:20:28 -05:00
CHIEFSOFT\ameye ca3ab4f944 fix email send 2024-11-23 12:10:29 -05:00
CHIEFSOFT\ameye 10b0fd1d8d long RegisterPromoAction(CVars in) 2024-11-23 11:51:42 -05:00
CHIEFSOFT\ameye 7bf57b7324 c_str 2024-11-23 11:30:27 -05:00
CHIEFSOFT\ameye caad097517 promo rtecords 2024-11-23 11:19:44 -05:00
CHIEFSOFT\ameye 69d601c1b9 Clean spaces 2024-11-23 10:16:10 -05:00
CHIEFSOFT\ameye 9b066a554b promo monitor emsil 2024-11-23 10:15:21 -05:00
CHIEFSOFT\ameye 73dedf0513 alett email format 2024-11-23 07:40:30 -05:00
CHIEFSOFT\ameye a1678ab730 New jobs 2024-11-20 06:43:46 -05:00
CHIEFSOFT\ameye 39be594de8 Fix data send 2024-11-19 11:46:48 -05:00
CHIEFSOFT\ameye a0fc70065b promo site 2024-11-19 11:36:00 -05:00
CHIEFSOFT\ameye ade858cf8d fix include 2024-11-19 06:15:38 -05:00
CHIEFSOFT\ameye 41b827d1ef assign task layers 2024-11-19 05:49:37 -05:00
CHIEFSOFT\ameye bbd14bc0bf Commit action 2024-11-18 16:22:37 -05:00
CHIEFSOFT\ameye 62f61b4704 assifb task 2024-11-18 16:13:58 -05:00
CHIEFSOFT\ameye 246e843f8b long WrenchPromoAssignTask( CVars in, CVars &out ) 2024-11-18 15:40:15 -05:00
CHIEFSOFT\ameye 618adef423 fix query 2024-11-18 13:58:44 -05:00
CHIEFSOFT\ameye 18dc920986 remnve extra checks 2024-11-18 13:50:02 -05:00
CHIEFSOFT\ameye f203267c96 out["status"] = "OK"; 2024-11-18 13:42:44 -05:00
CHIEFSOFT\ameye 40637e4abc get meber 2024-11-18 13:31:59 -05:00
CHIEFSOFT\ameye d76124776f member_uid 2024-11-18 13:27:39 -05:00
CHIEFSOFT\ameye 75c0cf058a Get API 2024-11-18 13:10:05 -05:00
CHIEFSOFT\ameye de9cc44fac total_record 2024-11-18 08:46:43 -05:00
CHIEFSOFT\ameye 7de1085643 offset 2024-11-18 08:25:33 -05:00
CHIEFSOFT\ameye 863cfc579f routes to mpost 2024-11-18 08:20:04 -05:00
CHIEFSOFT\ameye 51c90afda5 checks added 2024-11-18 07:42:05 -05:00
CHIEFSOFT\ameye 9e55465127 blog_selections 2024-11-18 07:02:33 -05:00
CHIEFSOFT\ameye ffc22f5119 result list 2024-11-18 06:53:51 -05:00
CHIEFSOFT\ameye b2f8ac55a1 protected duplicate 2024-11-18 06:45:10 -05:00
CHIEFSOFT\ameye 243d9136aa Fix data 2024-11-17 19:50:22 -05:00
CHIEFSOFT\ameye 9232d1a326 promo list 2024-11-17 19:29:24 -05:00
CHIEFSOFT\ameye 48c944ca94 added lkast 2024-11-17 14:33:09 -05:00
CHIEFSOFT\ameye 2ea75344d7 lastname 2024-11-17 14:31:34 -05:00
CHIEFSOFT\ameye 1341429715 fix query 2024-11-17 13:42:37 -05:00
CHIEFSOFT\ameye f7ab70b21e admin_uid 2024-11-17 12:53:28 -05:00
CHIEFSOFT\ameye 2814d226eb const WRENCHBOARD_PROMOADMIN_ADDLIST = 220015; 2024-11-17 12:13:19 -05:00
CHIEFSOFT\ameye 5486b31f27 promo add list 2024-11-17 11:51:37 -05:00
CHIEFSOFT\ameye f7515abe5a promoAddRef 2024-11-17 11:17:54 -05:00
CHIEFSOFT\ameye 6c467a7280 PromoAdmin 2024-11-17 07:55:00 -05:00
CHIEFSOFT\ameye dc5ae1c068 fix query 2024-11-17 06:58:15 -05:00
CHIEFSOFT\ameye bbfa9f7d9f fix query 2024-11-16 18:44:56 -05:00
CHIEFSOFT\ameye ef2f59c545 backend calls 2024-11-16 17:44:19 -05:00
CHIEFSOFT\ameye f6f19ca4d9 #define WRENCHBOARD_PROMOADMIN_LOGIN 220010 2024-11-16 17:21:35 -05:00
CHIEFSOFT\ameye 6acdb789e0 promo admin 2024-11-16 13:43:49 -05:00
CHIEFSOFT\ameye fa370bca63 email link 2024-11-16 10:35:30 -05:00
CHIEFSOFT\ameye 735b334371 fix email 2024-11-16 09:10:47 -05:00
CHIEFSOFT\ameye 122106e750 SignUpStats 2024-11-15 17:23:39 -05:00
CHIEFSOFT\ameye 07cbb7e9ca count added 2024-11-09 20:21:41 -05:00
CHIEFSOFT\ameye 3172e1d1eb is array list 2024-11-09 20:13:29 -05:00
CHIEFSOFT\ameye 6f33fd5b05 $this->saveCache($endpoint,$out,1500); 2024-11-09 20:07:54 -05:00
CHIEFSOFT\ameye 1d85dc1912 Is array 2024-11-09 20:01:36 -05:00
CHIEFSOFT\ameye 3affada3fa $this->show_extra_wallet 2024-11-09 06:14:01 -05:00
CHIEFSOFT\ameye 72eb876f26 show_extra_wallet 2024-11-09 06:11:39 -05:00
CHIEFSOFT\ameye 6223e0d22e Increased the cache time 2024-11-09 06:08:10 -05:00
CHIEFSOFT\ameye 51153a06bc $previous_wallet 2024-11-09 05:36:25 -05:00
CHIEFSOFT\ameye b6ab92b91e removed caching 2024-11-09 05:26:40 -05:00
CHIEFSOFT\ameye 166508ca47 ['result_list'] 2024-11-09 05:22:51 -05:00
CHIEFSOFT\ameye cba976b9c9 is_array($out['result_list']) && 2024-11-09 05:16:01 -05:00
CHIEFSOFT\ameye 47f659f822 !is_array($out) 2024-11-09 05:08:29 -05:00
CHIEFSOFT\ameye a839a3af28 is array 2024-11-09 05:03:31 -05:00
CHIEFSOFT\ameye e72d915ea6 $banner_action 2024-11-07 06:54:42 -05:00
CHIEFSOFT\ameye fc9db10e63 removed count 2024-11-07 06:49:52 -05:00
CHIEFSOFT\ameye 2863b75aac Fix query 2024-11-07 06:35:49 -05:00
CHIEFSOFT\ameye 77e7247ee1 return ret; 2024-11-07 06:10:04 -05:00
CHIEFSOFT\ameye f2f9621d68 family bannserrs 2024-11-07 06:06:53 -05:00
CHIEFSOFT\ameye f4979046c5 formated result 2024-11-07 06:05:11 -05:00
CHIEFSOFT\ameye 983973a30d Reco family 2024-11-07 06:00:54 -05:00
CHIEFSOFT\ameye 21db457bbc RecoCheckFamilyOffers 2024-11-07 05:42:00 -05:00
CHIEFSOFT\ameye e947a040cf RecoCheckFamilyActive 2024-11-07 05:20:20 -05:00
CHIEFSOFT\ameye 1d9ebdf94a Added past due task 2024-11-07 05:07:07 -05:00
CHIEFSOFT\ameye 8690674077 RecoFamilyPastDueTask 2024-11-07 04:18:20 -05:00
CHIEFSOFT\ameye 92f1569c1c RecoRecomendToParent 2024-11-07 04:00:56 -05:00
CHIEFSOFT\ameye 153d667326 added family call 2024-11-07 03:51:20 -05:00
CHIEFSOFT\ameye acb395543f uid 2024-11-02 17:15:01 -04:00
CHIEFSOFT\ameye 74cc8d57b8 Family Request 2024-11-02 17:00:33 -04:00
CHIEFSOFT\ameye d406e7cd8f Missed # in define 2024-11-02 03:45:00 -04:00
CHIEFSOFT\ameye 8bf1a6f3f7 WRENCHBOARD_VIRTUAL_FAMILY_CARD 2024-11-02 03:40:26 -04:00
CHIEFSOFT\ameye cbccd8b085 Fix wallet 2024-11-02 02:13:24 -04:00
CHIEFSOFT\ameye 42faa1b655 update wallet 2024-11-01 18:10:35 -04:00
CHIEFSOFT\ameye 7bce678c02 Fix abackend 2024-11-01 16:17:11 -04:00
CHIEFSOFT\ameye d4548b550a Interact with our AI agent 2024-11-01 06:34:00 -04:00
CHIEFSOFT\ameye 10149affc3 card_assigned 2024-10-31 17:10:31 -04:00
CHIEFSOFT\ameye 3305e78fad Next action 2024-10-31 16:30:55 -04:00
CHIEFSOFT\ameye e052375dde added second call 2024-10-31 15:33:51 -04:00
CHIEFSOFT\ameye 8da8f3c8d4 result_list 2024-10-31 10:06:31 -04:00
CHIEFSOFT\ameye 4afb33aa83 process card 2024-10-31 10:03:15 -04:00
CHIEFSOFT\ameye aff0bd9221 starting status changed 2024-10-31 09:25:28 -04:00
CHIEFSOFT\ameye b61c82e2ae cardapplications 2024-10-31 09:19:08 -04:00
CHIEFSOFT\ameye f671e94b4e added log 2024-10-31 09:06:00 -04:00
CHIEFSOFT\ameye 3763b125dc added air call 2024-10-31 09:00:31 -04:00
CHIEFSOFT\ameye 7932d897b8 api call on call 2024-10-31 08:35:18 -04:00
CHIEFSOFT\ameye 76fefedf11 route fix 2024-10-31 08:30:27 -04:00
CHIEFSOFT\ameye d3e9d94778 fix txt 2024-10-31 08:26:45 -04:00
CHIEFSOFT\ameye 00512f6909 ACTION KEY ADDED 2024-10-31 06:59:38 -04:00
CHIEFSOFT\ameye 2a7701c4ff Spend action 2024-10-31 06:49:12 -04:00
CHIEFSOFT\ameye 29ab345a2d addVirtualCardWallet 2024-10-31 06:39:48 -04:00
CHIEFSOFT\ameye 1394c0a712 extra actions 2024-10-31 06:27:31 -04:00
CHIEFSOFT\ameye ad378ddb60 Fix find settings 2024-10-30 17:29:56 -04:00
CHIEFSOFT\ameye 247c6101b9 $auxWallet 2024-10-30 17:17:39 -04:00
CHIEFSOFT\ameye 40fe0cdd75 aux wallet 2024-10-30 17:14:39 -04:00
CHIEFSOFT\ameye b9691f2dea extra wallet 2024-10-30 16:42:07 -04:00
CHIEFSOFT\ameye c637146653 Wallet fix 2024-10-30 16:41:22 -04:00
CHIEFSOFT\ameye 4c46d4232f removed extra b 2024-10-30 10:57:08 -04:00
CHIEFSOFT\ameye 22dc3ec81d new routes 2024-10-30 10:39:27 -04:00
CHIEFSOFT\ameye 7515abfbe0 disable extra wallet for kids 2024-10-30 10:20:31 -04:00
CHIEFSOFT\ameye 2c933cbdbd WrenchUser 2024-10-30 10:05:06 -04:00
CHIEFSOFT\ameye 63e0233ed9 Fix unused data 2024-10-30 09:38:03 -04:00
CHIEFSOFT\ameye b67f9646f0 fix respirces listing 2024-10-30 09:15:02 -04:00
CHIEFSOFT\ameye 0817ba27a6 payload 2024-10-30 09:02:28 -04:00
CHIEFSOFT\ameye 4b303fa9cb blogdata 2024-10-30 08:52:27 -04:00
CHIEFSOFT\ameye d0a3699e37 blog data 2024-10-30 08:49:12 -04:00
CHIEFSOFT\ameye d1e7852158 Playground 2024-10-30 07:09:09 -04:00
CHIEFSOFT\ameye bf7e93fa0f New card 2024-10-30 06:15:35 -04:00
CHIEFSOFT\ameye 4bf2e181c9 all settings use 2024-10-27 18:00:29 -04:00
CHIEFSOFT\ameye 891728e487 passed all settimngs 2024-10-27 17:47:24 -04:00
CHIEFSOFT\ameye 3df121ff25 All status 2024-10-27 17:28:30 -04:00
CHIEFSOFT\ameye e4ea1c8564 Adding wallets models 2024-10-27 16:24:42 -04:00
CHIEFSOFT\ameye 1e7159890f change conditions 2024-10-27 16:07:14 -04:00
CHIEFSOFT\ameye 3286efe650 extra wallet settings 2024-10-27 15:48:41 -04:00
CHIEFSOFT\ameye 1c3fe1b41e fix offer to site email 2024-10-27 14:06:15 -04:00
CHIEFSOFT\ameye 30f424e9b7 Fix routing 2024-10-27 12:47:39 -04:00
CHIEFSOFT\ameye f0c4808bf8 try group routes 2024-10-27 12:34:09 -04:00
CHIEFSOFT\ameye 49b3a19080 Wallet country 2024-10-27 00:01:42 -04:00
CHIEFSOFT\ameye b6ed837ace Fix cache nami ng 2024-10-26 23:53:36 -04:00
CHIEFSOFT\ameye da93e702d5 Wallet 2024-10-26 23:44:34 -04:00
CHIEFSOFT\ameye d487b66de5 controlled aache 2024-10-26 22:07:09 -04:00
CHIEFSOFT\ameye e8b9d49b75 remove one card conditoon for now 2024-10-20 15:19:34 -04:00
CHIEFSOFT\ameye 272e9ffd39 wallet call 2024-10-18 23:17:53 -04:00
CHIEFSOFT\ameye 743e47f182 members_card_request 2024-10-18 23:09:08 -04:00
CHIEFSOFT\ameye 7d307be2b8 $owner_country 2024-10-18 22:13:53 -04:00
CHIEFSOFT\ameye 75dd4bcc01 wallet bug 2024-10-18 22:09:15 -04:00
CHIEFSOFT\ameye cfb3f6c31e extra wallets 2024-10-18 22:07:19 -04:00
CHIEFSOFT\ameye a6da898570 wallet_country 2024-10-18 21:59:29 -04:00
CHIEFSOFT\ameye 617b139559 wallet filter 2024-10-18 21:55:47 -04:00
CHIEFSOFT\ameye d27d37908e wallet filter 2024-10-18 21:38:33 -04:00
CHIEFSOFT\ameye dd01642637 address size 2024-10-18 09:26:36 -04:00
CHIEFSOFT\ameye 531e87d3bb Request card call backend 2024-10-18 09:11:04 -04:00
CHIEFSOFT\ameye 2137b7f4be wallet backend 2024-10-18 09:02:32 -04:00
CHIEFSOFT\ameye dfdd1a63fd WrenchWallet::requestVirtualCard 2024-10-18 06:53:47 -04:00
CHIEFSOFT\ameye b84f9daec3 clean up display 2024-10-18 06:15:22 -04:00
CHIEFSOFT\ameye 4e28e161f7 faq lern more 2024-10-18 06:11:43 -04:00
CHIEFSOFT\ameye 24c48d787b country_state 2024-10-17 14:27:02 -04:00
CHIEFSOFT\ameye 1dc7402c8f Resource function 2024-10-17 14:21:20 -04:00
CHIEFSOFT\ameye 749b4da1b7 fix image 2024-10-17 14:14:00 -04:00
CHIEFSOFT\ameye 0e71a84c89 New Resources 2024-10-17 12:58:35 -04:00
CHIEFSOFT\ameye 5abd8f4037 wallet array 2024-10-16 22:28:30 -04:00
CHIEFSOFT\ameye 9c3f39c228 comment extra wallet 2024-10-16 22:12:09 -04:00
CHIEFSOFT\ameye 99ee13ab80 adjusted images 2024-10-16 14:39:48 -04:00
CHIEFSOFT\ameye 906a3199d3 aded icons 2024-10-16 12:41:46 -04:00
CHIEFSOFT\ameye 99ff27508f get kids wallet 2024-10-16 12:32:38 -04:00
CHIEFSOFT\ameye 7a3e63be7b wallet image 2024-10-15 18:11:33 -04:00
CHIEFSOFT\ameye 21e27c54cc check array 2024-10-15 17:48:46 -04:00
CHIEFSOFT\ameye a992ecdf36 fix data 2024-10-15 12:57:41 -04:00
CHIEFSOFT\ameye 84620bdd67 "action_text" => "XXX-X0XX", 2024-10-15 12:20:13 -04:00
CHIEFSOFT\ameye c943cb98b5 WrenchBoardMainSite 2024-10-15 10:52:12 -04:00
CHIEFSOFT\ameye de35db769a Wrench extra cards 2024-10-15 09:10:36 -04:00
CHIEFSOFT\ameye a06ebfab08 New add virtual card 2024-10-14 19:29:28 -04:00
CHIEFSOFT\ameye 0c7a047d9d more text 2024-10-14 16:28:24 -04:00
CHIEFSOFT\ameye 132c458a35 Go Further and Faster 2024-10-14 16:23:49 -04:00
CHIEFSOFT\ameye 4497a3cc4a Optimize wallet function 2024-10-14 13:32:36 -04:00
CHIEFSOFT\ameye d10f0279fa New wallet call 2024-10-14 13:26:20 -04:00
CHIEFSOFT\ameye 13b3a7461f rec 2024-10-13 15:28:26 -04:00
CHIEFSOFT\ameye cf215dd9b1 res data 2024-10-13 15:24:51 -04:00
CHIEFSOFT\ameye a93de5a2ac limit 5 2024-10-13 15:07:28 -04:00
CHIEFSOFT\ameye 48d311a87c concat string 2024-10-13 15:03:41 -04:00
CHIEFSOFT\ameye 4bff0c43eb added blog filter 2024-10-13 14:53:14 -04:00
CHIEFSOFT\ameye 7798aacb7d Blog random 2024-10-13 07:34:15 -04:00
CHIEFSOFT\ameye 07cc186972 flowRefreshResources 2024-10-13 07:12:49 -04:00
CHIEFSOFT\ameye 0e20fd5f8b market message 2024-10-11 10:51:38 -04:00
CHIEFSOFT\ameye f3a64b5117 Job message 2024-10-10 08:56:47 -04:00
CHIEFSOFT\ameye 14803caaf8 Job message 2024-10-09 10:53:21 -04:00
CHIEFSOFT\ameye 45a132c601 Job message 2024-10-09 10:25:51 -04:00
CHIEFSOFT\ameye 3b12450fd3 currency 2024-10-09 09:25:49 -04:00
CHIEFSOFT\ameye a5c7098760 Added currency codes 2024-10-09 09:20:09 -04:00
CHIEFSOFT\ameye bc1dcb0feb in["strict_timeline"] 2024-10-08 08:11:47 -04:00
CHIEFSOFT\ameye 2c11e96691 $in["strict_timeline"] 2024-10-08 08:08:09 -04:00
CHIEFSOFT\ameye b8af2de471 $in["strict_timeline"] 2024-10-08 08:04:39 -04:00
CHIEFSOFT\ameye 4f0c5b003d reward history 2024-10-08 06:04:20 -04:00
CHIEFSOFT\ameye c156a2cc22 http status error 2024-10-08 05:35:25 -04:00
CHIEFSOFT\ameye 949266da98 cache hx 2024-10-08 05:02:32 -04:00
CHIEFSOFT\ameye 5234e4d34f link part 2024-10-06 14:21:37 -04:00
CHIEFSOFT\ameye 783d7523d3 promo transfer 2024-10-06 11:08:41 -04:00
CHIEFSOFT\ameye cbe3386da6 email fix 2024-10-05 23:40:25 -04:00
CHIEFSOFT\ameye bb34455bd3 inititlialize cache 2024-10-05 05:47:31 -04:00
CHIEFSOFT\ameye 1c00b5608c cchnage redid server 2024-10-05 05:35:36 -04:00
CHIEFSOFT\ameye 992851462d message added emails 2024-10-05 04:48:04 -04:00
CHIEFSOFT\ameye 1a4cab314e deleteCache 2024-10-05 04:13:52 -04:00
CHIEFSOFT\ameye cfbe6e61b4 assign filter 2024-10-05 00:28:44 -04:00
CHIEFSOFT\ameye 188e3ea935 wallet country 2024-10-05 00:25:55 -04:00
CHIEFSOFT\ameye 754f889937 log_message('critical', "***** ***** WrenchJobs::JOB AFTER FILTER Ret ". serialize($filter_job_list)); 2024-10-05 00:10:12 -04:00
CHIEFSOFT\ameye e04efab6ba $filter_job_list 2024-10-05 00:04:26 -04:00
CHIEFSOFT\ameye 4c6b6eef72 reult list 2024-10-04 23:58:05 -04:00
CHIEFSOFT\ameye 3046f45908 http://?:3033/walletcountry 2024-10-04 23:47:45 -04:00
CHIEFSOFT\ameye ed7492909e get jobs 2024-10-04 23:39:52 -04:00
CHIEFSOFT\ameye e044d7bcd6 added wallet find 2024-10-04 23:12:51 -04:00
CHIEFSOFT\ameye c981fc3855 fale in 2024-10-04 21:26:41 -04:00
CHIEFSOFT\ameye 8648ef0b4a job data 2024-10-04 21:23:25 -04:00
CHIEFSOFT\ameye 4fd5bb83aa Interest separare 2024-10-04 21:14:29 -04:00
CHIEFSOFT\ameye 179b7d9fb9 member_id 2024-10-04 06:13:06 -04:00
CHIEFSOFT\ameye ea94fd5df3 mark completed 2024-10-04 06:05:22 -04:00
CHIEFSOFT\ameye 8030ff1daf Start on WrenchBoard Today! 2024-10-03 16:22:03 -04:00
CHIEFSOFT\ameye e1e3f2ebde Pening emsil 2024-10-03 13:18:10 -04:00
CHIEFSOFT\ameye 358622fff2 job offer email 2024-10-03 11:24:29 -04:00
CHIEFSOFT\ameye f1ce1c901b send welcome emaail 2024-10-03 11:02:25 -04:00
CHIEFSOFT\ameye 7f3478fcc1 emsil alerts 2024-10-03 10:34:01 -04:00
CHIEFSOFT\ameye d731c0b0b2 WRENCHBOARD_ACCOUNT_PENDING 2024-10-03 09:58:15 -04:00
CHIEFSOFT\ameye c0ba3f6a83 fix synthas 2024-10-03 09:24:54 -04:00
CHIEFSOFT\ameye 181c9c4084 New cron emsil 2024-10-03 09:15:18 -04:00
CHIEFSOFT\ameye 4efc69f411 minimum_due 2024-10-03 04:35:17 -04:00
CHIEFSOFT\ameye 1ab4a71543 job_description 2024-10-02 18:04:28 -04:00
CHIEFSOFT\ameye 4c817b4b91 strict_timeline 2024-10-02 17:47:42 -04:00
CHIEFSOFT\ameye 84996198e1 strict_timeline 2024-10-02 17:03:15 -04:00
CHIEFSOFT\ameye be14c3ae2b user_server_name 2024-10-02 14:16:31 -04:00
CHIEFSOFT\ameye 5e56b3688b removed server name 2024-10-02 14:13:27 -04:00
CHIEFSOFT\ameye 22ebe7f34d Final Out 2024-10-02 13:46:43 -04:00
CHIEFSOFT\ameye a4011289f8 log_message('critical', "summaryReturnData:: ********* OUT ".serialize($outResult) ); 2024-10-02 13:45:04 -04:00
CHIEFSOFT\ameye f8500dce8c $in['action'] = WRENCHBOARD_MARKET_PLAN01_NEXT1; 2024-10-02 13:40:04 -04:00
CHIEFSOFT\ameye 089dff778a Promo server name log 2024-10-02 13:36:55 -04:00
CHIEFSOFT\ameye 91f75b6739 strict_timeline 2024-10-02 12:58:52 -04:00
CHIEFSOFT\ameye 57686e6f76 user_server_name 2024-10-02 12:38:28 -04:00
CHIEFSOFT\ameye 783dbf36dd fix backend 2024-10-02 12:35:21 -04:00
CHIEFSOFT\ameye 4ee61febbb $out 2024-10-02 12:11:37 -04:00
CHIEFSOFT\ameye 426b78b29f $out['user_server_name'] = $this->getSiteConfigurations("system.server_name"); // 'https://dev-users.wrenchboard.com'; 2024-10-02 12:03:05 -04:00
CHIEFSOFT\ameye d353451c79 clean cachew 2024-10-02 06:55:17 -04:00
CHIEFSOFT\ameye 56f4dc8439 $in["strict_timeline"] 2024-10-02 06:29:47 -04:00
CHIEFSOFT\ameye 3985496e81 Increase bactch to 20 2024-10-01 15:05:53 -04:00
CHIEFSOFT\ameye a14469c7ce href="https://users.wrenchboard.com/" 2024-10-01 11:13:48 -04:00
CHIEFSOFT\ameye 20dd999993 email teamplates 2024-10-01 10:58:32 -04:00
CHIEFSOFT\ameye e3dd3a1f58 email teamplets 2024-10-01 10:34:07 -04:00
CHIEFSOFT\ameye 8080d8da95 fix teamplates 2024-10-01 10:20:30 -04:00
CHIEFSOFT\ameye 4a16034e41 Embrace Independence Achieve More With WrenchBoard 2024-10-01 10:01:52 -04:00
CHIEFSOFT\ameye a639394741 promotion 2024-10-01 09:32:07 -04:00
64 changed files with 5130 additions and 1095 deletions
+4
View File
@@ -25,4 +25,8 @@ services:
- ./wrenchboard/email:/opt/mainsite/wrenchboard/email
#- ./wrenchboard/src:/opt/mainsite/wrenchboard/src
- /opt/wrenchboard:/opt/wrenchboard
extra_hosts:
- blogdata.chiefsoft.net:10.10.33.15
- blog.wrenchboad.com:10.10.33.15
- smtp.gmail.com:10.10.33.15
env_file: .env
+12 -18
View File
@@ -4,7 +4,7 @@ Subject: {{site_name}} - Log in Confirmation
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta 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,7 +16,7 @@ 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;}
.bodycopy {font-size: 14px; line-height: 20px;}
.bodycopy {font-size: 16px; line-height: 25px;}
.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;}
@@ -33,7 +33,7 @@ img {height: auto;}
<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">
@@ -42,7 +42,7 @@ img {height: auto;}
<tr>
<td>
<![endif]-->
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
<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">
@@ -76,15 +76,16 @@ img {height: auto;}
<tr>
<td>
<![endif]-->
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td class="bodycopy">
Hello {{firstname}},
Hello <b>{{firstname}}</b>,
<br />
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<table width="100%" border="0" cellspacing="2" cellpadding="5">
<tr>
<td class="bodycopy">
Please be informed that you logged on to {{site_name}} account at <b>{{last_login2}}</b>.
@@ -105,14 +106,14 @@ 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="{{server_name}}/contact">{{server_name}}/contact</a>
For all support, contact us at <a href="https://www.wrenchboard.com/contact">https://www.wrenchboard.com/contact</a>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy">
{{site_name}} Team
<br>
{{server_name}}
https://www.wrenchboard.com/
</td>
</tr>
<tr><td>
@@ -123,14 +124,7 @@ For all support, contact us at <a href="{{server_name}}/contact">{{server_name}
<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>
@@ -177,4 +171,4 @@ You received this email because you subscribe to {{site_name}}. If you get this
</tr>
</table>
</body>
</html>
</html>
@@ -19,7 +19,7 @@ body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;
.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; padding-bottom:10px;}
.bodycopy {font-size: 16px; line-height: 25px; padding-bottom:10px;}
.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;}
@@ -60,47 +60,59 @@ style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing:
<tr>
<td class="innerpadding borderbottom">
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Hello <b>{{firstname}}</b>,
<br>
<br>
<table class="col380" align="left" border="0" cellpadding="2" cellspacing="2" style="width: 100%;">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Welcome to <b>WrenchBoard!</b> We are excited to have you on board.
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp;Welcome to {{site_name}}!. In order to complete your registration , use the one time verification code below to complete registration.
To complete your registration, please use the one-time verification code below:
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td class="bodycopy" style="padding-bottom:10px; text-align: center;">
<div class="signup_random" style="font-size: 30px; padding:10px; ">{{signup_random}}</div>
</td>
</tr>
<tr>
<td class="cent-ver" style="text-align:center; height:100px;">
Enter the number verification code <br>
<div class="signup_random" style="font-size: 44px; padding:10px; ">{{signup_random}}</div>
in the mobile app to continue.
<div class="line-band"><br></div>
<div class="continue-web" style="background-color:aliceblue; padding:10px;">
If you want to continue on the web, <a href="{{server_name}}/vemail?vlnk={{verify_link}}">click here to verify account</a> to continue your account on the web.
<td class="bodycopy" style="padding-bottom:10px;">
<b>To continue on the mobile app, simply enter this code when prompted.</b>
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Prefer to continue on the web?
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
<a href="{{server_name}}/vemail?vlnk={{verify_link}}">
Click here to verify your account
</a>
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
<div class="warning" style="color:#ff0033;">
Note: This code and link will expire in 24 hours.
</div>
<br>
If you did not initiate this registration, please ignore this message.
</td>
</tr>
<tr>
<td class="bodycopy" style="color:#ff0033; padding-bottom:10px;">
<div class="warning" style="color:#ff0033; font-weight: bolder; padding 10px;">Note : The link will expire by : {{expire}} </div>
<div class="line-band"><br></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
@@ -148,4 +160,4 @@ You received this email because you subscribe to {{site_name}}. If you get this
</table>
</body>
</html>
</html>
@@ -2,21 +2,24 @@ Subject: {{site_name}} - {{send_firstname}} {{send_lastname}} will like to show
<!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>{{site_name}} - {{send_firstname}} {{send_lastname}} will like to show this to you </title>
<meta charset="utf-8">
<title>{{site_name}} - {{send_firstname}} {{send_lastname}} will like to show this to you </title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important;}
img {height: auto;}
body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;}
.content {width: 100%; max-width: 600px;}
.header {padding: 10px 10px 10px 10px;}
.innerpadding {padding: 10px 10px 10px 10px;}
.signup_random{ font-size: 44px; padding:10px; margin:10px;}
.line-band {height 20px;}
.warning{color:lightred; font-weight: bolder; padding 10px;}
.continue-web{background-color:aliceblue; padding:10px;}
.cent-ver{text-align:center; }
.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;}
.bodycopy {font-size: 14px; line-height: 20px; padding-bottom:10px;}
.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;}
@@ -25,21 +28,16 @@ img {height: auto;}
</style>
</head>
<body yahoo bgcolor="#f6f8f1">
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
<body style="margin: 0; padding: 10px; min-width: 100%!important; font-size: 14px; line-height: 20px; font-family: sans-serif; background-color:#f6f8f1;" bgcolor="#f6f8f1; padding: 10px;">
<table style="max-width:640px; margin:0px auto auto auto" 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 align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<td>
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="50">
<td class="header">
<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>
@@ -48,7 +46,8 @@ img {height: auto;}
</td>
</tr>
<tr>
<td class="subhead" style="padding: 0 0 0 3px; text-align:center;">
<td class="subhead"
style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px; color:black; padding: 0 0 0 3px; text-align:center;">
{{site_trade_name}}
</td>
</tr>
@@ -56,106 +55,109 @@ img {height: auto;}
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Dear <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp; <span style="color:darkgreen; font-weight:bolder;">{{send_firstname}} {{send_lastname}} </span> invites you to explore <a href="{{server_name}}/invite?refer_link={{refer_link}}">{{site_name}}!</a>. Unlock the power of your skills and social networks. Start earning today!
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:0px 30px 10px 30px;">
<hr />
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp;<b>Invitation Link :</b><br> {{server_name}}/invite?refer_link={{refer_link}}
<hr size="1">
<div style="background-color:#fce6f2; margin-top: 10px; padding: 5px; border-radius:10px;">
You can also use the button below<br>
<div style="color:darkgreen; text-align:center; width:100%; padding: 10px;">
<a href="{{server_name}}/invite?refer_link={{refer_link}}">Invitation Link</a>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</td>
</tr>
<tr>
<tr class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<td class="innerpadding borderbottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="h2">
Dear {{firstname}},
</td>
</tr>
<tr>
<td class="bodycopy">
{{send_firstname}} {{send_lastname}} will like to share <a href="{{server_name}}/invite?refer_link={{refer_link}}">{{site_name}}!</a>. <a href="{{server_name}}/invite?refer_link={{refer_link}}">{{site_name}}</a> connects you with opportunities or your skills with people who need your abilities.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; ">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy">
<b>Invitation Link :</b><br> {{server_name}}/invite?refer_link={{refer_link}}
</td>
</tr>
<tr>
<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="{{server_name}}/invite?refer_link={{refer_link}}">Invitation Link</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
<hr size="1">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy">
<tr>
<td class="innerpadding bodycopy" style="padding: 10px 10px 10px 10px;">
{{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}} {{yyyy}} <br/>
You received this email because a subscriber, {{send_firstname}} {{send_lastname}}, to {{site_name}} refer you, . 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>
<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="{{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="{{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" style="color:#ffffff; padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because a subscriber, {{send_firstname}} {{send_lastname}}, to {{site_name}} refers you. If you get this email in error, please <a href="{{main_site_url}}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="{{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="{{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>
</td>
</tr>
</table>
</body>
</html>
</html>
@@ -0,0 +1,156 @@
Subject: Your Invitation Link {{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 charset="utf-8">
<title>Welcome to {{site_name}}</title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;}
.content {width: 100%; max-width: 600px;}
.header {padding: 10px 10px 10px 10px;}
.innerpadding {padding: 10px 10px 10px 10px;}
.signup_random{ font-size: 44px; padding:10px; margin:10px;}
.line-band {height 20px;}
.warning{color:lightred; font-weight: bolder; padding 10px;}
.continue-web{background-color:aliceblue; padding:10px;}
.cent-ver{text-align:center; }
.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; padding-bottom:10px;}
.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 style="margin: 0; padding: 10px; min-width: 100%!important; font-size: 14px; line-height: 20px; font-family: sans-serif; background-color:#f6f8f1;" bgcolor="#f6f8f1; padding: 10px;">
<table style="max-width:640px; margin:0px auto auto auto" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="header">
<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://www.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
</td>
</tr>
<tr>
<td class="subhead"
style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px; color:black; padding: 0 0 0 3px; text-align:center;">
{{site_trade_name}}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Dear <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp;&nbsp;The link below is your account invitation link. Share this link with any new users. Once your invitations sign up, the reward is automatically attached to your account.
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:0px 30px 10px 30px;">
<hr />
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:0px 30px 10px 30px;">
<a href="{{refer_link}}">{{refer_link}}</a>
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:0px 30px 10px 30px;">
<hr />
</td>
</tr>
</table>
</td>
</tr>
<tr class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<td class="innerpadding borderbottom">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy" style="padding: 10px 10px 10px 10px;">
{{site_name}} Team
<br>
{{server_name}}
</td>
</tr>
<tr>
<td class="footer" style="color:#ffffff; padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="{{main_site_url}}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="{{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="{{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>
</td>
</tr>
</table>
</body>
</html>
@@ -19,7 +19,7 @@ body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;
.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; padding-bottom:10px;}
.bodycopy {font-size: 16px; line-height: 25px; padding-bottom:10px;}
.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;}
@@ -81,8 +81,8 @@ Dear <b>{{firstname}}</b>,
&nbsp;&nbsp; With <a href="{{server_name}}">{{site_name}}</a>, you can set up a family accounts and reward achievements or set up tasks for others to perform or simply find tasks that rewards you.
<hr size="1">
<div style="background-color:#fce6f2; margin-top: 10px; padding: 5px; border-radius:10px;">
If you did not initiate this account creation or have any further support question, Please contact us at {{server_name}}/contact<br>
<div style="background-color:#fce6f2; margin-top: 10px; padding: 15px; border-radius:10px;">
If you did not initiate this account creation or have any further support question, Please contact us at <a href="https://www.wrenchboard.com/contact"> https://www.wrenchboard.com/contact</a><br>
</div>
</td>
@@ -72,9 +72,26 @@ img {height: auto;}
<td colspan="2"><h2>{{report_date}}</h2></td>
</tr>
<tr class="report_line">
<td class="left" style="width:350px">Today Sign-up - <span>People that completed the sign-up</span></td>
<td class="left" style="width:350px">Today Sign-up - <span>People that completed the sign-up today</span></td>
<td class="bodycopy rr">{{today_signup}}</td>
</tr>
<tr class="report_line">
<td class="left" style="width:350px">Last 3 day(s) Sign-up - <span>People that completed the sign-up in last 3 days</span></td>
<td class="bodycopy rr">{{today_signup_3days}}</td>
</tr>
<tr class="report_line">
<td class="left" style="width:350px">Last 7 day(s) Sign-up - <span>People that completed the sign-up in last 7 days</span></td>
<td class="bodycopy rr">{{today_signup_7days}}</td>
</tr>
<tr class="report_line">
<td class="left" style="width:350px">Total Login in last 24 hrs - <span>People that login in last 24 hours</span></td>
<td class="bodycopy rr">{{today_login_24hrs}}</td>
</tr>
<tr class="trColor">
<td class="left" style="width:350px">Pending Sign-up - <span>People still in the process not completed</span></td>
<td class="bodycopy rr">{{today_pending_signup}}</td>
@@ -84,7 +101,7 @@ img {height: auto;}
<td class="bodycopy rr">{{total_active_public_jobs}}</td>
</tr>
<tr class="trColor">
<td class="left" style="width:350px">Interest Contats - <span>Total Show of interest today</span></td>
<td class="left" style="width:350px">Interest Contacts - <span>Total Show of interest today</span></td>
<td class="bodycopy rr">{{total_task_interest}}</td>
</tr>
<tr>
@@ -100,7 +117,17 @@ img {height: auto;}
<td class="bodycopy rr">{{count_mobile_login}}</td>
</tr>
<tr>
<td colspan="2" class="bodycopy rr">
https://www.wrenchboard.com/
<br>
https://users.wrenchboard.com/
<br>
https://promo.wrenchboard.com/promoadmin
<br>
https://agents.wrenchboard.com/
</td>
</tr>
</table>
</td>
@@ -0,0 +1,171 @@
Subject: Embrace Independence Achieve More With WrenchBoard
<!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>View opportunities at {{site_name}}</title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;}
.content {width: 100%; max-width: 600px;}
.header {padding: 10px 10px 10px 10px;}
.innerpadding {padding: 10px 10px 10px 10px;}
.signup_random{ font-size: 44px; padding:10px; margin:10px;}
.line-band {height 20px;}
.warning{color:lightred; font-weight: bolder; padding 10px;}
.continue-web{background-color:aliceblue; padding:10px;}
.cent-ver{text-align:center; }
.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: 16px; line-height: 20px; padding-bottom:10px;}
.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: 16px;}
.footercopy a { text-decoration: underline;}
.hero-image {
background-image: url("https://www.wrenchboard.com/assets/ext/images/ng-indep.jpg"); /* The image used */
background-color: #cccccc; /* Used if the image is unavailable */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
}
</style>
</head>
<body style="margin: 0; padding: 10px; min-width: 100%!important; font-size: 16px; line-height: 20px; font-family: sans-serif; background-color:#f6f8f1;" bgcolor="#f6f8f1; padding: 10px;">
<table style="max-width:640px; margin:0px auto auto auto" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="header">
<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://users.wrenchboard.com/"><img src="https://www.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
</td>
</tr>
<tr>
<td class="subhead"
style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px; color:black; padding: 0 0 0 3px; text-align:center;">
{{site_trade_name}}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div class="hero-image" style="height:auto; width: 100%;">
<a href="https://www.wrenchboard.com/"><img style="width: 100%; height:auto;" src="https://www.wrenchboard.com/assets/ext/images/ng-indep.jpg" alt="WrenchBoard"></a>
</div>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Dear <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp; Celebrate Independence and Wrench with WrenchBoard. Connect to explore opportunities to earn.
</td>
</tr>
<tr>
<td class="bodycopy" style="padding: 10px 50px 10px 50px;">
<hr size="1" style="color:lightgrey; size=1" />
</td>
</tr>
<tr>
<tr class="innerpadding borderbottom" style="padding: 20px 10px 10px 10px;">
<td class="innerpadding borderbottom">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<td class="bodycopy">
<div style="background-color:#fce6f2; margin-top: 10px; padding: 5px; border-radius: 10px;">
&nbsp;&nbsp;We value your privacy. If you did not initiate this process or have any further support questions, don't hesitate to get in touch with us at {{server_name}}/contact<br>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy" style="padding: 10px 10px 10px 10px;">
{{site_name}} Team
<br>
{{server_name}}
</td>
</tr>
<tr>
<td class="footer" style="color:#000000; padding: 20px 30px 15px 30px; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because you subscribed to the {{site_name}} account. If you get this email in error please <a href="{{main_site_url}}contact" class="unsubscribe"><font color="#000000">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="{{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="{{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>
</td>
</tr>
</table>
</body>
</html>
@@ -74,6 +74,7 @@ img {height: auto;}
<tr>
<td class="bodycopy">
The task at <a href="{{server_name}}/">{{site_name}}</a> shown below is fast approaching deadline.
<br>
<br>
<span class="expire">Due Date : {{due_date}}.</span>
<br>
@@ -141,7 +142,7 @@ img {height: auto;}
<tr>
<td class="innerpadding bodycopy">
This task will be due very soon. After the due date, the task will be past due, and only the owner can extend it is for a short time before the task is closed permanently.
Your task is approaching its deadline. After the due date, it will be marked as pastdue, and only the task owner can extend it for a limited time before it is permanently closed.
</td>
</tr>
<tr>
+34 -28
View File
@@ -1,26 +1,27 @@
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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<title>{{subject}}</title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important;}
img {height: auto;}
body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;}
.content {width: 100%; max-width: 600px;}
.header {padding: 10px 10px 10px 10px;}
.innerpadding {padding: 10px 10px 10px 10px;}
.signup_random{ font-size: 44px; padding:10px; margin:10px;}
.line-band {height 20px;}
.warning{color:lightred; font-weight: bolder; padding 10px;}
.continue-web{background-color:aliceblue; padding:10px;}
.cent-ver{text-align:center; }
.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;}
.bodycopy {font-size: 16px; line-height: 20px; padding-bottom:10px;}
.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 {font-family: sans-serif; font-size: 16px; color: #ffffff;}
.footercopy a {color: #ffffff; text-decoration: underline;}
</style>
</head>
@@ -38,16 +39,16 @@ img {height: auto;}
<tr>
<td bgcolor="#62a5ce" class="header">
<td class="header">
<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://www.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;">
<td class="subhead"
style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px; color:black; padding: 0 0 0 3px; text-align:center;">
{{site_trade_name}}
</td>
</tr>
@@ -67,7 +68,7 @@ img {height: auto;}
</td>
</tr>
<tr>
<td class="bodycopy">
<td class="bodycopy" style="padding: 10px 0 10px 0;">
You have received a job message from <a href="{{server_name}}/eoffer?offerID={{offer_code}}">{{site_name}}</a> details below.
</td>
</tr>
@@ -80,20 +81,8 @@ You have received a job message from <a href="{{server_name}}/eoffer?offerID={{o
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td>
<table width="100%" border="0" >
<tr>
<td>
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img src="https://www.wrenchboard.com/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td>
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img src="https://www.wrenchboard.com/assets/images/download/andriod.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
@@ -161,9 +150,26 @@ Contact us at https://www.wrenchboard.com/contact if you have any question abou
{{server_name}}
</td>
</tr>
<tr class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<td class="innerpadding borderbottom">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="footer">
<td class="footer" style="color:#ffffff; padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
+75 -79
View File
@@ -5,7 +5,7 @@ Subject: {{subject}} - {{title}}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{title}}</title>
<title>{{subject}}</title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important;}
img {height: auto;}
@@ -16,6 +16,7 @@ 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;}
.sect-text {font-weight:bold; text-align: right;}
.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;}
@@ -36,96 +37,76 @@ img {height: auto;}
<![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 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 style="padding: 1px 0 1px 0; text-align:center;">
<a href="https://www.wrenchboard.com/"><img src="https://www.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>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<td bgcolor="#ffffff" class="header">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy">
Dear {{firstname}},
</td>
<td class="h1" style="padding: 0px 0 0 0; text-align:center;">
<a href="https://www.wrenchboard.com/"><img src="https://www.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a>
</td>
</tr>
<tr>
<td class="bodycopy">
You have posted a job offer at <a href="https://{{server_name}}">{{site_name}}</a> to the public domain with details below.
</td>
<td class="subhead" style="padding: 0 0 0 3px; text-align:center; color:black;">
{{site_trade_name}}
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;">
<table width="100%" border="0" cellspacing="0" cellpadding="5px;">
<tr>
<td>
<td class="bodycopy">
<b> Dear {{firstname}},</b>,
</td>
</tr>
<tr>
<td class="bodycopy">
&nbsp;&nbsp; You have posted a job offer at <a href="https://{{server_name}}">{{site_name}}</a> to the public domain with details below.
</td>
</tr>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bodycopy">
<tr>
<td>
Title
<hr size="1">
</td>
</tr>
<tr>
<td>
<div style="background-color:aliceblue; border-radius: 10px; padding: 10px;">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed;">
<tr>
<td width="100px" class="sect-text">
Title :
</td>
<td class="bodycopy">
{{title}}
</td>
</tr>
<tr>
<td>
Offer ID
<td class="sect-text">
Offer ID :
</td>
<td class="bodycopy">
{{offer_code}}
<a href ="{{server_name}}/eoffer?offerID={{offer_code}}">{{offer_code}}</a>
</td>
</tr>
<tr>
<td>
Description
<td class="sect-text">
Description :
</td>
<td class="bodycopy">
{{description}}
</td>
</tr>
<tr>
<td>
Duration
<tr>
<td class="sect-text">
Duration :
</td>
<td class="bodycopy">
{{timeline_days}} day(s)
@@ -133,47 +114,61 @@ Duration
</tr>
<tr>
<td>
Price
<td class="sect-text">
Reward :
</td>
<td class="bodycopy">
{{price}} {{currency}}
</td>
</tr>
<tr>
<td>
Detail
<td class="sect-text">
Detail :
</td>
<td class="bodycopy">
{{job_description}}
</td>
</tr>
<tr>
<td>
Offer Expire
<td class="sect-text">
Offer Expire :
</td>
<td class="bodycopy">
{{expire}}
</td>
</tr>
</table>
</div>
</td>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img src="{{server_name}}/assets/images/download-apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img src="{{server_name}}/assets/images/download-android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<tr>
<td class="innerpadding bodycopy">
Please contact us at https://www.wrenchboard.com/contact if you have any question about this email.
&nbsp;&nbsp; Please contact us at https://www.wrenchboard.com/contact if you have any question about this email.
</td>
</tr>
<tr>
@@ -185,12 +180,13 @@ Please contact us at https://www.wrenchboard.com/contact if you have any questio
</tr>
<tr>
<td class="footer">
<td class="footer" style="color:#ffffff; padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="{{main_site_url}}contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
&nbsp;&nbsp;You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="{{main_site_url}}contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
</td>
</tr>
<tr>
@@ -225,4 +221,4 @@ You received this email because you subscribe to {{site_name}}. If you get this
</table>
</body>
</html>
</html>
@@ -39,7 +39,6 @@ body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;
<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://www.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
@@ -1,4 +1,4 @@
Subject: View opportunities at {{site_name}}
Subject: Start on WrenchBoard Today!
<!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">
@@ -77,8 +77,10 @@ Dear <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:20px auto 40px auto; font-weight:bold; text-align:center; font-size 20px; color:darkgreen; background-color: #e8f6f3; ">
<a style="text-decoration:none;" href="{{promo_server_name}}/{{promo}}/{{promo_uid}}">Click here to view opportunities</a>
<td style="border-radius:10px; min-width:60px; padding:20px auto 40px auto; font-weight:bold; text-align:center; font-size 24px; color:darkgreen; background-color: #e8f6f3; ">
<a style="text-decoration:none;" href="{{promo_server_name}}/{{promo}}/{{promo_uid}}">
<span style="padding:20px;"> Click here to view opportunities</span></a>
</td>
</tr>
<tr>
@@ -89,12 +91,12 @@ Dear <b>{{firstname}}</b>,
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
<img width="180" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
<img width="180" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
@@ -0,0 +1,163 @@
Subject: {{site_name}} - {{send_firstname}} {{send_lastname}} will like to show this to you
<!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}} - {{send_firstname}} {{send_lastname}} will like to show this to you </title>
<style type="text/css">
body {margin: 0; padding: 0; min-width: 100%!important; font-family: sans-serif;}
.content {width: 100%; max-width: 600px;}
.header {padding: 10px 10px 10px 10px;}
.innerpadding {padding: 10px 10px 10px 10px;}
.signup_random{ font-size: 44px; padding:10px; margin:10px;}
.line-band {height 20px;}
.warning{color:lightred; font-weight: bolder; padding 10px;}
.continue-web{background-color:aliceblue; padding:10px;}
.cent-ver{text-align:center; }
.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; padding-bottom:10px;}
.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 style="margin: 0; padding: 10px; min-width: 100%!important; font-size: 14px; line-height: 20px; font-family: sans-serif; background-color:#f6f8f1;" bgcolor="#f6f8f1; padding: 10px;">
<table style="max-width:640px; margin:0px auto auto auto" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="header">
<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://www.wrenchboard.com/assets/ext/images/wrenchboard.png" alt="WrenchBoard"></a> <!-- {{site_name}} -->
</td>
</tr>
<tr>
<td class="subhead"
style="font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px; color:black; padding: 0 0 0 3px; text-align:center;">
{{site_trade_name}}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
Dear <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp; <span style="color:darkgreen; font-weight:bolder;">{{send_firstname}} {{send_lastname}} </span> invites you to explore <a href="{{server_name}}/invite?refer_link={{refer_link}}">{{site_name}}!</a>. Unlock the power of your skills and social networks. Start earning today!
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:0px 30px 10px 30px;">
<hr />
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
&nbsp;&nbsp;<b>Invitation Link :</b><br> {{server_name}}/promoref?refer_link={{refer_link}}
<hr size="1">
<div style="background-color:#fce6f2; margin-top: 10px; padding: 5px; border-radius:10px;">
You can also use the button below<br>
<div style="color:darkgreen; text-align:center; width:100%; padding: 10px;">
<a href="{{server_name}}/invite?refer_link={{refer_link}}">Invitation Link</a>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr class="innerpadding borderbottom" style="padding: 10px 10px 10px 10px;">
<td class="innerpadding borderbottom">
<hr size="1">
<table width="100%" border="0" >
<tr>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/apple.jpg" alt="Apple" border="0" />
</a>
</td>
<td style="text-align:center;">
<a href="https://apps.apple.com/us/app/wrenchboard/id1435718367?ls=1">
<img width="200" height="auto" src="{{server_name}}/assets/images/download/android.jpg" alt="Android" border="0" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy" style="padding: 10px 10px 10px 10px;">
{{site_name}} Team
<br>
{{server_name}}
</td>
</tr>
<tr>
<td class="footer" style="color:#ffffff; padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff; border-radius: 10px 10px 10px 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because a subscriber, {{send_firstname}} {{send_lastname}}, to {{site_name}} refers you. If you get this email in error, please <a href="{{main_site_url}}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="{{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="{{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>
</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,161 @@
Subject: Promo Manager - WrenchBoard Report {{site_name}}
<!DOCTYPE html />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>Promo Manager 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: #000000; font-family: sans-serif; letter-spacing: 3px;}
.h1, .h2, .bodycopy {color: darkgreen; font-family: sans-serif;}
.h1 {font-size: 25px; line-height: 38px; font-weight: bold;}
.bodycopy {font-size: 14px; line-height: 20px; text-align:center; font-weight:bolder;}
.rr{text-align:right;}
.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;}
.trColor{background-color:aliceblue;}
</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 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%;">
<tr>
<td height="50">
<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://www.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>
</td>
</tr>
<tr>
<td class="innerpadding borderbottom">
<table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
<tr>
<td><h4>{{report_date}}</h4></td>
<td style="text-align:right;"><h4>Points : {{points}}</h4></td>
</tr>
<tr class="trColor">
<td class="left" style="width:350px">
<div style="flex-direction: column;">
<div>Today Sign-up </div>
<div style="font-size: 10px; padding-left: 20px;"">People that completed the sign-up today</div>
</div>
</td>
<td class="bodycopy rr">{{today_signup}}</td>
</tr>
<tr class="report_line">
<td class="left" style="width:350px">
<div style="flex-direction: column;">
<div>Today Sign-up 3 days </div>
<div style="font-size: 10px; padding-left: 20px;">People that completed the sign-up in last 3 days</div>
</div>
</td>
<td class="bodycopy rr">{{today_signup_3days}}</td>
</tr>
<tr class="trColor">
<td class="left" style="width:350px">
<div style="flex-direction: column;">
<div>Today Sign-up 7 days </div>
<div style="font-size: 10px; padding-left: 20px;"">People that completed the sign-up in last 7 days</div>
</div>
</td>
<td class="bodycopy rr">{{today_signup_3days}}</td>
</tr>
<tr>
<td colspan="2" class="bodycopy rr">
https://promo.wrenchboard.com/promoadmin
<br>
https://www.wrenchboard.com/
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="innerpadding bodycopy">
{{site_name}} Support Team
<br>
{{server_name}}
</td>
</tr>
<tr><td>
<tr>
<td class="footer">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="footercopy">
&reg; {{site_name}} {{YYYY}}<br/>
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="{{main_site_url}}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="{{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="{{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>
</td>
</tr>
</table>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
#ifndef __mx_cron_email_h__
#define __mx_cron_email_h__
#include "vars.h"
long submit_cron_email(CVars in);
long CronSendMail(CVars in, CVars &out);
#endif
+2
View File
@@ -34,6 +34,7 @@ long account_email(long mailtype, CVars in, CVars &out);
long job_email(long mailtype, CVars in, CVars &out);
long project_email(long mailtype, CVars in, CVars &out);
long test_email(CVars in, CVars &out);
long test_just_email(CVars in, CVars &out);
long sendmoney_email(long mailtype, CVars in, CVars &out);
long alert_email(long mailtype, CVars in, CVars &out) ;
long SendmarketMessage(CVars in, CVars &out);
@@ -44,6 +45,7 @@ long market_email(long mailtype, CVars in, CVars &out);
long plan_notification(CVars in, CVars &out);
long SignupPendingAlertMailfile(CVars in);
long SignupCompletedAlertMailfile(CVars in);
long promo_email(long mailtype, CVars in, CVars &out);
#endif
+1
View File
@@ -18,6 +18,7 @@ long DeductMemberWallet(long member_id,long wallet_id,long amount, long payment
long WrenchMemberCouponPayment( CVars in, CVars &out );
long WrenchMemberTopupPayment( CVars in, CVars &out );
long WrenchFamilyPayment( CVars in, CVars &out );
long AssignVirtualCardWallet( CVars in,CVars out);
#endif
+25 -1
View File
@@ -14,6 +14,12 @@ enum { PARTNER_STRIPE };
#define WRENCH_FILE_JOB 500
#define WRENCH_FILE_JOBFILE 600
#define CARD_REQUESTED 1
#define CARD_HOLDER_CREATED 10
#define CARD_OWNER_ACTIVE 30
#define CARD_ASSIGNED 40
#define CARD_ACTIVATE_CARD 50
#define CARD_WALLET_ADD 60
#define PHP_API_OK 0
#define PHP_CREATED_OK 10
@@ -167,8 +173,13 @@ enum { PARTNER_STRIPE };
#define WRB_CRONJOB_TESTNOTIFICATIONS 779
#define WRB_CRONJOB_SCHEULETRANSFER 780
#define WRB_CRONJOB_PROCESSTRANSFER 781
#define WRB_CRONJOB_APPEMAILS 782
#define WRB_CRONJOB_REFRESHBLOG 783
#define WRB_CRONJOB_PROCESS_VUSA 784
#define WRB_CRONJOB_AUTO_OFFEREXPIRE 785
#define WRB_CRONJOB_HOLIDAY_BROADCAST 786
#define WRB_CRONJOB_PROCESS_PROMO 788
#define WRB_CRONJOB_PENDINGSM 790
@@ -194,7 +205,7 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_CREATE_MOBILEUSER 11011
#define WRENCHBOARD_COMPLETE_MOBILEUSER 11012
#define WRENCHBOARD_RESET_PASSWORD 11013
#define WRENCHBOARD_RESET_PASSWORD 11013
#define WRENCHBOARD_ACCOUNT_JOBLIST 11014
#define WRENCHBOARD_VERIFY_PENDING_LINK 11015
@@ -266,6 +277,10 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_ACCOUNT_MYPAGE 11070
#define WRENCHBOARD_ACCOUNT_PAGEINTRO 11071
#define WRENCHBOARD_LOAD_REFERLINK 11072
#define WRENCHBOARD_VIRTUAL_CARDADD 11080
#define WRENCHBOARD_VIRTUAL_FAMILY_CARD 11082
#define WRENCHBOARD_ACCOUNT_PRICE_COMBO 11171
#define WRENCHBOARD_ACCOUNT_JOBPOST_DURATION 11173
@@ -291,6 +306,7 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_RESOURCE_MYFILES 11307
#define WRENCHBOARD_MYFILES_LIST 11309
#define WRENCHBOARD_MYREFLINK 11310
#define WRENCHBOARD_USER_DELETEACC 11990
#define WRENCHBOARD_ACCOUNT_END 11999
@@ -448,6 +464,13 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_MARKET_PLAN01_START 220001
#define WRENCHBOARD_MARKET_PLAN01_NEXT1 220003
#define WRENCHBOARD_PROMOADMIN_LOGIN 220010
#define WRENCHBOARD_PROMOADMIN_ASSIGNTASK 220012
#define WRENCHBOARD_PROMOADMIN_GETMEMBER 220013
#define WRENCHBOARD_PROMOADMIN_GETLIST 220014
#define WRENCHBOARD_PROMOADMIN_ADDLIST 220015
#define WRENCHBOARD_PROMOADMIN_ACTIONLIST 220016
#define WRENCHBOARD_MARKET_END 229999
@@ -503,6 +526,7 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_BALANCE_TOPUP_PURCHASE 800030
#define WRENCHBOARD_BALANCE_TOPUP_PAYMENT 800040
#define WRENCHBOARD_TEST_PATH 9999099
#define VIRTUAL_AIRTOPUP 70011
+185 -20
View File
@@ -129,6 +129,10 @@ long test() {
}
long WrenchTestWalletCapability(CVars in, CVars &out);
long WrenchImportContacts(CVars in, CVars &out);
long WrenchRequestVirtualCard(CVars in, CVars &out);
long WrenchRequestFamilyVirtualCard(CVars in, CVars &out);
long WrenchLoadReferLink(CVars in, CVars &out);
long WrenchResendMyReferLink(CVars in, CVars &out);
long account_calls(CVars in, CVars &out) {
logfmt(logINFO, "account_calls()");
@@ -244,27 +248,10 @@ long account_calls(CVars in, CVars &out) {
break;
case WRENCHBOARD_ACCOUNT_PENDING:
/*
if ( load_db_record(out, "SELECT uid FROM members_pending WHERE LOWER(username)=LOWER('%s')",in["username"].c_str()) ){
out["acc"]="DULPICATE";
return -1;
}
if ( load_db_record(out, "SELECT uid FROM members WHERE LOWER(username)=LOWER('%s')",in["username"].c_str()) ){
out["acc"]="DULPICATE";
return -1;
}*/
return CreateWrenchBoardAccountPending(in, out);
break;
case WRENCHBOARD_ACCOUNT_CREATEACC:
/*if ( load_db_record(out, "SELECT uid FROM members_pending WHERE LOWER(username)=LOWER('%s')",in["username"].c_str()) ){
out["acc"]="DULPICATE";
return -1;
}
if ( load_db_record(out, "SELECT uid FROM members WHERE LOWER(username)=LOWER('%s')",in["username"].c_str()) ){
out["acc"]="DULPICATE";
return -1;
}*/
return CreateWrenchBoardAccount(in, out);
break;
@@ -507,6 +494,10 @@ long account_calls(CVars in, CVars &out) {
return WrenchMyFilesList(in, out);
break;
case WRENCHBOARD_MYREFLINK:
return WrenchResendMyReferLink(in, out);
break;
case WRENCHBOARD_ACCOUNT_PREFERENCES:
return WrenchAccountUsePrefrence(in, out);
break;
@@ -524,13 +515,186 @@ long account_calls(CVars in, CVars &out) {
return WrenchMyPageIntro(in, out);
break;
case WRENCHBOARD_LOAD_REFERLINK:
return WrenchLoadReferLink(in, out);
break;
case WRENCHBOARD_VIRTUAL_CARDADD:
return WrenchRequestVirtualCard(in, out);
break;
case WRENCHBOARD_VIRTUAL_FAMILY_CARD:
return WrenchRequestFamilyVirtualCard(in, out);
break;
}
logfmt(logINFO, "/account_calls()");
return ret;
}
#define PHP_API_TRANSFER_COMPLETE 200
#define PHP_API_TRANSFER_COMPLETE 200
long WrenchResendMyReferLink(CVars in, CVars &out) {
logfmt(logINFO, "WrenchResendMyReferLink()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char buf[1500];
CVars x;
try {
REQ_STRING(in, "uid_part", 5, 15, "(.*)");
REQ_STRING(in, "refer_link", 5, 150, "(.*)");
long member_id = REQ_LONG(in, "member_id", 1, -1);
if ( load_db_record(x, " SELECT id, uid,email,firstname,lastname FROM members "
" WHERE LOWER(SUBSTRING(uid::text, 0,9)) = LOWER('%s') "
" AND id = %lu", in["uid_part"].c_str(), in["member_id"].Long()) > 0){
x["refer_link"] = in["refer_link"]; x["refer_link"].set_valid( true );
account_email(WRENCHBOARD_MYREFLINK, x, x);
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return ret;
}
long WrenchLoadReferLink(CVars in, CVars &out) {
logfmt(logINFO, "WrenchMyPageIntro()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char buf[1500];
CVars x;
try {
REQ_STRING(in, "refer_link", 20, 100, "(.*)");
long action_path = REQ_LONG(in, "action_path", 1, -1);
if (action_path == 200){
sprintf(buf, "SELECT firstname, lastname, email FROM promo_member WHERE LOWER(uid::text)=LOWER('%s') AND status = 1", in["refer_link"].c_str());
}
else{
sprintf(buf, "SELECT firstname, lastname, email FROM members_refer_friend WHERE LOWER(refer_link)=LOWER('%s') AND status = 1", in["refer_link"].c_str());
}
if ( load_db_record(out, "%s ", buf) > 0){
ret = PHP_API_OK;
}
else{
out["status"] = "Invalid link";
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return ret;
}
long WrenchRequestFamilyVirtualCard(CVars in, CVars &out) {
CVars x;
long ret = PHP_API_BAD_PARAM;
logfmt(logINFO, "long WrenchRequestFamilyVirtualCard(CVars in, CVars out)");
try{
long member_id = REQ_LONG(in, "member_id", 1, -1);
long request_type = REQ_LONG(in, "request_type", 1, -1);
REQ_STRING(in, "uid", 20, 100, "(.*)");
REQ_STRING(in, "family_uid", 20, 100, "(.*)");
REQ_STRING(in, "address", 5, 150, "(.*)");
REQ_STRING(in, "city", 2, 50, "(.*)");
REQ_STRING(in, "state", 1, 15, "(.*)");
REQ_STRING(in, "country", 1, 3, "(.*)");
REQ_STRING(in, "postal_code", 1, 10, "(.*)");
REQ_STRING(in, "phone_number", 5, 15, "(.*)");
long dob_day = REQ_LONG(in, "dob_day", 1, -1);
long dob_month = REQ_LONG(in, "dob_month", 1, -1);
long dob_year = REQ_LONG(in, "dob_year", 1, -1);
const PGresult *res = pgsql_query("SELECT m.uid::text AS target_uid FROM members_family f LEFT JOIN members m ON m.id = f.family_member_id WHERE f.uid::text='%s'", in["family_uid"].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);
x["uid"] = in["uid"]; x["uid"].set_valid(true);
x["member_id"] = member_id; x["member_id"].set_valid(true);
x["member_uid"] = in["uid"]; x["member_uid"].set_valid(true);
x["target_uid"] = rec["target_uid"]; x["target_uid"].set_valid(true); //
x["address"] = in["address"]; x["address"].set_valid(true);
x["request_type"] = in["request_type"]; x["request_type"].set_valid(true);
x["city"] = in["city"]; x["city"].set_valid(true);
x["state"] = in["state"]; x["state"].set_valid(true);
x["country"] = in["country"]; x["country"].set_valid(true);
x["postal_code"] = in["postal_code"]; x["postal_code"].set_valid(true);
x["phone_number"] = in["phone_number"]; x["phone_number"].set_valid(true);
x["dob_day"] = in["dob_day"]; x["dob_day"].set_valid(true);
x["dob_month"] = in["dob_month"]; x["dob_month"].set_valid(true);
x["dob_year"] = in["dob_year"]; x["dob_year"].set_valid(true);
return WrenchRequestVirtualCard( x, out );
} else {
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return ret;
}
long WrenchRequestVirtualCard(CVars in, CVars &out) {
CVars x;
long ret = PHP_API_BAD_PARAM;
logfmt(logINFO, "long WrenchRequestVirtualCard(CVars in, CVars out)");
try{
long member_id = REQ_LONG(in, "member_id", 1, -1);
long request_type = REQ_LONG(in, "request_type", 1, -1);
REQ_STRING(in, "uid", 20, 100, "(.*)");
REQ_STRING(in, "target_uid", 20, 100, "(.*)");
REQ_STRING(in, "address", 5, 150, "(.*)");
REQ_STRING(in, "city", 2, 50, "(.*)");
REQ_STRING(in, "state", 1, 15, "(.*)");
REQ_STRING(in, "country", 1, 3, "(.*)");
REQ_STRING(in, "postal_code", 1, 10, "(.*)");
REQ_STRING(in, "phone_number", 5, 15, "(.*)");
long dob_day = REQ_LONG(in, "dob_day", 1, -1);
long dob_month = REQ_LONG(in, "dob_month", 1, -1);
long dob_year = REQ_LONG(in, "dob_year", 1, -1);
const PGresult *res = pgsql_query("SELECT id AS request_id FROM members_card_request WHERE member_id=%lu AND status=1000", member_id);
if (res != NULL && pgsql_num_rows(res) > 0) {
} else {
x["member_id"] = member_id; x["member_id"].set_valid(true);
x["member_uid"] = in["uid"]; x["member_uid"].set_valid(true);
x["target_uid"] = in["target_uid"]; x["target_uid"].set_valid(true);
x["address"] = in["address"]; x["address"].set_valid(true);
x["request_type"] = in["request_type"]; x["request_type"].set_valid(true);
x["city"] = in["city"]; x["city"].set_valid(true);
x["state"] = in["state"]; x["state"].set_valid(true);
x["country"] = in["country"]; x["country"].set_valid(true);
x["postal_code"] = in["postal_code"]; x["postal_code"].set_valid(true);
x["phone_number"] = in["phone_number"]; x["phone_number"].set_valid(true);
x["dob_day"] = in["dob_day"]; x["dob_day"].set_valid(true);
x["dob_month"] = in["dob_month"]; x["dob_month"].set_valid(true);
x["dob_year"] = in["dob_year"]; x["dob_year"].set_valid(true);
long sid = insert_db_record(DBS_VALID, "members_card_request", "members_card_request_id_seq", x);
if ( sid > 0 ){
load_db_record(out, "SELECT id AS request_id, uid AS request_uid FROM members_card_request WHERE id = %lu ", sid);
account_email(WRENCHBOARD_VIRTUAL_CARDADD, out, out);
ret = PHP_API_OK;
}
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return ret;
}
long WrenchImportContacts(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
@@ -2013,6 +2177,7 @@ long WrenchSendReferLoadLink(CVars in, CVars &out) {
long WrenchSendRefer(CVars in, CVars &out) {
logfmt(logINFO, "long WrenchSendRefer(CVars in, CVars out)");
long ret = PHP_API_BAD_PARAM;
try {
//out = in;
out["status"] = "";
@@ -2473,7 +2638,7 @@ long WrenchTestWalletCapability(CVars in, CVars &out){
out["wallet_country_status"] = "USER_NEED_UPDATE_PROFILE_COUNTRY";
}
else{
ret = load_db_record(out, "SELECT id AS wallet_id, action_type FROM currency WHERE country ='%s'", in["country"].c_str());
ret = load_db_record(out, "SELECT id AS wallet_id, action_type FROM currency WHERE country ='%s' LIMIT 1", in["country"].c_str());
if ( ret >= 0 && out["wallet_id"].Long() > 0 ){
out["wallet_available_status"] = "WALLET_AVAILABLE";
out["wallet_country_status"] = "USER_COUNTRY_WALLET_ENABLED";
@@ -2565,7 +2730,7 @@ long LoginWrenchPromoAccount( CVars in, CVars &out ){
// inj["uid"] = "0"; inj["uid"].set_valid( true );
// inj["job_id"] = "0"; inj["member_id"].set_valid( true );
//inj["job_uid"] = "0"; inj["member_id"].set_valid( true );
inj["promo"] = in["promo"]; inj["promo"].set_valid( true );
inj["strict_timeline"] = "10"; inj["strict_timeline"].set_valid( true );
inj["email"] = inx["username"] ; inj["email"].set_valid( true ); // email
inj["job_description"] = inj["job_detail"]; inj["job_description"].set_valid( true );
+21 -4
View File
@@ -295,12 +295,13 @@ long WrenchReturnMemberPaymentHx(CVars in, CVars &out) {
const PGresult *res;
res = pgsql_query("SELECT m.added::date AS trx_date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, m.id AS trx_id,"
" r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS recipient,mp.confirmation,"
" r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS recipient,mp.confirmation, c.code, c.description AS currency, c.symbol,"
" 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 "
" LEFT JOIN currency c ON c.country=m.terminatingcountrycode "
" WHERE m.member_id =%lu AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT %lu", in["member_id"].Long(),limit);
if (res != NULL && pgsql_num_rows(res) > 0) {
@@ -312,6 +313,16 @@ long WrenchReturnMemberPaymentHx(CVars in, CVars &out) {
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "code_%05d", i);
out[vname] = rec["code"];
snprintf(vname, sizeof (vname), "currency_%05d", i);
out[vname] = rec["currency"];
snprintf(vname, sizeof (vname), "symbol_%05d", i);
out[vname] = rec["symbol"];
snprintf(vname, sizeof (vname), "trx_date_%05d", i);
out[vname] = rec["trx_date"];
@@ -1147,6 +1158,7 @@ long CreateWrenchBoardAccount(CVars in, CVars &out) {
long CreateWrenchBoardAccountPending(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
out = in;
CVars y;
try {
@@ -1223,8 +1235,8 @@ long CreateWrenchBoardAccountPending(CVars in, CVars &out) {
x["email"].set_valid(true);
x["phone"] = in["phone"];
x["phone"].set_valid(true);
x["country"] = in["country"];
x["country"].set_valid(true);
x["country"] = in["country"]; x["country"].set_valid(true);
x["refer_link"] = in["refer_link"]; x["refer_link"].set_valid(true);
if (in["loc"].length() > 0) x["loc"] = in["loc"];
x["loc"].set_valid(true);
@@ -1241,8 +1253,13 @@ long CreateWrenchBoardAccountPending(CVars in, CVars &out) {
if (ret > 0) {
pgsql_query("UPDATE members_pending SET password = md5('%s'),signup_random=%lu WHERE id = %lu", in["password"].c_str(),signup_random/1000, ret);
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE id=%lu LIMIT 1", ret);
load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE id=%lu LIMIT 1", ret);
if ( in["refer_link"] !=""){
y["email"] = in["email"]; y["email"].set_valid(true);
y["refer_link"] = in["refer_link"]; y["refer_link"].set_valid(true);
insert_db_record(DBS_VALID, "referlink_signup", "referlink_signup_id_seq", y);
}
}
if (ret > 0) {
+1 -1
View File
@@ -348,7 +348,7 @@ long WrenchContractMessage( CVars in, CVars &out )
if (message_id) {
ret = PHP_CREATED_OK;
x["message_id"] = message_id; x["message_id"].set_valid( true );
x["message_id"] = message_id; x["message_id"].set_valid( true );
job_email(JOBS_MESSAGE_ADDED,x,out);
load_db_record( out, "SELECT *,id AS message_id FROM jobs_contract_message WHERE id = %lu ", message_id );
out["status"] = "Message Sent";
+583
View File
@@ -0,0 +1,583 @@
#include "email.h"
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "safestring.h"
#include "cfg.h"
#include <string>
#include "pgsql_wrapper.h"
#include "pgsql.h"
void vars2form(CVars &v, C_CGI_Form &form);
extern int mailsend(CVars in, CVars &out);
long CronWelcomeAccountMail(CVars in);
long CronAccountPendingMail(CVars in) ;
long CronJobEmail(long mailtype, CVars in, CVars &out);
long CronAccountMail(long mailtype, CVars in);
/*
CREATE TABLE email_message(
id SERIAL,
uid uuid DEFAULT uuid_generate_v4(),
topic VARCHAR(150) NOT NULL,
action INT DEFAULT 0,
member_id INT DEFAULT 0,
job_id INT DEFAULT 0,
offer_id INT DEFAULT 0,
contract_id INT DEFAULT 0,
status INT DEFAULT 1,
added timestamp without time zone DEFAULT now(),
completed timestamp
);
ALTER TABLE ONLY email_message
ADD CONSTRAINT email_message_id_key UNIQUE (id);
*/
long submit_cron_email(CVars in){
return insert_db_record( DBS_VALID, "email_message", "email_message_id_seq", in );
}
long CronSendMail(CVars in, CVars &out){
logfmt(logINFO, " ***** CALL long CronSendMail(CVars in, CVars &out)");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT *, member_id AS pending_id FROM email_message WHERE topic ='WRENCHBOARD_ACCOUNT_PENDING' AND status = 1 ORDER BY id ASC LIMIT 20");
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);
pgsql_query("UPDATE email_message SET status = 2 WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
CronAccountPendingMail(rec); // send the cron email
pgsql_query("UPDATE email_message SET status = 5, completed = now() WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WRENCHBOARD_ACCOUNT_LOGIN(CVars in, CVars &out)");
}
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM email_message WHERE topic ='WRENCHBOARD_ACCOUNT_LOGIN' AND status = 1 ORDER BY id ASC LIMIT 20");
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);
pgsql_query("UPDATE email_message SET status = 2 WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
CronWelcomeAccountMail(rec); // send the cron email
pgsql_query("UPDATE email_message SET status = 5, completed = now() WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WRENCHBOARD_ACCOUNT_LOGIN(CVars in, CVars &out)");
}
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM email_message "
" WHERE topic IN ('JOBS_INDIVIDUAL_OFFER_MAIL', 'JOBS_OFFER_INTEREST_MAIL', 'JOBS_GROUP_OFFER_PUBLIC', 'JOBS_MESSAGE_ADDED') "
" AND status = 1 ORDER BY id ASC LIMIT 20");
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);
pgsql_query("UPDATE email_message SET status = 2 WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
CronJobEmail(rec["action"].Long(), rec, out); // send the cron email
pgsql_query("UPDATE email_message SET status = 5, completed = now() WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WRENCHBOARD_ACCOUNT_LOGIN(CVars in, CVars &out)");
}
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM email_message WHERE topic IN ('ACCOUNT_SEND_REFEREMAIL' ) AND status = 1 ORDER BY id ASC LIMIT 20");
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);
pgsql_query("UPDATE email_message SET status = 2 WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
CronAccountMail(rec["action"].Long(), rec); // send the cron email
pgsql_query("UPDATE email_message SET status = 5, completed = now() WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long CronAccountMail(CVars in,)");
}
return 0;
}
long CronAccountPendingMail(CVars in) //TESTED
{
REQ_LONG(in, "pending_id", 1, -1);
CVars x;
CVars out;
C_CGI_Form form("", "");
try{
form.LetStr("main_site_url", "https://www.wrenchboard.com/");
out["server_name"] = CfgReadChar("system.server_name");
form.LetStr("server_name", out["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
if (load_db_record(x, "SELECT *,to_char(expire, 'Day Mon dd, yyyy HH:MI AM') AS expire,to_char(now(), 'yyyy') AS YYYY 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_mobile.mailfile");
}
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return 0;
}
long CronWelcomeAccountMail(CVars in) // TESTED
{
REQ_LONG(in, "member_id", 1, -1);
CVars x;
CVars out;
CVars ml;
C_CGI_Form form("", "");
form.LetStr("main_site_url", "https://www.wrenchboard.com/");
out["server_name"] = CfgReadChar("system.server_name");
form.LetStr("server_name", out["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
if (load_db_record(x, "SELECT *,to_char(now(), 'yyyy') AS YYYY FROM members WHERE id = %lu ", in["member_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_welcome.mailfile");
}
return 0;
}
long CronJobEmail(long mailtype, CVars in, CVars &out) {
logfmt(logINFO, "job_email()");
CVars x, y, z, ml;
C_CGI_Form form("", "");
int c=0;
CGIList * inv_list = new CGIList(&form, "inv_items");
char listing_items[1024];
const PGresult *res;
// char * server_name; // = getenv("SERVER_NAME");
out["server_name"] = CfgReadChar("system.server_name");
//sprintf(server_name, "%s", out["server_name"].c_str());
form.LetStr("server_name", out["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
CVars yr;
load_db_record(yr, "SELECT to_char(now(), 'yyyy') AS YYYY");
vars2form(yr, form);
switch (mailtype) {
case JOBS_INDIVIDUAL_OFFER_MAIL:
logfmt(logINFO, "JOBS_INDIVIDUAL_OFFER_MAIL");
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description, "
" j.description AS job_description, j.timeline_days,j.price,cc.description AS currency "
" FROM members_jobs_offer o "
" LEFT JOIN members_jobs j ON j.id =o.job_id "
" LEFT JOIN currency cc ON cc.country = j.country "
" WHERE o.id = %lu", in["offer_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "New Job Offer Received");
form.LetStr("email", x["email"].c_str());
form.Email("JOB/job_offer_invidual.mailfile");
}
break;
case WRENCHBOARD_JOB_REPLY_QUESTION:
if (load_db_record(y, "SELECT ms.*,m.email,m.firstname FROM members_messages ms LEFT JOIN members m ON m.id=ms.member_id WHERE ms.id=%lu", in["reply_id"].Long())) {
vars2form(y, form);
vars2form(yr, form);
form.LetStr("email", y["email"].c_str());
//we need previous message
load_db_record(x, "SELECT msg AS prev_message FROM members_messages ms LEFT JOIN members m ON m.id=ms.member_id WHERE ms.memo = '%s' AND ms.id<>%lu ORDER BY ms.id DESC LIMIT 1", in["memo"].c_str(), in["reply_id"].Long());
vars2form(x, form);
form.LetStr("subject", "Reply Message");
form.Email("JOB/job_reply_message.mailfile");
}
break;
case WRENCHBOARD_JOB_MRKTINT_QUEST:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title AS job_title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu", in["offer_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("job_title", x["job_title"].c_str());
//form.LetStr( "job_title", "Job title" );
form.LetStr("subject", "Job Interest Message");
if (load_db_record(y, "SELECT ms.*,m.email,m.firstname FROM members_messages ms LEFT JOIN members m ON m.id=ms.member_id WHERE ms.id=%lu", in["msg_id"].Long())) {
vars2form(y, form);
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_interest_message.mailfile");
}
}
break;
case JOBS_PAYMENT_DUE_MAIL:
if (load_db_record(y, "SELECT email,firstname FROM members WHERE id = %lu", in["member_id"].Long())) {
vars2form(y, form);
vars2form(yr, form);
// FOR CRON JOBS SET SERVER NAME
form.LetStr("preview_count", in["preview_count"].c_str());
form.LetStr("server_name", out["server_name"].c_str());
vars2form(x, form);
form.LetStr("subject", "Completed Task Processing Past Due");
form.LetStr("email", y["email"].c_str());
//form.LetStr( "email", "ameye@chiefsoft.com" );
form.Email("JOB/job_due_reviewreminder.mailfile");
}
break;
case JOBS_DUE_APPROACH_MAIL:
if (load_db_record(x, " SELECT m.firstname,m.email,mj.title,c.* ,cc.description AS currency ,mj.description AS job_description , "
" to_char(c.delivery_date, 'Day Mon dd, yyyy HH:MI AM') AS due_date"
" 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 "
" LEFT JOIN currency cc ON cc.country = mj.country "
" WHERE c.id=%lu AND c.due_remind IS NULL", in["contract_id"].Long())) {
// FOR CRON JOBS SET SERVER NAME
form.LetStr("server_name", out["server_name"].c_str());
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "Due Date Approaching");
form.LetStr("email", x["email"].c_str());
//form.LetStr( "email", "ameye@chiefsoft.com" );
form.Email("JOB/job_duereminder.mailfile");
}
break;
case JOBS_OFFER_ACCEPT_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.delivery_date, 'Day Mon dd, yyyy HH:MI AM') AS delivery_date2 ,cc.description AS currency ,j.description AS job_description"
" FROM members_jobs_contract o "
" LEFT JOIN members_jobs j ON j.id =o.job_id "
" LEFT JOIN currency cc ON cc.country = j.country "
" WHERE o.id = %lu", in["contract_id"].Long())) {
if (load_db_record(y, "SELECT email FROM members WHERE id = %lu", x["client_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "You have started working on the task - ");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_offer_accepted_client.mailfile");
}
if (load_db_record(z, "SELECT email FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "Your task was accepted");
form.LetStr("email", z["email"].c_str()); //job_offer_accepted_owner.mailfile
form.Email("JOB/job_offer_accepted_owner.mailfile");
}
}
break;
case JOBS_OFFER_REJECT_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2, "
" j.title,j.description,j.timeline_days,j.price, m.email AS owner_email,m.firstname AS owner_name "
" FROM members_jobs_offer o "
" LEFT JOIN members_jobs j ON j.id =o.job_id "
" LEFT JOIN members m ON m.id = o.member_id "
" WHERE o.id = %lu AND o.status = 3", in["offer_id"].Long())>0) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "Job Offer Rejected");
// load_db_record(y, "SELECT email FROM members WHERE id = %lu",x["member_id"].Long());
form.LetStr("email", x["email"].c_str());
form.Email("JOB/job_offer_rejected.mailfile");
form.LetStr("subject", "Offer Rejected");
form.LetStr("cleint_email", x["email"].c_str());
form.LetStr("email", x["owner_email"].c_str());
form.Email("JOB/job_offer_rejected_owner.mailfile");
}
// form.LetStr( "email", "ses66181+rej@gmail.com" );
// form.Email( "JOB/job_offer_rejected.mailfile" );
break;
case JOBS_OFFER_SENDTOME_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,"
" j.description,j.timeline_days,j.price,o.member_id,j.title, "
" (CASE WHEN o.email IS NULL THEN 'Public View' ELSE o.email END) AS job_email, "
" o.offer_code,to_char(now(), 'yyyy') AS YYYY "
" FROM members_jobs_offer o "
" LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.offer_code = '%s'", in["offer_code"].c_str())) {
vars2form(x, form);
load_db_record(y, "SELECT email,'Job by '||firstname||' @ WrenchBoard' AS ltitle,firstname,lastname FROM members WHERE id = %lu",x["member_id"].Long());
vars2form(y, form);
vars2form(yr, form);
form.LetStr("subject", y["ltitle"].c_str());
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_offer_sendtome.mailfile");
}
break;
case JOBS_OFFER_INTEREST_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu AND o.status = 1", in["offer_id"].Long())) {
vars2form(x, form);
if (load_db_record(y, "SELECT email,balance,firstname FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(y, form);
vars2form(yr, form);
form.LetStr("subject", "Job Interest Recieved");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_interest_member.mailfile");
}
if (load_db_record(z, "SELECT mi.*,m.firstname,m.lastname,m.email from members_offer_interest mi LEFT JOIN members m ON m.id = mi.member_id WHERE mi.id = %lu", in["interest_id"].Long())) {
vars2form(z, form);
vars2form(yr, form);
form.LetStr("subject", "Job Interest Sent");
form.LetStr("email", z["email"].c_str());
form.Email("JOB/job_interest_client.mailfile");
}
}
break;
case JOBS_OFFER_CANCEL_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,"
" j.description AS job_description,j.timeline_days,j.price "
" FROM members_jobs_offer o "
" LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu ", in["offer_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "Job Offer Canceled");
form.LetStr("email", x["email"].c_str());
form.Email("JOB/job_offer_cancel.mailfile");
}
break;
case JOBS_GROUP_OFFER_MAIL:
logfmt(logINFO, "JOBS_GROUP_OFFER_MAIL");
if (load_db_record(x, "SELECT o.*,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu", in["offer_id"].Long())) {
const PGresult *res = pgsql_query("SELECT email FROM members_job_groupmember WHERE group_id=%lu AND status=1", x["group_id"].Long());
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);
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "Job Offer Received");
form.LetStr("email", rec["email"].c_str());
form.Email("JOB/job_offer_group.mailfile");
}
}
}
break;
case JOBS_GROUP_OFFER_PUBLIC:
logfmt(logINFO, "JOBS_GROUP_OFFER_PUBLIC");
if (load_db_record(x, "SELECT o.*,j.title,j.description,j.timeline_days,j.price,cc.description AS currency "
" FROM members_jobs_offer o "
" LEFT JOIN members_jobs j ON j.id =o.job_id "
" LEFT JOIN currency cc ON cc.country = j.country "
" WHERE o.id = %lu", in["offer_id"].Long())) {
vars2form(x, form);
if (load_db_record(y, "SELECT email,balance,firstname FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(y, form);
// vars2form( x, form );
form.LetStr("subject", "Job Offer Posted to the Public");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_offer_public.mailfile");
}
}
break;
case JOBS_MESSAGE_ADDED:
logfmt(logINFO, "JOBS_MESSAGE_ADDED");
res = pgsql_query("SELECT m.firstname,mj.title,c.member_id,c.client_id,j.contract,j.msg_type,substring(j.message,0,550) AS message,"
" to_char(j.created, 'Day Mon dd, yyyy HH:MI AM') AS added "
" FROM jobs_contract_message j "
" LEFT JOIN members_jobs_contract c ON c.contract = j.contract "
" LEFT JOIN members m ON m.id=j.member_id LEFT JOIN members_jobs mj ON mj.id = c.job_id "
" WHERE j.contract='%s' ORDER BY j.id desc LIMIT 4", in["contract"].c_str());
CVars rec;
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++) {
in["color"] = "FFFFFF";
if (c > 0) {
in["color"] = "ebfaeb";
}
c++;
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
map_to_cvars(f, rec);
sprintf(listing_items, "<TR><td style='background-color:#%s'>%s<hr size='1'></td></TR>", in["color"].c_str(), rec["message"].c_str());
inv_list->LetStr("pin", listing_items);
inv_list->CloseElement();
//<hr size=1 color=#FF0000>
if (c > 1) {
c = 0;
}
}
vars2form(rec, form);
if (load_db_record(y, "SELECT email FROM members WHERE id = %lu", rec["member_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Sent");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_message_m.mailfile");
}
vars2form(x, form); // not sure if I have to rebind again
if (load_db_record(z, "SELECT email FROM members WHERE id = %lu", rec["client_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Received");
form.LetStr("email", z["email"].c_str());
form.Email("JOB/job_message.mailfile");
}
}
/*
if (load_db_record(x, "SELECT m.firstname,mj.title,c.member_id,c.client_id,j.contract,j.msg_type,substring(j.message,0,550) AS message,"
" to_char(j.created, 'Day Mon dd, yyyy HH:MI AM') AS added "
" FROM jobs_contract_message j "
" LEFT JOIN members_jobs_contract c ON c.contract = j.contract "
" LEFT JOIN members m ON m.id=j.member_id LEFT JOIN members_jobs mj ON mj.id = c.job_id "
" WHERE j.contract='%s' ORDER BY j.id desc LIMIT 1", in["contract"].c_str())> 0) {
vars2form(x, form);
if (load_db_record(y, "SELECT email FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Sent");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_message_m.mailfile");
}
vars2form(x, form); // not sure if I have to rebind again
if (load_db_record(z, "SELECT email FROM members WHERE id = %lu", x["client_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Received");
form.LetStr("email", z["email"].c_str());
form.Email("JOB/job_message.mailfile");
}
}
*/
break;
}
logfmt(logINFO, "/CronJobEmail()");
return 0;
}
long CronAccountMail(long mailtype, CVars in){
logfmt(logINFO, "CronAccountMail()");
CVars out, x, y, z, ml;
C_CGI_Form form("", "");
int c=0;
CGIList * inv_list = new CGIList(&form, "inv_items");
char listing_items[1024];
const PGresult *res;
// char * server_name; // = getenv("SERVER_NAME");
out["server_name"] = CfgReadChar("system.server_name");
//sprintf(server_name, "%s", out["server_name"].c_str());
form.LetStr("server_name", out["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
CVars yr;
load_db_record(yr, "SELECT to_char(now(), 'yyyy') AS YYYY");
vars2form(yr, form);
switch (mailtype) {
case ACCOUNT_SEND_REFEREMAIL:
REQ_LONG(in, "refer_id", 1, -1);
if (load_db_record(x, "SELECT r.*,m.firstname AS send_firstname,m.lastname AS send_lastname,"
" date_part('year',now()) AS yyyy "
" FROM members_refer_friend r "
" LEFT JOIN members m ON m.id = r.member_id "
" WHERE r.id = %lu ", in["refer_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_refer_individual.mailfile");
}
break;
}
logfmt(logINFO, "/CronJobEmail()");
return 0;
}
+253 -112
View File
@@ -1,4 +1,5 @@
#include "email.h"
#include "cron_email.h"
#include "clog.h"
#include "cgi.h"
#include "input.h"
@@ -55,16 +56,51 @@ CREATE TABLE members_notification (
x["icon"].set_valid(true);
}
ret = insert_db_record(DBS_VALID, "members_notification", "members_notification_id_seq", x);
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long plan_notification(CVars in, CVars &out)");
}
return ret;
}
long promo_email(long mailtype, CVars in, CVars &out){
logfmt(logINFO, "alert_email()");
CVars x, y, z;
C_CGI_Form form("", "");
out["alertemail"] = CfgReadChar("transnotif.contact");
out["signupreport"] = CfgReadChar("transnotif.signupreport");
CVars yr;
load_db_record(yr, "SELECT to_char(now(), 'yyyy') AS YYYY, TO_CHAR(NOW(), 'Day Mon dd, yyyy hh:mm AM') AS report_date");
vars2form(yr, form);
//char * server_name = getenv("SERVER_NAME");
//form.LetStr("server_name", server_name);
//form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
out["server_name"] = CfgReadChar("system.server_name");
form.LetStr("server_name", out["server_name"].c_str());
//form.LetStr("site_name", "WrenchBoard");
//form.LetStr("site_trade_name", "Connecting Opportunities");
switch (mailtype) {
case WRB_CRONJOB_PROCESS_PROMO:
vars2form(in, form);
form.LetStr("email", in["email"]);
form.Email("PROMO/promo_alert.mailfile");
break;
case WRENCHBOARD_PROMOADMIN_ADDLIST:
vars2form(in, form);
form.LetStr("email", in["email"]);
form.Email("PROMO/member_referpromo_individual.mailfile");
break;
}
return 0;
}
long alert_email(long mailtype, CVars in, CVars &out) {
logfmt(logINFO, "alert_email()");
@@ -241,7 +277,7 @@ long cron_email(long mailtype, CVars in, CVars &out) {
" LEFT JOIN currency cc ON cc.country = mj.country "
" LEFT JOIN members m ON m.id=mc.client_id "
"WHERE mc.member_id = %lu AND mc.status IN (1,2) "
" AND delivery_date < now() ", in["member_id"].Long());
" AND mc.delivery_date < now() ORDER BY mc.delivery_date DESC LIMIT 8", in["member_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
@@ -290,9 +326,12 @@ long cron_email(long mailtype, CVars in, CVars &out) {
form.Email("REMINDER/offer_pending_reminder.mailfile");
break;
case WRB_CRONJOB_HOLIDAY_BROADCAST:
vars2form(x, form); // need to remove
vars2form(in, form);
form.LetStr("email", in["email"].c_str());
form.Email("HOLIDAY/independence_ng_2025.mailfile");
break;
}
} catch (bad_parameter) {
@@ -377,14 +416,21 @@ long market_email(long mailtype, CVars in, CVars &out) {
case WRENCHBOARD_BKO_MARKETING_MSG:
REQ_STRING (in, "uid", 5, 149, "(.*)");
if (load_db_record(x, "SELECT email AS market_email, * FROM marketing_list WHERE uid='%s'", in["uid"].c_str())) {
if (load_db_record(x, "SELECT *, uid AS promo_uid FROM market_import WHERE id = %lu", in["import_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "WrenchBoard - Connect with Rewards.");
form.LetStr("email", x["market_email"].c_str());
form.Email("PROMO/promotion1.mailfile");
// form.LetStr("subject", "WrenchBoard - Connect with Rewards.");
// form.LetStr("email", x["market_email"].c_str());
// form.Email("PROMO/promotion1.mailfile");
// form.Email("PROMO/promotion2.mailfile");
// form.Email("PROMO/promotion_a.mailfile");
vars2form(x, form);
form.LetStr("subject", "View opportunities at");
form.LetStr("email", x["email"].c_str());
//form.LetStr("email", "ameye@chiefsoft.com");
form.Email("MARKET/market_invite_step1.mailfile");
}
break;
@@ -474,8 +520,7 @@ long family_email(long mailtype, CVars in, CVars &out) {
long account_email(long mailtype, CVars in, CVars &out) {
//REQ_LONG( in, "member_id", 1, -1 );
CVars x;
CVars x, ml;
C_CGI_Form form("", "");
CGIList * inv_list = new CGIList(&form, "inv_items");
@@ -501,13 +546,26 @@ long account_email(long mailtype, CVars in, CVars &out) {
return AccountPendingMail(in);
break;
case WRENCHBOARD_MYREFLINK:
vars2form(in, form);
form.LetStr("email", in["email"].c_str());
form.Email("ACCOUNT/member_refer_link.mailfile");
break;
case ACCOUNT_SEND_REFEREMAIL:
REQ_LONG(in, "refer_id", 1, -1);
if (load_db_record(x, "SELECT r.*,m.firstname AS send_firstname,m.lastname AS send_lastname,date_part('year',now()) AS yyyy FROM members_refer_friend r LEFT JOIN members m ON m.id = r.member_id WHERE r.id = %lu ", in["refer_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_refer_individual.mailfile");
}
ml["action"] = ACCOUNT_SEND_REFEREMAIL; ml["action"].set_valid( true );
ml["topic"] = "ACCOUNT_SEND_REFEREMAIL"; ml["topic"].set_valid( true );
ml["refer_id"] = in["refer_id"]; ml["refer_id"].set_valid( true );
//ml["interest_id"] = in["interest_id"]; ml["interest_id"].set_valid( true );
submit_cron_email(ml);
//
// if (load_db_record(x, "SELECT r.*,m.firstname AS send_firstname,m.lastname AS send_lastname,date_part('year',now()) AS yyyy FROM members_refer_friend r LEFT JOIN members m ON m.id = r.member_id WHERE r.id = %lu ", in["refer_id"].Long())) {
// vars2form(x, form);
// form.LetStr("email", x["email"].c_str());
// form.Email("ACCOUNT/member_refer_individual.mailfile");
// }
break;
case ACCOUNT_CREATED_MAIL:
@@ -623,6 +681,14 @@ long account_email(long mailtype, CVars in, CVars &out) {
form.Email("ALERT/alert_contact.mailfile");
}
break;
case WRENCHBOARD_VIRTUAL_CARDADD:
ml["action"] = WRENCHBOARD_VIRTUAL_CARDADD; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_VIRTUAL_CARDADD"; ml["topic"].set_valid( true );
ml["offer_id"] = in["offer_id"]; ml["offer_id"].set_valid( true );
ml["interest_id"] = in["interest_id"]; ml["interest_id"].set_valid( true );
submit_cron_email(ml);
break;
}
} catch (bad_parameter) {
@@ -636,7 +702,7 @@ long account_email(long mailtype, CVars in, CVars &out) {
long job_email(long mailtype, CVars in, CVars &out) {
logfmt(logINFO, "job_email()");
CVars x, y, z;
CVars x, y, z, ml;
C_CGI_Form form("", "");
int c=0;
CGIList * inv_list = new CGIList(&form, "inv_items");
@@ -794,25 +860,33 @@ long job_email(long mailtype, CVars in, CVars &out) {
break;
case JOBS_OFFER_INTEREST_MAIL:
if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu AND o.status = 1", in["offer_id"].Long())) {
vars2form(x, form);
if (load_db_record(y, "SELECT email,balance,firstname FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(y, form);
vars2form(yr, form);
form.LetStr("subject", "Job Interest Recieved");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_interest_member.mailfile");
}
if (load_db_record(z, "SELECT mi.*,m.firstname,m.lastname,m.email from members_offer_interest mi LEFT JOIN members m ON m.id = mi.member_id WHERE mi.id = %lu", in["interest_id"].Long())) {
vars2form(z, form);
vars2form(yr, form);
form.LetStr("subject", "Job Interest Sent");
form.LetStr("email", z["email"].c_str());
form.Email("JOB/job_interest_client.mailfile");
}
ml["action"] = JOBS_OFFER_INTEREST_MAIL; ml["action"].set_valid( true );
ml["topic"] = "JOBS_OFFER_INTEREST_MAIL"; ml["topic"].set_valid( true );
ml["offer_id"] = in["offer_id"]; ml["offer_id"].set_valid( true );
ml["interest_id"] = in["interest_id"]; ml["interest_id"].set_valid( true );
submit_cron_email(ml);
}
// if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu AND o.status = 1", in["offer_id"].Long())) {
// vars2form(x, form);
// if (load_db_record(y, "SELECT email,balance,firstname FROM members WHERE id = %lu", x["member_id"].Long())) {
// vars2form(y, form);
// vars2form(yr, form);
// form.LetStr("subject", "Job Interest Recieved");
// form.LetStr("email", y["email"].c_str());
// form.Email("JOB/job_interest_member.mailfile");
// }
//
// if (load_db_record(z, "SELECT mi.*,m.firstname,m.lastname,m.email from members_offer_interest mi LEFT JOIN members m ON m.id = mi.member_id WHERE mi.id = %lu", in["interest_id"].Long())) {
// vars2form(z, form);
// vars2form(yr, form);
// form.LetStr("subject", "Job Interest Sent");
// form.LetStr("email", z["email"].c_str());
// form.Email("JOB/job_interest_client.mailfile");
// }
//
// }
break;
@@ -827,6 +901,7 @@ long job_email(long mailtype, CVars in, CVars &out) {
form.LetStr("subject", "Job Offer Canceled");
form.LetStr("email", x["email"].c_str());
form.Email("JOB/job_offer_cancel.mailfile");
}
break;
@@ -841,9 +916,14 @@ long job_email(long mailtype, CVars in, CVars &out) {
" WHERE o.id = %lu", in["offer_id"].Long())) {
vars2form(x, form);
vars2form(yr, form);
form.LetStr("subject", "New Job Offer Received");
form.LetStr("email", x["email"].c_str());
form.Email("JOB/job_offer_invidual.mailfile");
// form.LetStr("subject", "New Job Offer Received");
// form.LetStr("email", x["email"].c_str());
// form.Email("JOB/job_offer_invidual.mailfile");
ml["action"] = JOBS_INDIVIDUAL_OFFER_MAIL; ml["action"].set_valid( true );
ml["topic"] = "JOBS_INDIVIDUAL_OFFER_MAIL"; ml["topic"].set_valid( true );
ml["offer_id"] = in["offer_id"]; ml["offer_id"].set_valid( true );
submit_cron_email(ml);
}
break;
@@ -878,9 +958,13 @@ long job_email(long mailtype, CVars in, CVars &out) {
if (load_db_record(y, "SELECT email,balance,firstname FROM members WHERE id = %lu", x["member_id"].Long())) {
vars2form(y, form);
// vars2form( x, form );
form.LetStr("subject", "Job Offer Posted to the Public");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_offer_public.mailfile");
// form.LetStr("subject", "Job Offer Posted to the Public");
// form.LetStr("email", y["email"].c_str());
// form.Email("JOB/job_offer_public.mailfile");
ml["action"] = JOBS_GROUP_OFFER_PUBLIC; ml["action"].set_valid( true );
ml["topic"] = "JOBS_GROUP_OFFER_PUBLIC"; ml["topic"].set_valid( true );
ml["offer_id"] = in["offer_id"]; ml["offer_id"].set_valid( true );
submit_cron_email(ml);
}
}
break;
@@ -888,58 +972,64 @@ long job_email(long mailtype, CVars in, CVars &out) {
case JOBS_MESSAGE_ADDED:
logfmt(logINFO, "JOBS_MESSAGE_ADDED");
res = pgsql_query("SELECT m.firstname,mj.title,c.member_id,c.client_id,j.contract,j.msg_type,substring(j.message,0,550) AS message,"
" to_char(j.created, 'Day Mon dd, yyyy HH:MI AM') AS added "
" FROM jobs_contract_message j "
" LEFT JOIN members_jobs_contract c ON c.contract = j.contract "
" LEFT JOIN members m ON m.id=j.member_id LEFT JOIN members_jobs mj ON mj.id = c.job_id "
" WHERE j.contract='%s' ORDER BY j.id desc LIMIT 4", in["contract"].c_str());
CVars rec;
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++) {
x["color"] = "FFFFFF";
if (c > 0) {
in["color"] = "ebfaeb";
}
c++;
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
map_to_cvars(f, rec);
sprintf(listing_items, "<TR><td style='background-color:#%s'>%s<hr size='1'></td></TR>", in["color"].c_str(), rec["message"].c_str());
inv_list->LetStr("pin", listing_items);
inv_list->CloseElement();
//<hr size=1 color=#FF0000>
if (c > 1) {
c = 0;
}
}
ml["action"] = JOBS_MESSAGE_ADDED; ml["action"].set_valid( true );
ml["topic"] = "JOBS_MESSAGE_ADDED"; ml["topic"].set_valid( true );
ml["contract"] = in["contract"]; ml["contract"].set_valid( true );
submit_cron_email(ml);
vars2form(rec, form);
if (load_db_record(y, "SELECT email FROM members WHERE id = %lu", rec["member_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Sent");
form.LetStr("email", y["email"].c_str());
form.Email("JOB/job_message_m.mailfile");
}
vars2form(x, form); // not sure if I have to rebind again
if (load_db_record(z, "SELECT email FROM members WHERE id = %lu", rec["client_id"].Long())) {
vars2form(x, form);
form.LetStr("subject", "Activity Message Received");
form.LetStr("email", z["email"].c_str());
form.Email("JOB/job_message.mailfile");
}
}
// res = pgsql_query("SELECT m.firstname,mj.title,c.member_id,c.client_id,j.contract,j.msg_type,substring(j.message,0,550) AS message,"
// " to_char(j.created, 'Day Mon dd, yyyy HH:MI AM') AS added , c.id AS contract_id "
// " FROM jobs_contract_message j "
// " LEFT JOIN members_jobs_contract c ON c.contract = j.contract "
// " LEFT JOIN members m ON m.id=j.member_id LEFT JOIN members_jobs mj ON mj.id = c.job_id "
// " WHERE j.contract='%s' ORDER BY j.id desc LIMIT 4", in["contract"].c_str());
// CVars rec;
// 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++) {
// in["color"] = "FFFFFF";
// if (c > 0) {
// in["color"] = "ebfaeb";
// }
//
// c++;
// map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
// if (f.empty()) continue;
//
// map_to_cvars(f, rec);
//
// sprintf(listing_items, "<TR><td style='background-color:#%s'>%s<hr size='1'></td></TR>", in["color"].c_str(), rec["message"].c_str());
// inv_list->LetStr("pin", listing_items);
// inv_list->CloseElement();
// //<hr size=1 color=#FF0000>
// if (c > 1) {
// c = 0;
// }
// }
//
//
// vars2form(rec, form);
// if (load_db_record(y, "SELECT email FROM members WHERE id = %lu", rec["member_id"].Long())) {
// vars2form(x, form);
// form.LetStr("subject", "Activity Message Sent");
// form.LetStr("email", y["email"].c_str());
// form.Email("JOB/job_message_m.mailfile");
// }
//
// vars2form(x, form); // not sure if I have to rebind again
// if (load_db_record(z, "SELECT email FROM members WHERE id = %lu", rec["client_id"].Long())) {
// vars2form(x, form);
// form.LetStr("subject", "Activity Message Received");
// form.LetStr("email", z["email"].c_str());
// form.Email("JOB/job_message.mailfile");
// }
//
//
//
// }
/*
if (load_db_record(x, "SELECT m.firstname,mj.title,c.member_id,c.client_id,j.contract,j.msg_type,substring(j.message,0,550) AS message,"
@@ -1180,6 +1270,22 @@ long getContractMemberClientEmail(long contract_id, CVars &out) {
return 0;
}
long test_just_email(CVars in, CVars &out){
logfmt(logINFO, "SENDING TEST EMAIL START");
C_CGI_Form form("", "");
out["server_name"] = CfgReadChar("system.server_name");
form.LetStr("server_name", out["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
vars2form(in, form);
form.LetStr("email", "ameye+test@chiefsoft.com");
form.Email("ALERT/alert_general.mailfile");
logfmt(logINFO, "SENDING TEST EMAIL END");
return 0;
}
long test_email(CVars in, CVars &out) {
CVars x,y,z;
C_CGI_Form form("", "");
@@ -1230,6 +1336,7 @@ long LocationAccountLoginMail(CVars in) {
REQ_LONG(in, "member_id", 1, -1);
CVars x;
CVars out;
CVars ml;
C_CGI_Form form("", "");
form.LetStr("main_site_url", "https://www.wrenchboard.com/");
out["server_name"] = CfgReadChar("system.server_name");
@@ -1237,9 +1344,14 @@ long LocationAccountLoginMail(CVars in) {
form.LetStr("site_name", "WrenchBoard");
if (load_db_record(x, "SELECT * FROM members WHERE id = %lu ", in["member_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_welcome.mailfile");
// vars2form(x, form);
// form.LetStr("email", x["email"].c_str());
// form.Email("ACCOUNT/member_welcome.mailfile");
// CVars ml;
ml["action"] = WRENCHBOARD_ACCOUNT_LOGIN; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ACCOUNT_LOGIN"; ml["topic"].set_valid( true );
ml["member_id"] = in["member_id"]; ml["member_id"].set_valid( true );
submit_cron_email(ml);
}
return 0;
}
@@ -1266,7 +1378,7 @@ long ContactMessage(CVars in) {
long SignupPendingAlertMailfile(CVars in) {
REQ_LONG(in, "pending_id", 1, -1);
CVars x;
CVars x, ml;
CVars out;
C_CGI_Form form("", "");
@@ -1279,9 +1391,13 @@ long SignupPendingAlertMailfile(CVars in) {
form.LetStr("subject", "WrenchBoard Contact Us Alert");
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");
// vars2form(x, form);
// form.LetStr("email", out["alertemail"].c_str());
// form.Email("ALERT/alert_signup.mailfile");
ml["action"] = WRENCHBOARD_ACCOUNT_PENDING; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ALERT"; ml["topic"].set_valid( true );
ml["member_id"] = in["pending_id"]; ml["member_id"].set_valid( true );
submit_cron_email(ml);
}
} catch (bad_parameter) {
out["status"] = "ERROR";
@@ -1292,7 +1408,7 @@ long SignupPendingAlertMailfile(CVars in) {
long SignupCompletedAlertMailfile(CVars in) {
REQ_LONG(in, "member_id", 1, -1);
CVars x;
CVars x, ml;
CVars out;
C_CGI_Form form("", "");
out["alertemail"] = CfgReadChar("transnotif.contact");
@@ -1303,9 +1419,14 @@ long SignupCompletedAlertMailfile(CVars in) {
form.LetStr("subject", "WrenchBoard Contact Us Alert");
if (load_db_record(x, "SELECT *,email as email2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
vars2form(x, form);
form.LetStr("email", out["alertemail"].c_str());
form.Email("ALERT/alert_signupcompleted.mailfile");
// vars2form(x, form);
// form.LetStr("email", out["alertemail"].c_str());
// form.Email("ALERT/alert_signupcompleted.mailfile");
ml["action"] = WRENCHBOARD_ACCOUNT_LOGIN; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ALERT"; ml["topic"].set_valid( true );
ml["member_id"] = in["member_id"]; ml["member_id"].set_valid( true );
submit_cron_email(ml);
}
return 0;
}
@@ -1331,6 +1452,7 @@ long AlertActions(CVars in) {
long ManagerAccountLoginMail(CVars in) {
REQ_LONG(in, "member_id", 1, -1);
CVars x;
CVars ml;
CVars out;
C_CGI_Form form("", "");
form.LetStr("main_site_url", "https://www.wrenchboard.com/");
@@ -1339,9 +1461,14 @@ long ManagerAccountLoginMail(CVars in) {
form.LetStr("site_name", "WrenchBoard");
if (load_db_record(x, "SELECT * FROM members WHERE id = %lu ", in["member_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_welcome.mailfile");
// vars2form(x, form);
// form.LetStr("email", x["email"].c_str());
// form.Email("ACCOUNT/member_welcome.mailfile");
// CVars ml;
ml["action"] = WRENCHBOARD_ACCOUNT_LOGIN; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ACCOUNT_LOGIN"; ml["topic"].set_valid( true );
ml["member_id"] = in["member_id"]; ml["member_id"].set_valid( true );
submit_cron_email(ml);
}
return 0;
}
@@ -1349,7 +1476,7 @@ long ManagerAccountLoginMail(CVars in) {
long AccountPendingMail(CVars in) //TESTED
{
REQ_LONG(in, "pending_id", 1, -1);
CVars x;
CVars x,ml;
CVars out;
C_CGI_Form form("", "");
try{
@@ -1363,10 +1490,18 @@ long AccountPendingMail(CVars in) //TESTED
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");
ml["action"] = WRENCHBOARD_ACCOUNT_PENDING; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ACCOUNT_PENDING"; ml["topic"].set_valid( true );
ml["member_id"] = in["pending_id"]; ml["member_id"].set_valid( true );
// submit_cron_email(ml);
form.Email("ACCOUNT/member_pending_mobile.mailfile");
} else {
form.Email("ACCOUNT/member_pending_mobile.mailfile");
ml["action"] = WRENCHBOARD_ACCOUNT_PENDING; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ACCOUNT_PENDING"; ml["topic"].set_valid( true );
ml["member_id"] = in["pending_id"]; ml["member_id"].set_valid( true );
// submit_cron_email(ml);
form.Email("ACCOUNT/member_pending_mobile.mailfile");
}
}
@@ -1386,6 +1521,7 @@ long WelcomeAccountMail(CVars in) // TESTED
REQ_LONG(in, "member_id", 1, -1);
CVars x;
CVars out;
CVars ml;
C_CGI_Form form("", "");
form.LetStr("main_site_url", "https://www.wrenchboard.com/");
out["server_name"] = CfgReadChar("system.server_name");
@@ -1393,10 +1529,15 @@ long WelcomeAccountMail(CVars in) // TESTED
form.LetStr("site_name", "WrenchBoard");
if (load_db_record(x, "SELECT *,to_char(now(), 'yyyy') AS YYYY FROM members WHERE id = %lu ", in["member_id"].Long())) {
vars2form(x, form);
form.LetStr("email", x["email"].c_str());
form.Email("ACCOUNT/member_welcome.mailfile");
}
// vars2form(x, form);
// form.LetStr("email", x["email"].c_str());
// form.Email("ACCOUNT/member_welcome.mailfile");
// CVars ml;
ml["action"] = WRENCHBOARD_ACCOUNT_LOGIN; ml["action"].set_valid( true );
ml["topic"] = "WRENCHBOARD_ACCOUNT_LOGIN"; ml["topic"].set_valid( true );
ml["member_id"] = in["member_id"]; ml["member_id"].set_valid( true );
submit_cron_email(ml);
}
in["title"] = "Account Creation Completed";
in["message"] = "Account Creation Completed";
+5 -2
View File
@@ -113,7 +113,7 @@ long WrenchPurchaseHx( CVars in, CVars &out )
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT id, uid,added::date AS added_date,"
res = pgsql_query("SELECT id, uid,added::date AS added_date,currency,"
" (CASE 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 "
@@ -129,6 +129,9 @@ long WrenchPurchaseHx( CVars in, CVars &out )
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "currency_%05d", i);
out[vname] = rec["currency"];
snprintf(vname, sizeof (vname), "added_date_%05d", i);
out[vname] = rec["added_date"];
@@ -184,7 +187,7 @@ long WrenchRefferHx( CVars in, CVars &out )
res = pgsql_query("SELECT added::date AS added_date, firstname, lastname,email,"
" (CASE WHEN status=1 THEN 'Pending' WHEN status=5 THEN 'Completed' ElSE '' END) As status "
" FROM members_refer_friend "
" WHERE member_id = %lu ORDER BY id DESC LIMIT %lu OFFSET %lu ",member_id,limit,offset);
" WHERE member_id = %lu AND status > 0 ORDER BY id DESC LIMIT %lu OFFSET %lu ",member_id,limit,offset);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
+33 -3
View File
@@ -1007,7 +1007,9 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) {
REQ_LONG(in, "member_id", 1, -1);
REQ_STRING(in, "offer_code", 1, 15, "(.*)"); //offer_code
const PGresult *res = pgsql_query("SELECT *,id as offer_id FROM members_jobs_offer WHERE offer_code ='%s' AND expire>= now() AND status = 1 AND public_view > 0", in["offer_code"].c_str());
const PGresult *res = pgsql_query("SELECT *,id as offer_id, member_id AS job_owner_member_id FROM members_jobs_offer WHERE offer_code ='%s' "
" AND expire>= now() AND status = 1 "
" AND public_view > 0", in["offer_code"].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
if (!f.empty()) {
@@ -1020,7 +1022,8 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) {
return ret;
}
const PGresult *res1 = pgsql_query("SELECT * FROM members_offer_interest WHERE offer_id =%lu AND member_id = %lu AND status IN(1,5)", rec["offer_id"].Long(), in["member_id"].Long());
const PGresult *res1 = pgsql_query("SELECT * FROM members_offer_interest WHERE offer_id =%lu AND member_id = %lu "
" AND status IN(1,5)", rec["offer_id"].Long(), in["member_id"].Long());
if (res1 != NULL && pgsql_num_rows(res1) > 0) {
out["status"] = "You have sent or completed a request for this task already.";
return ret;
@@ -1039,6 +1042,14 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) {
x["interest_id"] = interest_id;
x["interest_id"].set_valid(true);
job_email(JOBS_OFFER_INTEREST_MAIL, x, out); // note I need interest_id to
CVars xy;
if ( load_db_record(xy, "SELECT id AS member_id, uid AS member_uid, 'message.svg' AS icon "
" FROM members WHERE id = %lu ",rec["job_owner_member_id"].Long()) > 0 ){
xy["msg"] = "You have received an interest in your task !!!";
xy["msg"].set_valid(true);
plan_notification(xy, out);
}
}
}
}
@@ -1088,7 +1099,12 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
}
load_db_record(out, "SELECT jo.member_id AS owner_member_id,jo.id AS offer_id, j.id AS job_id,jo.added::date AS added_date,j.title,j.description, j.timeline_days, j.price,jo.offer_code,jo.job_description,jo.expire 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 = %lu AND jo.offer_code='%s'", in["member_id"].Long(), in["offer_code"].c_str());
load_db_record(out, "SELECT jo.promo, jo.strict_timeline, jo.member_id AS owner_member_id,jo.id AS offer_id, "
" j.id AS job_id,jo.added::date AS added_date,j.title,j.description,"
" j.timeline_days, j.price,jo.offer_code,jo.job_description,jo.expire "
" 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 = %lu AND jo.offer_code='%s'", in["member_id"].Long(), in["offer_code"].c_str());
in["offer_id"] = out["offer_id"];
@@ -1134,6 +1150,12 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
x["timeline_days"] = out["timeline_days"];
x["timeline_days"].set_valid(true);
x["strict_timeline"] = out["strict_timeline"];
x["strict_timeline"].set_valid(true);
x["promo"] = out["promo"];
x["promo"].set_valid(true);
x["loc"] = loc;
x["loc"].set_valid(true);
//x[""] = out[""]; x[""].set_valid( true );
@@ -1682,6 +1704,11 @@ long WrenchSendJobsOfferIndividual(CVars in, CVars &out) {
CVars z;
try {
if ( in["strict_timeline"] =="" ){
in["strict_timeline"] = "0"; in["strict_timeline"].set_valid(true);
}
// let us use this email to see if this already a user on the system
if (load_db_record(out, " SELECT username,id AS client_id FROM members WHERE LOWER(username) =LOWER(TRIM('%s'));", in["email"].c_str())) {
in["client_id"] = out["client_id"]; // overiddind if account is found
@@ -1744,6 +1771,9 @@ long WrenchSendJobsOfferIndividual(CVars in, CVars &out) {
x["strict_timeline"] = in["strict_timeline"];
x["strict_timeline"].set_valid(true);
x["promo"] = in["promo"];
x["promo"].set_valid(true);
const char * loc = getenv("REMOTE_ADDR");
x["loc"] = loc;
x["loc"].set_valid(true);
+9 -68
View File
@@ -162,35 +162,6 @@ long WrenchJobManagerOffers( CVars in, CVars &out){
}
ret = PHP_API_OK;
out["status"] = "OK";
/*
wrenchboard=> \d members_jobs
Table "public.members_jobs"
Column | Type | Collation | Nullable | Default
---------------+-----------------------------+-----------+----------+------------------------------------------
id | integer | | not null | nextval('members_jobs_id_seq'::regclass)
member_id | integer | | |
title | character varying(150) | | |
description | character varying(300) | | |
job_detail | text | | |
timeline_days | integer | | not null |
price | integer | | not null |
loc | inet | | |
created | timestamp without time zone | | | now()
updated | timestamp without time zone | | | now()
status | integer | | | 1
country | character varying(2) | | |
uid | uuid | | | uuid_generate_v4()
Indexes:
"members_jobs_id_key" UNIQUE CONSTRAINT, btree (id)
Foreign-key constraints:
"members_jobs_country_fkey" FOREIGN KEY (country) REFERENCES country(code)
"members_jobs_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
Referenced by:
TABLE "members_jobs_offer" CONSTRAINT "members_jobs_offer_job_id_fkey" FOREIGN KEY (job_id) REFERENCES members_jobs(id)
wrenchboard=>
*/
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchJobManagerOffers");
@@ -339,42 +310,6 @@ long WrenchJobManagerList( CVars in, CVars &out){
}
ret = PHP_API_OK;
out["status"] = "OK";
/*
'job_country' => $out["job_country_${key}"],
'currency' => 'Naira',
'currency_code' => 'NGN',
c.description AS currency_description
wrenchboard=> \d members_jobs
Table "public.members_jobs"
Column | Type | Collation | Nullable | Default
---------------+-----------------------------+-----------+----------+------------------------------------------
id | integer | | not null | nextval('members_jobs_id_seq'::regclass)
member_id | integer | | |
title | character varying(150) | | |
description | character varying(300) | | |
job_detail | text | | |
timeline_days | integer | | not null |
price | integer | | not null |
loc | inet | | |
created | timestamp without time zone | | | now()
updated | timestamp without time zone | | | now()
status | integer | | | 1
country | character varying(2) | | |
uid | uuid | | | uuid_generate_v4()
Indexes:
"members_jobs_id_key" UNIQUE CONSTRAINT, btree (id)
Foreign-key constraints:
"members_jobs_country_fkey" FOREIGN KEY (country) REFERENCES country(code)
"members_jobs_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
Referenced by:
TABLE "members_jobs_offer" CONSTRAINT "members_jobs_offer_job_id_fkey" FOREIGN KEY (job_id) REFERENCES members_jobs(id)
wrenchboard=>
*/
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchJobManagerList");
@@ -600,9 +535,9 @@ long WrenchUsersActiveTasksList(CVars in, CVars &out) {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT mc.id AS contract_id, mc.job_id AS job_id, mc.price, mc.timeline_days,mc.contract, "
res = pgsql_query("SELECT mc.id AS contract_id, mc.job_id AS job_id, mc.price, mc.timeline_days,mc.contract,mc.strict_timeline, "
" mj.title, mj.description AS description,mc.job_detail AS job_description,mc.uid AS contract_uid, mj.job_type AS job_type, mj.media_uid AS media_uid, "
" mj.banner AS banner, c.code AS currency_code, c.description AS currency_description, mj.uid AS job_uid, "
" mj.banner AS banner, c.code AS currency_code, c.description AS currency_description, mj.uid AS job_uid, (mc.delivery_date - interval ' 10 hours') AS minimum_due,"
" (CASE WHEN mc.status=4 THEN 'REVIEW' "
" WHEN mc.status = 1 AND mc.delivery_date > now() THEN 'ACTIVE' "
" WHEN mc.status = 1 AND mc.delivery_date <now() THEN 'PASTDUE' "
@@ -627,12 +562,18 @@ long WrenchUsersActiveTasksList(CVars in, CVars &out) {
snprintf(vname, sizeof (vname), "id_%05d", i);
out[vname] = rec["contract_id"];
snprintf(vname, sizeof (vname), "minimum_due_%05d", i);
out[vname] = rec["minimum_due"];
snprintf(vname, sizeof (vname), "job_detail_%05d", i);
out[vname] = "";
out[vname] = rec["job_description"];
snprintf(vname, sizeof (vname), "expire_%05d", i);
out[vname] = rec["expire"];
snprintf(vname, sizeof (vname), "strict_timeline_%05d", i);
out[vname] = rec["strict_timeline"];
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
+393 -1
View File
@@ -13,10 +13,17 @@
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include "jobs.h"
#include <curl/curl.h>
long WrenchMarketImport(CVars in, CVars &out);
long WrenchPromoLoad(CVars in, CVars &out);
long WrenchPromoAdminLogin(CVars in, CVars &out);
long WrenchPromoAddList(CVars in, CVars &out);
long WrenchPromoGetList( CVars in, CVars &out );
long WrenchPromoGetMember( CVars in, CVars &out );
long WrenchPromoAssignTask( CVars in, CVars &out );
long WrenchPromoActionList( CVars in, CVars &out );
long market_calls(CVars in, CVars &out) {
logfmt(logINFO, "market_calls()");
@@ -33,6 +40,28 @@ long market_calls(CVars in, CVars &out) {
case WRENCHBOARD_MARKET_PLAN01_NEXT1:
return WrenchPromoLoad(in, out);
break;
case WRENCHBOARD_PROMOADMIN_LOGIN:
return WrenchPromoAdminLogin(in, out);
break;
//const WRENCHBOARD_PROMOADMIN_ADDLIST = 220015;
case WRENCHBOARD_PROMOADMIN_ADDLIST:
return WrenchPromoAddList(in, out);
break;
//#define WRENCHBOARD_PROMOADMIN_GETLIST 220014
case WRENCHBOARD_PROMOADMIN_GETLIST:
return WrenchPromoGetList(in, out);
break;
//#define 220016
case WRENCHBOARD_PROMOADMIN_ACTIONLIST:
return WrenchPromoActionList(in, out);
break;
case WRENCHBOARD_PROMOADMIN_GETMEMBER:
return WrenchPromoGetMember(in, out);
break;
case WRENCHBOARD_PROMOADMIN_ASSIGNTASK:
return WrenchPromoAssignTask(in, out);
break;
}
} catch (bad_parameter) {
@@ -42,6 +71,366 @@ long market_calls(CVars in, CVars &out) {
return ret;
}
long WrenchPromoActionList( CVars in, CVars &out )
{
char vname[30];
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchPromoActionList()" );
out["result"] = "Yes i go to this back end";
try {
long admin_id = REQ_LONG(in, "promo_admin_id", 1, -1);
REQ_STRING (in, "admin_uid", 5, 120, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
long limit = REQ_LONG(in, "limit", 1, -1);
long offset = REQ_LONG(in, "offset", 1, -1);
const PGresult *res;
res = pgsql_query("SELECT count(id) FROM promo_actions WHERE admin_id = %lu", admin_id);
out["sum_total_record"] = pgsql_num_rows(res);
res = pgsql_query("SELECT * FROM promo_actions"
" WHERE admin_id = %lu ORDER BY id DESC LIMIT %lu OFFSET %lu ",admin_id,limit,offset);
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), "updated_%05d", i);
out[vname] = rec["updated"];
snprintf(vname, sizeof (vname), "uid_%05d", i);
out[vname] = rec["uid"];
snprintf(vname, sizeof (vname), "added_%05d", i);
out[vname] = rec["added"];
snprintf(vname, sizeof (vname), "category_%05d", i);
out[vname] = rec["category"];
snprintf(vname, sizeof (vname), "description_%05d", i);
out[vname] = rec["description"];
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 WrenchPromoActionList(CVars in, CVars &out)");
}
logfmt( logINFO, "/WrenchPromoActionList()" );
return 0;
}
long WrenchPromoAssignTask( CVars in, CVars &out )
{
long ret = PHP_API_BAD_PARAM;
CVars outX;
CVars inj;
CVars p;
const PGresult *res;
long member_id = 0;
logfmt( logINFO, "WrenchPromoAssignTask()" );
try {
long admin_id = REQ_LONG(in, "promo_admin_id", 1, -1);
REQ_STRING (in, "admin_uid", 5, 120, "(.*)");
REQ_STRING (in, "member_uid", 5, 120, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
res = pgsql_query("SELECT * FROM promo_member"
" WHERE admin_id = %lu AND uid = '%s' ",admin_id,in["member_uid"].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);
out = rec;
long retF = load_db_record( outX, "SELECT *,id AS member_id "
"FROM members WHERE (username)=LOWER('%s') ", out["email"].c_str() );
if (retF && outX["promo_admin_id"].Long() > 0) {
out["status_message"] = "Good Already Signup";
member_id = outX["member_id"].Long();
}else{
ret = PHP_API_OK;
out["status"] = "OK";
out["task_result"] = "User yet to complete signup";
return ret;
}
if ( member_id == 0 ){
out["status"] = "OK";
out["task_result"] = "Cannot find user to assign to";
return ret;
}
if ( load_db_record(p, "SELECT count(id) AS offer_count FROM members_jobs_offer WHERE client_id = %lu AND status IN (1,2) ", member_id)> 0){
if (p["offer_count"].Long() > 0){
out["status"] = "OK";
out["task_result"] = "There is offer in place already";
return ret;
}
}
if ( load_db_record(p, "SELECT count(id) AS contract_count FROM members_jobs_contract WHERE client_id = %lu ", member_id)> 0){
if (p["offer_count"].Long() > 0){
out["status"] = "OK";
out["task_result"] = "Previous job found";
return ret;
}
}
if ( load_db_record(p, "SELECT * FROM promo_admin WHERE uid::text ='%s' ", in["admin_uid"].c_str())> 0){
if ( load_db_record(inj, "SELECT j.member_id, j.uid AS job_uid, j.id AS job_id, j.title,j.description,j.country, m.uid,j.job_detail "
" FROM members_jobs j LEFT JOIN members m ON m.id = j.member_id WHERE j.uid::text ='%s'",p["first_job"].c_str())> 0){
inj["promo"] = in["promo"]; inj["promo"].set_valid( true );
inj["strict_timeline"] = "10"; inj["strict_timeline"].set_valid( true );
inj["email"] = out["email"]; inj["email"].set_valid( true ); // email
inj["job_description"] = inj["job_detail"]; inj["job_description"].set_valid( true );
inj["action"] = WRENCHBOARD_JOB_OFFER_SYSTEM; inj["action"].set_valid( true );
inj["assign_mode"] = ASSIGN_MODE_EMAIL; inj["assign_mode"].set_valid( true );
out["assign_id"] = WrenchJobOfferSystems(inj, outX);
}
}
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
out["status"] = "ERROR";
logfmt(logINFO, "ERROR CALL long WrenchPromoAssignTask(CVars in, CVars &out)");
}
out["status"] = "OK";
out["task_result"] = "Backend Not Ready";
return ret;
}
long WrenchPromoGetMember( CVars in, CVars &out )
{
char vname[30];
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchPromoGetList()" );
out["result"] = "Yes i go to this back end";
try {
long admin_id = REQ_LONG(in, "promo_admin_id", 1, -1);
REQ_STRING (in, "admin_uid", 5, 120, "(.*)");
REQ_STRING (in, "member_uid", 5, 120, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
const PGresult *res;
// res = pgsql_query("SELECT count(id) FROM promo_member WHERE admin_id = %lu", admin_id);
// out["sum_total_record"] = pgsql_num_rows(res);
res = pgsql_query("SELECT * FROM promo_member"
" WHERE admin_id = %lu AND uid = '%s' ",admin_id,in["member_uid"].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);
out = rec;
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
out["status"] = "ERROR";
logfmt(logINFO, "ERROR CALL long WrenchPromoGetMember(CVars in, CVars &out)");
}
logfmt( logINFO, "/WrenchPromoGetMember()" );
return ret;
}
long WrenchPromoGetList( CVars in, CVars &out )
{
char vname[30];
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchPromoGetList()" );
out["result"] = "Yes i go to this back end";
try {
long admin_id = REQ_LONG(in, "promo_admin_id", 1, -1);
REQ_STRING (in, "admin_uid", 5, 120, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
long limit = REQ_LONG(in, "limit", 1, -1);
long offset = REQ_LONG(in, "offset", 1, -1);
const PGresult *res;
res = pgsql_query("SELECT count(id) FROM promo_member WHERE admin_id = %lu", admin_id);
out["sum_total_record"] = pgsql_num_rows(res);
res = pgsql_query("SELECT * FROM promo_member"
" WHERE admin_id = %lu ORDER BY id DESC LIMIT %lu OFFSET %lu ",admin_id,limit,offset);
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), "updated_%05d", i);
out[vname] = rec["updated"];
snprintf(vname, sizeof (vname), "uid_%05d", i);
out[vname] = rec["uid"];
snprintf(vname, sizeof (vname), "added_%05d", i);
out[vname] = rec["added"];
snprintf(vname, sizeof (vname), "firstname_%05d", i);
out[vname] = rec["firstname"];
snprintf(vname, sizeof (vname), "lastname_%05d", i);
out[vname] = rec["lastname"];
snprintf(vname, sizeof (vname), "email_%05d", i);
out[vname] = rec["email"];
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 WrenchPromoGetList(CVars in, CVars &out)");
}
logfmt( logINFO, "/WrenchPromoGetList()" );
return 0;
}
long WrenchPromoAddList(CVars in, CVars &out){
logfmt(logINFO, "WrenchPromoAdminLogin()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
long retF = -1;
CVars outX;
CVars x;
try {
REQ_STRING (in, "email", 5, 49, "(.*)");
REQ_STRING (in, "firstname", 2, 25, "(.*)");
REQ_STRING (in, "lastname", 2, 25, "(.*)");
long admin_id = REQ_LONG(in, "promo_admin_id", 1, -1);
REQ_STRING (in, "admin_uid", 5, 120, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
ret = load_db_record( out, "SELECT *,id AS promo_admin_id FROM promo_admin WHERE status=1 AND id=%lu AND uid::text='%s'", admin_id, in["admin_uid"].c_str() );
if (ret && out["promo_admin_id"].Long() > 0) {
retF = load_db_record( outX, "SELECT *,id AS promo_admin_id "
"FROM promo_member WHERE (email)=LOWER('%s') AND admin_id= %lu", in["email"].c_str(), admin_id );
if (retF && outX["promo_admin_id"].Long() > 0) {
out["status_message"] = "Error Duplicate Found";
ret = PHP_API_OK;
out["status"] = "OK";
return 0;
}
retF = load_db_record( outX, "SELECT *,id AS promo_admin_id "
"FROM members_pending WHERE status =1 AND (username)=LOWER('%s') ", in["email"].c_str() );
if (retF && outX["promo_admin_id"].Long() > 0) {
out["status_message"] = "Error Already Started Signup";
ret = PHP_API_OK;
out["status"] = "OK";
return 0;
}
retF = load_db_record( outX, "SELECT *,id AS promo_admin_id "
"FROM members WHERE (username)=LOWER('%s') ", in["email"].c_str() );
if (retF && outX["promo_admin_id"].Long() > 0) {
out["status_message"] = "Error Already Signup";
ret = PHP_API_OK;
out["status"] = "OK";
return 0;
}
x["admin_id"] = admin_id; x["admin_id"].set_valid(true);
x["email"] = in["email"]; x["email"].set_valid(true);
x["firstname"] = in["firstname"]; x["firstname"].set_valid(true);
x["lastname"] = in["lastname"]; x["lastname"].set_valid(true);
x["loc"] = in["loc"]; x["loc"].set_valid(true);
long sid = insert_db_record(DBS_VALID, "promo_member", "promo_member_id_seq", x);
if (sid > 0 ){
out["status_message"] = "New Entry Added";
}
// long retF = load_db_record( outX, "SELECT *,id AS promo_admin_id "
// "FROM member WHERE (email)=LOWER('%s') AND admin_id= %lu", in["email"].c_str(), admin_id );
// if (retF && retF["promo_admin_id"].Long() > 0) {
// out["status_message"] = "Error Duplicate Found";
// ret = PHP_API_OK;
// out["status"] = "OK";
// return 0;
// }
// there will be promo action
// pgsql_query("UPDATE promo_admin SET updated=now() WHERE id=%lu", out["promo_admin_id"].Long());
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchMarketImport(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchPromoAdminLogin()");
return ret;
}
long WrenchPromoAdminLogin(CVars in, CVars &out){
logfmt(logINFO, "WrenchPromoAdminLogin()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
ret = load_db_record( out, "SELECT *,id AS promo_admin_id, md5( now()::text )||''||md5( (now() + '1 hr')::text ) AS sessionid FROM promo_admin WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret && out["promo_admin_id"].Long() > 0) {
pgsql_query("UPDATE promo_admin SET updated=now() WHERE id=%lu", out["promo_admin_id"].Long());
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchMarketImport(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchPromoAdminLogin()");
return ret;
}
long WrenchMarketImport(CVars in, CVars &out) {
logfmt(logINFO, "WrenchMarketImport()");
@@ -51,7 +440,7 @@ logfmt(logINFO, "WrenchMarketImport()");
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT id AS import_id,* FROM market_import WHERE status =1 ORDER BY ecount ASC LIMIT 10");
res = pgsql_query("SELECT id AS import_id,* FROM market_import WHERE status = 1 AND completed IS NULL ORDER BY ecount ASC LIMIT 10");
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
@@ -63,6 +452,9 @@ logfmt(logINFO, "WrenchMarketImport()");
map_to_cvars(f, rec);
market_email(WRENCHBOARD_MARKET_PLAN01_START, rec, rec);
pgsql_query("UPDATE market_import SET ecount=ecount+1 WHERE uid::text='%s'", rec["uid"].c_str());
if ( rec["ecount"].Long() > 2 ){
pgsql_query("UPDATE market_import SET completed=now() WHERE uid::text='%s'", rec["uid"].c_str());
}
}
}
ret = PHP_API_OK;
+33 -1
View File
@@ -390,8 +390,40 @@ long WrenchMemberCouponPayment( CVars in, CVars &out )
logfmt(FLOG_MAX, "/long WrenchMemberCouponPayment(CVars in, CVars &out)" );
return ret;
}
/*
Construct Virtual card Wallet
*/
long AssignVirtualCardWallet(CVars in,CVars out){
logfmt(FLOG_MAX, "long CheckWallet()" );
long wallet_id = 0;
CVars y;
try{
REQ_STRING(in, "request_uid", 12, 160, "(.*)");
long request_id = REQ_LONG(in, "request_id", 0, -1);
if ( load_db_record( y, "SELECT r.*,m.id AS target_member_id FROM members_card_request r LEFT JOIN members m ON m.uid::text=r.target_uid::text WHERE r.status = %lu AND r.uid::text ='%s' AND r.id =%lu",CARD_ACTIVATE_CARD, in["request_uid"].c_str(),request_id ) > 0 )
{
CVars x;
x["member_id"] = y["target_member_id"]; x["member_id"].set_valid( true );
x["currency"] = "VUSD"; x["currency"].set_valid( true );
x["transfer_limit"] = "100000"; x["transfer_limit"].set_valid( true );
x["card_issue_id"] = y["card_issue_id"]; x["card_issue_id"].set_valid( true );
x["card_id"] = y["card_id"]; x["card_id"].set_valid( true );
x["brand"] = y["brand"]; x["brand"].set_valid( true );
x["card_last4"] = y["card_last4"]; x["card_last4"].set_valid( true );
wallet_id = insert_db_record( DBS_VALID, "members_wallet", "members_wallet_id_seq", x );
if(wallet_id> 0){
pgsql_exec("UPDATE members_card_request SET status = %lu WHERE uid::text ='%s' AND id =%lu",CARD_WALLET_ADD, in["request_uid"].c_str(),request_id); //
}
}
else{
wallet_id = -1;
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long AssignVirtualCardWallet(CVars in, CVars &out)");
}
return wallet_id;
}
/*
call to verify the user have the wallet in place - or create it
+435 -4
View File
@@ -46,6 +46,14 @@ long RecoLearnMore( int itm_count, CVars in, CVars &out );
long RecoJobOwner( int itm_count, CVars in, CVars &out );
long RecoFamilyWaiting( int itm_count, CVars in, CVars &out );
long RecoRecentPastDueTask( int itm_count, CVars in, CVars &out );
long RecoPlayGround( int itm_count, CVars in, CVars &out );
// family banners
long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out );
long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out );
long RecoFamilyPastDueTask( int itm_count, CVars in, CVars &out );
long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out );
long RecoRecomendToParent( int itm_count, CVars in, CVars &out );
long recommendation_engine(long action , CVars in, CVars &out) {
try{
@@ -80,10 +88,373 @@ return 0;
long WrenchFamilyHomeBanners(CVars in, CVars &out){
out["status"] = "long WrenchFamilyHomeBanners(CVars in, CVars &out)";
long ret = PHP_API_BAD_PARAM;
CVars offV;
char vname[30];
long member_id = REQ_LONG(in, "member_id", 1, -1);
int itm_count= 0;
if( RecoCheckFamilyOffers( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } /*ONLY IF OFFER IS GREATER THAN 2 */
if( RecoCheckFamilyActive( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoFamilyPastDueTask( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoFamilyKidsWaiting( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoRecomendToParent( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
return 0;
if(itm_count < 3){
// if( RecoLearnMore( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoPlayGround( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
// if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
// if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
}
out["total_record"] = itm_count;
logfmt(logINFO, "/WrenchFamilyHomeBanners()");
ret = PHP_API_OK;
return ret;
}
long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoCheckFamilyOffers()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
try {
int ic = itm_count;
long member_id = REQ_LONG(in, "member_id", 1, -1);
res = pgsql_query("SELECT * FROM members_jobs_offer WHERE expire > now() AND status = 1 AND client_id > 0 AND client_id = %lu ",member_id);
if (res != NULL && pgsql_num_rows(res) > 2) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Ready to Start ?";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "You have received some offers. View, accept, or reject before the offer(s) expire.";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "OFFERS";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1 imp_offers";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
//out[vname] ="banner-waiting.jpg";
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-start.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "pending";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "pending";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "Continue";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View now";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Ready to Start ?";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = " View, accept, or reject before the offer(s) expire";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style";
ret = PHP_API_OK;
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoCheckFamilyOffers()");
return ret;
}
long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoCheckFamilyActive()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
try {
int ic = itm_count;
long member_id = REQ_LONG(in, "member_id", 1, -1);
res = pgsql_query("SELECT * FROM members_jobs_contract WHERE client_id = %lu AND status =1 AND delivery_date > ( now() - interval '1440 minutes' ) ",member_id);
if (res != NULL && pgsql_num_rows(res) > 0) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Current Activities";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "View you current task(s) ";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "ACTIVEJOB";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-active.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "mytask"; //Active Task Page //"my-active-jobs";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "mytask";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "View Tasks";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Current Activities";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "View you current task(s) ";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style lr";
ret = PHP_API_OK;
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoCheckFamilyActive()");
return ret;
}
/*
Family past due tasks
*/
long RecoFamilyPastDueTask( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoFamilyPastDueTask()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
try {
int ic = itm_count;
long member_id = REQ_LONG(in, "member_id", 1, -1);
res = pgsql_query("SELECT * FROM members_jobs_contract WHERE client_id = %lu AND status =1 AND delivery_date< now() AND delivery_date > ( now() - interval '2880 minutes' ) ",member_id);
if (res != NULL && pgsql_num_rows(res) > 0) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Past Due Tasks";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "Request an extension before the task gets canceled.";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "PASTDUEJOB";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-pastdue.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "pastdue"; //Active Task Page //"my-active-jobs";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "pastdue";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "View Tasks";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Past Due Tasks";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "You have some past due task(s) ";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style lr";
ret = PHP_API_OK;
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoFamilyPastDueTask()");
return ret;
}
/*
Task sent to parent , waiting to start
*/
long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoFamilyKidsWaiting()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
try {
int ic = itm_count;
long member_id = REQ_LONG(in, "member_id", 1, -1);
res = pgsql_query("SELECT * FROM members_family_suggesttask WHERE member_id = %lu AND status = 1 LIMIT 5", member_id);
if (res != NULL && pgsql_num_rows(res) > 0) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Waiting for Parent";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "Waiting for parent to get started.";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "KIDS_SUGGEST";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1 imp_offers";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-suggested.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "parentwaiting";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "parentwaiting";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "Continue";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Waiting for Parent.";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "Waiting for parent to get started.";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style";
ret = PHP_API_OK;
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoFamilyKidsWaiting()");
return ret;
}
/*
Show the banner for the kids to recommend to parent
*/
long RecoRecomendToParent( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoRecomendToParent()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
try {
int ic = itm_count;
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Recommend to Parent";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "Send to parent to approve";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "LEARN_MORE";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1 imp_offers";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-recommend.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "familymarket";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "familymarket";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Recommend to Parent";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "Suggest Task to the Parents";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style";
ret = PHP_API_OK;
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoRecomendToParent()");
return ret;
return 0;
}
//long RecoStartMarketCard( int itm_count, CVars in, CVars &out );
//long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out );
@@ -95,9 +466,10 @@ long WrenchHomeBanners(CVars in, CVars &out) {
char vname[30];
long member_id = REQ_LONG(in, "member_id", 1, -1);
int itm_count= 0;
if( RecoCheckOffers( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } /*ONLY IF OFFER IS GREATER THAN 2 */
if( RecoRecentPastDueTask( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoFamilyWaiting( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoCheckOffers( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } /*ONLY IF OFFER IS GREATER THAN 2 */
if( RecoCheckActiveTask( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoStartMarketCardUS( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoStartMarketCard( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
@@ -122,6 +494,7 @@ long WrenchHomeBanners(CVars in, CVars &out) {
if(itm_count < 3){
if( RecoLearnMore( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoPlayGround( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
}
@@ -298,6 +671,64 @@ long RecoFamilyWaiting( int itm_count, CVars in, CVars &out ){
//return 0;
//}
long RecoPlayGround( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoPlayGround()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
int ic = itm_count;
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Visit Playground";
snprintf(vname, sizeof (vname), "description_%05d", ic);
out[vname] = "Interact with our AI agent, find, upload, and share media.";
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
out[vname] = "PLAYGROUND";
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
out[vname] = "0";
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
out[vname] = "icon1";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/playground.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "resources";
snprintf(vname, sizeof (vname), "action_%05d", ic);
out[vname] = "resources";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "View Tasks";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Playground";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "Interact with our AI agent,share media ";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style lr";
ret = PHP_API_OK;
return ret;
}
long RecoJobOwner( int itm_count, CVars in, CVars &out ){
return 0;
@@ -351,7 +782,7 @@ long RecoRecentPastDueTask( int itm_count, CVars in, CVars &out ){
out[vname] = "Past Due Tasks";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "View you have past due task(s) ";
out[vname] = "View your past due task(s) ";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style lr";
@@ -963,7 +1394,7 @@ long RecoCheckActiveTask( int itm_count, CVars in, CVars &out ){
try {
int ic = itm_count;
long member_id = REQ_LONG(in, "member_id", 1, -1);
res = pgsql_query("SELECT * FROM members_jobs_contract WHERE client_id = %lu AND status =1 AND delivery_dateAND delivery_date > ( now() - interval '1440 minutes' ) ",member_id);
res = pgsql_query("SELECT * FROM members_jobs_contract WHERE client_id = %lu AND status =1 AND delivery_date > ( now() - interval '1440 minutes' ) ",member_id);
if (res != NULL && pgsql_num_rows(res) > 0) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
+403 -13
View File
@@ -13,6 +13,8 @@
#include <curl/curl.h>
#include "jobs.h"
#include "bko.h"
#include "cron_email.h"
#include "payments.h"
long ReviewReminder(CVars in, CVars &out);
long OfferPending(CVars in, CVars &out);
@@ -32,7 +34,14 @@ long ProcessTransferJobs(CVars in, CVars &out);
long ScheduleTransferJobs(CVars in, CVars &out);
long TestNotificationsJobs(CVars in, CVars &out);
long ProcessExpiredOffers(CVars in, CVars &out);
long ScheduleHolidayJobs(CVars in, CVars &out);
long RefreshBlogs(CVars in, CVars &out);
long RefreshPromoActivities(CVars in, CVars &out);
long RegisterPromoPoint(CVars in);
long RegisterPromoAction(CVars in);
long ReferEmailsCleanup();
long ReferEmailsNotification();
long ReferLinkProcessing();
/*
CREATE TABLE cron_jobs (
id SERIAL,
@@ -147,13 +156,385 @@ long sitecrons_calls(CVars in, CVars &out) {
CronTracker(ct, co);
return ProcessExpiredOffers(in, out);
break;
//define('WRB_CRONJOB_HOLIDAY_BROADCAST', 786);
case WRB_CRONJOB_HOLIDAY_BROADCAST:
ct["job_type"]="WRB_CRONJOB_HOLIDAY_BROADCAST"; ct["job_type"].set_valid( true );
ct["description"]="Process Transfer Expired Offers"; ct["description"].set_valid( true );
CronTracker(ct, co);
return ScheduleHolidayJobs(in, out);
break;
case WRB_CRONJOB_APPEMAILS:
ct["job_type"]="WRB_CRONJOB_APPEMAILS"; ct["job_type"].set_valid( true );
ct["description"]="Send Email Batch"; ct["description"].set_valid( true );
CronTracker(ct, co);
return CronSendMail(in, out);
break;
case WRB_CRONJOB_REFRESHBLOG:
ct["job_type"]="WRB_CRONJOB_REFRESHBLOG"; ct["job_type"].set_valid( true );
ct["description"]="Refresh Blog"; ct["description"].set_valid( true );
CronTracker(ct, co);
return RefreshBlogs(in, out);
break;
case WRB_CRONJOB_PROCESS_VUSA:
ct["job_type"]="WRB_CRONJOB_PROCESS_VUSA"; ct["job_type"].set_valid( true );
ct["description"]="Process Virtual Card"; ct["WRB_CRONJOB_PROCESS_VUSA"].set_valid( true );
CronTracker(ct, co);
return AssignVirtualCardWallet(in, out);
break;
case WRB_CRONJOB_PROCESS_PROMO:
ct["job_type"]="WRB_CRONJOB_PROCESS_PROMO"; ct["job_type"].set_valid( true );
ct["description"]="Process Promo Stats"; ct["WRB_CRONJOB_PROCESS_PROMO"].set_valid( true );
CronTracker(ct, co);
return RefreshPromoActivities(in, out);
break;
// define('WRB_CRONJOB_APPEMAILS', 782);
}
logfmt(logINFO, "/sitecrons_calls()");
return ret;
}
long RefreshPromoActivities(CVars in, CVars &out){
logfmt(logINFO, "RefreshPromoActivities() *** **** **** ENTRY");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
out["total_record"] = "0";
const PGresult *res, *resF;
// check if pending
res = pgsql_query("SELECT * FROM promo_member WHERE status = 1 ORDER BY id DESC LIMIT 120");
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);
// check if on pending table
resF = pgsql_query("SELECT status FROM members_pending where LOWER(username)= LOWER('%s')", rec["email"].c_str());
if (resF != NULL && pgsql_num_rows(resF) > 0) {
pgsql_query("UPDATE promo_member SET updated = now(), status=2 WHERE id = %lu ", rec["id"].Long()); // mo
CVars yp;
yp["category"] ="SIGNUP"; yp["category"].set_valid( true );
yp["admin_id"] = rec["admin_id"]; yp["admin_id"].set_valid( true );
yp["description"] = "Sign up was started"; yp["description"].set_valid( true );
RegisterPromoAction(yp);
}
}
}
// check if signup
res = pgsql_query("SELECT * FROM promo_member WHERE status = 2 ORDER BY id DESC LIMIT 20");
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);
// check if on pending table
resF = pgsql_query("SELECT status FROM members where LOWER(username)= LOWER('%s')", rec["email"].c_str());
if (resF != NULL && pgsql_num_rows(resF) > 0) {
pgsql_query("UPDATE promo_member SET updated = now(), status=3 WHERE id = %lu ", rec["id"].Long()); // mo
// now let us register the points
CVars xp;
xp["category"] ="SIGNUP"; xp["category"].set_valid( true );
xp["member_uid"] = rec["uid"]; xp["member_uid"].set_valid( true );
xp["admin_id"] = rec["admin_id"]; xp["admin_id"].set_valid( true );
xp["points"] = "100"; xp["points"].set_valid( true );
RegisterPromoPoint(xp);
}
}
}
// send reports to admins
res = pgsql_query("SELECT * FROM promo_admin WHERE status = 1 ORDER BY updated ASC LIMIT 20");
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);
//rec["points"] = "0"; rec["points"].set_valid( true );
rec["today_signup"] = "0"; rec["today_signup"].set_valid( true );
rec["today_signup_3days"] = "0"; rec["today_signup_3days"].set_valid( true );
rec["today_signup_7days"] = "0"; rec["today_signup_7days"].set_valid( true );
promo_email(WRB_CRONJOB_PROCESS_PROMO, rec, out); // send the reminder email
pgsql_query("UPDATE promo_admin SET updated = now() WHERE id = %lu ", rec["id"].Long()); // mo
}
}
ReferLinkProcessing(); // handles refer links entries
ReferEmailsCleanup(); // clean up account refer
ReferEmailsNotification(); // end emsil if needed
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long ScheduleHolidayJobs(CVars in, CVars &out)");
}
logfmt(logINFO, "/RefreshPromoActivities()");
return ret;
}
long ReferLinkProcessing(){
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
//in["promo"].c_str(), in["limit"].Long()
CVars out, in;
res = pgsql_query(" SELECT refer_link, substring(refer_link,0,9) AS uid_part,email, id ,uid,substring(refer_link,9)::INT AS member_id FROM referlink_signup "
" WHERE status = 1 LIMIT 20");
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);
pgsql_query("UPDATE referlink_signup SET member_id=%lu, status = 2 WHERE id =%lu", rec["member_id"].Long(), rec["id"].Long());
if ( load_db_record(out, "SELECT * from members_pending WHERE refer_link = '%s' ORDER BY id DESC limit 1", rec["refer_link"].c_str())> 0){
CVars x;
x["member_id"] = rec["member_id"];
x["member_id"].set_valid(true);
x["firstname"] = out["firstname"];
x["firstname"].set_valid(true);
x["email"] = rec["email"];
x["email"].set_valid(true);
x["lastname"] = out["lastname"];
x["lastname"].set_valid(true);
int r1, r2, r3;
char refer_link[100];
srand(time(NULL));
r1 = abs(rand()*100000000);
srand(time(NULL));
r2 = abs(rand() * r1);
srand(time(NULL));
r3 = abs(rand() * r2);
sprintf(refer_link, "WRENREF-%09lu-%08lu-%08lu", r1, r2, r3);
x["refer_link"] = refer_link;
x["refer_link"].set_valid(true);
long refer_id = 0;
refer_id = insert_db_record(DBS_VALID, "members_refer_friend", "members_refer_friend_id_seq", x);
if( refer_id > 0){
pgsql_query("UPDATE referlink_signup SET status=5 WHERE id =%lu", rec["id"].Long());
}
}
// pgsql_query("UPDATE referlink_signup SET email_sent=now() WHERE id =%lu", rec["promo_id"].Long());
}
}
return 0;
}
long ReferEmailsNotification(){
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
//in["promo"].c_str(), in["limit"].Long()
CVars out, in;
res = pgsql_query(" SELECT p.id AS promo_id, a.firstname AS send_firstname,a.lastname AS send_lastname,"
" p.firstname,p.lastname, 'REFPROMO-'||p.uid AS refer_link , p.email "
" FROM promo_member p "
" LEFT JOIN promo_admin a ON a.id = p.admin_id "
" WHERE p.email_sent IS NULL AND p.status = 1 LIMIT 20");
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);
promo_email(WRENCHBOARD_PROMOADMIN_ADDLIST, rec, out); // send the reminder email
pgsql_query("UPDATE promo_member SET email_sent=now() WHERE id =%lu", rec["promo_id"].Long());
}
}
return 0;
}
long ReferEmailsCleanup(){
logfmt(logINFO, "ReferEmailsCleanup() *** **** **** ENTRY");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
// check if pending
res = pgsql_query("SELECT id, email ,added, status FROM members_refer_friend WHERE status =1 AND added < now() + '-14 days' LIMIT 20");
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);
// check if on pending table
const PGresult *res1 = pgsql_query("SELECT * FROM members WHERE email='%s'", rec["email"].c_str());
if (res1 != NULL && pgsql_num_rows(res1) > 0) {
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s' AND id=%lu", rec["email"].c_str(), rec["id"].Long());
}
else{
pgsql_query("UPDATE members_refer_friend SET status = 0 WHERE status = 1 AND email = '%s' AND id=%lu", rec["email"].c_str(), rec["id"].Long());
}
}
}
return 0;
}
long RegisterPromoPoint(CVars in){
/*
CREATE TABLE promo_points(
id SERIAL,
uid uuid DEFAULT uuid_generate_v4(),
admin_id INT REFERENCES promo_admin(id),
category VARCHAR(50) NOT NULL,
point INT DEFAULT 0,
added timestamp without time zone DEFAULT now()
);
ALTER TABLE ONLY promo_points
ADD CONSTRAINT promo_points_id_key UNIQUE (id);
ALTER TABLE promo_admin ADD points INT Default 0;
*/
long ret = PHP_API_BAD_PARAM;
//const PGresult *res;
CVars xx;
try {
//long blog_id = REQ_LONG(in, "blog_id", 1, -1);
REQ_STRING (in, "category", 5, 49, "(.*)");
long admin_id = REQ_LONG(in, "admin_id", 1, -1);
long points = REQ_LONG(in, "points", 1, -1);
xx["category"] = in["category"]; xx["category"].set_valid( true );
xx["point"] = in["points"]; xx["point"].set_valid( true );
xx["admin_id"] = in["admin_id"]; xx["admin_id"].set_valid( true );
long point_id = insert_db_record(DBS_VALID, "promo_points", "promo_points_id_seq", xx);
if( point_id > 0 ){
pgsql_query("UPDATE promo_admin SET points= points + %lu WHERE id = %lu ", in["points"].Long(), in["admin_id"].Long());
CVars yp;
yp["category"] ="SIGNUP_POINT";
yp["admin_id"] = in["admin_id"]; yp["admin_id"].set_valid( true );
yp["description"] = "Sign up was completed";
RegisterPromoAction(yp);
ret = PHP_API_OK;
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long RegisterPromoAction(CVars in, CVars &out)");
}
return ret;
}
long RegisterPromoAction(CVars in){
long ret = PHP_API_BAD_PARAM;
CVars xx;
try {
//long blog_id = REQ_LONG(in, "blog_id", 1, -1);
REQ_STRING (in, "category", 5, 49, "(.*)");
REQ_STRING (in, "description", 5, 149, "(.*)");
long admin_id = REQ_LONG(in, "admin_id", 1, -1);
xx["category"] = in["category"]; xx["category"].set_valid( true );
xx["description"] = in["description"]; xx["description"].set_valid( true );
xx["admin_id"] = in["admin_id"]; xx["admin_id"].set_valid( true );
insert_db_record(DBS_VALID, "promo_actions", "promo_actions_id_seq", xx);
ret = PHP_API_OK;
//out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long RegisterPromoAction(CVars in, CVars &out)");
}
return ret;
}
long RefreshBlogs(CVars in, CVars &out){
long ret = PHP_API_BAD_PARAM;
CVars xx;
try {
long blog_id = REQ_LONG(in, "blog_id", 1, -1);
REQ_STRING (in, "banner", 5, 149, "(.*)");
REQ_STRING (in, "title", 5, 149, "(.*)");
const PGresult *res;
res = pgsql_query("SELECT * FROM blog_selections WHERE blog_id = %lu", blog_id);
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);
xx["title"] = in["title"]; xx["title"].set_valid( true );
xx["banner"] = in["banner"]; xx["banner"].set_valid( true );
update_db_record(DBS_VALID, "blog_selections", xx, rec["id"].Long() );
}
else{
xx["blog_id"] = in["blog_id"]; xx["blog_id"].set_valid( true );
xx["title"] = in["title"]; xx["title"].set_valid( true );
xx["banner"] = in["banner"]; xx["banner"].set_valid( true );
blog_id = insert_db_record(DBS_VALID, "blog_selections", "blog_selections_id_seq", xx);
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long RefreshBlogs(CVars in, CVars &out)");
}
logfmt(logINFO, "/RefreshBlogs()");
return ret;
}
long ScheduleHolidayJobs(CVars in, CVars &out){
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM holiday_message WHERE status = 1 AND completed IS NULL ORDER BY id DESC LIMIT 20");
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);
cron_email(WRB_CRONJOB_HOLIDAY_BROADCAST, rec, out); // send the cron email
pgsql_query("UPDATE holiday_message SET status = 5, completed = now() WHERE id = %lu ", rec["id"].Long()); // move the status so no retry
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long ScheduleHolidayJobs(CVars in, CVars &out)");
}
logfmt(logINFO, "/ScheduleHolidayJobs()");
return ret;
}
long ProcessExpiredOffers(CVars in, CVars &out){
char vname[30];
@@ -315,8 +696,8 @@ long TestNotificationsJobs(CVars in, CVars &out){
push_ret = BkoSendPush( xx, out);
//52cee358-759f-42f5-8cfb-d3f77b323c1a
xx["member_uid"] = "52cee358-759f-42f5-8cfb-d3f77b323c1a"; xx["member_uid"].set_valid( true );
xx["push_text"] = "Notification test system...Toks"; xx["push_text"].set_valid( true );
// xx["member_uid"] = "52cee358-759f-42f5-8cfb-d3f77b323c1a"; xx["member_uid"].set_valid( true );
// xx["push_text"] = "Notification test system...Toks"; xx["push_text"].set_valid( true );
push_ret = BkoSendPush( xx, out);
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long TestNotificationsJobs(CVars in, CVars &out)");
@@ -583,16 +964,25 @@ long PastDueWarings(CVars in, CVars &out) {
long SignUpStats(CVars in, CVars &out) {
logfmt(logINFO, "SignUpStats()");
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");
in = out;
alert_email(WRB_CRONJOB_SIGNUP_ALERT, in, out);
try{
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 count(id) AS today_signup_3days FROM members WHERE added::date BETWEEN now() +'-3 day(s)' AND now()::date");
load_db_record(out, "SELECT count(id) AS today_signup_7days FROM members WHERE added::date BETWEEN now() +'-7 day(s)' AND now()::date");
load_db_record(out, "SELECT count(id) AS today_login_24hrs FROM members WHERE last_login::date BETWEEN now() +'-2 day(s)' AND now()::date");
//SELECT count(id) AS today_signup_3days FROM members WHERE added::date BETWEEN now() +'-59 day(s)' AND now()::date
in = out;
alert_email(WRB_CRONJOB_SIGNUP_ALERT, in, out);
} catch (bad_parameter) {
out["action_status"] = "Invalid SignUpStats Action";
}
logfmt(logINFO, "/SignUpStats()");
return 0;
+1 -1
View File
@@ -162,7 +162,7 @@ long member_addrecipient(CVars in, CVars &out) {
try {
REQ_LONG(in, "member_id", 1, -1);
REQ_STRING(in, "bank_code", 2, 3, "(.*)");
REQ_STRING(in, "bank_code", 2, 25, "(.*)");
REQ_STRING(in, "firstname", 2, 49, "(.*)");
REQ_STRING(in, "lastname", 2, 49, "(.*)");
REQ_STRING(in, "account_no", 2, 15, "(.*)");
@@ -137,8 +137,8 @@ long wrenchboard_api_main(CVars in, CVars &out) {
switch (action) {
case 9999099:
return test_email(in, out);
case WRENCHBOARD_TEST_PATH:
return test_just_email(in, out);
break;
@@ -998,7 +998,7 @@ long wrenchboard_api_main(CVars in, CVars &out) {
case WRENCHBOARD_ADD_MONEYRECIPIENT:
REQ_LONG(in, "customerid", 1, -1);
REQ_STRING(in, "bank_code", 1, 5, "(.*)");
REQ_STRING(in, "bank_code", 1,25, "(.*)");
REQ_STRING(in, "lastname", 1, 50, "(.*)");
REQ_STRING(in, "firstname", 1, 50, "(.*)");
REQ_STRING(in, "account_no", 5, 12, "(.*)");
+22 -1
View File
@@ -91,6 +91,14 @@ define('EVENT_PRIORITY_NORMAL', 100);
/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead.
*/
const CARD_REQUESTED = 1;
const CARD_HOLDER_CREATED = 10;
const CARD_OWNER_ACTIVE = 30;
const CARD_ASSIGNED = 40;
const CARD_ACTIVATE_CARD = 50;
const CARD_WALLET_ADD = 60;
define('EVENT_PRIORITY_HIGH', 10);
define('WRB_JOB_CRONJOB',770);
@@ -262,6 +270,10 @@ define('WRENCHBOARD_ACCOUNT_UPDATE_PREFS', 11066);
define('WRENCHBOARD_ACCOUNT_MYPAGE', 11070);
define('WRENCHBOARD_ACCOUNT_PAGEINTRO', 11071);
const WRENCHBOARD_LOAD_REFERLINK = 11072;
const WRENCHBOARD_VIRTUAL_CARDADD = 11080;
const WRENCHBOARD_VIRTUAL_FAMILY_CARD = 11082;
define('WRENCHBOARD_ACCOUNT_PRICE_COMBO', 11171);
define('WRENCHBOARD_ACCOUNT_JOBPOST_DURATION', 11173);
@@ -289,6 +301,7 @@ const WRENCHBOARD_PICTURE_FAMBANNER= 11304;
const WRENCHBOARD_PICTURE_FAMMEMBER = 11305;
const WRENCHBOARD_RESOURCE_MYFILES = 11307;
const WRENCHBOARD_MYFILES_LIST = 11309;
const WRENCHBOARD_MYREFLINK = 11310;
define('WRENCHBOARD_USER_DELETEACC', 11990);
define('WRENCHBOARD_ACCOUNT_END', 11999);
@@ -464,10 +477,18 @@ define('PAY_MODE_BONUS', 9);
define('APPROVED_BALANCE', 5);
define('DISAPROVE_BALANCE', 3);
const WRENCHBOARD_TEST_PATH = 9999099;
const WRENCHBOARD_MARKET_START = 220000;
const WRENCHBOARD_MARKET_PLAN01_START = 220001;
const WRENCHBOARD_MARKET_PLAN01_NEXT1 = 220003;
const WRENCHBOARD_PROMOADMIN_LOGIN = 220010;
const WRENCHBOARD_PROMOADMIN_ASSIGNTASK = 220012;
const WRENCHBOARD_PROMOADMIN_GETMEMBER = 220013;
const WRENCHBOARD_PROMOADMIN_GETLIST = 220014;
const WRENCHBOARD_PROMOADMIN_ADDLIST = 220015;
const WRENCHBOARD_PROMOADMIN_ACTIONLIST = 220016;
const WRENCHBOARD_MARKET_END = 229999;
+21
View File
@@ -40,7 +40,21 @@ $routes->set404Override();
$routes->post('/en/promo/api/v1/start', 'Promo::promoStart');
$routes->post('/en/promo/api/v1/tasks', 'Promo::promoTask');
$routes->post('/en/promoadmin/api/v1/auth', 'Promo::promoAuth');
$routes->post('/en/promoadmin/api/v1/getlist', 'PromoAdmin::promoList');
$routes->post('/en/promoadmin/api/v1/list', 'PromoAdmin::promoAddRef');
$routes->post('/en/promoadmin/api/v1/getmember', 'PromoAdmin::promoGetMember');
$routes->post('/en/promoadmin/api/v1/assigntask', 'PromoAdmin::promoAssignTask');
$routes->post('/en/promoadmin/api/v1/getactions', 'PromoAdmin::promoActionList');
$routes->get('/en/flow/api/v1/appemails', 'AirFlow::flowAppEmails');
$routes->get('/en/flow/api/v1/new-account', 'AirFlow::flowNewAccount');
$routes->get('/en/flow/api/v1/offer-pending', 'AirFlow::flowOfferPending');
$routes->get('/en/flow/api/v1/due-reminder', 'AirFlow::flowDueReminder');
@@ -54,7 +68,14 @@ $routes->get('/en/flow/api/v1/scheduletransfer', 'AirFlow::flowScheduleTrans
$routes->get('/en/flow/api/v1/testnotifications', 'AirFlow::flowTestNotifications');
$routes->get('/en/flow/api/v1/automarket01', 'AirFlow::flowAutoMarket01');
$routes->get('/en/flow/api/v1/offersmissed', 'AirFlow::flowOfferMissed');
$routes->get('/en/flow/api/v1/holidaybroadcast', 'AirFlow::flowHolidayBroadCast');
$routes->get('/en/flow/api/v1/refreshresoucres', 'AirFlow::flowRefreshResources');
$routes->get('/en/flow/api/v1/stripe-card', 'AirFlow::flowStripeCard');
$routes->get('/en/flow/api/v1/promoprocess', 'AirFlow::flowPromoProcess');
//$routes->group('/en/wrench/api/v1/', static function ($routes) {
// $routes->get('/stripe-card', 'AirFlow::flowStripeCard');
//});
include "RoutesV1.php";
+48 -30
View File
@@ -8,6 +8,11 @@ $routes->get('/', 'Home::index');
$routes->get('/en/wrench/api/v1/test','Home::test');
$routes->group('/backoffice/svs/bko/', static function ($routes) {
$routes->get('generics','BackOffice::backofficegate');
$routes->post('generics','BackOffice::backofficegate');
});
$routes->post('/en/wrench/api/v1/promoverify', 'Promo::promoVerify');
$routes->post('/en/wrench/api/v1/playground', 'WrenchPlayGround::apigate');
@@ -21,6 +26,8 @@ $routes->post('/en/wrench/api/v1/faqdata', 'WrenchFaq::apigate');
$routes->post('/en/wrench/api/v1/helpdata', 'WrenchFaq::helpgate');
$routes->post('/en/wrench/api/v1/learnmore', 'WrenchFaq::learnMoreUser');
$routes->post('/en/wrench/api/v1/loadrefer', 'WrenchAccount::loadRefer');
$routes->post('/en/wrench/api/v1/apigate', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/generics', 'WrenchApi::apigate');
@@ -37,10 +44,12 @@ $routes->post('/en/wrench/api/v1/completemobileuser', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/startresetpasword', 'WrenchAuth::passwordReset'); //'WrenchApi::apigate'
// $routes->post('/en/wrench/api/v1/userlogin', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/userlogin', 'WrenchAuth::userLogin'); // New routes defined
$routes->post('/en/wrench/api/v1/qrlogin', 'WrenchAuth::qrLogin'); //'WrenchApi::apigate'
$routes->post('/en/wrench/api/v1/loginpromo', 'WrenchAuth::promoLogin'); //'WrenchApi::apigate'
$routes->group('/en/wrench/api/v1/', static function ($routes) {
$routes->post('authlogin', 'WrenchAuth::userLogin'); // New routes defined
$routes->post('userlogin', 'WrenchAuth::userLogin'); // To be retired
$routes->post('qrlogin', 'WrenchAuth::qrLogin'); //'WrenchApi::apigate'
$routes->post('loginpromo', 'WrenchAuth::promoLogin'); //'WrenchApi::apigate'
});
$routes->post('/en/wrench/api/v1/homebanners', 'WrenchBanners::usersBanners'); // 'WrenchApi::apigate'
$routes->post('/en/wrench/api/v1/startjoblist', 'WrenchApi::apigate');
@@ -57,7 +66,7 @@ $routes->post('/en/wrench/api/v1/offerslist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/offersresponse', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/activejoblist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/loadprofile', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/loadprofile', 'WrenchUser::loadProfile');
$routes->post('/en/wrench/api/v1/updateprofile', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/account', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/message', 'WrenchApi::apigate');
@@ -77,19 +86,20 @@ $routes->post('/en/wrench/api/v1/topupresult', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/preferences', 'WrenchGeneralData::usersPreferences'); // 'WrenchApi::apigate'
$routes->post('/en/wrench/api/v1/setpreferences', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanageragree', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanagerlist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanagerfiles', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanageroffers', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanageractive', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanagercreatejob', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanagerupdatejob', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobmanagerdeletejob', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobgrouplist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/jobgroupadd', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/groupmemberadd', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/groupmemberdel', 'WrenchApi::apigate');
$routes->group('/en/wrench/api/v1/', static function ($routes) {
$routes->post('jobmanageragree', 'WrenchApi::apigate');
$routes->post('jobmanagerlist', 'WrenchJobManager::jobManagerList');
$routes->post('jobmanagerfiles', 'WrenchApi::apigate');
$routes->post('jobmanageroffers', 'WrenchJobManager::jobManagerManageOffers');
$routes->post('jobmanageractive', 'WrenchJobManager::jobManagerActive');
$routes->post('jobmanagercreatejob', 'WrenchApi::apigate');
$routes->post('jobmanagerupdatejob', 'WrenchApi::apigate');
$routes->post('jobmanagerdeletejob', 'WrenchApi::apigate');
$routes->post('jobgrouplist', 'WrenchApi::apigate');
$routes->post('jobgroupadd', 'WrenchApi::apigate');
$routes->post('groupmemberadd', 'WrenchApi::apigate');
$routes->post('groupmemberdel', 'WrenchApi::apigate');
});
$routes->post('/en/wrench/api/v1/activetaskslist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/tasksreport', 'WrenchApi::apigate');
@@ -98,17 +108,19 @@ $routes->post('/en/wrench/api/v1/tasksreport', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/mypageload', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/mypageintro', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/familylist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/familylist', 'WrenchFamily::familyList');
//$routes->post('/en/wrench/api/v1/familywallet', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/getwallets', 'WrenchApi::apigate'); // to be retired
$routes->post('/en/wrench/api/v1/wallets', 'WrenchWallet::getWallet');
$routes->post('/en/wrench/api/v1/kidwallets', 'WrenchWallet::getKidWallet');
$routes->post('/en/wrench/api/v1/wallets/escrols', 'WrenchWallet::getEscrols');
$routes->post('/en/wrench/api/v1/getwallets', 'WrenchApi::apigate'); // to be retired
// WALLET FUNCTIONS
$routes->group('/en/wrench/api/v1/', static function ($routes) {
$routes->post('wallets', 'WrenchWallet::getWallet');
$routes->post('kidwallets', 'WrenchWallet::getKidWallet');
$routes->post('wallets/escrols', 'WrenchWallet::getEscrols');
$routes->post('wallets/card/request', 'WrenchWallet::requestVirtualCard');
$routes->post('wallets/card/familyrequest', 'WrenchWallet::requestFamilyVirtualCard');
});
$routes->post('/en/wrench/api/v1/familywallet/redeem', 'WrenchWallet::redeemOptions');
$routes->post('/en/wrench/api/v1/familywallet/redeem/options', 'WrenchWallet::redeemOptions');
@@ -133,7 +145,7 @@ $routes->post('/en/wrench/api/v1/connectmembers', 'WrenchFamily::familyCon
$routes->post('/en/wrench/api/v1/connectinvite', 'WrenchFamily::familyConnectInvite');
$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchFamily::familyRewardHx'); // WrenchApi::apigate
$routes->post('/en/wrench/api/v1/familytransferstart', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/familytransfer', 'WrenchApi::apigate');
@@ -176,6 +188,11 @@ $routes->post('/en/wrench/api/v1/sitecontact', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/signupcountry', 'WrenchGeneralData::signUpCountry');
$routes->post('/en/wrench/api/v1/userscards', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/countrystate', 'WrenchResources::getCountryStates');
$routes->post('/en/wrench/api/v1/resources', 'WrenchResources::website');
$routes->post('/en/wrench/api/v1/askresources', 'WrenchResources::aigate');
$routes->post('/en/wrench/api/v1/couponhx', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/couponpending', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/couponredeem', 'WrenchApi::apigate');
@@ -192,7 +209,9 @@ $routes->post('/en/wrench/api/v1/assigntask', 'WrenchJobs::assignTask' ); //
$routes->post('/en/wrench/api/v1/assignmediatask','WrenchJobs::assignTask' ); //'WrenchApi::apigate'
$routes->post('/en/wrench/api/v1/uploads', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/myfiles', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/myfiles', 'WrenchUser::UsersFiles'); //'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/sendreferlink','WrenchUser::UsersRefLink'); //'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/marketmessage', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/marketinterest', 'WrenchJobs::sendJobInterest'); //'WrenchApi::apigate'
@@ -213,8 +232,7 @@ $routes->post('/en/wrench/api/v1/offersinterestproc', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/offerinterestmsg', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/offerinterestlistmsg', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/resources', 'WrenchResources::website');
$routes->post('/en/wrench/api/v1/askresources', 'WrenchResources::aigate');
$routes->post('/en/wrench/api/v1/setaccsettings', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/getaccsettings', 'WrenchApi::apigate');
View File
+155 -14
View File
@@ -13,8 +13,14 @@ define('WRB_CRONJOB_GROUPJOBS', 778);
define('WRB_CRONJOB_TESTNOTIFICATIONS', 779);
define('WRB_CRONJOB_SCHEULETRANSFER', 780);
define('WRB_CRONJOB_PROCESSTRANSFER', 781);
define('WRB_CRONJOB_APPEMAILS', 782);
define('WRB_CRONJOB_REFRESHBLOG', 783);
define('WRB_CRONJOB_PROCESS_VUSA', 784);
define('WRB_CRONJOB_AUTO_OFFEREXPIRE', 785);
define('WRB_CRONJOB_HOLIDAY_BROADCAST', 786);
define('WRB_CRONJOB_PROCESS_PROMO', 788);
define('WRB_CRONJOB_PENDINGSM', 790) ;
@@ -26,10 +32,44 @@ class AirFlow extends BaseController
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
$in["action"] = WRB_CRONJOB_APPEMAILS;
$in["call_action"] = WRB_CRONJOB_APPEMAILS;
log_message('critical', "AirFlow::flowNewAccount ********* ALL ".serialize($in) );
$ret['WRB_CRONJOB_APPEMAILS'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return [];
}
public function flowRefreshResources(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
log_message('critical', "AirFlow::flowRefreshResources ********* ALL ".serialize($in) );
return []; //json_encode( $final_out );
}
public function flowAppEmails(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRB_JOB_CRONJOB;
$in["call_action"] = WRB_CRONJOB_APPEMAILS;
$out =[];
log_message('critical', "AirFlow::flowAppEmails ********* ALL ".serialize($in) );
$ret['WRB_CRONJOB_APPEMAILS'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
}
public function flowHolidayBroadCast(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRB_JOB_CRONJOB; //WRB_CRONJOB_AUTO_OFFEREXPIRE
$in["call_action"] = WRB_CRONJOB_HOLIDAY_BROADCAST;
$out =[];
log_message('critical', "AirFlow::flowHolidayBroadCast ********* ALL ".serialize($in) );
$ret['WRB_CRONJOB_HOLIDAY_BROADCAST'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
}
public function flowOfferPending(){
$raw_json = file_get_contents('php://input');
@@ -47,19 +87,17 @@ class AirFlow extends BaseController
$out =[];
log_message('critical', "AirFlow::flowDueReminder ********* ALL ".serialize($in) );
return $this->jobLevelAlerts();
// return []; //json_encode( $final_out );
}
public function flowOfferMissed(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRB_JOB_CRONJOB; //WRB_CRONJOB_AUTO_OFFEREXPIRE
$in["action"] = WRB_JOB_CRONJOB;
$in["call_action"] = WRB_CRONJOB_AUTO_OFFEREXPIRE;
$out =[];
log_message('critical', "AirFlow::flowOfferMissed ********* ALL ".serialize($in) );
$ret['WRB_CRONJOB_AUTO_OFFEREXPIRE'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
return [];
}
public function flowInterestcount(){
@@ -77,13 +115,96 @@ class AirFlow extends BaseController
}
return []; //json_encode( $final_out );
}
public function flowStripeCard():array{
log_message('critical', "AirFlow::flowStripeCard ********* IN CALL " );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
/* GET LIST IN THE LIMIT AT STATUS */
$in['limit'] = 2;
$in['status'] = CARD_REQUESTED;
$local_url = "http://".$this->micro_service_net1.":3038/cardapplications";
$out = $this->APIcall('POST', $local_url, $in);
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($out) );
foreach ($out['result_list'] as $index=>$item){
if ( $item['request_id'] !='' && $item['request_uid'] !=''){
$local_url = "http://".$this->micro_service_net1.":3038/createCardHolder";
$out = $this->APIcall('POST', $local_url, $item);
}
}
//LET US GET TEH AGREEMENT FIXED
$in['limit'] = 2;
$in['status'] = CARD_HOLDER_CREATED; // pick from holders
$local_url = "http://".$this->micro_service_net1.":3038/cardapplications";
$outX = $this->APIcall('POST', $local_url, $in);
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($outX) );
foreach ($outX['result_list'] as $index=>$item){
if ( $item['request_id'] !='' && $item['request_uid'] !=''){
$item['aggrement_ip'] = '76.209.103.227';
$local_url = "http://".$this->micro_service_net1.":3038/acceptterms";
$out = $this->APIcall('POST', $local_url, $item);
}
}
//LET US CREATE THE CARDS NOW
$in['limit'] = 2;
$in['status'] = CARD_OWNER_ACTIVE; // pick from holders
$local_url = "http://".$this->micro_service_net1.":3038/cardapplications";
$outY = $this->APIcall('POST', $local_url, $in);
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($outY) );
foreach ($outY['result_list'] as $index=>$item){
if ( $item['request_id'] !='' && $item['request_uid'] !=''){
$item['aggrement_ip'] = '76.209.103.227';
$local_url = "http://".$this->micro_service_net1.":3038/createcard";
$out = $this->APIcall('POST', $local_url, $item);
}
}
// work on the list
//LET US ACTIVATE THE CARDS NOW
$in['limit'] = 2;
$in['status'] = CARD_ASSIGNED; // pick from holders
$local_url = "http://".$this->micro_service_net1.":3038/cardapplications";
$outZ = $this->APIcall('POST', $local_url, $in);
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($outZ) );
foreach ($outZ['result_list'] as $index=>$item){
if ( $item['request_id'] !='' && $item['request_uid'] !=''){
$item['aggrement_ip'] = '76.209.103.227';
$local_url = "http://".$this->micro_service_net1.":3038/activate";
$out = $this->APIcall('POST', $local_url, $item);
}
}
//LET US CREATE THE WALLET NOW
$in['limit'] = 2;
$in['status'] = CARD_ACTIVATE_CARD; // pick from holders
$local_url = "http://".$this->micro_service_net1.":3038/cardapplications";
$outZ = $this->APIcall('POST', $local_url, $in);
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($outZ) );
foreach ($outZ['result_list'] as $index=>$in){
if ( $in['request_id'] !='' && $in['request_uid'] !=''){
$in["action"] =WRB_JOB_CRONJOB;
$in['call_action'] = WRB_CRONJOB_PROCESS_VUSA;
$in['one_limit'] = 3;
$this->wrenchboard->wrenchboard_api($in, $out);
}
}
log_message('critical', "AirFlow::flowStripeCard ********* ALL ".serialize($in) );
return []; //json_encode( $final_out );
}
public function flowApproveReminder(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
log_message('critical', "AirFlow::flowApproveReminder ********* ALL ".serialize($in) );
return []; //json_encode( $final_out );
return [];
}
public function flowAutoMarket01(){
@@ -112,7 +233,7 @@ class AirFlow extends BaseController
$in['one_limit'] = 10; //remove this
$in['limit'] = 10;
$ret['WRB_CRONJOB_PROCESSTRANSFER'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
return [];
}
public function flowScheduleTransfer(){
@@ -127,7 +248,7 @@ class AirFlow extends BaseController
$in['action'] = WRB_JOB_CRONJOB;
$in['call_action'] = WRB_CRONJOB_SCHEULETRANSFER;
$in['one_limit'] = 10; //remove this
$in['one_limit'] = 10;
$in['limit'] = 10;
$ret['WRB_CRONJOB_SCHEULETRANSFER'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
@@ -144,15 +265,29 @@ class AirFlow extends BaseController
$in['one_limit'] = 10; //remove this
$in['limit'] = 10;
$ret['WRB_CRONJOB_TESTNOTIFICATIONS'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
return [];
}
public function flowPromoProcess(){
log_message('critical', "***** ***** AirFlow::flowPromoProcess ****" );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
log_message('critical', "AirFlow::flowPromoProcess ********* ALL ".serialize($in) );
$in["loc"] = $_SERVER["REMOTE_ADDR"]; //
$in["action"] =WRB_JOB_CRONJOB;
$in['call_action'] = WRB_CRONJOB_PROCESS_PROMO;
$in['one_limit'] = 10; //remove this
$in['limit'] = 10;
$ret['WRB_CRONJOB_PROCESS_PROMO'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return [];
}
public function flowSendNotifications(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
log_message('critical', "AirFlow::flowApproveReminder ********* ALL ".serialize($in) );
log_message('critical', "AirFlow::flowSendNotifications ********* ALL ".serialize($in) );
$in["loc"] = $_SERVER["REMOTE_ADDR"];
$in["action"] =WRB_JOB_CRONJOB;
$in['call_action'] = WRB_CRONJOB_NOTIFICATIONS;
@@ -191,6 +326,16 @@ class AirFlow extends BaseController
$res1= $rawData['payload']; //[0]['payload'];
$this->saveCache($endpoint,$res1);
}
$in['action'] = WRB_JOB_CRONJOB;
$in['call_action'] = WRB_CRONJOB_REFRESHBLOG;
foreach ( $res1['blograndom'] AS $item){
$item['action'] = WRB_JOB_CRONJOB;
$item['call_action'] = WRB_CRONJOB_REFRESHBLOG;
$ret_update = (new \App\Models\BackendModel())->wrenchboard_api($item, $outX);
}
log_message('critical', "AirFlow::flowRefreshBlog ********* ALL ".serialize($in) );
return []; //json_encode( $final_out );
}
@@ -203,10 +348,6 @@ class AirFlow extends BaseController
$in['one_limit'] = 3;
$ret['WRB_CRONJOB_JOBDUE_REMINDER'] = $wrenchboard->wrenchboard_api($in, $out);
//
// $in['call_action'] = WRB_CRONJOB_PENDOFFER_ALERT;
// $in['one_limit'] = 3;
// $ret['WRB_CRONJOB_PENDOFFER_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
$in['call_action'] = WRB_CRONJOB_JOBDUE_PAYMENTS;
$in['one_limit'] = 3;
@@ -224,7 +365,7 @@ class AirFlow extends BaseController
// $out['internal_return'] = $ret;
$out = $ret;
log_message('critical', "WrenchCrons ===> 0001");
log_message('critical', "jobLevelAlerts ===> 0001");
//$response = []; //json_decode($complete, true);
return $this->response->setJson($out);
}
+96
View File
@@ -0,0 +1,96 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class BackOffice extends BaseController
{
use ResponseTrait;
protected $request;
public function index()
{
return '';
}
public function backofficegate()
{
log_message('critical', "Back Office Call 0001");
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
$local_out = []; // use local out to send output when the result is not from the extenstion
$ret = -1;
header("Access-Control-Allow-Origin: *");
header("Access-Control-Expose-Headers: Access-Control-Allow-Origin");
header("Access-Control-Allow-Headers: Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With");
header("Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS");
header('Content-type: application/json');
if ("OPTIONS" === $_SERVER['REQUEST_METHOD']) {
exit();
}
$endpoint = strtolower(str_replace('/svs/bko/', '', strtok($_SERVER['REQUEST_URI'], '?')));
$id = 0; // update, get & delete actions require ID
if (substr($endpoint, 0, 19) == 'gettransportrequest' || substr($endpoint, 0, 13) == 'updateprofile') {
$endpoint = strtok($endpoint, '/');
$id = strtok('/');
}
// if (!isset($endpoints[$endpoint])) {
// header('HTTP/1.1 400 Bad Request');
// header('Status: 400 Bad Request');
// echo "{\"status\":\"Invalid endpoint url WRB\"}";
// exit();
// }
//
// $methods = $endpoints[$endpoint];
//
// if (array_search($_SERVER['REQUEST_METHOD'], $methods) === false) {
// header('HTTP/1.1 405 Method Not Allowed');
// header('Status: 405 Method Not Allowed');
// echo "{\"status\":\"Invalid request method\"}";
// exit();
// }
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$in = $this->flatten(json_decode(file_get_contents('php://input'), true));
}
if ($_SERVER["REQUEST_METHOD"] == "PUT") {
parse_str(file_get_contents('php://input'), $in);
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$in = $_GET;
}
$in["loc"] = $_SERVER["REMOTE_ADDR"];
switch ($endpoint) {
case 'generics':
break;
}
$in["pid"] = 100;
$out = [];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->respond($this->summaryReturnData($in,$out,[]), 200);
}
private function flatten($data, $parentkey = "") {
$result = array();
foreach ($data as $key => $val) {
if (is_array($val)) {
$result = array_merge($result, flatten($val, $parentkey . $key . "_"));
} else {
$result[$parentkey . $key] = $val;
}
}
return $result;
}
}
+105 -16
View File
@@ -40,12 +40,20 @@ abstract class BaseController extends Controller
*/
protected $helpers = [];
private $cache_tag='NONE';
private $cache_server;
//private $cache_server='10.0.0.32';
public $current_env=0;
public $primary_image_sever='';
public $server_tag='';
public $website_url='';
public $wrenchboard=null;
public $micro_service_net1;
public $user_server_name ='';
public $allSettings = [];
public $show_extra_wallet = 0;
/**
* Constructor.
*/
@@ -63,6 +71,19 @@ abstract class BaseController extends Controller
$this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$this->server_tag = $this->getSiteConfigurations("system.server_tag");
$this->micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.1
$this->user_server_name = $this->getSiteConfigurations("system.server_name"); // 'https://dev-users.wrenchboard.com';
$this->show_extra_wallet = $this->getSiteConfigurations("system.show_extra_wallet");
$this->website_url = $this->getSiteConfigurations("system.website_url");
//
$this->getSettings(''); // help create all settings data
// $appConfig = config('Cache');
// $appConfig->redis['host'] = $this->getSiteConfigurations("system.cache_host");
// $this->cache_server = cache()->initialize($appConfig);
//
// var_dump($appConfig->redis['host']);
// exit();
//$this->cache_server = $this->getSiteConfigurations("system.cache_host");
// $redis = [
@@ -76,7 +97,6 @@ abstract class BaseController extends Controller
// //$this->load->driver('cache', $redis);
}
public function getIpData(){
//$ip_loc="0.0.0.0";
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
@@ -88,6 +108,9 @@ abstract class BaseController extends Controller
}
return $ip_loc;
}
public function saveCache($cacheKey,$data,$timeLine=5000){
$cacheKey = $this->cache_tag."-".$cacheKey;
// $cache = \Config\Services::cache();
@@ -116,10 +139,15 @@ abstract class BaseController extends Controller
public function deleteCache($cacheKey){
$data = [];
$cacheKey = $this->cache_tag."-".$cacheKey;
if (cache($cacheKey)) {
// echo 'Getting Data From Cache!<br>';
$data = unserialize(cache()->delete($cacheKey));
try {
if (cache($cacheKey)) {
// echo 'Getting Data From Cache!<br>';
$data = unserialize(cache()->delete($cacheKey));
}
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
return $data;
}
private function data_stringify($data) {
@@ -303,6 +331,9 @@ abstract class BaseController extends Controller
public function procOfferInterest($in) {
$proc = $in['proc'];
$in['interest'] = 0;
if ( !isset($in["strict_timeline"]) ) {
$in["strict_timeline"] =0;
}
switch ($proc) {
case 'ACCEPT':
$in['interest'] = JOB_INTEREST_ACCEPT;
@@ -412,6 +443,7 @@ abstract class BaseController extends Controller
}
public function APIcall($method, $url, $data) {
if(!is_array($data)) $data =[]; //
// $curl = curl_init();
$curl = curl_init($url);
switch ($method) {
@@ -502,23 +534,35 @@ wrenchboard=#
$final_out["active_tasks_list"] = $extraOut['activetaskslist'];
}
$final_out["environment"] = $this->current_env + 0;
$final_out["session_image_server"] = $this->primary_image_sever;
$final_out["server_tag"] = $this->server_tag;
$final_out["language"] = "en";
//$final_out["ip_loc"] = $this->getIpData();
$final_out["current_version"] = 20240306;
$final_out["family_types"] = $this->familyTypes();
$final_out["history_types"] = $this->historyTypes();
$final_out["generative_types"] = $this->generativeTypes();
$final_out["refer_link"] = "https://www.wrenchboard.com";
return json_encode( $final_out );
$final_out['user_server_name'] = $this->user_server_name;
$final_out["environment"] = $this->current_env + 0;
$final_out["session_image_server"] = $this->primary_image_sever;
$final_out["server_tag"] = $this->server_tag;
$final_out["language"] = "en";
//$final_out["ip_loc"] = $this->getIpData();
$final_out["current_version"] = 20250614;
$final_out["family_types"] = $this->familyTypes();
$final_out["history_types"] = $this->historyTypes();
$final_out["generative_types"] = $this->generativeTypes();
return $final_out ;
}
public function blogData($endpoint,$raw_array)
{
$res1 = $this->getCache($endpoint);
if (count($res1)==0){
$rawData = $this->apiData();
$res1= $rawData['payload']; //[0]['payload'];
$this->saveCache($endpoint,$res1);
}
return $res1;
}
protected $db;
public $con_name = 'wrench_dockerblog'; // 'wrench_blog';
protected function apiData($blog_id=0) {
protected function apiData($blog_id=0) :array {
$this->db = \Config\Database::connect($this->con_name);
$data = array();
$extra_filter = "";
@@ -548,6 +592,7 @@ wrenchboard=#
$randomIndex = rand(1, $totalCount);
$data['payload']['featured'] = $data['payload']['blogdata'][$randomIndex ];
$data['payload']['blograndom'] = $this->BlogRandom();
$data['payload']['image_url'] = 'https://blog.wrenchboard.com/wp-content/uploads/';
$data['payload']['blog_url'] = 'https://blog.wrenchboard.com/';
$data['payload']['total'] = $totalCount;
@@ -558,4 +603,48 @@ wrenchboard=#
return $data;
}
private function BlogRandom(){
$mysql ="
SELECT p1.id AS blog_id, p1.post_title AS title,
CONCAT('https://blog.wrenchboard.com/wp-content/uploads/',wm2.meta_value) AS banner FROM wp_posts p1 LEFT JOIN wp_postmeta wm1
ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' )
LEFT JOIN
wp_postmeta wm2
ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL )
WHERE
p1.post_status='publish'
AND p1.post_type='post'
ORDER BY RAND() DESC LIMIT 5
";
log_message('critical', "BlogRandom Query -> ".$mysql );
$query = $this->db->query($mysql);
return $query->getResult('array');
}
protected function getSettings($settingkey, $defaultVal=''){
$out=[];
$in=[];
$endpoint = "SETTINGS";
$out = $this->getCache($endpoint);
if (!is_array($out) || count($out)==0 ) {
$local_url = "http://".$this->micro_service_net1.":3037/settings";
$out = $this->APIcall('GET', $local_url, $in);
if (count($out['result_list']) > 0 ){ // dont cache empty
$this->saveCache($endpoint,$out,55500);
}
}
if (is_array($out) && count($out['result_list']) > 0 ) {
$this->allSettings = $out['result_list'];
foreach ($this->allSettings as $index => $item) {
if ($item['name'] == $settingkey){
return $item['val'];
}
}
// return (isset($out['result_list'][$settingkey])) ? $out['result_list'][$settingkey]: $defaultVal;
}
return $defaultVal;
}
}
+16 -3
View File
@@ -2,11 +2,14 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class Home extends BaseController
{
use ResponseTrait;
public function index()
{
$this->mongoDbTest();
// $this->mongoDbTest();
$data['envID'] = getenv('ENV_ID');
$data['home_background'] = getenv('HOME_PAGE_BACKGROUND');
return view('welcome_message',$data);
@@ -14,8 +17,18 @@ class Home extends BaseController
public function test()
{
echo "hello world, from home controller";
phpinfo();
//const WRENCHBOARD_TEST_PATH = 9999099;
//echo "hello world, from home controller";
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
$in["action"] = WRENCHBOARD_TEST_PATH;
$in["dummy"] ="This is a dummy message for test";
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function mongoDbTest(){
$client = new \MongoDB("mongodb://chiefsoft:may12002@10.0.0.32:27017/","mongoClient");
+69 -4
View File
@@ -21,16 +21,19 @@ class Promo extends BaseController
// $in["promo_owner"] = $promoOwner;
log_message('critical', "Promo::promoStart ********* ALL ".serialize($in) );
$in["loc"] = $_SERVER["REMOTE_ADDR"];
$in['limit'] = 10;
// $in["loc"] = $_SERVER["REMOTE_ADDR"];
// $in['limit'] = 10;
// $out["firstname"] = "Firstname";
// $out["promo_title"] = "This is the promo title";
// $out["promo_description"] = "This is the promo description , This is the promo description ,This is the promo description ,This is the promo description ,This is the promo description ,This is the promo description ,This is the promo description ,";
$out["site_name"]= "WrenchBoard";
$out["server_name"]= "https://www.wrenchboard.com";
$out['yyyy'] = '2024';
$out['user_server_name'] = 'https://dev-users.wrenchboard.com';
//$out['yyyy'] = '2024';
//$out['user_server_name'] = $this->getSiteConfigurations("system.server_name"); // 'https://dev-users.wrenchboard.com';
//log_message('critical', "Promo::user_server_name **** user_server_name ". $out["user_server_name"] );
log_message('critical', "Promo::promoStart ********* OUT ".serialize($out) );
$in['action'] = -1; // we dont need reformating on this data
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
@@ -94,4 +97,66 @@ class Promo extends BaseController
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoAuth(){
log_message('critical', "***** ***** promoAuth::userLogin ****" );
// $in = $this->request->getPostGet();
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_PROMOADMIN_LOGIN;
if (!isset($in["login_mode"])){
$in["login_mode"] = MOBILE_LOGIN;
}
// make safe for redis
$outF["username"] = str_replace("@", "_", $in["username"]);
$outF["username"] = str_replace(".", "_", $outF["username"]);
$outF["original_username"] = $in["username"];
$outF["loc"] = $in["loc"];
$fail_endpoint = "PROMO-LOGIN_FAILED-".$outF["username"]."-";
//===================REDIS DATA IN CASE OF FAIL
$out_redis = $this->getCache($fail_endpoint); // try find in cache
if (isset($out_redis["fail_count"]) && $out_redis["fail_count"] > 2){
// we need stop here
log_message('critical', "Danger ***** ***** promoAuth::userLogin FAIL = ".$out_redis["fail_count"] );
}else{
$outF["fail_count"] = isset( $out_redis["fail_count"] ) ? $out_redis["fail_count"]+1:1;
}
$out=[];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** promoAuth::userLogin Ret = ".$ret );
if ( $out['internal_return'] == 100 ){
$endpoint = "PROMO-USER_SESSION-". str_pad($out["member_id"], 12, "0", STR_PAD_LEFT) ."-";
log_message('critical', "***** ***** promoAuth::promoAuth USER_SESSION = ".$endpoint );
$this->saveCache($endpoint,$out,15000);
}else
{
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$fail_endpoint );
$this->saveCache($fail_endpoint,$outF,15000);
}
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoList(){
log_message('critical', "***** ***** Promo::promoList ****" );
// $in = $this->request->getPostGet();
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoAddRef(){
log_message('critical', "***** ***** Promo::promoAddRef ****" );
// $in = $this->request->getPostGet();
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
}
+65
View File
@@ -0,0 +1,65 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class PromoAdmin extends BaseController
{
use ResponseTrait;
public function promoList(){
log_message('critical', "***** ***** PromoAdmin::promoList ****" );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
$in["action"] = WRENCHBOARD_PROMOADMIN_GETLIST;
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoActionList(){
//#define WRENCHBOARD_PROMOADMIN_ACTIONLIST 220016
log_message('critical', "***** ***** PromoAdmin::promoActionList ****" );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
$in["action"] = WRENCHBOARD_PROMOADMIN_ACTIONLIST;
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoAddRef(){
log_message('critical', "***** ***** PromoAdmin::promoAddRef ****" );
// $in = $this->request->getPostGet();
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
$in["action"] = WRENCHBOARD_PROMOADMIN_ADDLIST;
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoGetMember(){
log_message('critical', "***** ***** promoGetMember::promoAddRef ****" );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
$in["action"] = WRENCHBOARD_PROMOADMIN_GETMEMBER;
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function promoAssignTask(){
log_message('critical', "***** ***** promoGetMember::promoAssignTask ****" );
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out = [];
$in["action"] = WRENCHBOARD_PROMOADMIN_ASSIGNTASK;
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
}
+23
View File
@@ -45,4 +45,27 @@ class WrenchAccount extends BaseController
// return $this->summaryReturnData($in,$out); //json_encode( $final_out );
}
public function loadRefer(){
$out=[];
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$in = $raw_array;
$in["action"] = WRENCHBOARD_LOAD_REFERLINK;
$in["action_path"] = 100;
$in["loc"] = $_SERVER["REMOTE_ADDR"];
if (isset($in["path"]) && $in["path"] == 'promoref'){
$in["refer_link"] = str_replace('REFPROMO-', "", $in["refer_link"]);
$in["action_path"] = 200;
}
$endpoint = "REFER_LINK-". $in["action_path"]."-". str_replace('-','_', $in["refer_link"]);// $in[""];
$out = $this->getCache($endpoint);
if ( count($out)==0 ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
$this->saveCache($endpoint,$out,360);
}
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
}
+12 -17
View File
@@ -246,6 +246,7 @@ class WrenchApi extends BaseController
$in["action"] = 13012; // WRENCHBOARD_JOB_JOBFILES; -- cannot get contsants to work
break;
case 'jobmanagerlist':
log_message('critical', "******************************************* WRENCHBOARD_JOB_LISTJOBS");
$in["action"] = WRENCHBOARD_JOB_LISTJOBS;
break;
case 'jobgrouplist':
@@ -517,11 +518,13 @@ class WrenchApi extends BaseController
return $in;
}
public function apigate(){
/*
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "MainApi Path GATE 001");
*/
$call_backend = true;
/*
/* June 25
//header("Access-Control-Allow-Origin: http://localhost:9057 ");
header('Access-Control-Expose-Headers: Access-Control-Allow-Origin');
//header('Access-Control-Allow-Credentials: true ');
@@ -530,13 +533,14 @@ class WrenchApi extends BaseController
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Content-type: application/json');
*/
/* june 25
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 3600");
header('content-type: application/json; charset=utf-8');
*/
$method = $_SERVER['REQUEST_METHOD'];
// if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
@@ -613,7 +617,7 @@ class WrenchApi extends BaseController
//$raw_array["file_data"] = $out['file_data'] = $in['file_data'] =""; // no need to carry raw file data anymore - saved or cached ath this point
if (is_array($raw_array) && array_key_exists("file_data", $raw_array)) unset($raw_array["file_data"]);
if (is_array($out) && array_key_exists("file_data", $out)) unset($out["file_data"]);
if (is_array($int) && array_key_exists("file_data", $in)) unset($in["file_data"]);
if (is_array($in) && array_key_exists("file_data", $in)) unset($in["file_data"]);
} catch (Exception $e) {
$error = 'Caught exception: '. $e->getMessage();
log_message('critical', "ERROR ENDPOINT TESTING UPLOAD-> ".$error );
@@ -662,21 +666,12 @@ class WrenchApi extends BaseController
{
$out = $local_out;
}
$cacheOn = false;
if ($cacheOn){
$this->doCacheStep($in, $out);
}
$this->doCacheStep($in, $out);
// $final_out = ( new \App\Models\ResultFormatter() )->processOutJson($in, $out);
// $final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live");
// $final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
// //$final_out["session_image_server"] = "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
// $final_out["server_tag"] = $server_tag;
// $final_out["language"] = "en";
// $final_out["ip_loc"] = $ip_loc;
// $final_out["current_version"] = 20240306;
// $final_out["family_types"] = $this->familyTypes();
// $final_out["history_types"] = $this->historyTypes();
// //return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in,$out,[]), 200);
}
private function childBanners(): array
+13 -2
View File
@@ -20,7 +20,7 @@ class WrenchAuth extends BaseController
log_message('critical', "***** ***** WrenchAuth::userLogin Ret = ".$ret );
if ( $out['internal_return'] == 100 ){
$endpoint = "USER_SESSION-". str_pad($out["member_id"], 12, "0", STR_PAD_LEFT) ."-";
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$endpoint );
log_message('critical', "***** ***** WrenchAuth::promoLogin USER_SESSION = ".$endpoint );
$this->saveCache($endpoint,$out,15000);
}else
{
@@ -30,7 +30,7 @@ class WrenchAuth extends BaseController
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function userLogin(){
log_message('critical', "***** ***** WrenchAuth::userLogin ****" );
// $in = $this->request->getPostGet();
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
@@ -51,6 +51,7 @@ class WrenchAuth extends BaseController
$out_redis = $this->getCache($fail_endpoint); // try find in cache
if (isset($out_redis["fail_count"]) && $out_redis["fail_count"] > 2){
// we need stop here
log_message('critical', "Danger ***** ***** WrenchAuth::userLogin FAIL = ".$out_redis["fail_count"] );
}else{
$outF["fail_count"] = isset( $out_redis["fail_count"] ) ? $out_redis["fail_count"]+1:1;
}
@@ -61,8 +62,10 @@ class WrenchAuth extends BaseController
log_message('critical', "***** ***** WrenchAuth::userLogin Ret = ".$ret );
if ( $out['internal_return'] == 100 ){
$endpoint = "USER_SESSION-". str_pad($out["member_id"], 12, "0", STR_PAD_LEFT) ."-";
$out["refer_link"] = $this->user_server_name."/myrefer/".substr($out["uid"], 0, 8).str_pad($out["member_id"], 4, "0", STR_PAD_LEFT);
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$endpoint );
$this->saveCache($endpoint,$out,15000);
$this->neatCache($out);
}else
{
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$fail_endpoint );
@@ -72,6 +75,14 @@ class WrenchAuth extends BaseController
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function neatCache($in): int{
// clean up user cache at start
$endpoint = "ACCOUNT_HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
$this->deleteCache($endpoint);
return 0;
}
public function qrLogin(){
$raw_json = file_get_contents('php://input');
+50 -49
View File
@@ -2,8 +2,11 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchBanners extends BaseController
{
use ResponseTrait;
public function __construct()
{
$this->request = $request = \Config\Services::request();
@@ -12,34 +15,7 @@ class WrenchBanners extends BaseController
{
return [];
}
/*
{
"action": 11200,
"member_id": "379",
"uid": "5c2f7660-2214-4c75-98b0-12e44c0d7e78",
"sessionid": "800EBCB2C336A6954BB4FA589988092434B6221CBCCF9E1D92F09D9E10CA77AC",
"limit": 30,
"offset": 0
}
*/
// public function familyBanners(){
//
// $raw_json = file_get_contents('php://input');
// $in = json_decode($raw_json, true);
//
// $in["action"] = WRENCHBOARD_FAMILY_HOMEBANNERS;
// $endpoint = "FAMILY_BANNERS-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT);
// $out = $this->getCache($endpoint); // try find in cache
// if ( count($out) == 0 ){
// $local_url = "http://".$this->micro_service_net1.":3032/familybanners";
// $out = $this->APIcall('GET', $local_url, $in);
// log_message('critical', "familyBanners ********* ALL ".serialize($out["result_list"]) );
// log_message('critical', "familyBanners ********* COUNT ".serialize(count($out["result_list"])) );
// $this->saveCache($endpoint,$out,1500);
// }
// return $this->summaryReturnData($in,$out); //json_encode( $final_out );
// }
//activetaskslist
private function bannerGetActiveTasks($in){
$in["action"] = WRENCHBOARD_JOB_USERACTIVE;
$in["nocache"] = $in["nocache"] ?? false;
@@ -83,30 +59,55 @@ class WrenchBanners extends BaseController
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
$extra_out =[];
$in["action"] = WRENCHBOARD_ACCOUNT_HOMEBANNERS;
if (isset($in["uuid"]) && $in["uuid"] !='' ){
$in["uid"]=$in["uuid"];
try{
if (isset($in["uuid"]) && $in["uuid"] !='' ){
$in["uid"]=$in["uuid"];
}
$in["nocache"] = $in["nocache"] ?? false;
$endpoint = "ACCOUNT-HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
$out = $this->getCache($endpoint); // try find in cache
$previous_banners = false;
if (is_array($out) && count($out)> 0 /*&& is_array($out['result_list']) && count($out['result_list'])>0*/ ){
$previous_banners = true;
}
$previous_banners = false; // suspend the cache for now
if ( !$previous_banners ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "usersBanners ********* ALL ".serialize($out) );
// dont cache junks
if (is_array($out) /* && is_array($out['result_list']) && count($out['result_list'])>0 */) {
$this->saveCache($endpoint, $out, 1500);
$previous_banners = true;
}
}
$extra_banner_call = false;
if($extra_banner_call){
$extra_out["offers_list"] = $this->bannerGetOffers($in);
$extra_out["activetaskslist"] = $this->bannerGetActiveTasks($in);
}else{
$extra_out["offers_list"] = [];
$extra_out["activetaskslist"] = [];
}
} catch (Exception $e) {
$errMsg = ' BANNER DATA ERROR **** Caught exception: '. $e->getMessage();
log_message('critical', $errMsg);
}
$in["nocache"] = $in["nocache"] ?? false;
$endpoint = "ACCOUNT_HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
$out = $this->getCache($endpoint); // try find in cache
if ( count($out) == 0 ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "usersBanners ********* ALL ".serialize($out) );
$this->saveCache($endpoint,$out,1500);
}
$extra_out["offers_list"] = $this->bannerGetOffers($in);
$extra_out["activetaskslist"] = $this->bannerGetActiveTasks($in);
return $this->summaryReturnData($in,$out, $extra_out); //json_encode( $final_out );
//return $final_out;
return $this->respond($this->summaryReturnData($in,$out, $extra_out), 200);
// return $this->summaryReturnData($in,$out, $extra_out); //json_encode( $final_out );
}
public function apigate(){
log_message('critical', "0001");
+10 -31
View File
@@ -23,24 +23,7 @@ class WrenchBlog extends BaseController
return $this->respond( $this->summaryReturnData($in,$res1), 200);
}
public function blogData($endpoint,$raw_array)
{
/*
$rawData = $this->apiData();
// $res1= $rawData[0]['payload'];
$res1= $rawData; //[0]['payload'];
$this->saveCache('blogdata',$res1['payload']);
*/
$res1 = $this->getCache($endpoint);
if (count($res1)==0){
$rawData = $this->apiData();
$res1= $rawData['payload']; //[0]['payload'];
$this->saveCache($endpoint,$res1);
}
//$resJson = $this->response->setJson($res1);
return $res1;
}
public function website(){
@@ -68,25 +51,21 @@ class WrenchBlog extends BaseController
else{
$endpoint = "WRENCH_BLOG_DATA";
$res1 = $this->getCache($endpoint);
if (count($res1)==0){
$rawData = $this->apiData($blog_id);
$do_newRead = true;
if (isset($res1) && is_array($res1) && count($res1) > 0 && isset($res1['blogdata']) && is_array($res1['blogdata']) && count($res1['blogdata']) > 0){
$do_newRead = false;
}
if ($do_newRead){
//$rawData = $this->apiData($blog_id);
// $res1= $rawData['payload']; //[0]['payload'];
$remoteURL = "https://blogdata.chiefsoft.net/blogdata/wrenchboard";
$in["blog"] ="wrenchboard";
$rawData = $this->APIcall('GET', $remoteURL, $in);
$res1= $rawData['payload']; //[0]['payload'];
$this->saveCache($endpoint,$res1);
}
}
/*
*
Column | Type | Collation | Nullable | Default
---------+-----------------------------+-----------+----------+---------------------------------------------
id | integer | | not null | nextval('blog_selections_id_seq'::regclass)
uid | uuid | | | uuid_generate_v4()
blog_id | integer | | not null |
title | character varying(50) | | not null |
banner | character varying(250) | | not null |
status | integer | | | 1
added | timestamp without time zone | | | now()
*/
$limit = isset($in['limit']) ? $in['limit']: 0;
if ($limit> 0){
+1
View File
@@ -10,6 +10,7 @@ define('WRB_CRONJOB_OFFER_REFUND_ALERT',775);
define('WRB_CRONJOB_PENDOFFER_ALERT',776);
define('WRB_CRONJOB_NOTIFICATIONS', 777) ;
define('WRB_CRONJOB_GROUPJOBS', 778) ;
define('WRB_CRONJOB_PROCESS_PROMO', 788) ;
define('WRB_CRONJOB_PENDINGSM', 790) ;
+55 -15
View File
@@ -2,9 +2,11 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchFamily extends BaseController
{
use ResponseTrait;
public function __construct()
{
$this->request = $request = \Config\Services::request();
@@ -30,8 +32,7 @@ class WrenchFamily extends BaseController
log_message('critical', "familyConnectMembers ********* COUNT ".serialize(count($out["result_list"])) );
$this->saveCache($endpoint,$out,1500);
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function familyConnectInvite(){
@@ -53,7 +54,7 @@ class WrenchFamily extends BaseController
$out["allow_invite"] = 100;
$out['internal_return'] = 0;
return $this->summaryReturnData($in,$out);
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function familyConnect(){
@@ -74,7 +75,7 @@ class WrenchFamily extends BaseController
$out["allow_invite"] = 100;
$out['internal_return'] = 0;
return $this->summaryReturnData($in,$out);
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function relativeEditKids(){
$raw_json = file_get_contents('php://input');
@@ -85,7 +86,7 @@ class WrenchFamily extends BaseController
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->summaryReturnData($in,$out);
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function relativeSettings(){
$raw_json = file_get_contents('php://input');
@@ -96,7 +97,7 @@ class WrenchFamily extends BaseController
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->summaryReturnData($in,$out);
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function relativeReminder(){
$raw_json = file_get_contents('php://input');
@@ -107,11 +108,10 @@ class WrenchFamily extends BaseController
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->summaryReturnData($in,$out);
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function familyBanners(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
@@ -119,13 +119,15 @@ class WrenchFamily extends BaseController
$endpoint = "FAMILY_BANNERS-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT);
$out = $this->getCache($endpoint); // try find in cache
if ( count($out) == 0 ){
$local_url = "http://".$this->micro_service_net1.":3032/familybanners";
$out = $this->APIcall('GET', $local_url, $in);
// $local_url = "http://".$this->micro_service_net1.":3032/familybanners";
// $out = $this->APIcall('GET', $local_url, $in);
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "familyBanners ********* ALL ".serialize($out["result_list"]) );
log_message('critical', "familyBanners ********* COUNT ".serialize(count($out["result_list"])) );
$this->saveCache($endpoint,$out,1500);
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function familySampleTasks(){
@@ -142,7 +144,45 @@ class WrenchFamily extends BaseController
if ($ret == 0)
$this->saveCache($endpoint,$out,65000);
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in, $out), 200);
}
//familysampletasks
public function familyRewardHx(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_FAMILY_TRANSFERHX;
$endpoint = "FAMILY_REWARD_HX-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT);
$out = $this->getCache($endpoint); // try find in cache
if ( count($out) == 0 ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
$this->saveCache($endpoint,$out,1000);
}
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function familyList()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_FAMILY_LIST;
$out = [];
$endpoint = "WRENCHBOARD_FAMILY_LIST-".$in["uid"];
$out = $this->getCache($endpoint);
if (count($out) == 0) {
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint, $out, 1500);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchFamily::familyList Cache Done:::Ret " . $ret);
}
log_message('critical', "***** ***** WrenchFamily::familyList Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
}
+19 -31
View File
@@ -18,19 +18,23 @@ class WrenchFaq extends BaseController
$in = json_decode($raw_json, true);
$msgS = "<div style='width: 100%; min-height: 300px; border-radius: 10px; background-color: whitesmoke; padding: 10px;'>
<b>Finding Task and Posting Jobs </b>
<b>Task and Jobs </b>
<br>
<iframe style='width: 100%; min-height: 250px; height: auto' width='100%' src='https://www.youtube.com/embed/GhSxT7rk0y8?si=Q4guiwdl9vBmmQKF' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
<br>
Random gibberish text to use in web pages, site templates and in typography demos.
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time.
<b>Go Further and Faster </b>
<br><hr>
Looking for a platform to push that next campaign or get real feedback on that great app feature or just any task, connect with our thriving community to get it done fast.
<br>
<b>Finding Task and Posting Jobs </b>
<b><hr > </b>
<br>
<iframe style='width: 100%; min-height: 250px; height: auto' width='100%' src='https://www.youtube.com/embed/GhSxT7rk0y8?si=Q4guiwdl9vBmmQKF' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
<br>
<b>Do more. </b>
<br><hr>
<br>
Random gibberish text to use in web pages, site templates and in typography demos.
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time.
Ready to launch your next campaign, get real feedback on your app, or tackle any task? Connect with our vibrant community for fast, affordable results.
</div>";
$data["result_list"][] = array(
"uid" => '0000-0000-0000-000 A1',
@@ -39,12 +43,12 @@ class WrenchFaq extends BaseController
);
$msgS = "<div style='width: 100%; min-height: 300px; border-radius: 10px; background-color: whitesmoke; padding: 10px;'>
<b>Family Engagement </b>
<b>Take the Stress Out and excite your kids to do more! </b>
<br>
<iframe style='width: 100%; min-height: 250px; height: auto' width='100%' src='https://www.youtube.com/embed/GhSxT7rk0y8?si=Q4guiwdl9vBmmQKF' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
<br>
Random gibberish text to use in web pages, site templates and in typography demos.
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </div>";
Take the stress out of getting your kids excited about learning life skills! Leverage the science of motivation and go beyond chores to build a system of growth where families connect to inspire kids.
</div>";
$data["result_list"][] = array(
"uid" => '0000-0000-0000-000 A2',
"topic" => "Family",
@@ -56,8 +60,9 @@ class WrenchFaq extends BaseController
<br>
<iframe style='width: 100%; min-height: 250px; height: auto' width='100%' src='https://www.youtube.com/embed/GhSxT7rk0y8?si=Q4guiwdl9vBmmQKF' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
<br>
Random gibberish text to use in web pages, site templates and in typography demos.
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </div>";
<b>Flexible and Customizable Rewards </b><br><hr>
Our reward system is flexible because we know motivation differs for each person. We empower you to match reward with motivation to celebrate achievement.
. </div>";
$data["result_list"][] = array(
"uid" => '0000-0000-0000-000 A3',
"topic" => "Rewards",
@@ -69,32 +74,15 @@ class WrenchFaq extends BaseController
<br>
<iframe style='width: 100%; min-height: 250px; height: auto' width='100%' src='https://www.youtube.com/embed/GhSxT7rk0y8?si=Q4guiwdl9vBmmQKF' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
<br>
Random gibberish text to use in web pages, site templates and in typography demos.
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </div>";
<b>Interact and Explore </b><br><hr>
Kids interact and explore with a suite of carefully selected content and games aimed at helping them learn financial skills. AI adapts to each child's unique learning style, ensuring personalized experiences that grow with them
. </div>";
$data["result_list"][] = array(
"uid" => '0000-0000-0000-000 A4',
"topic" => "Playground",
"contents" => $msgS
);
// for ($i = 0; $i < $total; $i++) {
//
// $msg='';
// $msgS = "<div> Random gibberish text to use in web pages, site templates and in typography demos.
// Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </div>";
//
// $txL = rand(1,5);
// for($ii=1; $ii<$txL; $ii++){
// $msg = $msg.$msgS;
// }
//
// $data["result_list"][] = array(
// "uid" => '0000-0000-0000-000'. $i,
// "topic" => "Topic ".$i,
// "contents" => $msg
// );
// }
return $this->summaryReturnData($in,$data); //json_encode( $final_out );
}
@@ -2,8 +2,12 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchGeneralData extends BaseController
{
use ResponseTrait;
protected $request;
public function __construct()
{
@@ -25,7 +29,8 @@ class WrenchGeneralData extends BaseController
$out['internal_return'] = $ret;
$this->saveCache($endpoint,$out,15000);
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
// return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in,$out,[]), 200);
}
public function usersPreferences(){
@@ -44,7 +49,8 @@ class WrenchGeneralData extends BaseController
$this->saveCache($endpoint,$out,25000);
}
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
//return $this->summaryReturnData($in,$out); //json_encode( $final_out );
return $this->respond($this->summaryReturnData($in,$out,[]), 200);
}
}
@@ -25,4 +25,7 @@ class WrenchGetResources extends BaseController
return [];
}
}
@@ -0,0 +1,81 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchJobManager extends BaseController
{
use ResponseTrait;
public function __construct()
{
$this->request = $request = \Config\Services::request();
}
public function jobManagerList()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_JOB_LISTJOBS;
$out = [];
$endpoint = "WRENCHBOARD_JOB_LISTJOBS-" . $in["client_uid"];
$out = $this->getCache($endpoint);
// if (count($out) == 0) { //suspend cache for now
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint, $out, 1500);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchJobManager::jobManagerList Cache Done:::Ret " . $ret);
//}
log_message('critical', "***** ***** WrenchJobManager::jobManagerList Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function jobManagerActive()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["job_mode"] = $in["job_mode"] ?? "ACTIVE";
$in["action"] = WRENCHBOARD_JOB_ACTIVE;
$out = [];
$endpoint = "WRENCHBOARD_JOB_ACTIVE-" . $in["job_mode"]."-".$in["uuid"];
$out = $this->getCache($endpoint);
if (count($out) == 0) {
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint, $out, 1500);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchJobManager::jobManagerActive Cache Done:::Ret " . $ret);
}
log_message('critical', "***** ***** WrenchJobManager::jobManagerActive Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function jobManagerManageOffers()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["job_mode"] = $in["job_mode"] ?? "OFFERS";
$in["action"] = WRENCHBOARD_JOB_OFFERS;
$out = [];
$endpoint = "WRENCHBOARD_JOB_OFFERS-OFFERS-".$in["uuid"];
$out = $this->getCache($endpoint);
if (count($out) == 0) {
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint, $out, 1500);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchJobManager::jobManagerManageOffers Cache Done:::Ret " . $ret);
}
log_message('critical', "***** ***** WrenchJobManager::jobManagerManageOffers Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
}
+88 -28
View File
@@ -18,7 +18,7 @@ class WrenchJobs extends BaseController
$in = json_decode($raw_json, true);
$in["action"] = -1;
$out=[];
$endpoint = "COMPLETED_HX-". $in["uid"];
$endpoint = "COMPLETED_HX-". str_replace('-','_', $in["uid"]);
// $out = $this->getCache($endpoint);
if ( count($out)==0 ){
@@ -45,35 +45,88 @@ class WrenchJobs extends BaseController
}
return $ret;
}
private function refreshJobsData(){
$in =[
'limit' => 60,
'page' => 1
];
$endpoint = $endpoint = "MARKET_JOB_DATA";
$local_url = "http://".$this->micro_service_net1.":3033/marketjobs";
$out = $this->APIcall('GET', $local_url, $in);
// dont cache junk
if ( is_array($out) && is_array($out["result_list"]) && count($out["result_list"]) > 0){
$this->deleteCache($endpoint);
$this->saveCache($endpoint,$out,1440);
}
}
public function getJobsData() {
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = -1; // bad number - we dont want formating WRENCHBOARD_ACCOUNT_JOBLIST; dont send this line , the formater will be confused
$out=[];
$endpoint = "JOB_DATA-". $in["uid"];
$endpoint = "MARKET_JOB_DATA"; // All jobs Data
log_message('critical', "ENTER ***** ***** WrenchJobs::getJobsData IN ");
try {
$out = $this->getCache($endpoint);
$countItem = 0;
if( is_array($out)){
$countItem = count($out);
$out = $this->getCache($endpoint);
$countItem = 0;
if( is_array($out)){
$countItem = count($out);
}
if ( $countItem == 0 ){
$in["action"] = WRENCHBOARD_ACCOUNT_JOBLIST;
$out=[];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
// $local_url = "http://".$this->micro_service_net1.":3033/marketjobs";
// $out = $this->APIcall('GET', $local_url, $in);
// dont cache junk
if ( is_array($out) && is_array($out["result_list"]) && count($out["result_list"]) > 0){
$this->saveCache($endpoint,$out,30);
}
$out['internal_return'] = 0; // just backwad comaptobility
log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret ");
}
$endpointW = "WALLETS-COUNTRY-". str_replace('-','_', $in["uid"]);
// $endpointW = "USER_WALLET_COUNTRY-". $in["uid"];
$outW = $this->getCache($endpointW);
// I need your wallet country here
if ( !is_array($outW["result_list"])){
$local_urlW = "http://".$this->micro_service_net1.":3033/walletcountry";
$outW = $this->APIcall('GET', $local_urlW, $in);
if ( is_array($outW["result_list"]) && count($outW["result_list"]) > 0){
$this->saveCache($endpointW,$outW,15660);
}
}
$filter_job_list =[];
$wallet_country = $first_names = array_column($outW['result_list'], 'country');
if (is_array($out['result_list']) && count($out['result_list']) > 0 ){
foreach ($out['result_list'] as $item) {
if (in_array($item['job_country'], $wallet_country)) {
log_message('critical', "***** ***** WrenchJobs::ITEM " . serialize($item));
$filter_job_list[] = $item;
}
}
}
log_message('critical', "***** ***** WrenchJobs::JOB AFTER FILTER Ret ". serialize($filter_job_list));
$out['result_list'] = $filter_job_list;
// Fileter result_list to wallet country
$endpoint = "WRENCH_JOB_INTEREST_COUNT";
$int_list = $this->getCache($endpoint)["result_list"];
$out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : [];
} catch (Exception $e) {
$errMsg = ' JOB DATA ERROR **** Caught exception: '. $e->getMessage();
log_message('critical', $errMsg);
}
if ( $countItem == 0 ){
$local_url = "http://".$this->micro_service_net1.":3033/marketjobs";
$out = $this->APIcall('GET', $local_url, $in);
// dont cache junk
if ( is_array($out) && is_array($out["result_list"]) && count($out["result_list"]) > 0){
$this->saveCache($endpoint,$out,180);
}
$out['internal_return'] = 0; // just backwad comaptobility
log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret ");
}
$endpoint = "WRENCH_JOB_INTEREST_COUNT";
$int_list = $this->getCache($endpoint)["result_list"];
$out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : [];
log_message('critical', "***** ***** WrenchJobs::getJobsData Ret ");
log_message('critical', "END ***** ***** WrenchJobs::getJobsData Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
@@ -98,11 +151,14 @@ class WrenchJobs extends BaseController
public function contractHx(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out=[];
$local_url = "http://".$this->micro_service_net1.":3033/contractHx";
$out = $this->APIcall('GET', $local_url, $in );
return $this->respond( $this->summaryReturnData($in,$out), 3000);
$endpoint = "USER_CONTRACT_HX-". str_replace('-','_', $in["uid"]);;
$out = $this->getCache($endpoint);
if ( count($out)==0 ){
$local_url = "http://".$this->micro_service_net1.":3033/contractHx";
$out = $this->APIcall('GET', $local_url, $in );
$this->saveCache($endpoint,$out,360);
}
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
@@ -154,12 +210,16 @@ class WrenchJobs extends BaseController
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_JOB_OFFER_SYSTEM;
if ( !isset($in["strict_timeline"])){
$in["strict_timeline"] = 0;
}
$out=[];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchJobs::assignTask Ret = ".$ret );
if ( isset($out['internal_return']) && isset( $out['offer_code']) ){
$this->refreshJobsData();
$endpoint = "NEW_OFFER_".$in["assign_mode"]."-". $out["offer_code"];
log_message('critical', "***** ***** WrenchJobs::assignTask NEW_OFFER_ = ".$endpoint );
$this->saveCache($endpoint,$out,25000);
+8 -8
View File
@@ -155,17 +155,17 @@ class WrenchPlayGround extends BaseController
$out["result_list"][] =[
"name" => " There is name 3333",
"banner" => "If any banner is needed ",
"item_list" => $this->apiData()
"item_list" => $this->apiExtraData()
];
$out["result_list"][] =[
"name" => " There is name 3333",
"banner" => "If any banner is needed ",
"item_list" => $this->apiData()
"item_list" => $this->apiExtraData()
];
$out["result_list"][] =[
"name" => " There is name 3333",
"banner" => "If any banner is needed ",
"item_list" => $this->apiData()
"item_list" => $this->apiExtraData()
];
@@ -183,7 +183,7 @@ class WrenchPlayGround extends BaseController
return $in;
}
private function apiFeaturedData() {
private function apiFeaturedData():array{
$data=[];
$data["item"][] = array(
"banner" => "I have no idea",
@@ -212,7 +212,7 @@ class WrenchPlayGround extends BaseController
return $data;
}
private function apiSharedData() {
private function apiSharedData():array {
$data=[];
$total = 0;
for ($i = 0; $i < $total; $i++) {
@@ -225,7 +225,7 @@ class WrenchPlayGround extends BaseController
}
return $data;
}
private function apiCollectionData() {
private function apiCollectionData():array {
$data=[];
$total = 0;
for ($i = 0; $i < $total; $i++) {
@@ -239,8 +239,8 @@ class WrenchPlayGround extends BaseController
return $data;
}
private function apiData() {
private function apiExtraData():array {
$data = [];
$total = rand(1,3);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
+283 -142
View File
@@ -10,43 +10,46 @@ use Orhanerday\OpenAi\OpenAi;
class WrenchResources extends BaseController
{
use ResponseTrait;
public function generatives(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$a = rand(1,20);
$b = rand(1,30);
$c= $a+$b;
public function generatives()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$ansPos = rand(1,4);
$option_mix=[];
for ($ii=1; $ii<=4; $ii++){
if ($ii== $ansPos){
$option_mix[]= $c;
}else
{
$ansRand = rand(1000,9999);
$option_mix[]= ($ansRand == $c)? $ansRand+rand(1,5) : $ansRand;
}
$a = rand(1, 20);
$b = rand(1, 30);
$c = $a + $b;
$ansPos = rand(1, 4);
$option_mix = [];
for ($ii = 1; $ii <= 4; $ii++) {
if ($ii == $ansPos) {
$option_mix[] = $c;
} else {
$ansRand = rand(1000, 9999);
$option_mix[] = ($ansRand == $c) ? $ansRand + rand(1, 5) : $ansRand;
}
}
//[ rand(1000,9999), $c , rand(1000,9999)]
$next_question = [
"question" => "What is C ? <br> C = $a + $b .",
"option" => $option_mix,
"answer" => $c,
'option_mix' => $option_mix,
"last" => false,
"points" => 10
];
$out = [
"next_question" => $next_question
];
log_message('critical', "***** ***** WrenchResources::generatives Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
$next_question = [
"question" => "What is C ? <br> C = $a + $b .",
"option" => $option_mix,
"answer" => $c,
'option_mix' => $option_mix,
"last" => false,
"points" => 10
];
$out = [
"next_question" => $next_question
];
log_message('critical', "***** ***** WrenchResources::generatives Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
public function blogTopics(){
public function blogTopics()
{
$open_ai_key = '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';
@@ -56,7 +59,7 @@ class WrenchResources extends BaseController
// text-davinci-003 davinci-instruct-beta-v3
$complete = $open_ai->completion([
'model' => 'gpt-3.5-turbo-instruct',
'prompt' => 'Generate blog topics on: '. $prompt,
'prompt' => 'Generate blog topics on: ' . $prompt,
'temperature' => 0.9,
'max_tokens' => 150,
'frequency_penalty' => 0,
@@ -65,22 +68,23 @@ class WrenchResources extends BaseController
$response = json_decode($complete, true);
//$response = $response["choices"][0]["text"];
// return $this->response->setJson($response);
// return $this->response->setJson($response);
return $response;
}
public function aigate(){
public function aigate()
{
$open_ai_key = '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';
$open_ai = new OpenAi($open_ai_key);
$prompt = " autonomous cars";
// 'model' => 'text-davinci-003',
// 'model' => 'text-davinci-003',
$complete = $open_ai->completion([
'model' => 'gpt-3.5-turbo-instruct',
'prompt' => 'Writing 3 marketing Facebook caption for '. $prompt,
'prompt' => 'Writing 3 marketing Facebook caption for ' . $prompt,
'temperature' => 0.9,
'max_tokens' => 150,
'frequency_penalty' => 0,
@@ -92,26 +96,43 @@ class WrenchResources extends BaseController
$response["other_topic"] = $this->blogTopics();
return $this->response->setJson($response);
}
public function website(){
log_message('critical', "WrenchResources-> " );
public function website()
{
log_message('critical', "WrenchResources-> ");
$res1['tab_categories'] = $this->CategoryData();
$res1['ask_categories'] = $this->AskCategoryData();
$res1['upload_types'] = $this->uploadTypes();
$res1['marketdata'] = $this->MarketData();
$res1['productdata'] = $this->ProductData();
$res1['collectiondata'] = $this->CollectionData();
$res1['blogdata'] = $this->getBlogData();
$res1['marketdata'] = []; // $this->MarketData();
$res1['productdata'] = []; // $this->ProductData();
$res1['collectiondata'] = []; // $this->CollectionData();
$res1['blogdata']["payload"] = $this->getBlogData();
return $this->response->setJson($res1);
}
private function getBlogData(){
return ( new \App\Models\BlogDataModel() )->blogData(100);
private function getBlogData()
{
$blog_id = 0;
$endpoint = "WRENCH_BLOG_DATA";
$res1 = $this->getCache($endpoint);
if (count($res1)==0){
$rawData = $this->apiData($blog_id);
$res1= $rawData['payload']; //[0]['payload'];
$this->saveCache($endpoint,$res1);
}
$res1['blogconfig'] = [
"media_url" => "https://blog.wrenchboard.com/wp-content/uploads",
"image_url" => "https://blog.wrenchboard.com/wp-content/uploads",
"site_url" => "https://blog.wrenchboard.com",
"other_config2" => "NONE",
];
return $res1;
//return (new \App\Models\BlogDataModel())->blogData(100);
}
//************************
private function AskCategoryData(): array
{
$arrayVar = [
"data" => [
[
@@ -126,12 +147,11 @@ class WrenchResources extends BaseController
],
]
];
return $arrayVar;
return $arrayVar;
}
private function uploadTypes(): array
{
//JPG, PNG, GIP, SVG, MP4, MP3, WEBM, OGG, GLB, GLTF
$arrayVar = [
"data" => [
@@ -165,80 +185,57 @@ class WrenchResources extends BaseController
"name" => "MP4",
"max_size_mb" => "60",
],
]
];
return $arrayVar;
}
private function CategoryData(): array
{
$arrayVar = [
return [
"data" => [
[
"id" => "0",
"name" => "blog",
"content" => "Blog",
"enabled" => 1
],
[
"id" => "1",
"name" => "onsale",
"content" => "Questions?",
"enabled" => 1
],
[
"id" => "2",
"name" => "owned",
"content" => "Interesting",
"enabled" => 0
],
[
"id" => "3",
"id" => "1",
"name" => "created",
"content" => "My Items",
"enabled" => 1
],
[
"id" => "2",
"name" => "blog",
"content" => "Blog",
"enabled" => 1
],
[
"id" => "3",
"name" => "owned",
"content" => "Interesting",
"enabled" => 0
],
]
];
/*
* [
"id" => "4",
"name" => "hidden",
"content" => "Hidden",
],
[
"id" => "5",
"name" => "collection",
"content" => "Collection",
],
[
"id" => "6",
"name" => "activity",
"content" => "Activity",
],
*/
return $arrayVar;
}
//************************************
public function index()
{
}
public function familyresources(){
public function familyresources()
{
log_message('critical', "WrenchResources-> " );
log_message('critical', "WrenchResources-> ");
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchResources Path GATE 001");
$call_backend = true;
$call_backend = true;
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
@@ -248,13 +245,12 @@ class WrenchResources extends BaseController
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
$ip_loc = $this->getIpData();
$ip_loc = $this->getIpData();
if ($method == "OPTIONS") {
header("HTTP/1.1 200 OK CORS");
log_message('critical', " WrenchJobs()-> OPTIONS DIE*****" );
log_message('critical', " WrenchJobs()-> OPTIONS DIE*****");
die();
}
@@ -266,14 +262,14 @@ class WrenchResources extends BaseController
if ($pos > 5) {
$uri = substr($uri, 0, $pos);
}
log_message('critical', "API-GATE URI -> ".$uri );
log_message('critical', "API-GATE URI -> " . $uri);
$pieces = explode('/', $uri);
$psc = count($pieces);
$endpoint = $psc > 0 ? $pieces[$psc - 1] : '';
log_message('critical', "Enpoint-> ".$endpoint );
log_message('critical', "Enpoint-> " . $endpoint);
$endpoints = $this->endPointList();
$endpoints = $this->endPointList();
$out = array();
$res1 = [];
// if (array_key_exists($endpoint, $endpoints)) {
@@ -286,26 +282,26 @@ class WrenchResources extends BaseController
// ]);
// }
$current_env = $this->getSiteConfigurations("system.live");
$current_env = $this->getSiteConfigurations("system.live");
$primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$server_tag = $this->getSiteConfigurations("system.server_tag");
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
// echo "EXYTACT INPUT DATA HERE";
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$local_out =[];
$local_out = [];
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
log_message('critical', "Enpoint LOC2 HERE -> ".$endpoint );
log_message('critical', "Enpoint LOC2 HERE -> " . $endpoint);
$get_param = $_GET['reqData'] ?? null;
$raw_array = ($get_param!=null) ? json_decode($get_param, true):[];
$raw_array = ($get_param != null) ? json_decode($get_param, true) : [];
}
$in = $raw_array;
$in = $raw_array;
$in["loc"] = $_SERVER["REMOTE_ADDR"];
log_message('critical', "WrenchResources Path GATE 005");
// $res1['tab_categories'] = json_encode( $this->getFamilyResourceCategory($in));
$res1 = $this->getFamilyResourceCategory($in);
// $res1['tab_categories'] = json_encode( $this->getFamilyResourceCategory($in));
$res1 = $this->getFamilyResourceCategory($in);
log_message('critical', "WrenchResources Path GATE 010 " . serialize($in));
log_message('critical', "WrenchResources Path GATE 010 " . serialize($res1['tab_categories']));
log_message('critical', "WrenchResources Path GATE 11");
@@ -313,14 +309,15 @@ class WrenchResources extends BaseController
return $this->response->setJson($res1);
}
public function commonmedia(){
public function commonmedia()
{
log_message('critical', "WrenchResources-> " );
log_message('critical', "WrenchResources-> ");
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchResources Path GATE 001");
$call_backend = true;
$call_backend = true;
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
@@ -330,13 +327,12 @@ class WrenchResources extends BaseController
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
$ip_loc = $this->getIpData();
$ip_loc = $this->getIpData();
if ($method == "OPTIONS") {
header("HTTP/1.1 200 OK CORS");
log_message('critical', " WrenchJobs()-> OPTIONS DIE*****" );
log_message('critical', " WrenchJobs()-> OPTIONS DIE*****");
die();
}
@@ -348,71 +344,74 @@ class WrenchResources extends BaseController
if ($pos > 5) {
$uri = substr($uri, 0, $pos);
}
log_message('critical', "API-GATE URI -> ".$uri );
log_message('critical', "API-GATE URI -> " . $uri);
$pieces = explode('/', $uri);
$psc = count($pieces);
$endpoint = $psc > 0 ? $pieces[$psc - 1] : '';
log_message('critical', "Enpoint-> ".$endpoint );
log_message('critical', "Enpoint-> " . $endpoint);
$endpoints = $this->endPointList();
$endpoints = $this->endPointList();
$out = array();
$res1 = [];
$current_env = $this->getSiteConfigurations("system.live");
$current_env = $this->getSiteConfigurations("system.live");
$primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$server_tag = $this->getSiteConfigurations("system.server_tag");
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
// echo "EXYTACT INPUT DATA HERE";
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$local_out =[];
$local_out = [];
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
log_message('critical', "Enpoint LOC2 HERE -> ".$endpoint );
log_message('critical', "Enpoint LOC2 HERE -> " . $endpoint);
$get_param = $_GET['reqData'] ?? null;
$raw_array = ($get_param!=null) ? json_decode($get_param, true):[];
$raw_array = ($get_param != null) ? json_decode($get_param, true) : [];
}
$in = $raw_array;
$in = $raw_array;
$in["loc"] = $_SERVER["REMOTE_ADDR"];
log_message('critical', "WrenchResources Path GATE 005");
$res1 = $this->getCommonMediaList($in);
$res1 = $this->getCommonMediaList($in);
log_message('critical', "WrenchResources Path GATE 010 " . serialize($in));
log_message('critical', "WrenchResources Path GATE 010 " . serialize($res1['tab_categories']));
log_message('critical', "WrenchResources Path GATE 11");
return $this->response->setJson($res1);
}
private function getFamilyResourceCategory($in){
log_message('critical', "WrenchResources Path GATE 006");
try {
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$local_url = "http://".$micro_service_net1.":3034/famresourcecat";
log_message('critical', "WrenchResources Path GATE 00666 -> ".$local_url);
return $this->APIcall('GET', $local_url, $in);
} catch (Exception $e) {
log_message('critical', "WrenchResources Path GATE 007 - ".$e->getMessage());
return [];
}
}
private function getCommonMediaList($in){
private function getFamilyResourceCategory($in)
{
log_message('critical', "WrenchResources Path GATE 006");
try {
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$local_url = "http://".$micro_service_net1.":3034/commonmedia";
log_message('critical', "WrenchResources Path GATE 00-commonmedia-> ".$local_url);
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$local_url = "http://" . $micro_service_net1 . ":3034/famresourcecat";
log_message('critical', "WrenchResources Path GATE 00666 -> " . $local_url);
return $this->APIcall('GET', $local_url, $in);
} catch (Exception $e) {
log_message('critical', "WrenchResources Path GATE 007 commonmedia - ".$e->getMessage());
log_message('critical', "WrenchResources Path GATE 007 - " . $e->getMessage());
return [];
}
}
private function CollectionData(){
private function getCommonMediaList($in)
{
log_message('critical', "WrenchResources Path GATE 006");
try {
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
$local_url = "http://" . $micro_service_net1 . ":3034/commonmedia";
log_message('critical', "WrenchResources Path GATE 00-commonmedia-> " . $local_url);
return $this->APIcall('GET', $local_url, $in);
} catch (Exception $e) {
log_message('critical', "WrenchResources Path GATE 007 commonmedia - " . $e->getMessage());
return [];
}
}
private function CollectionData()
{
$arrayVar = [
"data" => [
[
@@ -534,9 +533,11 @@ class WrenchResources extends BaseController
],
],
];
return $arrayVar;
return $arrayVar;
}
private function ProductData(){
private function ProductData()
{
$arrayVar = [
@@ -616,9 +617,11 @@ return $arrayVar;
],
];
return $arrayVar;
return $arrayVar;
}
private function MarketData(){
private function MarketData()
{
$arrayVar = [
"data" => [
@@ -742,9 +745,147 @@ return $arrayVar;
],
];
return $arrayVar ;
return $arrayVar;
}
public function getCountryStates(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
$outx = [];
$in["action"] = -1; //
$outx["country_state"]['US'] = $this->usStates();
$outx["country_state"]['NG'] = $this->ngStates();
$outx["country_state"]['CA'] = $this->caStates();
if ( $in["country"] !=''){
if (isset($outx["country_state"][$in["country"]])){
$out["country_state"] = $outx["country_state"][$in["country"]];
}
}
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
}
private function usStates()
{
return [
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District Of Columbia',
'FL' => 'Florida',
'GA' => 'Georgia',
'HI' => 'Hawaii',
'ID' => 'Idaho',
'IL' => 'Illinois',
'IN' => 'Indiana',
'IA' => 'Iowa',
'KS' => 'Kansas',
'KY' => 'Kentucky',
'LA' => 'Louisiana',
'ME' => 'Maine',
'MD' => 'Maryland',
'MA' => 'Massachusetts',
'MI' => 'Michigan',
'MN' => 'Minnesota',
'MS' => 'Mississippi',
'MO' => 'Missouri',
'MT' => 'Montana',
'NE' => 'Nebraska',
'NV' => 'Nevada',
'NH' => 'New Hampshire',
'NJ' => 'New Jersey',
'NM' => 'New Mexico',
'NY' => 'New York',
'NC' => 'North Carolina',
'ND' => 'North Dakota',
'OH' => 'Ohio',
'OK' => 'Oklahoma',
'OR' => 'Oregon',
'PA' => 'Pennsylvania',
'RI' => 'Rhode Island',
'SC' => 'South Carolina',
'SD' => 'South Dakota',
'TN' => 'Tennessee',
'TX' => 'Texas',
'UT' => 'Utah',
'VT' => 'Vermont',
'VA' => 'Virginia',
'WA' => 'Washington',
'WV' => 'West Virginia',
'WI' => 'Wisconsin',
'WY' => 'Wyoming',
];
}
private function ngStates()
{
return [
'FC' => 'Abuja',
'AB' => 'Abia',
'AD' => 'Adamawa',
'AK' => 'Akwa Ibom',
'AN' => 'Anambra',
'BA' => 'Bauchi',
'BY' => 'Bayelsa',
'BE' => 'Benue',
'BO' => 'Borno',
'CR' => 'Cross River',
'DE' => 'Delta',
'EB' => 'Ebonyi',
'ED' => 'Edo',
'EK' => 'Ekiti',
'EN' => 'Enugu',
'GO' => 'Gombe',
'IM' => 'Imo',
'JI' => 'Jigawa',
'KD' => 'Kaduna',
'KN' => 'Kano',
'KT' => 'Katsina',
'KE' => 'Kebbi',
'KO' => 'Kogi',
'KW' => 'Kwara',
'LA' => 'Lagos',
'NA' => 'Nassarawa',
'NI' => 'Niger',
'OG' => 'Ogun',
'ON' => 'Ondo',
'OS' => 'Osun',
'OY' => 'Oyo',
'PL' => 'Plateau',
'RI' => 'Rivers',
'SO' => 'Sokoto',
'TA' => 'Taraba',
'YO' => 'Yobe',
'ZA' => 'Zamfara',
];
}
private function caStates()
{
return [
'AB' => 'Alberta',
'BC' => 'British Columbia',
'MB' => 'Manitoba',
'NB' => 'New Brunswick',
'NL' => 'Newfoundland and Labrador',
'NS' => 'Nova Scotia',
'ON' => 'Ontario',
'PE' => 'Prince Edward Island',
'QC' => 'Quebec',
'SK' => 'Saskatchewan',
'NT' => 'Northwest Territories',
'NU' => 'Nunavut',
'YT' => 'Yukon',
];
}
}
+7 -18
View File
@@ -2,21 +2,15 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchTransactions extends BaseController
{
use ResponseTrait;
public function apigate(){
log_message('critical', "WrenchTransactions-Gate");
header('Access-Control-Allow-Origin: *');
log_message('critical', "0002");
$call_backend = true;
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 3600");
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
if ($method == "OPTIONS") {
header("HTTP/1.1 200 OK CORS");
@@ -24,8 +18,6 @@ class WrenchTransactions extends BaseController
die();
}
//$request = service('request');
// what is the endpoint
$uri = urldecode(current_url(true));
$findme = '?';
$pos = strpos($uri, $findme);
@@ -93,11 +85,10 @@ class WrenchTransactions extends BaseController
$in["loc"] = $_SERVER["REMOTE_ADDR"];
log_message('critical', "wrenchboard_api-CALL PREPARE DATA".serialize($in) );
$out = [];
if ( $call_backend == true && $in["action"] !='' ){
log_message('critical', "WrenchTransactions-Gate 007 ->".$endpoint);
$wrenchboard = new \App\Models\BackendModel();
$ret = $wrenchboard->wrenchboard_api($in, $out);
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
}
else
@@ -105,10 +96,8 @@ class WrenchTransactions extends BaseController
$out = $local_out;
}
$this->doCacheStep($in, $out);
return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));
return $this->response->setJson($response);
log_message('critical', "REACH HERE ***** wrenchboard_api-startcredit".serialize($out) );
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
private function rawDataToInData($in){
+72
View File
@@ -0,0 +1,72 @@
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class WrenchUser extends BaseController
{
use ResponseTrait;
public function UsersFiles(){
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_MYFILES_LIST;
$out=[];
$endpoint = "UPLOADS-USER-". str_replace("-", "_", $in["uid"]);;
$out = $this->getCache($endpoint);
if ( count($out)==0 ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint,$out,15000);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchUser::UsersFiles Cache Done:::Ret ". $ret);
}
log_message('critical', "***** ***** WrenchUser::UsersFiles Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function UsersRefLink(){
//const WRENCHBOARD_MYREFLINK = 11310;
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_MYREFLINK;
$out=[];
$in["uid_part"] = substr(trim($in["refer_link"]), 0, 8);
$in["member_id"] = (int) substr(trim($in["refer_link"]), 9);
log_message('critical', "***** ***** WrenchUser::UsersRefLink uid_part = ".$in["uid_part"]);
log_message('critical', "***** ***** WrenchUser::UsersRefLink member_id = ". $in["member_id"]);
if ( $in["uid_part"] !='' && $in["member_id"] > 0 ){
log_message('critical', "***** ***** WrenchUser::UsersRefLink IN Call Backend ");
$in["refer_link"] = $this->website_url."/myrefer/".$in["refer_link"];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
}
log_message('critical', "***** ***** WrenchUser::UsersRefLink Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function loadProfile()
{
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_MOBILE_LOADPROFILE;
$out = [];
$endpoint = "WRENCHBOARD_MOBILE_LOADPROFILE-" . $in["client_uid"];
$out = $this->getCache($endpoint);
if (count($out) == 0) {
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$this->saveCache($endpoint, $out, 1500);
$out['internal_return'] = $ret;
log_message('critical', "***** ***** WrenchJobs::loadProfile Cache Done:::Ret " . $ret);
}
log_message('critical', "***** ***** WrenchJobs::loadProfile Ret ");
return $this->respond($this->summaryReturnData($in, $out), 200);
}
}
+18 -19
View File
@@ -26,7 +26,7 @@ class WrenchUserContacts extends BaseController
raw_contacts: contactResult }
*/
public function usersContacts(){
log_message('critical', "*********** WrenchUserContacts::usersContacts() 0000 ");
// log_message('critical', "*********** WrenchUserContacts::usersContacts() 0000 ");
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
@@ -36,37 +36,36 @@ class WrenchUserContacts extends BaseController
if (isset($in["uid"]) && $in["uid"] !='' ){
$in["member_uid"]=$in["uid"];
}
$member_uid = str_replace("-", "_", $in["uid"]);
$time_to_save = false;
$endpoint = "CONTACTS_IMPORT_ACTION-". $in["uid"];
$endpoint = "CONTACTS_IMPORT_ACTION-". $member_uid;
$outC = $this->getCache($endpoint); // try find in cache
if ( $in["mmode"] == 0 ){
if (isset($outC) && is_array($outC) && isset($outC['raw_contacts'])){
log_message('critical', "************* WrenchUserContacts REFRESH 0002 ".serialize($in));
$outC["raw_contacts_". $in["mmode"]] = $in["raw_contacts"]; // extra store raw
$this->deleteCache($endpoint);
$this->saveCache($endpoint,$in,1300);
$this->saveCache($endpoint,$outC,5300);
}
else
{
$outC = $this->getCache($endpoint); // try find in cache
$outArr = $outC; // unserialize( $outC );
log_message('critical', "CACHE READ ***** WrenchUserContacts::usersContacts() ----**> ".$outArr["raw_contacts"]);
$in["raw_contacts"] = $in["raw_contacts"].$outC["raw_contacts"];
$this->deleteCache($endpoint);
// $this->deleteCache($endpoint);
log_message('critical', "************* WrenchUserContacts CREATE 0001 ".serialize($in));
$in["raw_contacts_". $in["mmode"]] = $in["raw_contacts"]; // extra store raw
$this->saveCache($endpoint,$in,5300);
/*
Determine if this is the last
Fire process events
save to the backend database;
*/
if ($in["csize"] + $in["mmode"] >= $in["pcount"]){
$time_to_save = true;
}
}
if ($in["csize"] + $in["mmode"] >= $in["pcount"]){
$time_to_save = true;
}
///=== cache game gere
if($time_to_save){
$in["raw_contacts"] = serialize($in['raw_contacts']);
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
// $ret = $this->wrenchboard->wrenchboard_api($in, $out);
// $out['internal_return'] = $ret;
}
else{
$out["status_msg"] = "Received and cached";
+199 -144
View File
@@ -6,12 +6,15 @@ use CodeIgniter\API\ResponseTrait;
class WrenchWallet extends BaseController
{
protected \App\Models\WrenchWalletModel $wrenchWalletModel;
use ResponseTrait;
public function __construct()
{
log_message('critical', "WrenchWallet Path GATE 001");
$this->request = $request = \Config\Services::request();
$this->wrenchWalletModel = new \App\Models\WrenchWalletModel($this->allSettings);
}
@@ -60,8 +63,31 @@ class WrenchWallet extends BaseController
return [];
}
public function requestVirtualCard(){
log_message('critical', "WrenchWallet::requestVirtualCard Path GATE ***");
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_VIRTUAL_CARDADD;
$out=[];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "requestVirtualCard ********* ALL ".serialize($out) );
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function requestFamilyVirtualCard(){
log_message('critical', "WrenchWallet::requestFamilyVirtualCard Path GATE ***");
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = WRENCHBOARD_VIRTUAL_FAMILY_CARD;
$out=[];
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "requestFamilyVirtualCard ********* ALL ".serialize($out) );
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function redeemOptions(){
log_message('critical', "0001");
log_message('critical', "redeemOptions 0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchWallet Path GATE 001");
$call_backend = true;
@@ -157,172 +183,201 @@ class WrenchWallet extends BaseController
return json_encode( $final_out );
}
//getKidWallet
// private function getSettings($settingkey, $defaultVal=''){
// $raw_json = file_get_contents('php://input');
// $in = json_decode($raw_json, true);
// $out=[];
// $endpoint = "SETTINGS";
// $out = $this->getCache($endpoint);
// if (!is_array($out) || count($out)==0 ) {
// $local_url = "http://".$this->micro_service_net1.":3037/settings";
// $out = $this->APIcall('GET', $local_url, $in);
// if (count($out['result_list']) > 0 ){ // dont cache empty
// $this->saveCache($endpoint,$out,55500);
// }
// }
//
// if (is_array($out) && count($out['result_list']) > 0 ) {
// return (isset($out['result_list'][$settingkey])) ? $out['result_list'][$settingkey]: $defaultVal;
// }
// return $defaultVal;
// }
//getKidWallet from parent side
public function getKidWallet(){
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchWallet Path getWallet 001");
$call_backend = true;
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 3600");
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
$ip_loc = $this->getIpData();
log_message('critical', "WrenchWallet Path getWallet 003");
//$request = service('request');
// what is the endpoint
$uri = urldecode(current_url(true));
$findme = '?';
$pos = strpos($uri, $findme);
if ($pos > 5) {
$uri = substr($uri, 0, $pos);
}
log_message('critical', "API-WrenchWallet URI -> ".$uri );
$pieces = explode('/', $uri);
$psc = count($pieces);
$endpoint = $psc > 0 ? $pieces[$psc - 1] : '';
log_message('critical', "Endpoint-> ".$endpoint );
$endpoints = $this->endPointList();
$out = array();
$res1 = [];
$current_env = $this->getSiteConfigurations("system.live");
$primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$server_tag = $this->getSiteConfigurations("system.server_tag");
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
// echo "EXYTACT INPUT DATA HERE";
// header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchWallet Path getKidWallet 001");
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$local_out =[];
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
log_message('critical', "Endpoint LOC2 HERE -> ".$endpoint );
$get_param = $_GET['reqData'] ?? null;
$raw_array = ($get_param!=null) ? json_decode($get_param, true):[];
}
$in = $raw_array;
$in = json_decode($raw_json, true);
$out=[];
$endpoint = "WALLETS-USERS_KIDS-". str_replace('-','_', $in["family_uid"]);
$in["loc"] = $_SERVER["REMOTE_ADDR"];
log_message('critical', "IN ARRAY for call 0001 -> ".serialize($in));
$in["action"] = 'getkidswallets'; //WRENCHBOARD_ACCOUNT_JOBLIST;
log_message('critical', "before APIN call 0001");
if ( $call_backend == true && $in["action"] !='' ){
$local_url = "http://".$micro_service_net1.":3037/getkidswallets";
//log_message('critical', "before APIN call 0001");
$out = $this->getCache($endpoint);
if (!is_array($out) || count($out)==0 ){
// if ( $in["action"] !='' ){
$local_url = "http://".$this->micro_service_net1.":3037/getkidswallets";
$out = $this->APIcall('GET', $local_url, $in);
}
else
{
$out = $local_out;
if( is_array($out['result_list']) && count($out['result_list']) > 0 ){ // dont cache empty
$this->saveCache($endpoint,$out,60);
}
}
if ( is_array($out) && isset($out['result_list'])){
foreach ($out['result_list'] as $index=>$item){
if ($item['code']=='USD'){
$out['result_list'][$index]['extra_actions'] =
[
'ADD_VIRTUAL_CARD' => $this->wrenchWalletModel->addVirtualCardWallet()
];
}
else{
$out['result_list'][$index]['extra_actions'] = [];
}
}
}
$extraWallet = $this->wrenchWalletModel->kidsExtraWallet();
//$out["result_list"][] = $extraWallet;
$out["wallet_cards"] = [];
//$this->doCacheStep($in, $out);
// $final_out = $out; // start from all out
// $final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live");
// $final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
// $final_out["server_tag"] = $server_tag;
// $final_out["language"] = "en";
// $final_out["ip_loc"] = $ip_loc;
// return json_encode( $final_out );
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function getWallet(){
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "WrenchWallet Path getWallet 001");
$call_backend = true;
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 3600");
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
$ip_loc = $this->getIpData();
log_message('critical', "WrenchWallet Path getWallet 003");
//$request = service('request');
// what is the endpoint
$uri = urldecode(current_url(true));
$findme = '?';
$pos = strpos($uri, $findme);
if ($pos > 5) {
$uri = substr($uri, 0, $pos);
}
log_message('critical', "API-WrenchWallet URI -> ".$uri );
$pieces = explode('/', $uri);
$psc = count($pieces);
$endpoint = $psc > 0 ? $pieces[$psc - 1] : '';
log_message('critical', "Endpoint-> ".$endpoint );
$endpoints = $this->endPointList();
$out = array();
$res1 = [];
$current_env = $this->getSiteConfigurations("system.live");
$primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$server_tag = $this->getSiteConfigurations("system.server_tag");
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
// echo "EXYTACT INPUT DATA HERE";
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$local_out =[];
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
log_message('critical', "Endpoint LOC2 HERE -> ".$endpoint );
$get_param = $_GET['reqData'] ?? null;
$raw_array = ($get_param!=null) ? json_decode($get_param, true):[];
$in = json_decode($raw_json, true);
$in["action"] = 'getwallets';
$out=[];
$endpoint = "WALLETS-USERS-". str_replace('-','_', $in["uid"]);
$out = $this->getCache($endpoint);
$previous_wallet = false;
if (is_array($out) && is_array($out['result_list']) && count($out['result_list'])>0 ){
$previous_wallet = true;
}
$in = $raw_array;
$in["loc"] = $_SERVER["REMOTE_ADDR"];
log_message('critical', "IN ARRAY for call 0001 -> ".serialize($in));
$in["action"] = 'getwallets'; //WRENCHBOARD_ACCOUNT_JOBLIST;
log_message('critical', "before APIN call 0001");
if ( $call_backend == true && $in["action"] !='' ){
$local_url = "http://".$micro_service_net1.":3037/getwallets";
if (!$previous_wallet){
$local_url = "http://".$this->micro_service_net1.":3037/getwallets";
$out = $this->APIcall('GET', $local_url, $in);
}
else
{
$out = $local_out;
if ( is_array($out['result_list']) && count($out['result_list']) > 0 ){ // dont cache empty
$previous_wallet = true;
$this->saveCache($endpoint,$out,180);
}
}
if ($previous_wallet ){
foreach ($out['result_list'] as $index=>$item){
if ($item['code']=='USD' && $this->show_extra_wallet == 1 ){
$out['result_list'][$index]['extra_actions'] =
[
'ADD_VIRTUAL_CARD' => $this->wrenchWalletModel->addVirtualCardWallet()
];
}
elseif ($item['code']=='NAIRA'){
$out['result_list'][$index]['extra_actions'] =
[
'SPEND_FROM_BALANCE' => $this->wrenchWalletModel->spendFromBalanceWallet()
];
}
else{
$out['result_list'][$index]['extra_actions'] = [];
}
}
}
$this->doCacheStep($in, $out);
$final_out = $out; // start from all out
$final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live");
$final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
$final_out["server_tag"] = $server_tag;
$final_out["language"] = "en";
$final_out["ip_loc"] = $ip_loc;
return json_encode( $final_out );
if ( $previous_wallet ){
$owner_country = $out["result_list"][0]['owner_country'];
// $wallet_country = $first_names = array_column($owner_country , 'country');;
$auxWallet = $this->auxiliaryWallets($owner_country);
foreach ($auxWallet as $item){
// $out["result_list"][] = $item;
}
}
log_message('critical', "***** ***** WrenchJobs::getWallet Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
private function auxiliaryWallets( $owner_country ): array {
$auxWallet = [
[
"wallet_country" => ['US'],
"amount" => 0,
"id" => 1,
"code" => "USD",
"description" => "Add Virtual Debit Card",
"symbol" => "$",
"action_type" => "AC_AD_VIRTUAL_CARD",
"lorder" => 0,
"country" => "",
"processor" => 9010,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => $this->getSettings('ENABLE_EXTRA_WALLET', 0),
"show_balance" => false,
"rt_action_text" => "Add Card",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-card.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/cards.png'
],
[
"wallet_country" => [],
"amount" => 0,
"id" => 1,
"code" => "USD",
"description" => "Wrench Token",
"symbol" => "$",
"action_type" => "AC_AD_WR_TOKEN",
"lorder" => 0,
"country" => "",
"processor" => 9012,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => $this->getSettings('ENABLE_EXTRA_WALLET', 0),
"show_balance" => true,
"rt_action_text" => "View",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-token.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/token.png'
],
[
"wallet_country" => [],
"amount" => 0,
"id" => 1,
"code" => "USD",
"description" => "Wrench Points",
"symbol" => "$",
"action_type" => "AC_AD_WR_POINTS",
"lorder" => 0,
"country" => "",
"processor" => 9014,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => $this->getSettings('ENABLE_EXTRA_WALLET', 0),
"show_balance" => true,
"rt_action_text" => "Redeem",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-point.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/point.png'
]
];
log_message('critical', "***** ***** auxiliaryWallets::ALL ITEM ". serialize($auxWallet));
log_message('critical', "***** ***** auxiliaryWallets::ITEM ENTER **********");
$retArr=[];
foreach ( $auxWallet as $item){
if ( in_array( $owner_country, $item['wallet_country']) && $item['status'] == 100 ){
log_message('critical', "***** ***** auxiliaryWallets::ITEM ". serialize($item));
$retArr[] =$item;
}
}
return $retArr;
}
public function getEscrols(){
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
+118 -6
View File
@@ -115,10 +115,48 @@ class ResultFormatter extends Model
}
public function processOutJson($in, $out) {
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
switch ($in["action"]) {
case WRENCHBOARD_PROMOADMIN_ACTIONLIST:
$total = $out["total_record"];
$res = array(
"status" => $out["status"],
"total_record" => $total,
"internal_return" => $out["internal_return"],
"result_list" => array(),
);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$res["result_list"][] = array(
"category" => $out["category_${key}"],
"description" => $out["description_${key}"],
"status" => $out["status_${key}"],
"added" => $out["added_${key}"],
"updated" => $out["updated_${key}"]
);
}
break;
case WRENCHBOARD_PROMOADMIN_GETLIST:
$total = $out["total_record"];
$res = array(
"status" => $out["status"],
"total_record" => $total,
"internal_return" => $out["internal_return"],
"result_list" => array(),
);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$res["result_list"][] = array(
"firstname" => $out["firstname_${key}"],
"uid" => $out["uid_${key}"],
"lastname" => $out["lastname_${key}"],
"email" => $out["email_${key}"],
"status" => $out["status_${key}"],
"added" => $out["added_${key}"],
"updated" => $out["updated_${key}"]
);
}
break;
case WRENCHBOARD_ACCOUNT_PREFERENCES:
$total = $out["total_record"];
$res = array(
@@ -426,7 +464,7 @@ class ResultFormatter extends Model
$total = $out["total_record"];
$res = array(
"status" => $out["status"],
"total_record" => ($total - 1),
"total_record" => ($total),
"internal_return" => $out["internal_return"],
"family_action" => 0,
"home_dash_type" => $out["home_dash_type"],
@@ -454,6 +492,73 @@ class ResultFormatter extends Model
);
}
break;
case WRENCHBOARD_FAMILY_HOMEBANNERS:
$total = $out["total_record"];
$res = array(
"status" => $out["status"],
"total_record" => ($total - 1),
"internal_return" => $out["internal_return"],
"family_action" => 0,
"home_dash_type" => $out["home_dash_type"],
"result_list" => array(),
);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$banner_action = $out["action_${key}"];
/*
$res["result_list"][] =
[$banner_action =>
["banner" =>
[
"text" => $out["title_${key}"],
"contract" => $out["contract_${key}"],
"card_type" => $out["card_type_${key}"],
"style" => $out["card_style_${key}"],
"description" => $out["description_${key}"],
"blog_id" => $out["blog_id_${key}"],
"card_icon" => $out["card_icon_${key}"],
"offer_id" => $out["offer_id_${key}"],
"image" => $this->fixEmptyBanner( $out["banner_${key}"]),
"banner_location" => $out["banner_location_${key}"],
"link_path" => $out["link_path_${key}"],
"action" => $banner_action,
"button_text" => $out["button_text_${key}"],
"short_button_text" => $out["short_button_text_${key}"],
"short_title" => $out["short_title_${key}"],
"short_description" => $out["short_description_${key}"],
"short_style" => $out["short_style_${key}"],
"status"=> 1
]
]
];
*/
$res["result_list"][$banner_action] =
["banner" =>
[
"text" => $out["title_${key}"],
"contract" => $out["contract_${key}"],
"card_type" => $out["card_type_${key}"],
"style" => $out["card_style_${key}"],
"description" => $out["description_${key}"],
"blog_id" => $out["blog_id_${key}"],
"card_icon" => $out["card_icon_${key}"],
"offer_id" => $out["offer_id_${key}"],
"image" => $this->fixEmptyBanner( $out["banner_${key}"]),
"banner_location" => $out["banner_location_${key}"],
"link_path" => $out["link_path_${key}"],
"action" => $banner_action,
"button_text" => $out["button_text_${key}"],
"short_button_text" => $out["short_button_text_${key}"],
"short_title" => $out["short_title_${key}"],
"short_description" => $out["short_description_${key}"],
"short_style" => $out["short_style_${key}"],
"status"=> 1
]
];
}
break;
case WRENCHBOARD_CONTRACT_MSGLIST:
$total = $out["total_record"];
$res = array(
@@ -768,7 +873,10 @@ class ResultFormatter extends Model
'interest_count' => $out["${$int_c}"] ?? 0,
'ext_request' => $out["ext_request_${key}"],
'category' => $this->dummyGetCategory( $cateG ),
'depend_uid' => $out["depend_uid_${key}"]
'depend_uid' => $out["depend_uid_${key}"],
'strict_timeline' => $out["strict_timeline_${key}"],
'minimum_due' => $out["minimum_due_${key}"]
);
}
@@ -817,7 +925,10 @@ class ResultFormatter extends Model
"confirmation" => $out["confirmation_${key}"],
"status" => $out["status_${key}"],
"trx_date" => $out["trx_date_${key}"],
"trx_id" => $out["trx_id_${key}"]
"trx_id" => $out["trx_id_${key}"],
"code" => $out["code_${key}"],
"currency" => $out["currency_${key}"],
"symbol" => $out["symbol_${key}"]
);
}
break;
@@ -838,7 +949,8 @@ class ResultFormatter extends Model
"status" => $out["status_${key}"],
"added_date" => $out["added_date_${key}"],
"payment_id" => $out["id_${key}"],
"payment_uid" => $out["uid_${key}"]
"payment_uid" => $out["uid_${key}"],
"currency"=> $out["currency_${key}"],
);
}
break;
+93
View File
@@ -0,0 +1,93 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class WrenchWalletModel extends Model
{
protected array $allSettings;
public function __construct( $allSettings )
{
parent::__construct();
$this->allSettings =$allSettings;
log_message('critical', "WrenchWalletModel _construct");
}
public function kidsExtraWallet():array{
return [
"amount" => 0,
"id" => 1,
"code" => "USD",
"description" => "Add Virtual Debit Card",
"symbol" => "$",
"action_type" => "AC_AD_VIRTUAL_CARD",
"lorder" => 0,
"country" => "",
"processor" => 9010,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => $this->allSettings['ENABLE_EXTRA_KIDWALLET'] ?? 0,
"show_balance" => false,
"rt_action_text" => "Add Card",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-card.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/cards.png'
];
}
public function addVirtualCardWallet():array{
return [
[
"text" => 'Add Card',
"action_key" => 'ADD_VIRTUAL_CARD_STRP',
"wallet_country" => ['US'],
"amount" => 0,
"id" => 1,
"code" => "USD",
"description" => "Add Virtual Debit Card",
"symbol" => "$",
"action_type" => "AC_AD_VIRTUAL_CARD",
"lorder" => 0,
"country" => "",
"processor" => 9010,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => 0,
"show_balance" => false,
"rt_action_text" => "Add Card",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-card.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/cards.png'
]
];
}
public function spendFromBalanceWallet():array{
return [
[
"text" => 'Spend',
"action_key" => 'SPEND_TO_BANK_FLTW',
"wallet_country" => ['NG'],
"amount" => 0,
"id" => 1,
"code" => "NAIRA",
"description" => "Spend from balance",
"symbol" => "$",
"action_type" => "AC_AD_WR_FUND",
"lorder" => 0,
"country" => "",
"processor" => 9010,
"current_balance" => 0,
"transfer_limit" => 0,
"wallet_uid" => "",
"escrow" => 0,
"status" => 0,
"show_balance" => false,
"rt_action_text" => "Spend",
"banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-card.jpg',
"icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/cards.png'
]
];
}
}
+1 -1
View File
@@ -68,7 +68,7 @@
}
</style>
</head>
<body>
<body style="background:url(/assets/images/background-animate.gif); background-size: cover;">
<div class="wrap">
<h1>404 - File Not Found</h1>