first commit
This commit is contained in:
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
function formatCreateTranspData($in) {
|
||||
$in["member_id"] = $in["session_member_id"];
|
||||
$in['firstname'] = $in['patientinfo_firstname'];
|
||||
$in['lastname'] = $in['patientinfo_lastname'];
|
||||
$in['from_phone'] = $in['patientinfo_phone']; //
|
||||
|
||||
$in['from_street'] = $in['pickupaddress_streetaddress']; //
|
||||
//$in['from_aptno'] = $in['pickupaddress_aptno']; //
|
||||
$in['from_zipcode'] = $in['pickupaddress_zip']; //
|
||||
|
||||
$in['from_city'] = $in['pickupaddress_city']; //
|
||||
$in['from_state'] = $in['pickupaddress_state']; //
|
||||
$in['to_street'] = $in['dropoffaddress_streetaddress']; //
|
||||
//$in['to_aptno'] = $in['dropoffaddress_aptno']; //
|
||||
$in['to_zipcode'] = $in['dropoffaddress_zip']; //
|
||||
$in['to_city'] = $in['dropoffaddress_city']; //
|
||||
$in['to_state'] = $in['dropoffaddress_state']; //
|
||||
$in['facilityname'] = $in['dropoffaddress_facilityname']; //
|
||||
$in['transport_date'] = $in['datetime_currentdate'] . " " . $in['datetime_currentTime'];
|
||||
|
||||
// payment information
|
||||
$in['paymenttype'] = $in['paymentinfo_paymenttype']; //
|
||||
$in['paymentid'] = $in['paymentinfo_paymentid']; //
|
||||
$in['cardname'] = $in['paymentinfo_fullname']; //
|
||||
$in['cardnumber'] = $in['paymentinfo_cardnumber']; //
|
||||
$in['exp_month'] = $in['paymentinfo_exp_month']; //
|
||||
$in['exp_year'] = $in['paymentinfo_exp_year']; //
|
||||
$in['cvc'] = $in['paymentinfo_cvc']; //
|
||||
|
||||
|
||||
return $in;
|
||||
}
|
||||
|
||||
function processOutJson($in, $out) {
|
||||
if ($in["action"] != MEDTRANS_USER_GET_TRANSLIST) {
|
||||
// return $out;
|
||||
}
|
||||
|
||||
|
||||
switch ($in["action"]) {
|
||||
|
||||
|
||||
case WRENCHBOARD_MOBILE_TASKMESSAGE:
|
||||
|
||||
$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["title_${key}"],
|
||||
"msg" => $out["msg_${key}"],
|
||||
"msg_id" => $out["msg_id_${key}"],
|
||||
"date" => $out["date_${key}"]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_START_JOBLIST:
|
||||
case WRENCHBOARD_ACCOUNT_JOBLIST:
|
||||
case WRENCHBOARD_ACCOUNT_PENDJOB:
|
||||
|
||||
$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["title_${key}"],
|
||||
"description" => $out["description_${key}"],
|
||||
"id" => $out["id_${key}"],
|
||||
"job_description" => $out["job_description_${key}"],
|
||||
"price" => $out["price_${key}"],
|
||||
"timeline_days" => $out["timeline_days_${key}"],
|
||||
"expire" => $out["expire_${key}"],
|
||||
"sent" => $out["sent_${key}"]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
case WRENCHBOARD_MOBILE_ACTIVEJOB:
|
||||
case WRENCHBOARD_MOBILE_OFFERSLIST:
|
||||
|
||||
$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["title_${key}"],
|
||||
"description" => $out["description_${key}"],
|
||||
"id" => $out["id_${key}"],
|
||||
"job_description" => $out["job_description_${key}"],
|
||||
"price" => $out["price_${key}"],
|
||||
"timeline_days" => $out["timeline_days_${key}"],
|
||||
|
||||
"contract_id" => $out["contract_id_${key}"],
|
||||
"job_id" => $out["job_id_${key}"],
|
||||
"contract" => $out["contract_${key}"],
|
||||
"status_description" => $out["status_description_${key}"],
|
||||
|
||||
"delivery_date" => $out["delivery_date_${key}"]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
case WRENCHBOARD_MOBILE_MESSAGE:
|
||||
$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(
|
||||
"msg" => $out["msg_${key}"],
|
||||
"msg_id" => $out["msg_id_${key}"],
|
||||
"msg_date" => $out["msg_date_${key}"],
|
||||
"msg_from" => $out["msg_from_${key}"]
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_MOBILE_PAYMENTHX:
|
||||
$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(
|
||||
"fee" => $out["fee_${key}"],
|
||||
"amount" => $out["amount_${key}"],
|
||||
"recipient" => $out["recipient_${key}"],
|
||||
"confirmation" => $out["confirmation_${key}"],
|
||||
"status" => $out["status_${key}"],
|
||||
"trx_date" => $out["trx_date_${key}"],
|
||||
"trx_id" => $out["trx_id_${key}"]
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_USER_GETBANKLIST:
|
||||
|
||||
$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}"],
|
||||
"bank_id" => $out["bank_id_${key}"],
|
||||
"added" => $out["added_${key}"]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
return $out;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user