Backend Provider added

This commit is contained in:
2019-03-03 23:28:50 +00:00
parent 0d814375ff
commit 220b6dd983
+13 -10
View File
@@ -15,8 +15,7 @@
#include "providers.h"
#include "function_members.h"
long provider_login(CVars in, CVars &out);
long providers_call(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
@@ -28,13 +27,7 @@ long providers_call(CVars in, CVars &out) {
switch (in["action"].Long()) {
case MERMS_PROVIDERS_LOGIN:
REQ_STRING(in, "cardnumber", 10, 17, "(.*)");
REQ_LONG(in, "exp_month", 0, -1);
REQ_LONG(in, "exp_year", 0, -1);
REQ_LONG(in, "cvc", 0, -1);
ret = PHP_API_OK;
return provider_login(in, out);
break;
case EXISTING_CARD:
@@ -42,7 +35,7 @@ long providers_call(CVars in, CVars &out) {
break;
case INVOICED:
const PGresult *res = pgsql_query("SELECT * FROM members WHERE invoiced =1 AND id=%lu", in["member_id"].Long());
@@ -61,3 +54,13 @@ long providers_call(CVars in, CVars &out) {
return ret;
}
long provider_login(CVars in, CVars &out) {
long ret = 0;
ret = load_db_record(out, "SELECT p.name AS practice_name,u.* FROM practice_users u LEFT JOIN practice p ON p.id = u.practice_id WHERE u.id = 1 ");
ret = PHP_LOGIN_OK;
return ret;
}