RecoRecomendToParent
This commit is contained in:
@@ -53,7 +53,7 @@ long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out );
|
|||||||
long RecoCheckFamilyActive( 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 RecoRecentPastDueTask( int itm_count, CVars in, CVars &out );
|
||||||
long RecoFamilyKidsWaiting( 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) {
|
long recommendation_engine(long action , CVars in, CVars &out) {
|
||||||
try{
|
try{
|
||||||
@@ -88,15 +88,6 @@ return 0;
|
|||||||
|
|
||||||
long WrenchFamilyHomeBanners(CVars in, CVars &out){
|
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)";
|
out["status"] = "long WrenchFamilyHomeBanners(CVars in, CVars &out)";
|
||||||
long ret = PHP_API_BAD_PARAM;
|
long ret = PHP_API_BAD_PARAM;
|
||||||
CVars offV;
|
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( RecoCheckFamilyActive( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
||||||
if( RecoRecentPastDueTask( 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( 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){
|
if(itm_count < 3){
|
||||||
@@ -123,6 +114,79 @@ long RecoRecomendtToParent( int itm_count, CVars in, CVars &out ){ return 0;}
|
|||||||
return ret;
|
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 RecoStartMarketCard( int itm_count, CVars in, CVars &out );
|
||||||
//long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out );
|
//long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user