";
$text = preg_replace($tags, $replacement, $text);
$text = preg_replace("/=\"\"/", "=", $text);
$text = str_replace("\\n", "
", $text);
$text = str_replace('""\"','',$text);
$text = str_replace('"\""','',$text);
$text = str_replace(' ','',$text);
$text = str_replace('href=\\"\"http://','',$text);
$text = str_replace('href=\\"\"https://','',$text);
return $text;
}
public function processOutJson($in, $out) {
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
switch ($in["action"]) {
case WRENCHBOARD_CARDS_GETCARDLIST:
$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(
"assign_id" => $out["assign_id_${key}"],
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
"card_type" => $out["card_type_${key}"],
"card_style" => $out["card_style_${key}"],
"card_icon" => $out["card_icon_${key}"] );
}
break;
case WRENCHBOARD_COUPON_MEMLIST:
case WRENCHBOARD_COUPON_PENDLIST:
$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(
"coupon_id" => $out["coupon_id_${key}"],
"code" => $out["code_${key}"],
"amount" => $out["amount_${key}"],
"added" => $out["added_${key}"],
"status" => $out["status_${key}"]
);
}
break;
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(),
"categories" => dummyCategory()
);
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}"],
"offer_uid" => $out["offer_uid_${key}"],
"job_uid" => $out["job_uid_${key}"],
"job_description" => cleanUpDescription($out["job_description_${key}"]),
"price" => $out["price_${key}"],
"timeline_days" => $out["timeline_days_${key}"],
"expire" => $out["expire_${key}"],
"sent" => $out["sent_${key}"],
"offer_code" => $out["offer_code_${key}"],
"whishlisted"=> false,
"thumbnil" => 'marketplace-product-1.jpg',
'isActive' => true,
'offer_added' => $out["offer_added_${key}"],
'job_country' => $out["job_country_${key}"],
'currency' => 'Naira',
'currency_code' => 'NGN',
'category' => dummyGetCategory()
);
}
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}"],
"reply" => $out["reply_${key}"],
"message_mode" => $out["message_mode_${key}"],
"uid" => $out["uid_${key}"],
"memo" => $out["memo_${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;
case WRENCHBOARD_ACCOUNT_WALLETS:
$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(
"currency" => $out["currency_${key}"],
"amount" => $out["amount_${key}"],
"symbol" => $out["symbol_${key}"],
"description" => $out["description_${key}"],
"action_type" => $out["action_type_${key}"],
"code" => $out["code_${key}"]
);
}
break;
default:
return $out;
}
return $res;
}
public function dummyGetCategory(){
$i= rand(1,4);
$res=array();
switch ($i) {
case 1:
$res= array('CT1', 'CT2');
break;
case 2:
$res= array( 'CT3', 'CT4');
break;
case 3:
$res= array('CT1', 'CT4',);
break;
case 4:
$res= array( 'CT4');
break;
}
return $res;
}
public function dummyCategory(){
return array(
'CT1'=>'Category 1',
'CT2'=>'Category 2',
'CT3'=>'Category 3',
'CT4'=>'Category 4',
);
}
public function getBlogData(){
return [
[
'meta_value' => "https://blog.wrenchboard.com/wp-content/uploads/2022/01/universitty.jpg",
'post_date' => "2018-06-25T18:54:22.000Z",
'post_date_gmt' => "2018-06-25T18:54:22.000Z",
'post_content' => "Globalization spells danger for the type of jobs that will be available at graduation. The nature of jobs changes so often that it could frustrate for the students. The changes also present new opportunities. Globalization also ensures that job can come anonymously from any part of the world and transaction can be completed privately.\n\nThis is where WrenchBoard comes in, rather than focus on your primary education as your source of income, the new economy will look at your skills as this guide. Your question is to self-examine and attributes values to what you have that others need to make their own or goal complete.\n\nUniversity students can earn extra income along with their regular educational and school work by taking part-time tasks online. To get a project up and running there are a lot of components of service that every business goes through and there are those tasks that students can attend to. Students are in best position to do an initial critique of sites, write articles that bear innocence or interest meddling or test an app for a company in beta phase.\n\nThe online nature of the jobs gives the student the necessary flexibility to operate and added the benefit of interacting with people that don’t think like them, it is an opportunity for the larger world. It is getting very hard to manufacture excuses for not to be involved with one online job or the other when the opportunities and the capabilities collide. A student should be made aware of the fact that life is going to get busier once the excuse of the school is removed.\n\nThere are many jobs students can easily do online\n