This commit is contained in:
Olusesan Ameye
2021-02-20 18:45:21 -05:00
parent dc34379d34
commit 147e2debde
2 changed files with 36 additions and 5 deletions
+1
View File
@@ -95,6 +95,7 @@ enum {
// // --
#define MERMS_PROVIDERS_STARTPRACTICE 150005
#define MERMS_PROVIDERS_RESNDSTARTLNK 150006
#define MERMS_PROVIDERS_CANCELPENDING 150007
#define MERMS_PROVIDERS_BEFORESESSION 150010
#define MERMS_PROVIDERS_CREATEACCOUNT 150015
#define MERMS_PROVIDERS_RESETPASSWORD 150020
+35 -5
View File
@@ -25,10 +25,13 @@ long provider_acceptmember(CVars in, CVars &out);
long provider_linkIdemember(CVars in, CVars &out);
void GenerateLongID(char * number, int sz, int seed);
long provider_startNewPractice(CVars in, CVars &out);
long rejectPendingPractice(CVars in, CVars &out);
long providers_call(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
char vname[20];
logfmt(logINFO, "ERROR CALL long providers_call(CVars in, CVars &out)");
try {
REQ_LONG(in, "action", 0, -1);
@@ -65,23 +68,50 @@ long providers_call(CVars in, CVars &out) {
provider_email_calls(MERMS_PROVIDERS_STARTPRACTICE, in, out);
break;
case INVOICED:
const PGresult *res = pgsql_query("SELECT * FROM members WHERE invoiced =1 AND id=%lu", in["member_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
case MERMS_PROVIDERS_CANCELPENDING:
ret = rejectPendingPractice(in, out);
/*
resD = pgsql_query("SELECT * FROM practice_pending WHERE status NOT IN (0,3,5) AND id=%lu", in["practice_pending_id"].Long());
if (resD != NULL && pgsql_num_rows(resD) == 1) {
pgsql_query("UPDATE practice_pending SET status = 3 WHERE id = %lu AND status<>5", in["practice_pending_id"].Long()); // setting the password MD5 now
out["error_status"] = " The Pending was cancelled";
ret = PHP_API_OK;
} else {
out["error_status"] = "user not authorized to use invoice";
out["error_status"] = " Not authorized to use adjust this type";
}
break;
*/
break;
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long providers_call(CVars in, CVars &out)");
}
return ret;
}
long rejectPendingPractice(CVars in, CVars &out){
long ret = PHP_API_BAD_PARAM;
char vname[20];
const PGresult *resD = pgsql_query("SELECT * FROM practice_pending WHERE status NOT IN (0,3,5) AND id=%lu", in["practice_pending_id"].Long());
if (resD != NULL && pgsql_num_rows(resD) == 1) {
pgsql_query("UPDATE practice_pending SET status = 3 WHERE id = %lu AND status<>5", in["practice_pending_id"].Long()); // setting the password MD5 now
out["error_status"] = " The Pending was cancelled";
ret = PHP_API_OK;
} else {
out["error_status"] = " Not authorized to use adjust this type";
}
return ret;
}
long provider_login(CVars in, CVars &out) {
long ret = -1;