<?php
namespace App\Models;

use CodeIgniter\Model;

//www-api/app/Models/.php
class ResultFormatter extends Model
{
    public 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;
    }
    public function cleanUpDescription($job_description){
        // $job_description = trim($job_description); // trim it first

        /*
         *
         * $rest = substr("abcdef", -1);    // returns "f"
    $rest = substr("abcdef", -2);    // returns "ef"
    $rest = substr("abcdef", -3, 1); // returns "d"
         */

        if ( substr($job_description,0,1)==='"' ){
            //  $job_description = substr($job_description,1);
        }
        $job_description = $this->fixtags($job_description);

        if ( substr($job_description,0,1)==='"' ){
            //  $job_description = substr($job_description,2);
        }
        return $job_description;
    }

    private function fixEmptyBanner($banner_str){
        if (trim($banner_str)==''){
            $banner_str = 'default.jpg';
        }
        return $banner_str;
    }

    private function taskFileLink(){
        return 'file_link_will_be_here';
    }
    public function fixtags($text){
        $text = htmlspecialchars($text);
        $text = preg_replace("/=/", "=\"\"", $text);
        $text = preg_replace("/&quot;/", "&quot;\"", $text);
        $tags = "/&lt;(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\"&quot;\"|)(?|(.*)?&quot;(\")|)([\ ]?)(\/|)&gt;/i";
        $replacement = "<$1$2$3$4$5$6$7$8$9$10>";
        $text = preg_replace($tags, $replacement, $text);
        $text = preg_replace("/=\"\"/", "=", $text);
        $text = str_replace("\\n", "<br />", $text);

        $text = str_replace('"&quot;\"','',$text);
        $text = str_replace('&quot;\""','',$text);
        $text = str_replace('&nbsp;','',$text);

        $text = str_replace('href=\\&quot;\"http://','',$text);
        $text = str_replace('href=\\&quot;\"https://','',$text);

        return $text;
    }

    private function suggestedStatusText($status){
        $stArr = ['0 Status','Waiting','2 Status', '3 Status', '4 Status', '5 Status' ];
        return  $stArr[$status];
    }

    public function processRecentOutJson($in, $out) {

        return $out;
    }

    private function uploadedBanner($fileType){


        return 'default.svg';
    }

    function GetFamilyAge($age,$year,$month){
        $currAge= $age;
        if ($year >  0  && $month > 0  ){
            $bdate="$year/$month/1";
            $currAge = date_diff(date_create($bdate), date_create('now'))->y;
        }
        return $currAge;
    }

    public function processOutJson($in, $out) {
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
        switch ($in["action"]) {
            case WRENCHBOARD_PROMOADMIN_ACTIONLIST:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => $total,
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "category" => $out["category_${key}"],
                        "description" => $out["description_${key}"],
                        "status" => $out["status_${key}"],
                        "added" => $out["added_${key}"],
                        "updated" => $out["updated_${key}"]
                    );
                }
                break;
            case WRENCHBOARD_PROMOADMIN_GETLIST:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => $total,
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "firstname" => $out["firstname_${key}"],
                        "uid" => $out["uid_${key}"],
                        "lastname" => $out["lastname_${key}"],
                        "email" => $out["email_${key}"],
                        "status" => $out["status_${key}"],
                        "added" => $out["added_${key}"],
                        "updated" => $out["updated_${key}"]
                    );
                }
                break;
            case WRENCHBOARD_ACCOUNT_PREFERENCES:
                $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(
                        "description" => $out["description_${key}"],
                        "uid" => $out["uid_${key}"],
                        "pref" => $out["pref_${key}"],
                        "lang" => $out["lang_${key}"],
                        "added" => $out["added_${key}"],
                        "currval" => 0,
                    );
                }
                break;

            case WRENCHBOARD_ACCT_NOTIFICATIONS:
                $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}"],
                        "icon" => $out["icon_${key}"],
                        "date" => $out["added_${key}"],

                    );
                }
                break;

            case WRENCHBOARD_ACCOUNT_RECENTS:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $banner_img = ( $out["banner_${key}"] !="" ) ? $out["banner_${key}"] : 'default.jpg';
                    $res["result_list"][] = array(
                        "uid" => $out["uid_${key}"],
                        "description" => $out["description_${key}"],
                        "title" => $out["title_${key}"],
                        "added" => $out["added_${key}"],
                        "status" => $out["status_${key}"],
                        "banner" => $banner_img,
                    );
                }
                break;

            case WRENCHBOARD_MYFILES_LIST:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                //    $pref_id =  $out["pref_id_${key}"];
                 //   $pref_value_key  = "VALUE_".$pref_id;

               //     log_message('critical', "pref_value_key=>".$pref_value_key);
                //    log_message('critical', "pref_id       =>".$pref_id);
                    $fileType = $out["file_type_${key}"];

                    $res["result_list"][] = array(
                        "file_uid" => $out["file_uid_${key}"],
                        "description" => $out["description_${key}"],
                        "title" => $out["title_${key}"],
                        "added" => $out["added_${key}"],
                        "file_type" => $out["file_type_${key}"],
                        "file_size" => $out["file_size_${key}"],
                        "file_name" => $out["file_name_${key}"],
                        "banner" => $this->uploadedBanner( $fileType  ),
                    );
                }
                break;
            case WRENCHBOARD_GETUSER_SETTINGS:
                $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);
                    $pref_id =  $out["pref_id_${key}"];
                    $pref_value_key  = "VALUE_".$pref_id;

                    log_message('critical', "pref_value_key=>".$pref_value_key);
                    log_message('critical', "pref_id       =>".$pref_id);

                    $res["result_list"][] = array(
                        "uid" => $out["uid_${key}"],
                        "description" => $out["description_${key}"],
                        "title" => $out["title_${key}"],
                        "pref_id" => $out["pref_id_${key}"],
                        "banner" => $this->fixEmptyBanner( $out["banner_${key}"]),
                        "pref_value" => $out[$pref_value_key],
                    );
                }
                break;
            case WRENCHBOARD_FAMILY_RELLIST:
                $connStatus["0"] = "Pending";
                $connStatus["5"] = "Connected";
                $connStatus["7"] = "Removed";


                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "relative_uid" => $out["uid_${key}"],
                        "lastname" => $out["lastname_${key}"],
                        "email" => $out["email_${key}"],
                        "family_type" => $out["family_type_${key}"],
                        "status" => $connStatus[ $out["status_${key}"] ],
                        "status_action" => 'pending_relative_action',
                        "kid_count" => 0,
                        "firstname" => $out["firstname_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_FAMILY_SGGESTLIST:
            case WRENCHBOARD_FAMILY_SGGESTWAITING:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $status_no =  $out["status_${key}"];
                    $statusTxt  = $this->suggestedStatusText($status_no);
                    $banner_img = ( $out["banner_${key}"] !="" ) ? $out["banner_${key}"] : 'default.jpg';
                    $res["result_list"][] = array(
                        "uid" => $out["uid_${key}"],
                        "family_uid" => $out["family_uid_${key}"],
                        "description" => $out["description_${key}"],
                        "title" => $out["title_${key}"],
                        "added" => $out["added_${key}"],
                        "status" => $out["status_${key}"],
                        "status_text" => $statusTxt ,
                        "banner" => $banner_img,
                        "firstname" => $out["firstname_${key}"],
                        "remind" => $out["remind_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_RELATIVES_SETTINGS:
                $total = $out["total_kid"];
                $res = array(
                    "status" => $out["status"],
                    "internal_return" => $out["internal_return"],
                    "kids_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["kids_list"][] = array(
                        "family_uid" => $out["family_uid_${key}"]
                    );
                }
                break;
            case WRENCHBOARD_FAMILY_SAMPLETASKS:
                $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);
                    $banner_img = ( $out["banner_${key}"] !="" ) ? $out["banner_${key}"] : 'default.jpg';
                    $res["result_list"][] = array(
                        "uid" => $out["uid_${key}"],
                        "description" => $out["description_${key}"],
                        "title" => $out["title_${key}"],
                        "added" => $out["added_${key}"],
                        "age" => $out["age_${key}"],
                        "banner" => $banner_img,
                    );
                }
                break;

            case WRENCHBOARD_JOB_OFFER_INTLIST:
            case WRENCHBOARD_JOB_WAITING_INT:

                $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(
                        "interest_uid" => $out["interest_uid_${key}"],
                        "client_id" => $out["client_id_${key}"],
                        "client_uid" => $out["client_uid_${key}"],
                        "client_name" => $out["client_name_${key}"],
                        "client_added" => $out["client_added_${key}"],
                        "client_jobs_completed" => $out["client_jobs_completed_${key}"],
                        "client_jobs_active" => $out["client_jobs_active_${key}"],
                        "client_jobs_missed" => $out["client_jobs_missed_${key}"],
                        "client_offers_pending" => $out["client_offers_pending_${key}"],
                        "client_percent_completion" => $out["client_percent_completion_${key}"],
                        "client_ratings" => $out["client_ratings_${key}"],
                        "offer_code" => $out["offer_code_${key}"],
                        "offer_uid" => $out["offer_uid_${key}"],
                        "sent" => $out["sent_${key}"],
                        "title" => $out["title_${key}"],
                        "description" => $out["description_${key}"],
                        "job_id" => $out["job_id_${key}"],
                        "job_uid" => $out["job_uid_${key}"],
                        "expire" => $out["expire_${key}"],
                        "price" => $out["price_${key}"],
                        "timeline_days" => $out["timeline_days_${key}"],
                        'job_country' => $out["job_country_${key}"],
                        'currency' =>  $out["currency_${key}"],
                        'currency_code' => $out["currency_code_${key}"],
                    );
                }

                break;
            case WRENCHBOARD_JOB_INT_QUESTLST:
                $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_uid" => $out["msg_uid_${key}"],
                        "msg" => $out["msg_${key}"],
                        "added" => $out["added_${key}"],
                        "sender" => $out["sender_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_USER_CARDLIST:
                $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(
                        "card_uid" => $out["card_uid_${key}"],
                        "description" => $out["description_${key}"],
                        "digits" => $out["digits_${key}"],
                        "added" => $out["added_${key}"],
                        "active" => $out["active_${key}"],
                        "type" => $out["type_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_ACCOUNT_DASHDATA:
                $res = $out;
                $res['home_activities'] = [];
                if ($res["next_due_status"]==1) {
                    $res['next_due'] = [
                        "item_code" => $out["item_code"],
                        "due_date" =>  $out["due_date"],
                        "price" =>  $out["price"],
                        "currency" => $out["currency"],
                    ];
                }
                else{
                    $res['next_due'] = [];
                }
                break;
            case  WRENCHBOARD_ACCOUNT_HOMEBANNERS:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total - 1),
                    "internal_return" => $out["internal_return"],
                    "family_action" => 0,
                    "home_dash_type" => $out["home_dash_type"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "title" => $out["title_${key}"],
                        "contract" => $out["contract_${key}"],
                        "card_type" => $out["card_type_${key}"],
                        "card_style" => $out["card_style_${key}"],
                        "description" => $out["description_${key}"],
                        "blog_id" => $out["blog_id_${key}"],
                        "card_icon" => $out["card_icon_${key}"],
                        "offer_id" => $out["offer_id_${key}"],
                        "banner" => $this->fixEmptyBanner( $out["banner_${key}"]),
                        "banner_location" => $out["banner_location_${key}"],
                        "link_path" => $out["link_path_${key}"],
                        "button_text" => $out["button_text_${key}"],
                        "short_button_text" => $out["short_button_text_${key}"],
                        "short_title" => $out["short_title_${key}"],
                        "short_description" => $out["short_description_${key}"],
                        "short_style" => $out["short_style_${key}"],
                    );
                }
                break;

            case WRENCHBOARD_FAMILY_HOMEBANNERS:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total - 1),
                    "internal_return" => $out["internal_return"],
                    "family_action" => 0,
                    "home_dash_type" => $out["home_dash_type"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $banner_action  =   $out["action_${key}"];
                    /*
                    $res["result_list"][] =
                        [$banner_action =>
                            ["banner" =>
                                [
                                "text" => $out["title_${key}"],
                                "contract" => $out["contract_${key}"],
                                "card_type" => $out["card_type_${key}"],
                                "style" => $out["card_style_${key}"],
                                "description" => $out["description_${key}"],
                                "blog_id" => $out["blog_id_${key}"],
                                "card_icon" => $out["card_icon_${key}"],
                                "offer_id" => $out["offer_id_${key}"],
                                "image" => $this->fixEmptyBanner( $out["banner_${key}"]),
                                "banner_location" => $out["banner_location_${key}"],
                                "link_path" => $out["link_path_${key}"],
                                "action" => $banner_action,
                                "button_text" => $out["button_text_${key}"],
                                "short_button_text" => $out["short_button_text_${key}"],
                                "short_title" => $out["short_title_${key}"],
                                "short_description" => $out["short_description_${key}"],
                                "short_style" => $out["short_style_${key}"],
                                "status"=> 1
                                ]
                            ]
                        ];
*/
                    $res["result_list"][$banner_action] =
                            ["banner" =>
                                [
                                    "text" => $out["title_${key}"],
                                    "contract" => $out["contract_${key}"],
                                    "card_type" => $out["card_type_${key}"],
                                    "style" => $out["card_style_${key}"],
                                    "description" => $out["description_${key}"],
                                    "blog_id" => $out["blog_id_${key}"],
                                    "card_icon" => $out["card_icon_${key}"],
                                    "offer_id" => $out["offer_id_${key}"],
                                    "image" => $this->fixEmptyBanner( $out["banner_${key}"]),
                                    "banner_location" => $out["banner_location_${key}"],
                                    "link_path" => $out["link_path_${key}"],
                                    "action" => $banner_action,
                                    "button_text" => $out["button_text_${key}"],
                                    "short_button_text" => $out["short_button_text_${key}"],
                                    "short_title" => $out["short_title_${key}"],
                                    "short_description" => $out["short_description_${key}"],
                                    "short_style" => $out["short_style_${key}"],
                                    "status"=> 1
                                ]
                        ];
                }
                break;

            case WRENCHBOARD_CONTRACT_MSGLIST:
                $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(
                        "message" => $out["message_${key}"],
                        "msg" => $out["msg_${key}"],
                        "msg_date" => $out["msg_date_${key}"],
                        "msg_firstname" => $out["msg_firstname_${key}"],
                        "msg_id" => $out["msg_id_${key}"],
                        "msg_type" => $out["msg_type_${key}"],
                        "file_link" => $this->taskFileLink(),
                        "who" => $out["who_${key}"],
                        "msg_uid" => $out["msg_uid_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_FAMILY_LIST:

                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "family_uid" => $out["uid_${key}"],
                        "firstname" => $out["firstname_${key}"],
                        "lastname" => $out["lastname_${key}"],
                        "username" => $out["username_${key}"],
                        "age" => $this->GetFamilyAge( $out["age_${key}"],$out["year_${key}"],$out["month_${key}"]),
                        "year" => $out["year_${key}"],
                        "month" => $out["month_${key}"],
                        "last_login" => $out["last_login_${key}"],
                        "task_count" => $out["task_count_${key}"],
                        "enable_traking"=> $out["enable_traking_${key}"],
                        "pending_task_count" => $out["task_count_${key}"],
                        "added" => $out["added_${key}"],
                        "banner" => 'family.svg',
                        "profile_picture" => 'https://www.wrenchboard.com/assets/images/apps/icons/family.svg',
                        "banner_location" => 'LOCAL',
                    );
                }

                break;
            case MOBILE_LOGIN:
                $out["prefs"]=[];
                $out["layout"]=[];
                $res = $out;
                break;
            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}"],
                        "active" => $out["active_${key}"],
                        "allocation_uid"=> $out["allocation_uid_${key}"],
                        'currency' => 'Naira',
                        'currency_code' => 'NGN'
                    );
                }

                break;

            case WRENCHBOARD_SIGNUP_COUNTRY:

                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    'result'=>'100',
                    'signup_country'=>[ ['NG', 'Nigeria'],['US', 'United States'] ],
                    "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(
                        "code" => $out["code_${key}"],
                        "country" => $out["country_${key}"],
                        "phone_code" => $out["phone_code_${key}"],
                        "uid"=> $out["uid_${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" => $this->dummyCategory(),
                    "banners_options" => $this->dummyGetBanners()
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $int_c = 'interest_count_'.$out["offer_code_${key}"];
                    log_message('critical', "interest_count_ :::   ".$int_c);
                    $cateG =  $out["category_${key}"];
                    $banner_img = ( $out["banner_${key}"] !="" ) ? $out["banner_${key}"] : 'default.jpg';
                    $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" => $this->cleanUpDescription($out["job_description_${key}"]),
                        "job_detail" => $this->cleanUpDescription($out["job_detail_${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' =>  $out["currency_${key}"],
                        'currency_code' => $out["currency_code_${key}"],
                        'interest_count' => $out[$int_c] ?? 0,
                        'category' => $this->dummyGetCategory( $cateG ),
                        'banner' => $banner_img
                    );
                }

                break;
            case WRENCHBOARD_JOB_JOBGROUPS:
                $total = $out["total_record"];
                $total_member = $out["gm_total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "total_record_member" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $group_id = $out["group_id_${key}"];
                    $res["result_list"][] = array(
                        "group_uid" => $out["group_uid_${key}"],
                        "group_name" => $out["group_name_${key}"],
                        "group_id" => $out["group_id_${key}"],
                        "member_count" => $out["group_count_id_${group_id}"] ?? 0,
                    );
                }

                for ($i = 0; $i < $total_member; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list_member"][] = array(
                        "email" => $out["gm_email_${key}"],
                        "firstname" => $out["gm_firstname_${key}"],
                        "lastname" => $out["gm_lastname_${key}"],
                        "group_id" => $out["gm_group_id_${key}"],
                        "uid" => $out["gm_uid_${key}"],
                    );
                }

                break;
                //const WRENCHBOARD_JOB_JOBFILES = 13012;
            case 13012; //WRENCHBOARD_JOB_JOBFILES:
                $total = $out["total_record"];
                $total_member = $out["gm_total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "total_record_member" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $group_id = $out["group_id_${key}"];
                    $res["result_list"][] = array(
                        "file_uid" => $out["file_uid_${key}"],
                        "file_id" => $out["id_${key}"],
                        "originalname" => $out["originalname_${key}"],
                        "size" =>$out["size_${key}"]
                    );
                }
                break;

            case WRENCHBOARD_MOBILE_ACTIVEJOB:
            case WRENCHBOARD_MOBILE_OFFERSLIST:
            case WRENCHBOARD_JOB_LISTJOBS:
            case WRENCHBOARD_JOB_OFFERS:
            case WRENCHBOARD_JOB_ACTIVE:
            case WRENCHBOARD_JOB_USERACTIVE:
            CASE WRENCHBOARD_JOB_REPORT:
            case WRENCHBOARD_JOB_RECENTPASTDUE:

        $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                    "categories" =>  $this->dummyCategory(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $int_c = 'interest_count_'.$out["offer_code_${key}"];
                    $cateG =  $out["category_${key}"];
                    $res["result_list"][] = array(
                        "title" => $out["title_${key}"],
                        "description" => $out["description_${key}"],
                        "id" => $out["id_${key}"],
                        "job_description" => $out["job_description_${key}"],
                        "job_detail" => $this->cleanUpDescription($out["job_detail_${key}"]),
                        "price" => $out["price_${key}"],
                        "timeline_days" => $out["timeline_days_${key}"],
                        "contract_id" => $out["contract_id_${key}"],
                        "contract_uid" => $out["contract_uid_${key}"],
                        "job_id" => $out["job_id_${key}"],
                        "contract" => $out["contract_${key}"],
                        "created" => $out["created_${key}"],
                        "status_description" => $out["status_description_${key}"],
                        "delivery_date" => $out["delivery_date_${key}"],
                        "owner_status" => $out["owner_status_${key}"],
                        "offer_uid" => $out["offer_uid_${key}"],
                        "family_uid" => $out["family_uid_${key}"],
                        "job_uid" => $out["job_uid_${key}"],
                        "origin_job_uid" => $out["origin_job_uid_${key}"],
                        "expire" => $out["expire_${key}"],
                        "sent" => $out["sent_${key}"],
                        "offer_code" => $out["offer_code_${key}"],
                        "job_to" => $out["job_to_${key}"],
                        "public_view" => $out["public_view_${key}"],
                        "whishlisted"=> false,
                        "thumbnil" => 'marketplace-product-1.jpg',
                        'isActive' => true,
                        'offer_added' => $out["offer_added_${key}"],
                        'job_country' => $out["job_country_${key}"],
                        'currency' =>  $out["currency_${key}"],
                        'job_type' =>  $out["job_type_${key}"],
                        'media_uid' =>  $out["media_uid_${key}"],
                        'job_mode' =>  $out["job_mode_${key}"],
                        'currency_code' => $out["currency_code_${key}"],
                        "banner" => $this->fixEmptyBanner( $out["banner_${key}"]),
                        'interest_count' => $out["${$int_c}"] ?? 0,
                        'ext_request' => $out["ext_request_${key}"],
                        'category' => $this->dummyGetCategory( $cateG ),
                        'depend_uid' => $out["depend_uid_${key}"],
                        'strict_timeline' => $out["strict_timeline_${key}"],
                        'minimum_due' => $out["minimum_due_${key}"]

                    );
                }

                break;
            case WRENCHBOARD_MOBILE_JOB_MESSAGE:
            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}"],
                        "title" => $out["title_${key}"],
                        "description" => $out["description_${key}"],
                        "job_description" => $out["job_description_${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}"],
                        "code" => $out["code_${key}"],
                        "currency" => $out["currency_${key}"],
                        "symbol" => $out["symbol_${key}"]
                    );
                }
                break;
            case WRENCHBOARD_MOBILE_PURCHASEHX:
                $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}"],
                        "confirmation" => $out["confirmation_${key}"],
                        "status" => $out["status_${key}"],
                        "added_date" => $out["added_date_${key}"],
                        "payment_id" => $out["id_${key}"],
                        "payment_uid" => $out["uid_${key}"],
                        "currency"=> $out["currency_${key}"],
                    );
                }
                break;
            case WRENCHBOARD_ACCOUNT_ACCOUNT_TYPES:
                $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(
                        "name" => $out["name_${key}"],
                        "value" => $out["value_${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_USER_RECIPEINT:

                $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}"],
                        "recipient_id" => $out["id_${key}"],
                        "recipient_uid" => $out["uid_${key}"],
                        "country" => $out["country_${key}"],
                        "added" => $out["added_${key}"],
                        "bank_name" => $out["bank_name_${key}"],
                        "bank_uid" => $out["bank_uid_${key}"],
                    );
                }

                break;
            case WRENCHBOARD_ACCOUNT_COUNTRY_BANKS:
                $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(
                        "name" => $out["name_${key}"],
                        "code" => $out["code_${key}"],
                        "country" => $out["country_${key}"],
                        "bank_uid" => $out["bank_uid_${key}"],
                    );
                }
                break;

            case WRENCHBOARD_ACCOUNT_REFFERHX:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $res["result_list"][] = array(
                        "added_date" => $out["added_date_${key}"],
                        "email" => $out["email_${key}"],
                        "firstname" => $out["firstname_${key}"],
                        "lastname" => $out["lastname_${key}"],
                        "status" => $out["status_${key}"]
                    );
                }
                break;

            case WRENCHBOARD_ACCOUNT_WALLETS:
            case WRENCHBOARD_FAMILY_WALLET:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total - 0),
                    "internal_return" => $out["internal_return"],
                    "result_list" => array(),
                );
                for ($i = 0; $i < $total; $i++) {
                    $key = sprintf("%05d", $i);
                    $escrow_key = "escrow_".$out["code_${key}"];
                    $res["result_list"][] = array(
                        "currency" => $out["currency_${key}"],
                        "amount" => $out["amount_${key}"],
                        "escrow" => 0,
                        "symbol" => $out["symbol_${key}"],
                        "description" => $out["description_${key}"],
                        "action_type" => $out["action_type_${key}"],
                        "code" => $out["code_${key}"],
                        "country" => $out["country_${key}"],
                        "transfer_limit" => $out["transfer_limit_${key}"],
                        "processor" => $out["processor_${key}"],
                        "wallet_uid" => $out["wallet_uid_${key}"],
                        "escrow" => isset($out[$escrow_key]) ? $out[$escrow_key]: 0 ,
                    );
                }
                break;
