diff --git a/wrenchboard/email/ACCOUNT/member_welcome.mailfile b/wrenchboard/email/ACCOUNT/member_welcome.mailfile index 007dc23a..94dc163b 100644 --- a/wrenchboard/email/ACCOUNT/member_welcome.mailfile +++ b/wrenchboard/email/ACCOUNT/member_welcome.mailfile @@ -66,27 +66,22 @@ img {height: auto;} - - - - -
- -
+ - +
@@ -104,14 +99,14 @@ With {{site_name}}, you can enjoy free coor @@ -127,7 +122,7 @@ With {{site_name}}, you can enjoy free coor diff --git a/wrenchboard/email/ALERT/alert_contact.mailfile b/wrenchboard/email/ALERT/alert_contact.mailfile index 201e38c0..63fb4d7a 100644 --- a/wrenchboard/email/ALERT/alert_contact.mailfile +++ b/wrenchboard/email/ALERT/alert_contact.mailfile @@ -1,4 +1,4 @@ -Subject: {{subject}} +Subject: System Alert : {{subject}} diff --git a/wrenchboard/email/ALERT/alert_daily_stats.mailfile b/wrenchboard/email/ALERT/alert_daily_stats.mailfile index 1b9fc585..288c2a0b 100644 --- a/wrenchboard/email/ALERT/alert_daily_stats.mailfile +++ b/wrenchboard/email/ALERT/alert_daily_stats.mailfile @@ -1,4 +1,4 @@ -Subject: WrenchBoard Report {{site_name}} +Subject: System Alert-WrenchBoard Report {{site_name}} diff --git a/wrenchboard/email/ALERT/alert_jobs_created.mailfile b/wrenchboard/email/ALERT/alert_jobs_created.mailfile index fa35652d..42b22b9b 100644 --- a/wrenchboard/email/ALERT/alert_jobs_created.mailfile +++ b/wrenchboard/email/ALERT/alert_jobs_created.mailfile @@ -1,4 +1,4 @@ -Subject: {{subject}} +Subject: System Alert : {{subject}} diff --git a/wrenchboard/email/ALERT/alert_signup.mailfile b/wrenchboard/email/ALERT/alert_signup.mailfile index 0f48ec61..5dd72774 100644 --- a/wrenchboard/email/ALERT/alert_signup.mailfile +++ b/wrenchboard/email/ALERT/alert_signup.mailfile @@ -1,4 +1,4 @@ -Subject: WrenchBoard Signup Pending ALERT +Subject: System Alert-WrenchBoard Signup Pending ALERT diff --git a/wrenchboard/email/ALERT/alert_signupcompleted.mailfile b/wrenchboard/email/ALERT/alert_signupcompleted.mailfile index 2c50a3e2..df21c8e0 100644 --- a/wrenchboard/email/ALERT/alert_signupcompleted.mailfile +++ b/wrenchboard/email/ALERT/alert_signupcompleted.mailfile @@ -1,4 +1,4 @@ -Subject: {{site_name}} - Completed Signup ALERT +Subject: System Alert-{{site_name}} - Completed Signup ALERT diff --git a/wrenchboard/email/ALERT/template.mailfile b/wrenchboard/email/ALERT/template.mailfile index 510219ef..89cd1ca9 100644 --- a/wrenchboard/email/ALERT/template.mailfile +++ b/wrenchboard/email/ALERT/template.mailfile @@ -1,4 +1,4 @@ -Subject: {{subject}} +Subject: System Alert-{{subject}} diff --git a/wrenchboard/email/JOB/job_due_reviewreminder.mailfile b/wrenchboard/email/JOB/job_due_reviewreminder.mailfile index f42abea6..137c8b2a 100644 --- a/wrenchboard/email/JOB/job_due_reviewreminder.mailfile +++ b/wrenchboard/email/JOB/job_due_reviewreminder.mailfile @@ -62,14 +62,14 @@ img {height: auto;} @@ -83,7 +83,7 @@ It is essential that you login and process the task(s) appropriately. In the eve @@ -120,12 +120,12 @@ You received this email because you subscribe to {{site_name}}. If you get this diff --git a/wrenchboard/email/JOB/job_duereminder.mailfile b/wrenchboard/email/JOB/job_duereminder.mailfile index eaf80f2e..741b3b85 100644 --- a/wrenchboard/email/JOB/job_duereminder.mailfile +++ b/wrenchboard/email/JOB/job_duereminder.mailfile @@ -56,7 +56,7 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
- {{site_name}} empowers you to find jobs or join jobs group. With {{site_name}} you can set up and post your jobs and find expert skills sets to get them done. + {{site_name}} empowers you to find jobs or join jobs group. With {{site_name}} you can set up and post your jobs and find expert skills sets to get them done.
-With {{site_name}}, you can enjoy free coordinated skills training section. Empower yourself and be around those that work with latest to update your knowledge.
+
+With {{site_name}}, you can enjoy free coordinated skills training section. Empower yourself and be around those that work with latest to update your knowledge.
- +
- If you did not initiate this account creation or have any further support question, Please contact us at https://{{server_name}}/contact
+ If you did not initiate this account creation or have any further support question, Please contact us at {{server_name}}/contact

-With {{site_name}}, you can enjoy free coordinated skills training section. Empower yourself and be around those that work with latest to update your knowledge. +With {{site_name}}, you can enjoy free coordinated skills training section. Empower yourself and be around those that work with latest to update your knowledge.
® {{site_name}} 2022
- You received this email because you subscribe to {{site_name}}. If you get this email in error, please contact us. + You received this email because you subscribe to {{site_name}}. If you get this email in error, please contact us.
-You now have {{preview_count}} task(s) at {{site_name}} in "Preview" status and your attention is needed. +You now have {{preview_count}} task(s) at {{site_name}} in "Preview" status and your attention is needed.

-It is essential that you login and process the task(s) appropriately. In the event of no response from you, {{site_name}} will automatically pay the client and close the task for you in few hours. +It is essential that you login and process the task(s) appropriately. In the event of no response from you, {{site_name}} will automatically pay the client and close the task for you in few hours.

-

Please login into your account to manage this task.

+

Please login into your account to manage this task.

-Facebook +Facebook -Twitter +Twitter
-WrenchBoard +WrenchBoard
@@ -101,7 +101,7 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
-The task at {{site_name}} shown below is fast approaching deadline. +The task at {{site_name}} shown below is fast approaching deadline.
@@ -112,7 +112,7 @@ The task at {{site_name}} shown below is
- +
@@ -156,7 +156,7 @@ This task will be due very soon. After the due date, the task will be past due, -

Please login into your account to manage this task.

+

Please login into your account to manage this task.

