RecoCheckFamilyOffers

This commit is contained in:
CHIEFSOFT\ameye
2024-11-07 05:42:00 -05:00
parent e947a040cf
commit 21db457bbc
+61 -1
View File
@@ -115,8 +115,68 @@ long WrenchFamilyHomeBanners(CVars in, CVars &out){
}
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) {
return 0;
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] = "mytask";
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()");