From e947a040cf87973e04f121a403ec1b69ed635725 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 7 Nov 2024 05:20:20 -0500 Subject: [PATCH] RecoCheckFamilyActive --- wrenchboard/src/shared_tool/reco_egine.cc | 66 ++++++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 3771bffd..25081346 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -114,8 +114,70 @@ long WrenchFamilyHomeBanners(CVars in, CVars &out){ return ret; } -long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ){ return 0;} -long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ){ return 0;} +long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ){ + +return 0; +} +long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ){ + logfmt(logINFO, "RecoCheckFamilyActive()"); + 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_contract WHERE client_id = %lu AND status =1 AND delivery_dateAND delivery_date > ( now() - interval '1440 minutes' ) ",member_id); + if (res != NULL && pgsql_num_rows(res) > 0) { + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Current Activities"; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "View you current task(s) "; + + snprintf(vname, sizeof (vname), "card_type_%05d", ic); + out[vname] = "ACTIVEJOB"; + + 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"; + + snprintf(vname, sizeof (vname), "banner_%05d", ic); + out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/kids/banner-active.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "mytask"; //Active Task Page //"my-active-jobs"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); + out[vname] = "View Tasks"; + + snprintf(vname, sizeof (vname), "short_button_text_%05d", ic); + out[vname] = "View"; + + snprintf(vname, sizeof (vname), "short_title_%05d", ic); + out[vname] = "Current Activities"; + + snprintf(vname, sizeof (vname), "short_description_%05d", ic); + out[vname] = "View you current task(s) "; + + snprintf(vname, sizeof (vname), "short_style_%05d", ic); + out[vname] = "short_style lr"; + + ret = PHP_API_OK; + } + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoCheckFamilyActive()"); + } /* Family past due tasks