@@ -169,7 +169,7 @@ This task will be due very soon. After the due date, the task will be past due, - + @@ -199,12 +199,12 @@ You received this email because a subscriber to {{site_name}}. If you get this e -Facebook +Facebook -Twitter +Twitter diff --git a/wrenchboard/email/JOB/job_interest_client.mailfile b/wrenchboard/email/JOB/job_interest_client.mailfile index 820de865..43ec2d14 100644 --- a/wrenchboard/email/JOB/job_interest_client.mailfile +++ b/wrenchboard/email/JOB/job_interest_client.mailfile @@ -10,34 +10,18 @@ Subject: {{subject}} - {{title}} body {margin: 0; padding: 0; min-width: 100%!important;} img {height: auto;} .content {width: 100%; max-width: 600px;} -.header {padding: 40px 30px 20px 30px;} -.innerpadding {padding: 30px 30px 30px 30px;} +.header {padding: 10px 10px 10px 10px;} +.innerpadding {padding: 10px 10px 10px 10px;} .borderbottom {border-bottom: 1px solid #f2eeed;} .subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;} .h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;} .h1 {font-size: 33px; line-height: 38px; font-weight: bold;} -.h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;} .bodycopy {font-size: 14px; line-height: 20px;} .button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;} .button a {color: #ffffff; text-decoration: none;} -.footer {padding: 20px 30px 15px 30px;} +.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;} .footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;} .footercopy a {color: #ffffff; text-decoration: underline;} - -@media only screen and (max-width: 550px), screen and (max-device-width: 550px) { -body[yahoo] .hide {display: none!important;} -body[yahoo] .buttonwrapper {background-color: transparent!important;} -body[yahoo] .button {padding: 0px!important;} -body[yahoo] .button a {background-color: #e05443; padding: 15px 15px 13px!important;} -body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;} -} - -/*@media only screen and (min-device-width: 601px) { -.content {width: 600px !important;} -.col425 {width: 425px!important;} -.col380 {width: 380px!important;} -}*/ - @@ -53,41 +37,41 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
- - - - -
-WrenchBoard -
+ + + + +
+ WrenchBoard +
- - - + + + @@ -178,7 +196,7 @@ Please contact us at https://www.wrenchboard.com/contact if you have any questi @@ -187,12 +205,12 @@ You received this email because a user sent a job to you from {{site_name}}. If diff --git a/wrenchboard/email/JOB/job_message_m.mailfile b/wrenchboard/email/JOB/job_message_m.mailfile index 60b5831d..ba6adfab 100644 --- a/wrenchboard/email/JOB/job_message_m.mailfile +++ b/wrenchboard/email/JOB/job_message_m.mailfile @@ -82,7 +82,7 @@ img {height: auto;} @@ -97,6 +97,25 @@ You have sent a message + + + + @@ -194,12 +213,12 @@ You received this email because a user sent a job to you from {{site_name}}. If diff --git a/wrenchboard/email/JOB/job_offer_accepted.mailfile b/wrenchboard/email/JOB/job_offer_accepted.mailfile index aaefdfa9..a20b1c5c 100644 --- a/wrenchboard/email/JOB/job_offer_accepted.mailfile +++ b/wrenchboard/email/JOB/job_offer_accepted.mailfile @@ -89,7 +89,7 @@ img {height: auto;}
- +
+ + @@ -114,7 +98,7 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
+ + + + - -
+ - - - - - - -
-{{site_name}} -
-{{site_trade_name}} -
-
-
@@ -196,11 +180,6 @@ Note that this task was posted in the public domain and the owner can select any - - - diff --git a/wrenchboard/email/JOB/job_interest_member.mailfile b/wrenchboard/email/JOB/job_interest_member.mailfile index 3405e309..fc8482e9 100644 --- a/wrenchboard/email/JOB/job_interest_member.mailfile +++ b/wrenchboard/email/JOB/job_interest_member.mailfile @@ -113,7 +113,7 @@ body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px;
-

We have delivered your interest in the task at {{site_name}} with details shown below to the task owner.

+

We have delivered your interest in the task at {{site_name}} with details shown below to the task owner.

- -
Please contact us at https://www.wrenchboard.com/contact if you have any question about this email.
diff --git a/wrenchboard/email/JOB/job_message.mailfile b/wrenchboard/email/JOB/job_message.mailfile index 2a284f6f..9c348b02 100644 --- a/wrenchboard/email/JOB/job_message.mailfile +++ b/wrenchboard/email/JOB/job_message.mailfile @@ -83,7 +83,7 @@ img {height: auto;}
-

You have received an interest in your task at {{site_name}} with details shown below.

+

You have received an interest in your task at {{site_name}} with details shown below.

-You have received a job message from {{site_name}} details below. +You have received a job message from {{site_name}} details below.
@@ -100,7 +100,25 @@ You have received a job message from
- +
+ + + + +
+ +Apple + + + +Android + +
+
+ @@ -144,7 +162,7 @@ You have received a job message from login into your account to reply this message. +
Title : @@ -114,7 +132,7 @@ You have received a job message from -{{contract}} +{{contract}}

Please login into your account to reply this message.

@@ -157,7 +175,7 @@ You have received a job message from - +
® {{site_name}} 2022
-You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. +You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
-Facebook +Facebook -Twitter +Twitter
-You have sent a message {{site_name}} to a user with details below. +You have sent a message {{site_name}} to a user with details below.
+ + + + + +
+ +Apple + + + +Android + +
+
@@ -115,7 +134,7 @@ You have sent a message -{{contract}} +{{contract}} @@ -151,7 +170,7 @@ Last Message -

Please login into your account to reply this message.

+

Please login into your account to reply this message.

@@ -164,7 +183,7 @@ Last Message
- +
- Facebook + Facebook - Twitter + Twitter
- +
@@ -101,7 +101,7 @@ img {height: auto;} @@ -123,7 +123,7 @@ img {height: auto;} Offer ID @@ -190,7 +190,7 @@ img {height: auto;} @@ -211,7 +211,7 @@ img {height: auto;} @@ -220,12 +220,12 @@ img {height: auto;} @@ -244,8 +244,5 @@ img {height: auto;}
-

You have accepted the job offer from a {{site_name}} user with details below.

+

You have accepted the job offer from a {{site_name}} user with details below.

- {{contract}} + {{contract}}
- +
® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - - diff --git a/wrenchboard/email/JOB/job_offer_cancel.mailfile b/wrenchboard/email/JOB/job_offer_cancel.mailfile index 7834068f..9062056f 100644 --- a/wrenchboard/email/JOB/job_offer_cancel.mailfile +++ b/wrenchboard/email/JOB/job_offer_cancel.mailfile @@ -89,7 +89,7 @@ img {height: auto;}
- +
@@ -101,7 +101,7 @@ img {height: auto;} @@ -123,7 +123,7 @@ img {height: auto;} Offer ID @@ -180,7 +180,7 @@ img {height: auto;} @@ -201,7 +201,7 @@ img {height: auto;} @@ -210,12 +210,12 @@ img {height: auto;} @@ -235,7 +235,6 @@ img {height: auto;}
-

The offer below from a {{site_name}} with details below is canceled.

+

The offer below from a {{site_name}} with details below is canceled.

- {{offer_code}} + {{offer_code}}
- +
® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - + diff --git a/wrenchboard/email/JOB/job_offer_invidual.mailfile b/wrenchboard/email/JOB/job_offer_invidual.mailfile index c46ca62a..524f30ca 100644 --- a/wrenchboard/email/JOB/job_offer_invidual.mailfile +++ b/wrenchboard/email/JOB/job_offer_invidual.mailfile @@ -10,7 +10,7 @@ Subject: {{subject}} - {{title}} body {margin: 0; padding: 0; min-width: 100%!important;} img {height: auto;} .content {width: 100%; max-width: 600px;} - .header {padding: 40px 30px 20px 30px;} + .header {padding: 10px 30px 10px 30px;} .innerpadding {padding: 30px 30px 30px 30px;} .borderbottom {border-bottom: 1px solid #f2eeed;} .subhead {font-size: 12px; color: #ffffff; font-family: sans-serif; letter-spacing: 3px;} @@ -23,7 +23,8 @@ Subject: {{subject}} - {{title}} .footer {padding: 20px 30px 15px 30px;} .footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;} .footercopy a {color: #ffffff; text-decoration: underline;} - + .sect-text {font-weight: bold; } + .big-danger{ font-weight: bold; font-size: 18px; line-height: 20px; color:red;} @media only screen and (max-width: 550px), screen and (max-device-width: 550px) { body[yahoo] .hide {display: none!important;} body[yahoo] .buttonwrapper {background-color: transparent!important;} @@ -53,102 +54,77 @@ Subject: {{subject}} - {{title}} - + + + diff --git a/wrenchboard/email/JOB/job_offer_rejected.mailfile b/wrenchboard/email/JOB/job_offer_rejected.mailfile index 4d35ffba..bc7c3e2e 100644 --- a/wrenchboard/email/JOB/job_offer_rejected.mailfile +++ b/wrenchboard/email/JOB/job_offer_rejected.mailfile @@ -89,7 +89,7 @@ img {height: auto;}
- - - - -
- WrenchBoard -
- - - - - -
- - +
- -
- {{site_name}} + + WrenchBoard
+ {{site_trade_name}}
-
- +
- - - - - - - - -
- Dear {{email}}, -
-You have received a job offer from a {{site_name}} user with details below. + + + + + + - -
+ Hi, {{email}}, +
+ You have received a job offer from a {{site_name}} user with details below. -
-
- - - - - - - - -
- - - - + + + + + + + + + + + + + + + + - - - - - - -
- Title - +
+ Please login into your account to accept this offer. +
+ Offer Expire : {{expire2}} +
+
+
+ + + + + - - - - - - - - - - + - - + +
+Title + {{title}} -
- Offer ID - - {{offer_code}}
- Description + +Offer ID - {{description}} +{{offer_code}}
+
Duration @@ -157,49 +133,47 @@ You have received a job offer from a Price {{price}} Naira
- Detail + +Detail - {{job_description}} +{{job_description}} +
+
- Offer Expire - - {{expire2}} -
-

Please login into your account to accept this offer.

-
- +
+ + + + + +
+ + Apple + + + + Android + +
+
Please contact us at https://www.wrenchboard.com/contact if you have any question about this email. @@ -217,8 +191,8 @@ You have received a job offer from a
- ® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + ® {{site_name}} {{YYYY}}
+ You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- +
@@ -101,7 +101,7 @@ img {height: auto;} @@ -123,7 +123,7 @@ img {height: auto;} Offer ID @@ -187,7 +187,7 @@ img {height: auto;} @@ -208,7 +208,7 @@ img {height: auto;} @@ -217,12 +217,12 @@ img {height: auto;} @@ -241,8 +241,5 @@ img {height: auto;}
-

You have rejected the job offer from a {{site_name}} user with details below.

+

You have rejected the job offer from a {{site_name}} user with details below.

- {{offer_code}} + {{offer_code}}
- +
® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - - diff --git a/wrenchboard/email/JOB/job_offer_sendtome.mailfile b/wrenchboard/email/JOB/job_offer_sendtome.mailfile index 85418366..117f23d0 100644 --- a/wrenchboard/email/JOB/job_offer_sendtome.mailfile +++ b/wrenchboard/email/JOB/job_offer_sendtome.mailfile @@ -1,212 +1,228 @@ -Subject: {{subject}} +Subject: {{subject}} - {{title}} - + - -{{site_name}} - {{subject}}. - + - +
- - - - - + + + + + +
+ + + + + + + + + + + + + + + + + - - - - -
+ + + + + + + +
+ WrenchBoard +
+ {{site_trade_name}} +
+ +
+ + + + + + - - - - - - - - - - - - -
+ Hi, {{firstname}}, +
+ You have sent a job offer from a {{site_name}} user with details below to {{job_email}}. - - - - - -
- + - - - - - -
+ Offer Expire : {{expire2}} +
-{{site_name}} -
-{{site_trade_name}} -
-
- -
- - - - - -
-{{title}}, -
-
- -
- - - -
-Visit {{site_name}}! to learn more. -
- - - - - -
- +
+ + + + + - + + + + - - - - - - -
Title -{{title}} +{{title}}
-Description + +Offer ID -{{description}} +{{offer_code}} +
+ Duration + + {{timeline_days}} day(s)
-Duration + + Price -{{timeline_days}} day(s) + {{price}} Naira
-Price + +Detail -{{price}} Naira +{{job_description}}
- +
-
- -
- -
-{{firstname}} {{lastname}} @ {{site_name}} +
+
+ + + + + +
+ + Apple + + + + Android + +
+
+ Please contact us at https://www.wrenchboard.com/contact if you have any question about this email. +
+{{site_name}} Team
{{server_name}} -
- -
+ +
- \ No newline at end of file + diff --git a/wrenchboard/email/JOB/job_reply_message.mailfile b/wrenchboard/email/JOB/job_reply_message.mailfile index fd59a042..92e21e58 100644 --- a/wrenchboard/email/JOB/job_reply_message.mailfile +++ b/wrenchboard/email/JOB/job_reply_message.mailfile @@ -28,7 +28,7 @@ img {height: auto;} - + - - - + + + @@ -56,18 +56,18 @@ ?>
@@ -40,36 +40,25 @@ img {height: auto;} @@ -82,8 +71,7 @@ Dear {{firstname}},
- - - +
- - - - - - + + + + + +
- {{site_name}} -
- {{site_trade_name}} -
+WrenchBoard +
+{{site_trade_name}} +
-
-You have received a reply message from {{site_name}} at {{added}} as shown below. - +You have received a reply message from {{site_name}} at {{added}} as shown below.
@@ -91,36 +79,14 @@ You have received a reply message from - - - - -
- -
- - +
@@ -143,7 +120,7 @@ You have received a reply message from - + @@ -164,7 +141,7 @@ Please contact us at https://www.wrenchboard.com/contact if you have any questio @@ -173,12 +150,12 @@ You received this email because of your interest in a task @ {{site_name}}. If y @@ -197,8 +174,5 @@ You received this email because of your interest in a task @ {{site_name}}. If y
- - - - - - @@ -129,6 +95,17 @@ You have received a reply message from +{{prev_message}} + + +
-Message -
-{{prev_message}} -
-Reply +New Message
® {{site_name}} 2022
-You received this email because of your interest in a task @ {{site_name}}. If you get this email in error, please contact us. +You received this email because of your interest in a task @ {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - - diff --git a/wrenchboard/etc/wrenchboard_api.conf b/wrenchboard/etc/wrenchboard_api.conf index 9a3d7a17..73b1a84d 100644 --- a/wrenchboard/etc/wrenchboard_api.conf +++ b/wrenchboard/etc/wrenchboard_api.conf @@ -14,6 +14,7 @@ system: site_andriod_app = "https://play.google.com/store/apps/details?id=com.wrenchboard.users"; upload_size_limit = "3145728"; server_name = "https://oameye.work.wrenchboard.com"; + force_job_wait = "0"; }; flutterwave: @@ -136,3 +137,9 @@ google: storage_project_id = "wrenchboard-prod"; storage_auth_file = "/home/oameye/wrenchboard/wrenchboard/etc/wrenchboard-prod-16dbc94e46a8.json"; }; + +onesignal: +{ + app_id = "e80afcf4-6fad-493c-b5cc-452d37196dea"; +}; + diff --git a/wrenchboard/src/shared_tool/email.cc b/wrenchboard/src/shared_tool/email.cc index 9dfa6f93..1a3edea2 100644 --- a/wrenchboard/src/shared_tool/email.cc +++ b/wrenchboard/src/shared_tool/email.cc @@ -553,7 +553,9 @@ long job_email(long mailtype, CVars in, CVars &out) { 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,o.offer_code " + " 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); @@ -588,7 +590,7 @@ long job_email(long mailtype, CVars in, CVars &out) { 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.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 = 3", in["offer_id"].Long())) { + 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 ", in["offer_id"].Long())) { vars2form(x, form); form.LetStr("subject", "Job Offer Canceled"); form.LetStr("email", x["email"].c_str()); @@ -924,7 +926,7 @@ long test_email(CVars in, CVars &out) { form.LetStr("subject", "This is Test Email"); form.LetStr("email", in["email"].c_str()); form.Email("ALERT/template.mailfile"); -*/ + 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 >0", 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())) { @@ -941,6 +943,15 @@ long test_email(CVars in, CVars &out) { form.Email("JOB/job_interest_client.mailfile"); } + } + ,to_char(now(), 'yyyy') AS YYYY + */ + 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.timeline_days,j.price,to_char(now(), 'yyyy') AS YYYY 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); + form.LetStr("subject", "Job Offer Recieved"); + form.LetStr("email", x["email"].c_str()); + form.Email("JOB/job_offer_invidual.mailfile"); } return 0; diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index 677ffd21..08c626f3 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -488,7 +488,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) { if (WrenchRefundoffer(y, out) == PHP_CREATED_OK) { pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", out["offer_id"].Long(), in["offer_code"].c_str()); // REFUND THE MONEY - job_email(JOBS_OFFER_CANCEL_MAIL, in, out); // the email will come from offer table + job_email(JOBS_OFFER_CANCEL_MAIL, y, out); // the email will come from offer table } } break; diff --git a/wrenchboard/src/shared_tool/payments.cc b/wrenchboard/src/shared_tool/payments.cc index 6d741cbf..54765b0b 100644 --- a/wrenchboard/src/shared_tool/payments.cc +++ b/wrenchboard/src/shared_tool/payments.cc @@ -604,6 +604,9 @@ Foreign-key constraints: x["what_offer"] = in["offer_id"]; x["what_offer"].set_valid( true ); x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess + + x["currency"] = vw["currency"]; x["currency"].set_valid( true ); + payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x ); out["payment_id"] = payment_id; out["payment_id"].set_valid( true ); @@ -659,9 +662,11 @@ long WrenchRefundoffer( CVars in, CVars &out ) } - long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id); + long retDb2 = load_db_record( out, "SELECT id AS current_payment_id, * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id); if (retDb2) { + long current_payment_id = out["current_payment_id"].Long(); + CVars x; x["member_id"] = in["member_id"]; x["member_id"].set_valid( true ); x["code"] = in["code"]; x["code"].set_valid( true ); @@ -680,13 +685,13 @@ long WrenchRefundoffer( CVars in, CVars &out ) ret = PHP_CREATED_OK; x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet // now generate the confirmation - // pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long() + x["fee"].Long(),in["member_id"].Long() ); char confirmation[15] = ""; Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call UpdateMemberWallet( member_id, wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount x["flags"] = FLAG_OK; x["flags"].set_valid( true ); x["payment_id"] = payment_id; x["payment_id"].set_valid( true ); - pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id ); + pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id ); + pgsql_exec("UPDATE members_payments SET flags = 7 WHERE id = %lu",current_payment_id ); //pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() ); load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id ); } else { @@ -750,11 +755,12 @@ long WrenchContractPayment( CVars in, CVars &out ) return PHP_API_BAD_PARAM; } - CVars vw; + CVars vw; vw["currency"] = "NAIRA"; // this might become a variable based on the country vw["currency"].set_valid( true ); long wallet_id = CheckWallet(in["member_id"].Long(),vw); - +// + long client_wallet_id = CheckWallet(client_id,vw); // TEST FOR DUPLICATE long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", client_id); @@ -808,8 +814,8 @@ long WrenchContractPayment( CVars in, CVars &out ) //pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here char confirmation[15] = ""; Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call - - UpdateMemberWallet( x["member_id"].Long(), wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount + logfmt( logINFO, "paying for job completed, make sure you paythe correct person()" ); + UpdateMemberWallet( x["member_id"].Long(), client_wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount x["flags"] = FLAG_OK; x["flags"].set_valid( true ); x["payment_id"] = payment_id; x["payment_id"].set_valid( true ); diff --git a/www/OneSignalSDKWorker.js b/www/OneSignalSDKWorker.js new file mode 100644 index 00000000..1707e5e2 --- /dev/null +++ b/www/OneSignalSDKWorker.js @@ -0,0 +1,3 @@ +if( 'function' === typeof importScripts) { + importScripts('https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js'); +} diff --git a/www/application/controllers/Dash.php b/www/application/controllers/Dash.php index f4eed993..ced8ac7d 100644 --- a/www/application/controllers/Dash.php +++ b/www/application/controllers/Dash.php @@ -161,7 +161,7 @@ class Dash extends Users_Controller { $this->table->set_template($this->template); $jbx = "''/jobs/viewjob''"; - $mysql = "SELECT jo.added::date AS pdate,j.title,(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewjob' AS qpath," + $mysql = "SELECT jo.added::date AS pdate, jo.added::date AS start_job_date , jo.expire::date AS end_job_date, j.title,(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewjob' AS qpath," . 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,' . "'' AS View ,jo.offer_code AS offer_code " . "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id " @@ -184,9 +184,9 @@ class Dash extends Users_Controller { if ($offer_found == false) { - $data["dash_title"] = "Offer(s)"; + $data["dash_title"] = "Active Offer(s)"; $jbx = "''/jobs/viewmyjob''"; - $mysql = "SELECT jo.added::date||'
'||jo.expire::date AS pdate,j.title, (CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewmyjob' AS qpath," + $mysql = "SELECT jo.added::date||'
'||jo.expire::date AS pdate, jo.added::date AS start_job_date , jo.expire::date AS end_job_date, j.title, (CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewmyjob' AS qpath," . 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,' . "'' AS View,jo.offer_code AS offer_code " . "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id " diff --git a/www/application/controllers/Jobs.php b/www/application/controllers/Jobs.php index 27ddf62f..9c0e2154 100644 --- a/www/application/controllers/Jobs.php +++ b/www/application/controllers/Jobs.php @@ -715,6 +715,7 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); $data["timeline_days"] = $out["timeline_days"]; $data["price"] = $out["price"]; $data["offer_code"] = $out["offer_code"]; + $data['is_public_view'] = $out['public_view']; $a_from = array('\t','\n','\r','\0','\v'); $a_to = array("\t","\n","\r","",""); $data["job_description"] = trim(trim(str_replace($a_from,$a_to,$out["job_description"])),'"'); // str_replace('"','\"',$out["job_description"]); // $out["job_description"]; @@ -736,17 +737,15 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); // $data = array(); $data = $this->getSessionArray(); $this->load->model('offers_model'); - $out = $this->offers_model->getUserPendingOffers($_SESSION['member_id']); - - $data['my_offer_rows'] = $out["query"]->result(); - - - - $data['page_title'] = "Pending"; + $out = $this->offers_model->getUserPendingOffers($_SESSION['member_id'], 10000); + $data['my_offer_rows'] = $out["my_offer_rows"]; //same + $data['offer_dash_result'] = $out["my_offer_rows"]; //same + $data['offer_found']= count($out["my_offer_rows"])>0; + $data['dash_title'] = "Pending Offers"; $this->renderSecurePage('jobs/view_myoffer', $data); - } + public function pendingoffer() { $data = array(); $data = $this->getSessionArray(); diff --git a/www/application/controllers/Member.php b/www/application/controllers/Member.php index 401018e5..70ef4c0d 100644 --- a/www/application/controllers/Member.php +++ b/www/application/controllers/Member.php @@ -749,7 +749,7 @@ class Member extends Users_Controller { $data['card_coupon_data_result'] = $this->report_model->getRedeemCouponsList(6)['card_coupon_data_result']; $data['wallet'] = $this->account_model->getUserWallet( $_SESSION['member_id']); - + $data['escrow'] = $this->account_model->getUserEscrowWallet( $_SESSION['member_id']); if ($_POST) { $data['comment'] = $this->input->post('comment'); @@ -1014,11 +1014,25 @@ class Member extends Users_Controller { $data = $this->getSessionArray(); $this->load->library('table'); $this->table->set_template($this->template); - $mysql = "SELECT added::date AS msg_date,msg,id AS msg_id - FROM members_messages - WHERE member_id = " . $_SESSION['member_id'] . " AND reply IS NULL - ORDER BY id DESC LIMIT 20"; + $mysql88 = "SELECT mm.added::date AS msg_date,mm.msg,id AS msg_id ,ms.firstname AS senders_name + FROM members_messages mm + LEFT JOIN members ms ON mm.senders_id = ms.id + WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.reply IS NULL + ORDER BY mm.id DESC LIMIT 20"; + + + $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo,mm.reply + FROM members_messages mm + LEFT JOIN members ms ON mm.senders_id = ms.id + WHERE mm.member_id = " . $_SESSION['member_id'] . " + UNION + SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo, mm.reply + FROM members_messages mm + WHERE mm.senders_id = " . $_SESSION['member_id'] . " + ORDER BY msg_date DESC LIMIT 30"; + $query = $this->db->query($mysql); + $data['my_message_rows'] = $query->result_array(); // new implementation $myTable = ""; @@ -1037,6 +1051,30 @@ class Member extends Users_Controller { . ""; } + public function setupReply(){ + $message_id = trim($this->input->get('message_id')); + $job_id = trim($this->input->get('job_id')); + if ($message_id > 0 && $job_id !=''){ + $data['job_id'] = $job_id; + $data['message_id'] = $message_id; + + $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo + FROM members_messages mm + LEFT JOIN members ms ON mm.senders_id = ms.id + WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' + UNION + SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo + FROM members_messages mm + WHERE mm.senders_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' + ORDER BY msg_date DESC LIMIT 30"; + + $query = $this->db->query($mysql); + $data['my_message_rows'] = $query->result_array(); // new implementation + + $answer_string = $this->load->view('users/sections/mgs_reply', $data, TRUE); + echo $answer_string; + } + } public function messagedetail() { // echo 'Ameye'; @@ -1087,6 +1125,7 @@ class Member extends Users_Controller { $in["message_id"] = $this->input->get('message_id'); $in["memo"] = trim($this->input->get('message_code')); $in["yourmessage"] = trim($this->input->get('yourmessage')); + $in['member_id'] = $_SESSION['member_id']; if ($in["message_id"] > 0 && $in["memo"] != '' && $in["yourmessage"] != '') { $in['action'] = WRENCHBOARD_JOB_REPLY_QUESTION; diff --git a/www/application/controllers/Proj.php b/www/application/controllers/Proj.php index 98acbca2..877231a1 100644 --- a/www/application/controllers/Proj.php +++ b/www/application/controllers/Proj.php @@ -200,7 +200,7 @@ class Proj extends Users_Controller { $data['job_table_result'] = $query->result();; $data['ref_site'] = "/proj/active/$page"; - + $data['job_table'] = $this->table->generate($query); $this->table->set_heading(array('data' => 'Job', 'style' => 'width:180px'), 'Title/Description', array('data' => '', 'style' => 'width:100px; cellpadding:0px;')); //$this->table->set_heading('Job', 'Description', ''); @@ -362,114 +362,132 @@ class Proj extends Users_Controller { if ($ajax == 1) { echo $res; } else { - $this->load->view('users/view_header_user', $data); - $this->load->view('jobs/view_latejob', $data); - $this->load->view('users/view_footer_user', $data); + // $this->load->view('users/view_header_user', $data); + // $this->load->view('jobs/view_latejob', $data); + // $this->load->view('users/view_footer_user', $data); + $this->RenderUserPage('jobs/view_latejob', $data); } } } public function thisjob() { + $data = $this->getSessionArray(); $data['redirect_to'] = '/proj/active/'; $uploaded = false; if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { redirect(home); + return; + } + + ob_start(); + + $message = ""; + $res = -1; + // echo rand(100,9999). " ameye 1"; + + if ($_POST) { + $ajax = $this->input->post('ajax'); + $jobID = $this->input->post('jobID'); } else { - $message = ""; - // echo rand(100,9999). " ameye 1"; + $ajax = $this->input->get('ajax'); + $jobID = $this->input->get('jobID'); + $message = $this->input->get('message'); + } + $data['jobID'] = $jobID; - if ($_POST) { - $ajax = $this->input->post('ajax'); - $jobID = $this->input->post('jobID'); - } else { - $ajax = $this->input->get('ajax'); - $jobID = $this->input->get('jobID'); - $message = $this->input->get('message'); - } - $data['jobID'] = $jobID; + //$mybalance = 10666; + //$data['mybalance'] = $mybalance; - //$mybalance = 10666; - //$data['mybalance'] = $mybalance; + $this->load->model('backend_model'); + // echo rand(100,9999). " ameye 2"; + if ($_POST && !isset($_POST['uploadForm'])) { + // echo rand(100,9999). " ameye 2222-2222"; + // exit; + $msgArray = array(); + $msgArray['message'] = trim($this->input->post('jobmessage')); + $msgArray['contract'] = $this->input->post('contractId'); + $msgArray['msg_type'] = 'TEXT'; + $msgArray['member_id'] = $_SESSION['member_id']; // = $ret->email; - $this->load->model('backend_model'); - // echo rand(100,9999). " ameye 2"; - if ($_POST && !isset($_POST['uploadForm'])) { - // echo rand(100,9999). " ameye 2222-2222"; - // exit; - $msgArray = array(); - $msgArray['message'] = trim($this->input->post('jobmessage')); - $msgArray['contract'] = $this->input->post('contractId'); + if (trim($msgArray['message']) != '') { // NOTE THAT IT msg_type is IMPORTTANT $msgArray['msg_type'] = 'TEXT'; - $msgArray['member_id'] = $_SESSION['member_id']; // = $ret->email; + $msgArray['action'] = WRENCHBOARD_CONTRACT_MESSAGE; - if ($msgArray['message'] != '') { // NOTE THAT IT msg_type is IMPORTTANT - $msgArray['msg_type'] = 'TEXT'; - $msgArray['action'] = WRENCHBOARD_CONTRACT_MESSAGE; - - $out = array(); - $res = $this->backend_model->wrenchboard_api($msgArray, $out); - } - } else if ($_POST && isset($_POST['uploadForm']) && isset($_FILES["fileToUpload"])) { - list ($message, $uploaded) = $this->process_files($_FILES["fileToUpload"]); + $out = array(); + $res = $this->backend_model->wrenchboard_api($msgArray, $out); + } else { + $res = "Message is empty!"; } + } else if ($_POST && isset($_POST['uploadForm']) && isset($_FILES["fileToUpload"])) { + list ($message, $uploaded) = $this->process_files($_FILES["fileToUpload"]); + } - $data = $this->load_files($data, $jobID); - //$this->load_files($data, $jobID); + $data = $this->load_files($data, $jobID); + //$this->load_files($data, $jobID); - $data["sizeLimit"] = $this->backend_model->cfgReadChar("system.upload_size_limit"); + $data["sizeLimit"] = $this->backend_model->cfgReadChar("system.upload_size_limit"); + $data["force_job_wait"] = $this->backend_model->cfgReadChar("system.force_job_wait"); // configuration to supress wait time - $this->load->model('dash_model'); - $out = $this->dash_model->getDashData($data); - $data['active_task'] = $out['active_task']; - $data['active_pass_due'] = $out['active_pass_due']; - $data['current_balance'] = $out['current_balance']; - $data['new_message'] = $out['new_message']; - $data['message'] = $message; + $this->load->model('dash_model'); + $out = $this->dash_model->getDashData($data); + $data['active_task'] = $out['active_task']; + $data['active_pass_due'] = $out['active_pass_due']; + $data['current_balance'] = $out['current_balance']; + $data['new_message'] = $out['new_message']; + $data['message'] = $message; + $data['this_is_client'] = false; + $data['this_is_project_owner'] = false; + + + $data['disabled1'] = 'disabled'; + $data['disabled2'] = 'disabled'; + + $data['disabled11'] = 'disabled'; + $data['disabled22'] = 'disabled'; + + if ( $data["force_job_wait"] == 0 ){ + //just forget about delays + $data['disabled1'] = $data['disabled2'] = $data['disabled11'] = $data['disabled22'] =''; + } + + /* + $data['job_status'] = $jbD1->status; + $data['job_member_id'] = $jbD1->member_id; + $data['job_client_id'] = $jbD1->client_id; + */ + if ($data['job_member_id'] == $_SESSION['member_id']) { $data['this_is_client'] = false; - $data['this_is_project_owner'] = false; - - $data['disabled1'] = 'disabled'; - $data['disabled2'] = 'disabled'; - - $data['disabled11'] = 'disabled'; - $data['disabled22'] = 'disabled'; - /* - $data['job_status'] = $jbD1->status; - $data['job_member_id'] = $jbD1->member_id; - $data['job_client_id'] = $jbD1->client_id; - */ - if ($data['job_member_id'] == $_SESSION['member_id']) { - $data['this_is_client'] = false; - $data['this_is_project_owner'] = true; - if ($data["job_status"] == CONTRACT_NOTIFY_COMPLETE) { - $data['disabled11'] = ''; - $data['disabled22'] = ''; - } - } else { - $data['this_is_client'] = true; - $data['this_is_project_owner'] = false; - if ($data["job_status"] == 1 and $data['force_wait'] == false) { - - $data['disabled1'] = ''; - $data['disabled2'] = ''; - } + $data['this_is_project_owner'] = true; + if ($data["job_status"] == CONTRACT_NOTIFY_COMPLETE) { + $data['disabled11'] = ''; + $data['disabled22'] = ''; } + } else { + $data['this_is_client'] = true; + $data['this_is_project_owner'] = false; + if ($data["job_status"] == 1 and $data['force_wait'] == false) { - if ($ajax == 1) { - echo isset($res)? $res:''; - $this->RenderUserPage('jobs/view_thisjob', $data); + $data['disabled1'] = ''; + $data['disabled2'] = ''; + } + } + + if ($ajax == 1) { + ob_end_clean(); + echo isset($res)? $res:''; + // $this->RenderUserPage('jobs/view_thisjob', $data); + } else { + /* $this->load->view('users/view_header_user', $data); + $this->load->view('jobs/view_thisjob', $data); + $this->load->view('users/view_footer_user', $data); */ + ob_end_flush(); + if ($uploaded) { + redirect('/proj/thisjob?jobID='.$jobID.'&message='.$message); } else { - /* $this->load->view('users/view_header_user', $data); - $this->load->view('jobs/view_thisjob', $data); - $this->load->view('users/view_footer_user', $data); */ - if ($uploaded) { - redirect('/proj/thisjob?jobID='.$jobID.'&message='.$message); - } else { - $this->RenderUserPage('jobs/view_thisjob', $data); - } + $this->RenderUserPage('jobs/view_thisjob', $data); } } } @@ -656,12 +674,8 @@ class Proj extends Users_Controller { } } } - - - - + private function load_files($data, $jobID) { - $data['username'] = $_SESSION['username']; // = $this->input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; @@ -683,27 +697,35 @@ class Proj extends Users_Controller { $mysql = "SELECT 'Project ID :'||mc.contract||' - Name: '||m.firstname||'
Title:'||mc.title||'
'||'Description: '||mc.description||'
Timeline: '||mc.timeline_days||' day(s) Price: '||mc.price*0.01||'Naira'||' Expected Delivery: '||mc.delivery_date||' '||$detail_button AS this_job," . " mc.contract AS contract_id, mc.job_detail AS job_detail " . "FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id " - . " WHERE (mc.member_id = " . $_SESSION['member_id'] . " OR mc.client_id=" . $_SESSION['member_id'] . ") AND mc.id=" . $jobID; + . " WHERE (mc.member_id = '" . $_SESSION['member_id'] . "' OR mc.client_id='" . $_SESSION['member_id'] . "') AND mc.id=" . ((int)$jobID); $query = $this->db->query($mysql); - $jbD = $query->row(); + $result = $query->result_array(); + $jbD = array("this_job" => "", "contract_id" => "", "job_detail" => ""); + if (is_array($result) && count($result)>0) { + $jbD = $result[0]; + } //---------------------- $mysql = "SELECT m.id,mc.contract, m.firstname,mc.title,mc.description, mc.timeline_days, mc.price*0.01,mc.delivery_date, mc.contract AS contract_id, mc.job_detail AS job_detail , - $detail_button As delivery_details + $detail_button As delivery_details,mc.status AS current_job_status FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id - WHERE (mc.member_id = " . $_SESSION['member_id'] . " OR mc.client_id=" . $_SESSION['member_id'] . ") - AND mc.id=" . $jobID; + WHERE (mc.member_id = '" . $_SESSION['member_id'] . "' OR mc.client_id='" . $_SESSION['member_id'] . "') + AND mc.id=" . ((int)$jobID); $query = $this->db->query($mysql); - $data["this_job_result"] = $query->result()[0]; + $result = $query->result(); + $r = new stdClass(); + $r->id = ""; $r->contract = ""; $r->firstname = ""; $r->title = ""; $r->description = ""; $r->timeline_days = ""; + $r->price = ""; $r->delivery_date = ""; $r->contract_id = ""; $r->job_detail = ""; $r->delivery_details = ""; + $data["this_job_result"] = is_array($result) ? $result[0] : $r; //---------------------- // $this->table->set_heading('Job', 'Client', 'Terms', 'Price', 'Manage', 'Status'); $data['job_table'] = $this->table->generate($query); - $data['this_job'] = $jbD->this_job; - $data['contract_id'] = $jbD->contract_id; - $data['job_detail'] = $jbD->job_detail; + $data['this_job'] = $jbD["this_job"]; + $data['contract_id'] = $jbD["contract_id"]; + $data['job_detail'] = $jbD["job_detail"]; /* $sqlMsg = "SELECT (CASE WHEN jc.msg_type='FILE' THEN ''||jc.message||'' ELSE '['||m.firstname||']->'||jc.created||'
'||jc.message END) AS msg " . "FROM jobs_contract_message jc " @@ -751,15 +773,19 @@ class Proj extends Users_Controller { // $data['message_result_show'] = $this->messageAccordion($data['message_result']); - $mysql3 = "SELECT *,(delivery_date::date- now()::date)::int AS remaining_days FROM members_jobs_contract WHERE id= " . $jobID; + $mysql3 = "SELECT *,(delivery_date::date- now()::date)::int AS remaining_days FROM members_jobs_contract WHERE id= " . ((int)$jobID); $query3 = $this->db->query($mysql3); - $jbD1 = $query3->row(); - $data['job_status'] = $jbD1->status; - $data['job_member_id'] = $jbD1->member_id; - $data['job_client_id'] = $jbD1->client_id; - $data['job_contract'] = $jbD1->contract; - $data['timeline_days'] = $jbD1->timeline_days; - $data['remaining_days'] = $jbD1->remaining_days; + $result3 = $query3->result_array(); + $jbD1 = array("status"=>"","member_id"=>"","client_id"=>"","contract"=>"","timeline_days"=>"","remaining_days"=>""); + if (is_array($result3) && count($result3)) { + $jbD1 = $result3[0]; + } + $data['job_status'] = $jbD1["status"]; + $data['job_member_id'] = $jbD1["member_id"]; + $data['job_client_id'] = $jbD1["client_id"]; + $data['job_contract'] = $jbD1["contract"]; + $data['timeline_days'] = $jbD1["timeline_days"]; + $data['remaining_days'] = $jbD1["remaining_days"]; $data['force_wait'] = false; if ($data['remaining_days'] > 0) { if ($data['timeline_days'] / 2 < $data['remaining_days']) { diff --git a/www/application/libraries/Users_Controller.php b/www/application/libraries/Users_Controller.php index bf52f98b..efed1864 100644 --- a/www/application/libraries/Users_Controller.php +++ b/www/application/libraries/Users_Controller.php @@ -162,6 +162,8 @@ class Users_Controller extends WRB_Controller { } protected function renderSecurePage($page_path_name, $data) { + $this->load->model('backend_model'); + $data["OneSignalAppId"] = $this->backend_model->cfgReadChar("onesignal.app_id"); $this->load->view('site3/internal/template/view_securehead', $data); $this->load->view( $page_path_name, $data); $this->load->view('site3/internal/template/view_securefooter', $data); diff --git a/www/application/models/Account_model.php b/www/application/models/Account_model.php index 00233353..249058e2 100644 --- a/www/application/models/Account_model.php +++ b/www/application/models/Account_model.php @@ -18,6 +18,12 @@ class Account_model extends CI_Model { return $query->result_array(); } + public function getUserEscrowWallet($member_id) { + $mysql = "SELECT sum(amount),currency FROM members_payments WHERE code ='OFDPS' AND member_id = $member_id AND confirmation IS NOT NULL AND flags = 4 GROUP BY currency"; + $query = $this->db->query($mysql); + return $query->result_array(); + } + public function verify_link($data) { $q = $this ->db diff --git a/www/application/models/Job_model.php b/www/application/models/Job_model.php index aa243328..0eb3da2f 100644 --- a/www/application/models/Job_model.php +++ b/www/application/models/Job_model.php @@ -176,7 +176,8 @@ class Job_model extends CI_Model { public function readMyloadJobOffer($member_id, $offer_code) { $out = array(); $out['result'] = 0; - $mysql = "SELECT jo.added::date AS added_date,j.title,j.description, j.timeline_days, j.price*0.01 AS price,jo.offer_code,jo.job_description,jo.expire,(CASE WHEN jo.public_view > 0 THEN 'Public View' ELSE jo.email END ) AS job_sent_to " + $mysql = "SELECT jo.added::date AS added_date,j.title,j.description, j.timeline_days, j.price*0.01 AS price,public_view," + ." jo.offer_code,jo.job_description,jo.expire,(CASE WHEN jo.public_view > 0 THEN 'Public View' ELSE jo.email END ) AS job_sent_to " . "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id " . "WHERE jo.expire > now() AND jo.status = 1 " . "AND jo.member_id = " . $member_id . " AND jo.offer_code='" . $offer_code . "' "; @@ -192,6 +193,7 @@ class Job_model extends CI_Model { $out['offer_code'] = $q->row()->offer_code; $out['job_description'] = $q->row()->job_description; $out['expire'] = $q->row()->expire; + $out['public_view'] = $q->row()->public_view; $out['result'] = 1; } else { diff --git a/www/application/models/Offers_model.php b/www/application/models/Offers_model.php index 928180d1..7136e3e6 100644 --- a/www/application/models/Offers_model.php +++ b/www/application/models/Offers_model.php @@ -9,6 +9,13 @@ class Offers_model extends CI_Model function __construct() { + } + + // NOT completed -- + public function getSentPendingOffers($member_id) + { + + } public function attachOffers($email) @@ -28,10 +35,11 @@ class Offers_model extends CI_Model } // NOT completed -- - public function getUserPendingOffers($member_id) + public function getUserPendingOffers($member_id,$listLimit) { $out = array(); + /* $error_state = false; $out['error'] = ''; $sqlOffer = "SELECT mo.member_id, to_char(mo.added, 'Day Mon dd, yyyy HH:MI AM') AS sent, @@ -47,7 +55,35 @@ class Offers_model extends CI_Model $out["query"] = $this->db->query($sqlOffer); - return $out; + + + $offer_found = false; +*/ + $data = array(); + $data['offer_dash'] = $data['offer_dash_result'] =''; + + $jbx = "''/jobs/viewjob''"; + $mysql = "SELECT jo.added::date AS pdate, jo.added::date AS start_job_date , jo.expire::date AS end_job_date, j.title,(CASE WHEN jo.public_view > 0 THEN '-Public View' ELSE jo.email END) AS tRec,'\/jobs\/viewjob' AS qpath," + . 'CASE WHEN jo.status = 1 AND jo.public_view =0 THEN \'Pending\' WHEN jo.status = 1 AND jo.public_view >0 THEN \'Active\' ELSE \'Other\' END AS status,' + . "'' AS View ,jo.offer_code AS offer_code " + . "FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id " + . "WHERE jo.expire > now() AND jo.status = 1 " + . "AND jo.client_id = " .$member_id . " LIMIT $listLimit"; + $query = $this->db->query($mysql); + $num = $query->num_rows(); + $data["dash_title"] = "Pending Offer(s)"; + + // array('data' => 'Added', 'style' => 'width:80px') + + // $this->table->set_heading(array('data' => 'Added', 'style' => 'width:80px'), 'Title', array('data' => '', 'style' => 'width:80px')); + // $data['offer_dash'] = $this->table->generate($query); + $data['my_offer_rows'] = $query->result(); + $offer_found = true; + + + + + return $data; /* */ diff --git a/www/application/views/compo/comp_current_offers.php b/www/application/views/compo/comp_current_offers.php new file mode 100644 index 00000000..1b8836e9 --- /dev/null +++ b/www/application/views/compo/comp_current_offers.php @@ -0,0 +1,26 @@ +
+
+

+ 0) ? $dash_title : 'Offers'; ?> +

