diff --git a/application/config/constants.php b/application/config/constants.php index 070f26d..5498782 100644 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -140,6 +140,8 @@ define('WRENCHBOARD_BKO_UPDATEUSER', 10020); define('WRENCHBOARD_BKO_RESEND_OFFER', 10025); +define('WRENCHBOARD_BKO_SEND_PUSH', 10035); + define('WRENCHBOARD_BKO_END', 10999); //************************************************************** define('WRENCHBOARD_ACCOUNT_START', 11000); diff --git a/application/controllers/Bkosmember.php b/application/controllers/Bkosmember.php index 4f0b728..9d70562 100644 --- a/application/controllers/Bkosmember.php +++ b/application/controllers/Bkosmember.php @@ -189,4 +189,35 @@ if (coupon_id > 0 ){ $this->load->view('bko/view_bko_footer', $data); } + public function onesingal() { + // $this->load->view('bko/view_bko_header', $data); + if (!isset($_SESSION['bko_selected_row']) || !is_object($_SESSION['bko_selected_row']) || strlen($_SESSION['bko_selected_row']->uid) < 9) { + die('This method needs error handling: invalid member UID!'); + } + $data = array(); + $data = $this->bkoDashData(); + $data['member_uid'] = $_SESSION['bko_selected_row']->uid; + $data['member_push_text'] = ""; + $data['message'] = ""; + if ($this->input->post()) { + $this->load->model('backend_model'); + $in = array(); + $in['member_uid'] = $this->input->post('member_uid'); + $in['push_text'] = $this->input->post('member_push_text'); + $in['action'] = WRENCHBOARD_BKO_SEND_PUSH; + $out = array(); + $res = $this->backend_model->wrenchboard_api($in, $out); + if ($res == PHP_API_OK) { + $data['message'] = "Push notification submitted successfully for delivery"; + } else { + $data['message'] = "Failed to submit push notification for delivery"; + $data['member_uid'] = $in['member_uid']; + $data['member_push_text'] = $in['push_text']; + } + } + $this->load->view('bko/view_bko_header', $data); + $this->load->view('bko/view_bko_dash_onesignal', $data); + $this->load->view('bko/view_bko_footer', $data); + } + } diff --git a/application/views/bko/common/bko_menu.php b/application/views/bko/common/bko_menu.php index f44448d..8d19e2f 100644 --- a/application/views/bko/common/bko_menu.php +++ b/application/views/bko/common/bko_menu.php @@ -41,6 +41,7 @@
  • Payments
  • Jobs Performed
  • Jobs Posted
  • +
  • Push Notification
  • - \ No newline at end of file + diff --git a/application/views/bko/view_bko_dash_onesignal.php b/application/views/bko/view_bko_dash_onesignal.php new file mode 100644 index 0000000..b2d9198 --- /dev/null +++ b/application/views/bko/view_bko_dash_onesignal.php @@ -0,0 +1,142 @@ +
    + +
    + +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    MEMBERS :
    +
    APP : 0
    +
    +
    + + +
    + +
    + + +
    +
    +
    NAIRA:
    +
    USD:
    +
    +
    + + +
    + +
    + + +
    + + +
    + + +
    + +
    + + + +
    + +
    +
    Wallet Summary
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    + + + +
    + +
    +
    Send Push Notification
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + +
    Member UID (DEBUG)
    Push Text
    +
    +
    +
    +
    + + +
    + + + + +
    + + + +
    + + + + +
    + + \ No newline at end of file