1064 lines
45 KiB
C++
1064 lines
45 KiB
C++
// Twillo management toosl
|
|
#include "clog.h"
|
|
#include "cgi.h"
|
|
#include "input.h"
|
|
#include "wrenchboard_api.h"
|
|
#include "reco_engine.h" //error in file name
|
|
#include "email.h"
|
|
#include "safestring.h"
|
|
#include <string>
|
|
#include "pgsql.h"
|
|
#include "pgsql_wrapper.h"
|
|
#include <curl/curl.h>
|
|
#include "account.h"
|
|
#include "cards.h"
|
|
#include "twilo.h"
|
|
#include "mobile.h"
|
|
|
|
/*
|
|
#define RECOMMEND_COUPON 1000
|
|
#define RECOMMEND_BLOG 1005
|
|
#define RECOMMEND_NEWTASK 1010
|
|
#define RECOMMEND_TOKEN 1015
|
|
#define RECOMMEND_OFFERS 1020
|
|
//========================
|
|
*/
|
|
long sendOffersRecommendation( CVars in, CVars &out);
|
|
long sendCouponRecommendation( CVars in, CVars &out);
|
|
|
|
long RecoCheckOffers( int itm_count, CVars in, CVars &out );
|
|
long RecoCheckFamilyLogin( int itm_count, CVars in, CVars &out );
|
|
long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out );
|
|
long RecoCheckCoupons( int itm_count, CVars in, CVars &out );
|
|
long RecoCheckTaskDue( int itm_count, CVars in, CVars &out );
|
|
|
|
long RecoCheckActiveTask( 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 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{
|
|
|
|
switch (action) {
|
|
case RECOMMEND_COUPON:
|
|
return sendCouponRecommendation( in, out);
|
|
break;
|
|
|
|
case RECOMMEND_BLOG:
|
|
return 0;
|
|
break;
|
|
|
|
case RECOMMEND_NEWTASK:
|
|
return 0;
|
|
break;
|
|
|
|
case RECOMMEND_TOKEN:
|
|
return 0;
|
|
break;
|
|
|
|
case RECOMMEND_OFFERS:
|
|
return sendOffersRecommendation( in, out);
|
|
break;
|
|
}
|
|
|
|
} catch (bad_parameter) {
|
|
logfmt(logINFO, "ERROR CALL long recommendation_engine");
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
long WrenchFamilyHomeBanners(CVars in, CVars &out){
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
//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) {
|
|
out["status"] = "long WrenchHomeBanners(CVars in, CVars &out)";
|
|
long ret = PHP_API_BAD_PARAM;
|
|
CVars offV;
|
|
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++; }
|
|
if( RecoCheckFamilyLogin( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
if( RecoCheckFamilyCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
|
|
if(itm_count < 3){ // if you dont have 3 cards let ckeck
|
|
// active task
|
|
if( RecoCheckActiveTask( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
// reward family
|
|
|
|
}
|
|
|
|
if( RecoCheckCoupons( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
if( RecoCheckTaskReview( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
if( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } // - temporary for test
|
|
if( RecoOffersInterest( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
|
|
if(itm_count < 3){
|
|
|
|
|
|
}
|
|
|
|
if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
|
|
|
|
|
|
out["home_dash_type"]="DEFAULT_HOME_DASH";
|
|
LoginWrenchBoardSetDashType(in, out);
|
|
/*
|
|
DEFAULT_HOME_DASH
|
|
FAMILY_PARENT_DASH
|
|
WORKER_HOME_DASH
|
|
JOBOWNER_HOME_DASH
|
|
|
|
*/
|
|
//
|
|
// 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 users are interested in your job(s)";
|
|
//
|
|
// snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
// out[vname] = "short_style ly";
|
|
//
|
|
//
|
|
// }
|
|
//
|
|
//
|
|
// } catch (bad_parameter) {
|
|
// out["status"] = "ERROR";
|
|
// }
|
|
out["total_record"] = itm_count;
|
|
logfmt(logINFO, "/WrenchHomeBanners()");
|
|
ret = PHP_API_OK;
|
|
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 '6000 minutes' AND country='US' ", in["uid"].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()");
|
|
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 mo.* FROm members_offer_interest mo LEFT JOIN members_jobs_offer mj ON mj.id= mo.offer_id"
|
|
" WHERE mj.member_id = %lu AND mj.expire > now()",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Users are interested in some of your job(s)";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Some users are interested in your job(s).";
|
|
|
|
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] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg";
|
|
out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/interest-pending.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "offer-interest";
|
|
|
|
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 users are interested in 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, "/RecoOffersInterest()");
|
|
return ret;
|
|
}
|
|
|
|
long RecoStartMarketCard( 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 '6000 minutes' ", in["uid"].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-market.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
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] = "market";
|
|
|
|
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 RecoCheckOffers(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_jobs_offer WHERE expire > now() AND status = 1 AND client_id > 0 AND client_id = %lu ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Some offers are waiting for you.";
|
|
|
|
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] ="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";
|
|
|
|
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
|
|
out[vname] = "Continue";
|
|
|
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
|
out[vname] = "short_button_text";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "Some offers are waiting for you.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = " View, accept, or reject before the offer(s) expire";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
|
|
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoCheckOffers()");
|
|
return ret;
|
|
}
|
|
|
|
long RecoCheckFamilyLogin(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, "RecoCheckFamilyLogin()");
|
|
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_family WHERE member_id = %lu AND status = 1 AND last_login IS NULL ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Some family accounts are yet to log in.";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Some family members have not logged in - a little nudge might help.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "FAMILY_NOLOGIN";
|
|
|
|
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/family-login.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 Now";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "Some family accounts are yet to log in";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "Help your family member get started.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoCheckFamilyLogin()");
|
|
return ret;
|
|
}
|
|
|
|
long RecoReferAFreind(int itm_count, CVars in, CVars &out ){
|
|
logfmt(logINFO, "RecoReferAFreind()");
|
|
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 id = %lu ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Share WrenchBoard with a friend.";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Show WrenchBoard to a friend and earn free coupons. Get started.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "INVITE";
|
|
|
|
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/friend-invite.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
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] = "Invite a Friend - get Rewards";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "Share WrenchBoard with a friend.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style by";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
|
|
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoReferAFreind()");
|
|
return ret;
|
|
}
|
|
|
|
//
|
|
|
|
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, "RecoPendingInterestCount()");
|
|
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 moi.*,mjo.expire FROM members_offer_interest moi LEFT JOIN members_jobs_offer mjo ON mjo.id = moi.offer_id "
|
|
" LEFT JOIN members_jobs j ON j.id= mjo.job_id "
|
|
" WHERE moi.member_id = %lu AND mjo.expire > now() AND j.status= 1 AND moi.status = 1",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "You are waiting for feedback.";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "You have shown interest in a few tasks and are waiting for confirmation to start.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "PEND_INTEREST";
|
|
|
|
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/task-waiting.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "pend-interest";
|
|
|
|
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
|
|
out[vname] = "Continue";
|
|
|
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
|
out[vname] = "Details";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "You are waiting for feedback.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "You are waiting for confirmation to start.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style lb";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoPendingInterestCount()");
|
|
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()");
|
|
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 count(id) AS family_count FROM members_family WHERE member_id = %lu AND status = 1 ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) == 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Activate your family account.";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Add Kids, family, set, manage goals, and reward them.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "FAMILY_ADD";
|
|
|
|
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://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";
|
|
|
|
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] = "short_button_text";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "Activate your family account.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "Add Kids, family, set, manage goals, and reward them. ";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style lb";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoCheckFamilyCount()");
|
|
return ret;
|
|
}
|
|
|
|
long RecoCheckCoupons( int itm_count, CVars in, CVars &out ){
|
|
//SELECT id AS coupons_count FROM coupons_allocation WHERE member_id =1 AND amount> 0 AND active IS NULL;
|
|
logfmt(logINFO, "RecoCheckCoupons()");
|
|
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 AS coupons_count FROM coupons_allocation WHERE member_id = %lu AND amount> 0 AND active IS NULL ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Yo man , you have Coupons to play with";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "You have received some cash coupons waiting to be redeemed.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "COUPONS";
|
|
|
|
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/banner-coupons.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "my-coupon";
|
|
|
|
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
|
|
out[vname] = "Continue";
|
|
|
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
|
out[vname] = "Redeem";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "Redeem your Cash Coupons!";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "You have received some cash coupons waiting to be redeemed.";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style lg";
|
|
|
|
ret = PHP_API_OK;
|
|
}
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoCheckCoupons()");
|
|
return ret;
|
|
}
|
|
|
|
|
|
long RecoCheckActiveTask( int itm_count, CVars in, CVars &out ){
|
|
logfmt(logINFO, "RecoCheckActiveTask()");
|
|
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_date < now() ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "View you current task(s) ";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "View your current tasks, manage deliveries and updates";
|
|
|
|
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/active-jobs.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "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 Tasks";
|
|
|
|
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, "/RecoCheckActiveTask()");
|
|
return ret;
|
|
}
|
|
|
|
|
|
long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ){
|
|
logfmt(logINFO, "RecoCheckTaskDue()");
|
|
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 member_id = %lu AND status =1 AND delivery_date < now() ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Some of your task as owner of the tasks are due ";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Some of your task as owner of the tasks are due, Some of your task as owner of the tasks are due";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "PASTDUEJOB";
|
|
|
|
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/past-due.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "my-pastdue-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] = "Past Due Tasks";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "Some of your task are now past due";
|
|
|
|
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, "/RecoCheckTaskDue()");
|
|
return ret;
|
|
}
|
|
|
|
long RecoCheckTaskReview( int itm_count, CVars in, CVars &out ){
|
|
logfmt(logINFO, "RecoCheckTaskReview()");
|
|
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 member_id = %lu AND status = 4 ",member_id);
|
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = "Some of your task as owner Need Review now ";
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = "Some of your task as owner Need Review now,Some of your task as owner Need Review now, S Need Review now";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "REVIEWJOB";
|
|
|
|
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-job-due.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="LOCAL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "my-review-jobs";
|
|
|
|
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
|
|
out[vname] = "View Tasks";
|
|
|
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
|
out[vname] = "Start Review";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = "Review Ready Tasks";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] = "Some of your jobs are waiting for approval ";
|
|
|
|
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, "/RecoCheckTaskReview()");
|
|
return ret;
|
|
|
|
}
|
|
|
|
long RecoCheckBlog( int itm_count, CVars in, CVars &out ){
|
|
logfmt(logINFO, "RecoCheckBlog()");
|
|
long ret = PHP_API_BAD_PARAM;
|
|
const PGresult *res;
|
|
char vname[30];
|
|
try {
|
|
load_db_record( out, "SELECT title,id,banner,blog_id FROM blog_selections WHERE status = 1 ORDER BY RANDOM() LIMIT 1");
|
|
int ic = itm_count;
|
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
|
|
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
|
out[vname] = out["title"];
|
|
|
|
snprintf(vname, sizeof (vname), "description_%05d", ic);
|
|
out[vname] = out["title"]; //"The similarity index is a term you should be familiar with as an online writer. It is defined as the composite number that is highlighted after matching two texts to determine how similar the content from both pieces is.";
|
|
|
|
snprintf(vname, sizeof (vname), "card_type_%05d", ic);
|
|
out[vname] = "BLOG";
|
|
|
|
snprintf(vname, sizeof (vname), "offer_id_%05d", ic);
|
|
out[vname] = out["id"];
|
|
|
|
snprintf(vname, sizeof (vname), "blog_id_%05d", ic);
|
|
out[vname] = out["blog_id"];
|
|
|
|
snprintf(vname, sizeof (vname), "card_icon_%05d", ic);
|
|
out[vname] = "icon1";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_%05d", ic);
|
|
out[vname] = out["banner"]; //"https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg";
|
|
|
|
snprintf(vname, sizeof (vname), "banner_location_%05d", ic);
|
|
out[vname] ="URL";
|
|
|
|
snprintf(vname, sizeof (vname), "link_path_%05d", ic);
|
|
out[vname] = "blog-page";
|
|
|
|
snprintf(vname, sizeof (vname), "button_text_%05d", ic);
|
|
out[vname] = "View Article";
|
|
|
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
|
out[vname] = "Read Now";
|
|
|
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
|
out[vname] = out["title"]; //"Article - Similarity Index";
|
|
|
|
snprintf(vname, sizeof (vname), "short_description_%05d", ic);
|
|
out[vname] =out["title"]; // "Similarity index is a term you should be familiar with as an online writer";
|
|
|
|
snprintf(vname, sizeof (vname), "short_style_%05d", ic);
|
|
out[vname] = "short_style";
|
|
|
|
|
|
ret = PHP_API_OK;
|
|
|
|
} catch (bad_parameter) {
|
|
out["status"] = "ERROR";
|
|
}
|
|
logfmt(logINFO, "/RecoCheckBlog()");
|
|
return ret;
|
|
}
|
|
|
|
|
|
long sendOffersRecommendation( CVars in, CVars &out){
|
|
|
|
try{
|
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
|
REQ_LONG(in, "offer_id", 1, -1);
|
|
|
|
if ( load_db_record(out, "SELECT client_id FROM members_jobs_offer WHERE id=%lu", in["offer_id"].Long())> 0){
|
|
CVars xx;
|
|
CVars xout;
|
|
xx["action"] = WRENCHBOARD_CARDS_CREATECARD; xx["action"].set_valid( true );
|
|
xx["member_id"] = out["client_id"]; xx["member_id"].set_valid( true ); // the card is going to job recipient
|
|
xx["title"] = "New job offer"; xx["title"].set_valid( true );
|
|
xx["description"] = "You have received a new Task/Job offer"; xx["description"].set_valid( true );
|
|
xx["card_type"] = "OFFERS"; xx["card_type"].set_valid( true );
|
|
xx["card_style"] = "card2"; xx["card_style"].set_valid( true );
|
|
xx["card_icon"] = "icon1"; xx["card_icon"].set_valid( true );
|
|
xx["offer_id"] = in["offer_id"]; xx["offer_id"].set_valid( true );
|
|
xx["blog_id"] = "0"; xx["blog_id"].set_valid( true );
|
|
card_calls(xx, xout);
|
|
}
|
|
} catch (bad_parameter) {
|
|
logfmt(logINFO, "ERROR CALL long sendCouponRecommendation");
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
long sendCouponRecommendation( CVars in, CVars &out){
|
|
/*
|
|
CVars xx;
|
|
xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
|
xx["code"] = rec["code"]; xx["code"].set_valid(true);
|
|
xx["amount"] = rec["amount"]; xx["amount"].set_valid(true);
|
|
xx["status"] = COUPON_ACTIVE; xx["status"].set_valid(true);
|
|
coupon_id = insert_db_record(DBS_VALID, "coupons_allocation", "coupons_allocation_id_seq", xx);
|
|
|
|
['title'=>'This is your coupon',
|
|
'description'=>'This is the description of the description',
|
|
'card_type'=>'COUPON',
|
|
'card_style' =>'card1',
|
|
'card_icon' =>'icon1',
|
|
'assign_id'=> 0,
|
|
*/
|
|
|
|
try{
|
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
|
REQ_LONG(in, "coupon_id", 1, -1);
|
|
|
|
CVars xx;
|
|
CVars xout;
|
|
xx["action"] = WRENCHBOARD_CARDS_CREATECARD; xx["action"].set_valid( true );
|
|
xx["member_id"] = member_id; xx["member_id"].set_valid( true );
|
|
xx["title"] = "This is your coupon"; xx["title"].set_valid( true );
|
|
xx["description"] = "Click to redeem your coupon to your account"; xx["description"].set_valid( true );
|
|
xx["card_type"] = "COUPON"; xx["card_type"].set_valid( true );
|
|
xx["card_style"] = "card1"; xx["card_style"].set_valid( true );
|
|
xx["card_icon"] = "icon1"; xx["card_icon"].set_valid( true );
|
|
xx["blog_id"] = "0"; xx["blog_id"].set_valid( true );
|
|
xx["offer_id"] = "0"; xx["offer_id"].set_valid( true );
|
|
card_calls(xx, xout);
|
|
} catch (bad_parameter) {
|
|
logfmt(logINFO, "ERROR CALL long sendCouponRecommendation");
|
|
}
|
|
return 0;
|
|
}
|
|
|