From 841cab75ebb273896bff36c01be416d943c8fddb Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Mon, 23 Sep 2024 05:12:50 -0400 Subject: [PATCH] due date --- .../email/JOB/job_duereminder.mailfile | 339 +++++++++--------- wrenchboard/src/include/wrenchboard_api.h | 2 + wrenchboard/src/shared_tool/email.cc | 10 +- wrenchboard/src/shared_tool/reco_egine.cc | 4 +- wrenchboard/src/shared_tool/site_crons.cc | 18 + www-api/app/Config/Routes.php | 2 + www-api/app/Controllers/AirFlow.php | 13 +- 7 files changed, 211 insertions(+), 177 deletions(-) diff --git a/wrenchboard/email/JOB/job_duereminder.mailfile b/wrenchboard/email/JOB/job_duereminder.mailfile index 2648ddcc..3a89f338 100644 --- a/wrenchboard/email/JOB/job_duereminder.mailfile +++ b/wrenchboard/email/JOB/job_duereminder.mailfile @@ -1,11 +1,11 @@ -Subject: {{subject}} +Subject: {{subject}} - -{{subject}} + + {{subject}} - - + - - -
- - - - - - - - - - - - - + + + + - + + + + - -
- - - - -
-WrenchBoard -
- - - - - - - - - - + - -
+ + + + + - -
- - - - - - -
-{{site_name}} -
-{{site_trade_name}} -
-
- -
- - - - - - - -
-Message from {{firstname}}, -
-The task at {{site_name}} shown below is fast approaching deadline. -
-
- - - - -
- -
- - - - + + + + + + - - - - - - - - - + +
- - - + + + + + +
-Title: +
+ WrenchBoard +
+ {{site_trade_name}} +
+
+ + + + +
+ Message from {{firstname}}, +
+
-{{title}} -
-Job ID: -{{contract}} -
-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. -
-Delivery Date: + + + +
+ + + + -{{delivery_date}} - + + -
+ The task at {{site_name}} shown below is fast approaching deadline. +
+ Due Date : {{due_date}}. +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ Title : + + {{title}} +
+ Offer ID : + + {{offer_code}} +
+ Duration : + + {{timeline_days}} day(s) +
+ Reward : + + {{price}} {{currency}} +
+ Detail : + + {{job_description}} +
+
+
-
+
+ +

Please login into your account to manage this task.

+
+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.
- -
- -
-Please contact us at https://www.wrenchboard.com/contact if you have any question about this email. -
+ +
+ If you have any further support question, Please contact us at {{server_name}}/contact
+
+
{{site_name}} Team
{{server_name}} -
-
- - - - - - \ No newline at end of file + diff --git a/wrenchboard/src/include/wrenchboard_api.h b/wrenchboard/src/include/wrenchboard_api.h index 91d6542c..571e66e5 100644 --- a/wrenchboard/src/include/wrenchboard_api.h +++ b/wrenchboard/src/include/wrenchboard_api.h @@ -166,6 +166,8 @@ enum { PARTNER_STRIPE }; #define WRB_CRONJOB_SCHEULETRANSFER 780 #define WRB_CRONJOB_PROCESSTRANSFER 781 +#define WRB_CRONJOB_AUTO_OFFEREXPIRE 785 + #define WRB_CRONJOB_PENDINGSM 790 //************************************************************** diff --git a/wrenchboard/src/shared_tool/email.cc b/wrenchboard/src/shared_tool/email.cc index 3d1ef099..18b6df53 100644 --- a/wrenchboard/src/shared_tool/email.cc +++ b/wrenchboard/src/shared_tool/email.cc @@ -704,12 +704,18 @@ long job_email(long mailtype, CVars in, CVars &out) { case JOBS_DUE_APPROACH_MAIL: - if (load_db_record(x, "SELECT m.firstname,m.email,mj.title,c.* FROM members_jobs_contract c LEFT JOIN members m ON m.id=c.client_id LEFT JOIN members_jobs mj ON mj.id = c.job_id WHERE c.id=%lu AND c.due_remind IS NULL", in["contract_id"].Long())) { + 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", "Task Due Date Approaching"); + 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"); diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 7081e143..7fe5899a 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -114,9 +114,9 @@ long WrenchHomeBanners(CVars in, CVars &out) { } - - if( RecoCheckBlog( 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["home_dash_type"]="DEFAULT_HOME_DASH"; diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc index cd81d398..d62d96bc 100644 --- a/wrenchboard/src/shared_tool/site_crons.cc +++ b/wrenchboard/src/shared_tool/site_crons.cc @@ -31,6 +31,8 @@ long ProcessGroupJobs(CVars in, CVars &out); long ProcessTransferJobs(CVars in, CVars &out); long ScheduleTransferJobs(CVars in, CVars &out); long TestNotificationsJobs(CVars in, CVars &out); +long ProcessExpiredOffers(CVars in, CVars &out); + /* CREATE TABLE cron_jobs ( id SERIAL, @@ -139,12 +141,28 @@ long sitecrons_calls(CVars in, CVars &out) { return ProcessTransferJobs(in, out); break; + case WRB_CRONJOB_AUTO_OFFEREXPIRE: + ct["job_type"]="WRB_CRONJOB_AUTO_OFFEREXPIRE"; ct["job_type"].set_valid( true ); + ct["description"]="Process Transfer Expired Offers"; ct["description"].set_valid( true ); + CronTracker(ct, co); + return ProcessExpiredOffers(in, out); + break; + + } logfmt(logINFO, "/sitecrons_calls()"); return ret; } +long ProcessExpiredOffers(CVars in, CVars &out){ +// if ( load_db_record(out, "SELECT count(uid) AS pending_count FROM money_transfer WHERE status =1 AND completed IS NULL ")> 0){ +// if ( out["pending_count"].Long() > 0 ){ +// alert_email(WRB_CRONJOB_PENDINGSM,out, out); +// } +// } +return 0; +} long ProcessTransferJobs(CVars in, CVars &out){ // if ( load_db_record(out, "SELECT count(uid) AS pending_count FROM money_transfer WHERE status =1 AND completed IS NULL ")> 0){ diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 4792a6eb..2cdc01cb 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -53,6 +53,8 @@ $routes->get('/en/flow/api/v1/processtransfer', 'AirFlow::flowProcessTransf $routes->get('/en/flow/api/v1/scheduletransfer', 'AirFlow::flowScheduleTransfer'); $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'); + include "RoutesV1.php"; diff --git a/www-api/app/Controllers/AirFlow.php b/www-api/app/Controllers/AirFlow.php index f39dffc9..0c744be7 100644 --- a/www-api/app/Controllers/AirFlow.php +++ b/www-api/app/Controllers/AirFlow.php @@ -14,6 +14,8 @@ define('WRB_CRONJOB_TESTNOTIFICATIONS', 779); define('WRB_CRONJOB_SCHEULETRANSFER', 780); define('WRB_CRONJOB_PROCESSTRANSFER', 781); +define('WRB_CRONJOB_AUTO_OFFEREXPIRE', 785); + define('WRB_CRONJOB_PENDINGSM', 790) ; class AirFlow extends BaseController @@ -49,7 +51,16 @@ class AirFlow extends BaseController // return []; //json_encode( $final_out ); } - // + public function flowOfferMissed(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["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 ); + } + public function flowInterestcount(){ $raw_json = file_get_contents('php://input'); $in = json_decode($raw_json, true);