From 92f1569c1c0298d60032ff88be8cc263f96cd69d Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 7 Nov 2024 04:00:56 -0500 Subject: [PATCH] RecoRecomendToParent --- wrenchboard/src/shared_tool/reco_egine.cc | 86 ++++++++++++++++++++--- 1 file changed, 75 insertions(+), 11 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 5fab6067..285a6652 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -53,7 +53,7 @@ long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ); long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ); long RecoRecentPastDueTask( int itm_count, CVars in, CVars &out ); long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out ); -long RecoRecomendtToParent( int itm_count, CVars in, CVars &out ); +long RecoRecomendToParent( int itm_count, CVars in, CVars &out ); long recommendation_engine(long action , CVars in, CVars &out) { try{ @@ -88,15 +88,6 @@ return 0; long WrenchFamilyHomeBanners(CVars in, CVars &out){ - -long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ){ return 0;} -long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ){ return 0;} -long RecoRecentPastDueTask( int itm_count, CVars in, CVars &out ){ return 0;} -long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out ){ return 0;} -long RecoRecomendtToParent( int itm_count, CVars in, CVars &out ){ return 0;} - - - out["status"] = "long WrenchFamilyHomeBanners(CVars in, CVars &out)"; long ret = PHP_API_BAD_PARAM; CVars offV; @@ -107,7 +98,7 @@ long RecoRecomendtToParent( int itm_count, CVars in, CVars &out ){ return 0;} if( RecoCheckFamilyActive( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoRecentPastDueTask( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoFamilyKidsWaiting( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } - if( RecoRecomendtToParent( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } + if( RecoRecomendToParent( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if(itm_count < 3){ @@ -123,6 +114,79 @@ long RecoRecomendtToParent( int itm_count, CVars in, CVars &out ){ return 0;} 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 RecoRecentPastDueTask( int itm_count, CVars in, CVars &out ){ return 0;} +long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out ){ return 0;} + +/* +Show the banner for the kids to recommend to parent +*/ +long RecoRecomendToParent( int itm_count, CVars in, CVars &out ){ + + logfmt(logINFO, "RecoRecomendToParent()"); + long ret = PHP_API_BAD_PARAM; + const PGresult *res; + char vname[30]; + try { + int ic = itm_count; + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Learn more"; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "Need more information how it works ?"; + + snprintf(vname, sizeof (vname), "card_type_%05d", ic); + out[vname] = "LEARN_MORE"; + + 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] ="https://www.wrenchboard.com/assets/images/apps/banners/learnmore.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "learnmore"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); + out[vname] = "View"; + + snprintf(vname, sizeof (vname), "short_button_text_%05d", ic); + out[vname] = "View"; + + snprintf(vname, sizeof (vname), "short_title_%05d", ic); + out[vname] = "Learn more"; + + snprintf(vname, sizeof (vname), "short_description_%05d", ic); + out[vname] = "Need more information how it works ?"; + + snprintf(vname, sizeof (vname), "short_style_%05d", ic); + out[vname] = "short_style"; + + ret = PHP_API_OK; + + + + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoRecomendToParent()"); + return ret; + return 0; +} + + + //long RecoStartMarketCard( int itm_count, CVars in, CVars &out ); //long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out );