Improve quwey

This commit is contained in:
CHIEFSOFT\ameye
2024-09-23 20:30:18 -04:00
parent 14aa8859c7
commit d5e05cb66d
2 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ Hello <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding:20px auto 40px auto; font-weight:bold; font-size 20px; color:darkgreen; background-color: #e8f6f3; border-radius:10px; ">
<td class="bodycopy" style="padding:20px; font-weight:bold; font-size 20px; color:darkgreen; background-color: #e8f6f3; border-radius:10px; ">
<table border="0" width='100%;' id="table1" style="font-family: Trebuchet MS; font-size: 10pt ">
{{\inv_items}}
@@ -90,7 +90,7 @@ Hello <b>{{firstname}}</b>,
</td>
</tr>
<tr>
<td class="bodycopy" style="padding-bottom:10px;">
<td class="bodycopy" style="padding:20px;">
&nbsp;&nbsp; <a href ="{{server_name}}/login">Login</a> into your account to manage your task(s).
</td>
</tr>
+7 -5
View File
@@ -234,9 +234,12 @@ long cron_email(long mailtype, CVars in, CVars &out) {
x["job_list_head"] = "";
res = pgsql_query(" SELECT '<b>Project ID:</b>'||mc.contract||'<br><b>Title:</b>'||mc.title AS project,mc.delivery_date::date delivery_date,"
"m.firstname||' '||m.lastname AS Client, '<b>Timeline:</b> '||mc.timeline_days||' day(s)<br><b>Price:</b> #'||mc.price*0.01 AS detail ,mc.description, "
"m.firstname||' '||m.lastname AS Client, '<b>Timeline:</b> '||mc.timeline_days||' day(s)<br><b>Reward:</b>'||mc.price*0.01||' '||cc.description AS detail ,mc.description, "
"(CASE WHEN mc.status = 1 AND mc.delivery_date > now() THEN 'Active' WHEN mc.status = 1 AND mc.delivery_date <now() THEN 'Past Due' WHEN mc.status = 4 THEN 'Review' ELSE 'Not Set' END) AS status "
" FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id "
" FROM members_jobs_contract mc "
" LEFT JOIN members_jobs mj ON mj.id = mc.job_id "
" 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());
@@ -256,17 +259,16 @@ long cron_email(long mailtype, CVars in, CVars &out) {
in["color"] = "ebfaeb";
}
c++;
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
sprintf(listing_items, "<TR style='background-color:#%s'><td >%s</td><td>%s</td><td><b>%s</b><br>%s</td></TR>", in["color"].c_str(), rec["project"].c_str(), rec["detail"].c_str(), rec["status"].c_str(), rec["delivery_date"].c_str());
inv_list->LetStr("pin", listing_items);
inv_list->CloseElement();
//<hr size=1 color=#FF0000>
if (c > 2) {
c++;
if (c > 1) {
c = 0;
}
}