+
+ +
+
+
+
+
+
+ 0){ + include 'offers_jobs/offers_jobs_table.php'; + } + else{ + include 'offers_jobs/offers_jobs_noffers.php'; + } + ?> +
+
+
+
+
\ No newline at end of file diff --git a/www/application/views/compo/offers_jobs/offers_jobs_noffers.php b/www/application/views/compo/offers_jobs/offers_jobs_noffers.php new file mode 100644 index 00000000..3e17b314 --- /dev/null +++ b/www/application/views/compo/offers_jobs/offers_jobs_noffers.php @@ -0,0 +1,30 @@ +
+
+ +
+ +
+ +
+ +
+ +

No current offers found

+ + +

Click on the below buttons to +
search jobs.

+ + + Browse Jobs + +
+ + +
+ +
+ +
+
+
diff --git a/www/application/views/compo/offers_jobs/offers_jobs_table.php b/www/application/views/compo/offers_jobs/offers_jobs_table.php new file mode 100644 index 00000000..93c4411b --- /dev/null +++ b/www/application/views/compo/offers_jobs/offers_jobs_table.php @@ -0,0 +1,46 @@ +
+ + + + + + + + + + + + + + + + + + +
Added/ExpireTitle/Target
+
+ start_job_date?>
+ end_job_date?> +
+
+ title ?> + trec?> + + + + + + + + + +
\ No newline at end of file diff --git a/www/application/views/jobs/view_market.php b/www/application/views/jobs/view_market.php index 42ace573..4285c547 100644 --- a/www/application/views/jobs/view_market.php +++ b/www/application/views/jobs/view_market.php @@ -13,7 +13,6 @@ // --> -

