diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 294087e3..32433b56 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -34,7 +34,7 @@ long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ); long RecoCheckTaskReview( int itm_count, CVars in, CVars &out ); long RecoCheckBlog( int itm_count, CVars in, CVars &out ); long RecoOffersInterest( int itm_count, CVars in, CVars &out ); - +long RecoReferAFreind(int itm_count, CVars in, CVars &out ); long recommendation_engine(long action , CVars in, CVars &out) { try{ @@ -82,8 +82,9 @@ long WrenchHomeBanners(CVars in, CVars &out) { if( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoOffersInterest( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } + if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } - +//long RecoReferAFreind(int itm_count, CVars in, CVars &out ) // WrenchReturnJobOffersList(in, offV); // long total_offers = offV["total_record"].Long(); // if( total_offers > 0){ @@ -313,6 +314,71 @@ long RecoCheckFamilyLogin(int itm_count, CVars in, CVars &out ){ return ret; } +long RecoReferAFreind(int itm_count, CVars in, CVars &out ){ + logfmt(logINFO, "RecoOffersInterest()"); + 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 id FROm members " + " WHERE member_id = %lu ",member_id); + if (res != NULL && pgsql_num_rows(res) > 0) { + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Show this to a friend"; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "Show this to a friend for your Show this to a friend Show this to a friend"; + + 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"; + + snprintf(vname, sizeof (vname), "banner_%05d", ic); + out[vname] ="banner-refer.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="LOCAL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "referral"; + + 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] = "Interest Pending"; + + snprintf(vname, sizeof (vname), "short_description_%05d", ic); + out[vname] = "Some interest waiting for your job(s)"; + + snprintf(vname, sizeof (vname), "short_style_%05d", ic); + out[vname] = "short_style ly"; + + ret = PHP_API_OK; + } + + + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoReferAFreind()"); + return ret; +} + long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out ){ //SELECT count(id) AS family_count FROM members_family WHERE member_id =1 AND status = 1 AND last_login IS NULL ; logfmt(logINFO, "RecoCheckFamilyCount()"); @@ -501,7 +567,6 @@ long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ){ return ret; } - long RecoCheckTaskReview( int itm_count, CVars in, CVars &out ){ logfmt(logINFO, "RecoCheckTaskReview()"); long ret = PHP_API_BAD_PARAM; @@ -565,7 +630,6 @@ return ret; } - long RecoCheckBlog( int itm_count, CVars in, CVars &out ){ logfmt(logINFO, "RecoCheckBlog()"); long ret = PHP_API_BAD_PARAM;