//escrow_NAIRA
            case WRENCHBOARD_FAMILY_TRANSFERHX:
                $total = $out["total_record"];
                $res = array(
                    "status" => $out["status"],
                    "total_record" => ($total - 0),
                    "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}"],
                        "icon" => "https://www.wrenchboard.com/assets/images/apps/currency/".strtolower($out["currency_${key}"]).".svg",
                        "description" => $out["description_${key}"],
                        "confirmation" => $out["confirmation_${key}"],
                        "rec_lastname" => $out["rec_lastname_${key}"],
                        "rec_firstname" => $out["rec_firstname_${key}"],
                        "added" => $out["added_${key}"],
                        "uid" => $out["uid_${key}"],
                    );
                }
                break;
            default:
                return $out;
        }

        return $res;
    }

    public function dummyGetCategory($varCat){

       return  explode("@", $varCat);

//        $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'=>'Writings & Translations',
            'CT2'=>'Marketing & Promotions',
            'CT3'=>'Errands',
            'CT4'=>'Others',
        );
    }

    public function dummyGetBanners(){
        return [
            ['default.jpg','https://www.wrenchboard.com/assets/images/apps/jobs/defualt.jpg'],
            ['clean-closet.jpg','https://www.wrenchboard.com/assets/images/apps/jobs/clean-closet.jpg'],
            ['kid-book.jpg','https://www.wrenchboard.com/assets/images/apps/jobs/kid-book.jpg'],
            ['kid-coffee.jpg','https://www.wrenchboard.com/assets/images/apps/jobs/kid-coffee.jpg'],
            ['kid-dishes.jpg','https://www.wrenchboard.com/assets/images/apps/jobs/kid-dishes.jpg'],
        ];
    }

    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 <a href=\"https://www.wrenchboard.com\">WrenchBoard </a>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<ul>\n \t<li>\tOnline marketing  - most students have Facebooks and other social environments with tons of friends or connection. Somebody on this planet needs that profile or demography and will be will to pay for it if there is a way to do so</li>\n \t<li>\nTeaching - being a student also has the benefit of living in environment where you play with commercial tools, somebody have question about those tools you are playing with that they are willing to pay for - for example, student work with expensive robots in labs and an industrial hand may have questions that you can check out in your experiment environment</li>\n \t<li>\nWriting Articles/Blogging -</li>\n \t<li>\nSurveys/Research</li>\n \t<li>Campaigns</li>\n</ul>",
                'post_title' => "Online Jobs for University Students",
            ],
            [
                'meta_value' => "https://blog.wrenchboard.com/wp-content/uploads/2022/01/time_manageent.jpg",
                'post_date' => "2017-11-23T14:05:51.000Z",
                'post_date_gmt' => "2017-11-23T14:05:51.000Z",
                'post_content' => "There are different types of online jobs and some pay more money than others do while some typing jobs may need special equipment, education, or training in order to do them. The advantage of an online job is that you can work at any time of the day around your personal schedule. You can even work in the evening or at night.\n\nYour income from an online job will also depend on the kind of job you do, your experience and your skills.\n\n<strong>Price management</strong>\n\nFirstly, you will need to establish the services you will offer your clients and a business essentially succeeds by filling a void or a niche in the market.\n\nEnsure you are familiar with the different online jobs out there as each job category pays differently. The categories of online jobs include Copywriting, SEO copywriting, Content writing, Proofreading, editing, freelance writing, social media marketing and professional blogging. You do not have to work in one field only; you can work in various fields. Research on how much each field pays; this is so you do not sell yourself short and earn less money than you should be earning.\n\nAlways do your best work for every project as the quality of your work will speak for you and you can gauge your prices better while establishing your reputation.\n\nNetworking is also essential both online and in person. You can use social media platforms like LinkedIn to network online. The more you work towards being noticed, the more clients and projects you will get.\n\n<strong>Time management </strong>\n\nWorking an online business means, you will be working from home in most cases and time management is an essential part of working online. Here are a few tips to help you manage your time better with an online job.\n<ul>\n \t<li>Remove all the extra tabs from your web browser, as they can be reminders of the fact that the internet is a vast wormhole of your attention. Open fewer tabs if you want to have a more productive workday.</li>\n \t<li>Remove papers from your desktop as a ton of paperwork on your desktop could discourage you from remaining focused. Ensure you clear your desktop after each workday.</li>\n \t<li>Avoid social media interruptions as social media can hinder your productivity if you do not practice mindfulness. You can set up a specific time to socialize before your workday begins or just before retiring after your workday.</li>\n \t<li>Block any needless distractions because at times pure silence might be all you need to do to enhance your production. Turn your radio, television, or telephone off. Avoid visiting any social media platforms, ignore email notifications, and even close your browser.</li>\n \t<li>Select the best time for you to work; you may find that you are more productive during certain hours of the day. Find out what your optimal time frame is and work during said hours so that you get more work done. Most importantly, ensure you follow your schedule strictly.</li>\n</ul>\n&nbsp;",
                'post_title' => "Time and price management when working an online job",
            ],
            [
                'meta_value' => "https://blog.wrenchboard.com/wp-content/uploads/2022/01/man_reading.jpg",
                'post_date' => "2017-11-23T14:04:49.000Z",
                'post_date_gmt' => "2017-11-23T14:04:49.000Z",
                'post_content' => "Content syndication involves methods of content republication on other websites so you can reach a wider audience. Syndication of your content is a great way to enhance your brand awareness and your reach, direct traffic to your article, and build links. The internet is vast and it is not reasonable to assume that everyone you want to reach will read your content simply because you published it on your own site. Syndicating your content gets it to a different audience who might have never known it was there in the first place. Content syndication is a good and cheap way to further your content. It is a content marketing strategy. There are 4 kinds of content syndication you should know of:\n<ol>\n \t<li><strong>Syndicating content (3rd party) on your website </strong></li>\n</ol>\nPublishers can ask different websites for permission to display their content on your website or blog. Your site should have roughly 10% syndicated content ideally. Even though it might be unoriginal, it is always good to feature useful content that your readers will find beneficial and worth reading. It is difficult to find great authors committed to writing content for you when you run a website or blog with multiple authors. Ask an influencer on whether you can feature their existing content as a reasonable resolution. Syndicated content diversifies your site content instantly by highlighting something valuable and new to your target audience.\n<ol start=\"2\">\n \t<li><strong>Syndicating your content on other blogs or websites</strong></li>\n</ol>\nPublishers can syndicate their content to be displayed on another partner website or sites. You can either create content that is not original for your partner who will just be republishing your content. Alternatively, you can agree on a split which both sides find acceptable i.e. you can give them syndicated content for one month and produce original content the next month. If the agreement calls for 1-4 posts monthly, one of them must at least be original.\n<ol start=\"3\">\n \t<li><strong>Publish your content on websites syndicating their content</strong></li>\n</ol>\nAnother way to syndicate your content is by contributing regularly to websites already syndicating their content. Think of it this way, if you are publishing your content for a specific website on a regular basis and they are content syndicators, their content would also end up on other significant partner websites.\n<ol start=\"4\">\n \t<li><strong>Self-service syndication</strong></li>\n</ol>\nPublishers are also able to syndicate their own content with Medium as a great place to start with this endeavor. Medium allows you to import your already existing content from the internet edit, format, and publishing it. It allows you to run your own publications using minimal effort. LinkedIn is another platform you can use to republish your own website content so it reaches a bigger audience.\n\nYou have tools available at your disposal that can help you get your content to a wider target audience while enhancing traffic to your website, establishing a stronger following, and developing your reputation.",
                'post_title' => "How to use syndication techniques to promote your articles online",
            ],
            [
                'meta_value' => "https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg",
                'post_date' => "2017-11-23T14:03:39.000Z",
                'post_date_gmt' => "2017-11-23T14:03:39.000Z",
                'post_content' => "<strong>Paying mind to similarity index and why ignoring it could have serious repercussions&nbsp; </strong>\n\nThe similarity index is a term you should be familiar with as an online writer. It is defined as the composite number that is highlighted after matching two texts to determine how similar the content from both pieces is. It is typically displayed as a percentage and the displayed number measures the percentage of your article that the program found the matching text for. This is regardless of proper citation in your work or lack thereof.\n\nIf the similarity index is high this could mean the writer has quoted various other works to a large extent even if it is legitimate.\n\nIt is understandable that you will want to offer quality content for search engines in terms of consideration and indexation and this can lead you to weed your indexable content down. You may also be worried that search engines will not be able to comprehend your content due to existing similar pages because of things like product variations. It will be unwise for you to rush into a decision that could damage your SEO in the process of trying to make search engines happy while destroying your organic visibility in the process.\n\nYou can make use of canonical tags to instruct crawling search engines of the representative alternatives of similar or duplicate content. You just have to place these tags within your source code head section. Canonical tags are very effective in dealing with similar or duplicate content. The easiest way to determine whether you have similar content on your website is to review the site manually while addressing sections of the site appearing to have different URLs but similar content. Take some of the URLs and use tools such as Similar Page Checker or simply review the site for any similar content using Siteliner.\n\nYou may also want to consider consolidating multiple pages into one or expanding certain pages if you have multiple pages that appear to be similar. For example, if you have a site with two distinct pages for different but related topics but the information is the same on both these pages, you may either expand each page further to encompass original content about each topic or merge both pages into one about both topics.\n\nSimilar content can present an issue if not addressed:\n\nYour website will suffer in terms of ranking and you may end up losing traffic. Both losses typically originate from 2 main issues\n\n-&nbsp;&nbsp;&nbsp; Search engines rarely show multiple options of similar content in order to give users an optimum search experience. They will, therefore, be forced to select the best version which will be shown as the best result diluting visibility of websites with similar or duplicate content.\n\n-&nbsp;&nbsp;&nbsp; Equity of links will also be diluted further because other websites will have to choose the best option from the duplicates. As opposed to all the inbound links directing to one content piece, they will link to several pieces distributing the equity of the links among these duplicates. Inbound links are considered a ranking factor so they can affect the search visibility of certain pieces of content.\n\nThe overall result is that the piece of content will not get the search visibility it deserves.\n\n&nbsp;",
                'post_title' => "Paying mind to similarity index",
            ]
        ];
//return $blogData;
    }

    public function getBlogItem(){
        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 <a href=\"https://www.wrenchboard.com\">WrenchBoard </a>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<ul>\n \t<li>\tOnline marketing  - most students have Facebooks and other social environments with tons of friends or connection. Somebody on this planet needs that profile or demography and will be will to pay for it if there is a way to do so</li>\n \t<li>\nTeaching - being a student also has the benefit of living in environment where you play with commercial tools, somebody have question about those tools you are playing with that they are willing to pay for - for example, student work with expensive robots in labs and an industrial hand may have questions that you can check out in your experiment environment</li>\n \t<li>\nWriting Articles/Blogging -</li>\n \t<li>\nSurveys/Research</li>\n \t<li>Campaigns</li>\n</ul>",
                'post_title' => "Online Jobs for University Students ITEM",
            ]
        ];
//return $blogData;
    }


}

