From 21db457bbca3a627b457ac53c8abd39891911c20 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 7 Nov 2024 05:42:00 -0500 Subject: [PATCH] RecoCheckFamilyOffers --- wrenchboard/src/shared_tool/reco_egine.cc | 62 ++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 25081346..0da2f51a 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -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()");