country list
This commit is contained in:
@@ -391,16 +391,6 @@ long account_calls(CVars in, CVars &out) {
|
||||
return WrenchBoardCompleteBalanceTopup(in, out);
|
||||
break;
|
||||
case WRENCHBOARD_USER_DELETEACC:
|
||||
// REQ_LONG(in, "member_id", 1, -1);
|
||||
// REQ_STRING(in, "reason", 2, 149, "(.*)");
|
||||
// CVars xx;
|
||||
// xx["member_id"] = in["member_id"]; xx["member_id"].set_valid(true);
|
||||
// xx["reason"] = in["reason"]; xx["reason"].set_valid(true);
|
||||
// out["delete_id"] = insert_db_record(DBS_VALID, "members_delete", "members_delete_id_seq", xx);
|
||||
// ret = PHP_API_OK;
|
||||
/*
|
||||
DO THE DELETE HERE NOW
|
||||
*/
|
||||
return WrenchBoardDeleteAccount(in, out);
|
||||
break;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ long getUserRecipientCombo( CVars in, CVars &out ){
|
||||
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT b.id,b.firstname||' '||b.lastname||' '||b.account_no||' '||k.name AS recipient, b.account_no,b.country "
|
||||
res = pgsql_query("SELECT b.id,b.firstname||' '||b.lastname||' '||b.account_no||' '||k.name AS recipient, b.account_no,b.country,b.added "
|
||||
"FROM sendmoney_recipient b "
|
||||
"LEFT JOIN bank_entity_codes k ON k.code=b.bank_code "
|
||||
"WHERE b.member_id = %lu AND b.status=1",member_id);
|
||||
@@ -109,6 +109,9 @@ long getUserRecipientCombo( CVars in, CVars &out ){
|
||||
|
||||
snprintf(vname, sizeof (vname), "country_%05d", i);
|
||||
out[vname] = rec["country"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "added_%05d", i);
|
||||
out[vname] = rec["added"];
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
@@ -165,7 +168,58 @@ long getCountryCombo( CVars in, CVars &out ) {
|
||||
->get('country');
|
||||
|
||||
$option_value = $this->optionValueObject($q->result(), "code", "country", $curVal);
|
||||
id| code |country| phone_code |allow| status |created|updated|jobs
|
||||
*/
|
||||
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
logfmt( logINFO, "getCountryCombo()" );
|
||||
out["result"] = "Yes i go to this back end";
|
||||
|
||||
try {
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT * "
|
||||
"FROM country "
|
||||
"WHERE status = 1 ORDER BY country ASC");
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||
out[vname] = rec["id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "code_%05d", i);
|
||||
out[vname] = rec["code"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "country_%05d", i);
|
||||
out[vname] = rec["country"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "phone_code_%05d", i);
|
||||
out[vname] = rec["phone_code"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "account_no_%05d", i);
|
||||
out[vname] = rec["account_no"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "created_%05d", i);
|
||||
out[vname] = rec["created"];
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long getCountryCombo(CVars in, CVars &out)");
|
||||
}
|
||||
|
||||
logfmt( logINFO, "/getCountryCombo()" );
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -179,6 +233,56 @@ long getCountryJobCombo( CVars in, CVars &out ) {
|
||||
|
||||
$option_value = $this->optionValueObject($q->result(), "code", "country", $curVal);
|
||||
*/
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
logfmt( logINFO, "getCountryJobCombo()" );
|
||||
out["result"] = "Yes i go to this back end";
|
||||
|
||||
try {
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT * "
|
||||
"FROM country "
|
||||
"WHERE jobs IS NOT NULL ORDER BY country ASC");
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||
out[vname] = rec["id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "code_%05d", i);
|
||||
out[vname] = rec["code"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "country_%05d", i);
|
||||
out[vname] = rec["country"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "phone_code_%05d", i);
|
||||
out[vname] = rec["phone_code"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "account_no_%05d", i);
|
||||
out[vname] = rec["account_no"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "created_%05d", i);
|
||||
out[vname] = rec["created"];
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long getCountryCombo(CVars in, CVars &out)");
|
||||
}
|
||||
|
||||
logfmt( logINFO, "/getCountryJobCombo()" );
|
||||
return ret;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -300,6 +300,29 @@ class ResultFormatter extends Model
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_USER_RECIPEINT:
|
||||
|
||||
$total = $out["total_record"];
|
||||
$res = array(
|
||||
"status" => $out["status"],
|
||||
"total_record" => ($total - 1),
|
||||
"internal_return" => $out["internal_return"],
|
||||
"result_list" => array(),
|
||||
);
|
||||
for ($i = 0; $i < $total; $i++) {
|
||||
$key = sprintf("%05d", $i);
|
||||
$res["result_list"][] = array(
|
||||
"recipient" => $out["recipient_${key}"],
|
||||
"account_no" => $out["account_no_${key}"],
|
||||
"recipient_id" => $out["id_${key}"],
|
||||
"recipient_uid" => $out["uid_${key}"],
|
||||
"country" => $out["country_${key}"],
|
||||
"added" => $out["added_${key}"]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_WALLETS:
|
||||
$total = $out["total_record"];
|
||||
$res = array(
|
||||
|
||||
Reference in New Issue
Block a user