offer interest method

This commit is contained in:
CHIEFSOFT\ameye
2024-01-22 07:08:55 -05:00
parent 00d0318f4d
commit 7cdb1e3341
+69 -2
View File
@@ -82,7 +82,7 @@ long WrenchHomeBanners(CVars in, CVars &out) {
if( RecoCheckFamilyCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; }
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( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } // - temporary for test
//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++; }
@@ -114,6 +114,73 @@ long WrenchHomeBanners(CVars in, CVars &out) {
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";
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 RecoCheckOffers(int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoCheckOffers()");
long ret = PHP_API_BAD_PARAM;
@@ -242,7 +309,7 @@ long RecoCheckFamilyLogin(int itm_count, CVars in, CVars &out ){
}
long RecoReferAFreind(int itm_count, CVars in, CVars &out ){
logfmt(logINFO, "RecoOffersInterest()");
logfmt(logINFO, "RecoReferAFreind()");
long ret = PHP_API_BAD_PARAM;
const PGresult *res;
char vname[30];