help contents
This commit is contained in:
@@ -16,6 +16,7 @@ long WrenchMemberActiveJobs(CVars in, CVars &out);
|
||||
long WrenchReturnMemberPaymentHx(CVars in, CVars &out);
|
||||
long WrenchReturnMemberBankAccount(CVars in, CVars &out);
|
||||
long WrenchReturnMemberNotifications(CVars in, CVars &out);
|
||||
long WrenchReturnHelpItems(CVars in, CVars &out);
|
||||
long WrenchAccountSettings( CVars in, CVars &out );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -222,6 +222,7 @@ enum { PARTNER_STRIPE };
|
||||
|
||||
#define WRECNH_CREDIT_HOOKS_FULUTTER 11045
|
||||
#define WRENCHBOARD_ACCT_NOTIFICATIONS 11046
|
||||
#define WRENCHBOARD_ACCT_HELPITEMS 11047
|
||||
|
||||
#define WRENCHBOARD_USER_GETBANKLIST 11050
|
||||
#define WRENCHBOARD_USER_SENDMONEY 11051
|
||||
|
||||
@@ -345,6 +345,10 @@ long account_calls(CVars in, CVars &out) {
|
||||
return WrenchReturnMemberNotifications(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCT_HELPITEMS:
|
||||
return WrenchReturnHelpItems( in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_DASHDATA:
|
||||
return WrenchLoadDashData(in, out);
|
||||
break;
|
||||
|
||||
@@ -14,6 +14,66 @@
|
||||
#include "payments.h"
|
||||
#include "account.h"
|
||||
|
||||
long WrenchReturnHelpItems(CVars in, CVars &out){
|
||||
logfmt(logINFO, "WrenchReturnHelpItems()");
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
/*
|
||||
wrenchboard=> SELECT * FROM help_items WHERE status=1 ORDER BY lorder ASC;
|
||||
id | uid | icon | title | contents | lorder | status | added
|
||||
----+--------------------------------------+-------------+----------------------------+--------------------------------------+--------+--------+----------------------------
|
||||
1 | 82fabd0f-91c9-4472-9e84-8425010db4b4 | message.svg | What is WrenchBoard? | Coming soon - Contents will be fixed | 1 | 1 | 2023-12-09 12:27:14.68754
|
||||
2 | 10392635-0098-42df-b338-9a8ec98cae93 | message.svg | Family Account | Coming soon - Contents will be fixed | 1 | 1 | 2023-12-09 12:27:14.692123
|
||||
3 | d4e84174-5586-47b1-84fe-a2a339a33a8d | message.svg | How does Wrenchboard work? | Coming soon - Contents will be fixed | 1 | 1 | 2023-12-09 12:27:14.694878
|
||||
|
||||
*/
|
||||
try {
|
||||
long limit = REQ_LONG(in, "limit", 1, -1);
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_LONG(in, "page", 1, -1);
|
||||
|
||||
out["total_record"] = "0";
|
||||
|
||||
const PGresult *res;
|
||||
|
||||
res = pgsql_query("SELECT * FROM help_items WHERE status=1 ORDER BY lorder 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), "uid_%05d", i);
|
||||
out[vname] = rec["uid"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "icon_%05d", i);
|
||||
out[vname] = rec["icon"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "title_%05d", i);
|
||||
out[vname] = rec["title"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "contents_%05d", i);
|
||||
out[vname] = rec["contents"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "added_%05d", i);
|
||||
out[vname] = rec["added"];
|
||||
}
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long WrenchReturnHelpItems(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/WrenchReturnHelpItems()");
|
||||
return ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long WrenchReturnMemberNotifications(CVars in, CVars &out){
|
||||
/*
|
||||
|
||||
|
||||
@@ -230,6 +230,7 @@ define('WRENCHBOARD_SAVE_GALLERY', 11042);
|
||||
|
||||
define('WRENCHBOARD_ACCOUNT_PENDJOB', 11043);
|
||||
define('WRENCHBOARD_ACCT_NOTIFICATIONS', 11046);
|
||||
define('WRENCHBOARD_ACCT_HELPITEMS' , 11047);
|
||||
|
||||
const WRECNH_CREDIT_HOOKS_FULUTTER = 11045;
|
||||
|
||||
|
||||
@@ -146,36 +146,75 @@ class WrenchFaq extends BaseController
|
||||
}
|
||||
private function apiHelpData() {
|
||||
|
||||
$total = 20;
|
||||
|
||||
$data = array(
|
||||
"status" => 100,
|
||||
"total_record" => ($total - 1),
|
||||
"internal_return" => 0,
|
||||
"result_list" => array(),
|
||||
);
|
||||
|
||||
|
||||
for ($i = 0; $i < $total; $i++) {
|
||||
$key = sprintf("%05d", $i);
|
||||
$msg='';
|
||||
$msgS = "<p> Random gibberish text to use in web pages, site templates and in typography demos.
|
||||
Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </p>";
|
||||
$txL = rand(1,5);
|
||||
for($ii=1; $ii<$txL; $ii++){
|
||||
$msg = $msg.$msgS;
|
||||
}
|
||||
|
||||
$data["result_list"][] = array(
|
||||
"uid" => $key,
|
||||
"public" => "1",
|
||||
"title" => "This is faq title dummy text ".$key,
|
||||
"vid" => (rand(0,1)> 0) ? "https://www.youtube.com/embed/xZ4o180KFNk?si=zGuIgpfTb-Tc0o3H":'',
|
||||
"msg" => $msg
|
||||
);
|
||||
$local_out =[];
|
||||
$call_backend = true;
|
||||
// $local_out = $this->dummyData();
|
||||
$in["action"]=WRENCHBOARD_ACCT_HELPITEMS;
|
||||
if ( $call_backend == true && $in["action"] !='' ){
|
||||
$wrenchboard = new \App\Models\BackendModel();
|
||||
$ret = $wrenchboard->wrenchboard_api($in, $out);
|
||||
$out['internal_return'] = $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = $local_out;
|
||||
}
|
||||
|
||||
return $data;
|
||||
$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(
|
||||
"title" => $out["msg_${key}"],
|
||||
"uid" => $out["uid_${key}"],
|
||||
"public" => "1",
|
||||
"vid" => (rand(0,1)> 0) ? "https://www.youtube.com/embed/xZ4o180KFNk?si=zGuIgpfTb-Tc0o3H":'',
|
||||
"icon" => $out["icon_${key}"],
|
||||
"msg" => $out["contents_${key}"],
|
||||
"date" => $out["added_${key}"],
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $res;
|
||||
//
|
||||
// $total = 20;
|
||||
//
|
||||
// $data = array(
|
||||
// "status" => 100,
|
||||
// "total_record" => ($total - 1),
|
||||
// "internal_return" => 0,
|
||||
// "result_list" => array(),
|
||||
// );
|
||||
//
|
||||
//
|
||||
// for ($i = 0; $i < $total; $i++) {
|
||||
// $key = sprintf("%05d", $i);
|
||||
// $msg='';
|
||||
// $msgS = "<p> Random gibberish text to use in web pages, site templates and in typography demos.
|
||||
// Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. </p>";
|
||||
// $txL = rand(1,5);
|
||||
// for($ii=1; $ii<$txL; $ii++){
|
||||
// $msg = $msg.$msgS;
|
||||
// }
|
||||
//
|
||||
// $data["result_list"][] = array(
|
||||
// "uid" => $key,
|
||||
// "public" => "1",
|
||||
// "title" => "This is faq title dummy text ".$key,
|
||||
// "vid" => (rand(0,1)> 0) ? "https://www.youtube.com/embed/xZ4o180KFNk?si=zGuIgpfTb-Tc0o3H":'',
|
||||
// "msg" => $msg
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user