acc-family

This commit is contained in:
CHIEFSOFT\ameye
2024-09-12 00:17:14 -04:00
parent 098c1281a8
commit 4f4510e228
+80 -6
View File
@@ -40,7 +40,7 @@ long RecoOffersInterest( int itm_count, CVars in, CVars &out );
long RecoReferAFreind(int itm_count, CVars in, CVars &out );
long RecoPendingInterestCount( 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 recommendation_engine(long action , CVars in, CVars &out) {
try{
@@ -80,6 +80,7 @@ long WrenchFamilyHomeBanners(CVars in, CVars &out){
}
//long RecoStartMarketCard( int itm_count, CVars in, CVars &out );
//long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out );
// also used from accounts
long WrenchHomeBanners(CVars in, CVars &out) {
@@ -89,6 +90,7 @@ long WrenchHomeBanners(CVars in, CVars &out) {
char vname[30];
long member_id = REQ_LONG(in, "member_id", 1, -1);
int itm_count= 0;
if( RecoStartMarketCardUS( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoStartMarketCard( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoCheckOffers( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
if( RecoPendingInterestCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
@@ -154,6 +156,70 @@ JOBOWNER_HOME_DASH
return ret;
}
long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoCheckOffers()");
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 WHERE uid::text = '%s' AND added::date > now() - interval '3000 minutes' AND country='US' ", in["uuid"].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
snprintf(vname, sizeof (vname), "title_%05d", ic);
out[vname] = "Find new task in the market.";
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] ="https://www.wrenchboard.com/assets/images/apps/banners/family-login.jpg";
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/dash-family.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "acc-family";
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
out[vname] = "Continue";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Find new task in the market.";
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
out[vname] = "Find new task in the market";
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
out[vname] = "short_style";
ret = PHP_API_OK;
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/RecoStartMarketCard()");
return ret;
}
long RecoOffersInterest(int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoOffersInterest()");
@@ -250,10 +316,17 @@ long RecoStartMarketCard( int itm_count, CVars in, CVars &out ){
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/family-login.jpg";
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/dash-market.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="LOCAL";
out[vname] ="URL";
// snprintf(vname, sizeof (vname), "banner_%05d", ic);
// out[vname] ="banner-waiting.jpg";
//
// snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
// out[vname] ="LOCAL";
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
out[vname] = "mytask";
@@ -262,7 +335,7 @@ long RecoStartMarketCard( int itm_count, CVars in, CVars &out ){
out[vname] = "Continue";
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
out[vname] = "short_button_text";
out[vname] = "View";
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
out[vname] = "Find new task in the market.";
@@ -480,7 +553,7 @@ long RecoReferAFreind(int itm_count, CVars in, CVars &out ){
long RecoPendingInterestCount( 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()");
logfmt(logINFO, "RecoPendingInterestCount()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];
@@ -574,7 +647,8 @@ long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out ){
out[vname] = "icon1";
snprintf(vname, sizeof (vname), "banner_%05d", ic);
out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg";
//out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg";
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/family-invite.jpg";
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
out[vname] ="URL";