fix
This commit is contained in:
@@ -71,10 +71,10 @@ img {height: auto;}
|
||||
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
|
||||
<table align="left" border="1" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;">
|
||||
<tr>
|
||||
<td colspan="2"><h2>{{report_date}}</h2></td></tr>
|
||||
<td colspan="2"><h2>{{report_date}}</h2></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Today Sign-up<h5>People that completed the sign-up</h5></td>
|
||||
<td class="bodycopy"><h1>{{today_signup}}</h1></td>
|
||||
@@ -83,6 +83,7 @@ img {height: auto;}
|
||||
<td class="left" style="width:250px">Pending Sign-up<h5>People still in the process not completed</h5></td>
|
||||
<td class="bodycopy"><h2>{{today_pending_signup}}</h2></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="left" style="width:250px">Active Jobs<h5>People that completed the sign-up</h5></td>
|
||||
<td class="bodycopy"><h1>{{today_signup}}</h1></td>
|
||||
</tr>
|
||||
|
||||
@@ -119,6 +119,7 @@ enum { PARTNER_STRIPE };
|
||||
#define WRB_CRONJOB_SIGNUP_ALERT 773
|
||||
#define WRB_CRONJOB_PASTDUE_ALERT 774
|
||||
#define WRB_CRONJOB_OFFER_REFUND_ALERT 775
|
||||
#define WRB_CRONJOB_PENDOFFER_ALERT 776
|
||||
|
||||
//**************************************************************
|
||||
#define WRENCHBOARD_BKO_START 10000
|
||||
|
||||
@@ -210,7 +210,11 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case WRB_CRONJOB_PENDOFFER_ALERT:
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", in["email"].c_str());
|
||||
form.Email("REMINDER/offer_pending_reminder.mailfile");
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ long sitecrons_calls(CVars in, CVars &out) {
|
||||
return PastDueOffersRefund(in, out);
|
||||
break;
|
||||
|
||||
case WRB_CRONJOB_PENDOFFER_ALERT:
|
||||
return OfferPending(in, out);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
logfmt(logINFO, "/sitecrons_calls()");
|
||||
@@ -65,9 +69,31 @@ long ReviewReminder(CVars in, CVars &out) {
|
||||
}
|
||||
|
||||
long OfferPending(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "ENTER OfferPending()");
|
||||
|
||||
const PGresult *res = pgsql_query("SELECT jo.id AS offer_id,jo.added,j.title,jo.expire,jo.email, jo.client_id, "
|
||||
"jo.job_id,jo.reminder_count,jo.reminder_date "
|
||||
"FROM members_jobs_offer jo "
|
||||
"LEFT JOIN members_jobs j ON j.id = jo.job_id "
|
||||
"WHERE now() > jo.added +'6 hrs' "
|
||||
"AND jo.expire > now() AND jo.status = 1 AND jo.public_view =0 "
|
||||
"AND jo.reminder_count =0 AND jo.reminder_date IS NULL LIMIT 1 ");
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
cron_email(WRB_CRONJOB_PENDOFFER_ALERT, rec, out); // send the cron email
|
||||
|
||||
pgsql_exec("UPDATE members_jobs_offer SET reminder_count=reminder_count+1, reminder_date=now() "\
|
||||
"WHERE id=%lu AND job_id=%lu ", rec["offer_id"].Long(),rec["job_id"].Long());
|
||||
}
|
||||
}
|
||||
logfmt(logINFO, "/OfferPending()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
long InterestPending(CVars in, CVars &out) {
|
||||
|
||||
Reference in New Issue
Block a user