Available Jobs @@ -32,10 +31,9 @@

- - - + +
offer_code') foreach ($market_table_result as $row) { - ?> + ?>
@@ -77,7 +75,7 @@
- offer_code?> + offer_code?>
@@ -88,131 +86,119 @@
-
- - -
Added
Expire
Title
Recipient
Added/ExpireTitle/Target
- start_job_date?>
- end_job_date?> + start_job_date?>
+ end_job_date?>
title?> - To : job_to?> + To : job_to?> + class="btn btn-sm btn-icon btn-bg-primary btn-active-color-info"> diff --git a/www/application/views/jobs/view_thisjob.php b/www/application/views/jobs/view_thisjob.php index 7dfd84dc..6bbb8c65 100644 --- a/www/application/views/jobs/view_thisjob.php +++ b/www/application/views/jobs/view_thisjob.php @@ -17,18 +17,21 @@
- -

- title?> + + + + + +
+     + + title?> + +
+

@@ -68,14 +71,14 @@
@@ -88,7 +91,7 @@
- +
@@ -133,36 +136,9 @@
- - - - - - - - - -
- If you have completed this task and will like the owner to review the work for acceptance, click "Completed" button. - -
-
- If you are unable to complete and will like this project canceled, click "Cancel task" button. - -
-
-
-

