family list
This commit is contained in:
@@ -427,6 +427,11 @@ long WrenchFamilyList(CVars in, CVars &out){
|
||||
snprintf(vname, sizeof (vname), "task_count_%05d", i);
|
||||
out[vname] = rec["task_count"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "year_%05d", i);
|
||||
out[vname] = rec["year"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "month_%05d", i);
|
||||
out[vname] = rec["month"];
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
@@ -446,13 +451,15 @@ long WrenchFamilyAdd(CVars in, CVars &out){
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "age", 1, -1);
|
||||
//REQ_LONG(in, "age", 1, -1);
|
||||
REQ_LONG(in, "year", 1, -1);
|
||||
REQ_LONG(in, "month", 1, -1);
|
||||
REQ_STRING(in, "firstname", 2, 34, "(.*)");
|
||||
REQ_STRING(in, "lastname", 2, 34, "(.*)");
|
||||
CVars x;
|
||||
x["member_id"] = in["member_id"];
|
||||
x["member_id"].set_valid(true);
|
||||
x["age"] = in["age"];
|
||||
x["age"] = "0";
|
||||
x["age"].set_valid(true);
|
||||
x["firstname"] = in["firstname"];
|
||||
x["firstname"].set_valid(true);
|
||||
@@ -460,6 +467,13 @@ long WrenchFamilyAdd(CVars in, CVars &out){
|
||||
x["lastname"].set_valid(true);
|
||||
x["status"] = "1";
|
||||
x["status"].set_valid(true);
|
||||
|
||||
x["year"] = in["year"];
|
||||
x["year"].set_valid(true);
|
||||
|
||||
x["month"] = in["month"];
|
||||
x["month"].set_valid(true);
|
||||
|
||||
family_id = insert_db_record(DBS_VALID, "members_family", "members_family_id_seq", x);
|
||||
if (family_id > 0) {
|
||||
load_db_record(out, "SELECT * FROM members_family WHERE id =%lu",family_id);
|
||||
|
||||
Reference in New Issue
Block a user