Note: Buttons may be disabled for some days at the start of the task

-
- - - - - @@ -229,11 +205,25 @@ current_job_status != 4){ + include('jobaction/job_worker.php'); + } + + if ($this_job_result->current_job_status == 4){ + echo "You have sent this task to the owner for review and acceptance. The job will automatically be completed in 3 days if the owner does not respond"; + } + } if ($this_is_project_owner == true) { - include('jobaction/job_owner.php'); + if ($this_job_result->current_job_status == 4){ + include('jobaction/job_owner.php'); + } + else{ + echo "Waiting for the completion message from the client before you can approve."; + } + + // } ?> @@ -269,7 +259,7 @@ diff --git a/www/application/views/jobs/view_viewmyjoboffer.php b/www/application/views/jobs/view_viewmyjoboffer.php index c012f678..5a05485b 100644 --- a/www/application/views/jobs/view_viewmyjoboffer.php +++ b/www/application/views/jobs/view_viewmyjoboffer.php @@ -50,7 +50,7 @@
- +
@@ -80,7 +80,7 @@ -
+
@@ -104,14 +104,70 @@

- Other Offers + Actions

- + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ 0){ + ?> + Job sent to + + + + + +
+ + +
+ + +
+
+
+ +
+ + + + + + +
@@ -119,7 +175,8 @@
-
+ +
@@ -137,14 +194,14 @@
-
+
+ + + + + + + + + + + Refer a Friend + +
+ + - Pending + Pending Offers
- - -
- + $val) { + if ($val['currency'] === $wlt['code']) { + $escrow_amount = $val['sum']; + } + } + + echo money_format('%.2n', $escrow_amount * 0.01); + + ?> - +
-
-
-

- -

-
+ -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - -
Added/ExpireTitle/TargetStatus
-
- pdate ?> -
-
- title ?> - trec ?> - - status ?> - - - - - - - - - -
-
-
-
-
-
-
-
- -
- -
- -

- Recent Task Message -

- - -
- - -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
DateTitle/Message
-
- - date_contract ?> - -
-
- title ?> - title_message?> - - - - - - - - - - - -
-
- -
- - -
- - -
- -
- -
-
- -