626 lines
24 KiB
PHP
626 lines
24 KiB
PHP
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
function smart_htmlspecialchars($str) {
|
|
return htmlspecialchars_decode($str);
|
|
/*
|
|
if (substr($str, 0, 1) == '<')
|
|
return $str;
|
|
return htmlspecialchars($str);
|
|
*/
|
|
}
|
|
|
|
class Bkouser extends Bko_Controller {
|
|
|
|
public function index() {
|
|
$data["username"] = "";
|
|
$this->load->view('bko/view_bko_login', $data);
|
|
}
|
|
|
|
public function logout() {
|
|
$data['username'] = $data['password'] = '';
|
|
$this->load->view('bko/view_bko_login', $data);
|
|
}
|
|
|
|
public function dash() {
|
|
// $this->load->view('bko/view_bko_header', $data);
|
|
$data = array();
|
|
$data = $this->bkoDashData();
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_dash', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function wrbwhy() {
|
|
|
|
$data = array();
|
|
$data = $this->bkoDashData();
|
|
|
|
$data["why_title"] = $data["why_detail"] = $data["why_flag"] = '';
|
|
$data["why_flag"] = '0';
|
|
|
|
$this->load->model('backend_model');
|
|
$is_live = $this->backend_model->cfgReadChar("system.live");
|
|
//$data = array();
|
|
|
|
if ($_POST) {
|
|
|
|
$data['why_title'] = trim($this->input->post('why_title'));
|
|
$data['why_detail'] = htmlspecialchars($this->input->post('why_detail'));
|
|
$data['why_flag'] = $this->input->post('why_flag');
|
|
|
|
$xar = array();
|
|
$query = $this->db->query("SELECT id FROM why WHERE lower(title)=lower('" . $data['why_title'] . "') ");
|
|
if ($query->num_rows() > 0) {
|
|
echo "Duplicate!";
|
|
} else {
|
|
$xar['title'] = $data['why_title'];
|
|
$xar['msg'] = $data['why_detail'];
|
|
$xar['flags'] = $data['why_flag'];
|
|
$this->db->insert('why', $xar);
|
|
}
|
|
}
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SELECT '<b>'||title||'</b><br>'||msg AS FQ,"
|
|
. " '<div id=\"subdel_'||id||'\" ><input type=button onclick=\"return post_nav_find_action('||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"Edit\">"
|
|
. " <input type=button id=\"dacc'||id||'\" onclick=\"return deleteFaq('||id||')\" name=\"delete\" class=\"btn btn-warning btn-xs\" value=\"Del\"></div>' AS option "
|
|
. " FROM why ORDER BY id DESC";
|
|
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Dates', 'Username', 'Name', 'Status', 'Verify Link', 'Action');
|
|
$this->table->function = 'smart_htmlspecialchars';
|
|
$data['why_table'] = $this->table->generate($query);
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_why', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function uploads(){
|
|
$data = array();
|
|
$data = $this->bkoDashData();
|
|
|
|
$data["faq_title"] = $data["faq_detail"] = $data["faq_flag"] = '';
|
|
$data["faq_flag"] = '0';
|
|
|
|
$this->load->model('backend_model');
|
|
$is_live = $this->backend_model->cfgReadChar("system.live");
|
|
//$data = array();
|
|
|
|
if ($_POST) {
|
|
|
|
$data['faq_title'] = trim($this->input->post('faq_title'));
|
|
$data['faq_detail'] = htmlspecialchars($this->input->post('faq_detail'));
|
|
$data['faq_flag'] = $this->input->post('faq_flag');
|
|
|
|
$xar = array();
|
|
$query = $this->db->query("SELECT id FROM faq WHERE lower(title)=lower('" . $data['faq_title'] . "') ");
|
|
if ($query->num_rows() > 0) {
|
|
echo "Duplicate!";
|
|
} else {
|
|
$xar['title'] = $data['faq_title'];
|
|
$xar['msg'] = $data['faq_detail'];
|
|
$xar['flags'] = $data['faq_flag'];
|
|
$this->db->insert('faq', $xar);
|
|
}
|
|
}
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SELECT '<b>'||title||'</b><br>'||msg AS FQ,"
|
|
. " '<div id=\"subdel_'||id||'\" ><input type=button onclick=\"return post_nav_find_action('||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"Edit\">"
|
|
. " <input type=button id=\"dacc'||id||'\" onclick=\"return deleteFaq('||id||')\" name=\"delete\" class=\"btn btn-warning btn-xs\" value=\"Del\"></div>' AS option "
|
|
. " FROM faq ORDER BY id DESC";
|
|
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Dates', 'Username', 'Name', 'Status', 'Verify Link', 'Action');
|
|
$this->table->function = 'smart_htmlspecialchars';
|
|
$data['faq_table'] = $this->table->generate($query);
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_uploads', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
|
|
}
|
|
|
|
|
|
public function faq() {
|
|
$data = array();
|
|
$data = $this->bkoDashData();
|
|
|
|
$data["faq_title"] = $data["faq_detail"] = $data["faq_flag"] = '';
|
|
$data["faq_flag"] = '0';
|
|
|
|
$this->load->model('backend_model');
|
|
$is_live = $this->backend_model->cfgReadChar("system.live");
|
|
//$data = array();
|
|
|
|
if ($_POST) {
|
|
|
|
$data['faq_title'] = trim($this->input->post('faq_title'));
|
|
$data['faq_detail'] = htmlspecialchars($this->input->post('faq_detail'));
|
|
$data['faq_flag'] = $this->input->post('faq_flag');
|
|
|
|
$xar = array();
|
|
$query = $this->db->query("SELECT id FROM faq WHERE lower(title)=lower('" . $data['faq_title'] . "') ");
|
|
if ($query->num_rows() > 0) {
|
|
echo "Duplicate!";
|
|
} else {
|
|
$xar['title'] = $data['faq_title'];
|
|
$xar['msg'] = $data['faq_detail'];
|
|
$xar['flags'] = $data['faq_flag'];
|
|
$this->db->insert('faq', $xar);
|
|
}
|
|
}
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SELECT '<b>'||title||'</b><br>'||msg AS FQ,"
|
|
. " '<div id=\"subdel_'||id||'\" ><input type=button onclick=\"return post_nav_find_action('||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"Edit\">"
|
|
. " <input type=button id=\"dacc'||id||'\" onclick=\"return deleteFaq('||id||')\" name=\"delete\" class=\"btn btn-warning btn-xs\" value=\"Del\"></div>' AS option "
|
|
. " FROM faq ORDER BY id DESC";
|
|
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Dates', 'Username', 'Name', 'Status', 'Verify Link', 'Action');
|
|
$this->table->function = 'smart_htmlspecialchars';
|
|
$data['faq_table'] = $this->table->generate($query);
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_faq', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function deletefaq() {
|
|
$faq_id = $this->input->get('faq_id');
|
|
$mysql = "DELETE FROM faq WHERE id = " . $faq_id;
|
|
$this->db->query($mysql);
|
|
echo 'Deleted - ' . $faq_id;
|
|
}
|
|
|
|
public function deletewhy() {
|
|
$why_id = $this->input->get('why_id');
|
|
$mysql = "DELETE FROM why WHERE id = " . $why_id;
|
|
$this->db->query($mysql);
|
|
echo 'Deleted - ' . $why_id;
|
|
}
|
|
|
|
public function seluser() {
|
|
//url: "/bkouser/seluser?proc=SEL&member_id="+link_id
|
|
$member_id = $this->input->get('member_id');
|
|
|
|
$mysql = "SElECT * "
|
|
. " FROM members WHERE id = " . $member_id;
|
|
$query = $this->db->query($mysql);
|
|
|
|
$row = $query->row();
|
|
|
|
if (isset($row)) {
|
|
$_SESSION['bko_selected_id'] = $row->id;
|
|
$_SESSION['bko_selected_username'] = $row->username;
|
|
$_SESSION['bko_selected_row'] = $row;
|
|
$_SESSION['bko_selected_memberd_id'] = $member_id;
|
|
}
|
|
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
|
|
$mysql = "SELECT firstname,lastname,balance,email FROM members WHERE id=" . $_SESSION['bko_selected_id'];
|
|
$query = $this->db->query($mysql);
|
|
$data['user_table'] = $this->table->generate($query);
|
|
|
|
|
|
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
|
|
. "r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS Recitient,mp.confirmation,"
|
|
. "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status "
|
|
. "FROM money_transfer m "
|
|
. "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
|
|
. "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
|
|
. "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
|
|
. "WHERE m.member_id =" . $_SESSION['bko_selected_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 20";
|
|
|
|
$query = $this->db->query($mysql);
|
|
$this->table->set_heading('Date', 'Amount', 'Fee', 'Recipient', 'Confirmation', 'Status');
|
|
$data['sendmoney_table'] = $this->table->generate($query);
|
|
|
|
$mysql = "SELECT added::date,(CASE WHEN code = 'OFDPS' THEN 'Job Offer Deposit' "
|
|
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
|
|
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
|
|
. "WHEN code ='COPAY' THEN 'Completed Task Payment' ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
|
|
. "FROM members_payments "
|
|
. "WHERE member_id = " . $_SESSION['bko_selected_id'] . " AND status = 1 ORDER BY id DESC ";
|
|
|
|
$query = $this->db->query($mysql);
|
|
|
|
$this->table->set_heading(array('data' => 'Date', 'style' => 'width:100px'), 'Description', array('data' => 'Amount', 'style' => 'width:100px'), array('data' => 'Fee', 'style' => 'width:70px'), array('data' => 'Confirmation', 'style' => 'width:100px'));
|
|
$data['payment_result'] = $this->table->generate($query);
|
|
|
|
|
|
echo "<b>User:</b><br>" . $data['user_table'] . "<br><b> Withdraw Last 20:</b> <br>" . $data['sendmoney_table'] . "<br><b>Payments:</b><br>" . $data['payment_result'];
|
|
}
|
|
|
|
public function terms() {
|
|
|
|
$data = array();
|
|
$data['page_name'] = 'terms';
|
|
$data['page_title'] = 'Terms & Condition';
|
|
$data['page_key'] = 'WRB_MAIN_SIGNUP_TERM';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function about() {
|
|
|
|
$data = array();
|
|
$data['page_name'] = 'about';
|
|
$data['page_title'] = 'About us';
|
|
$data['page_key'] = 'WRB_MAIN_ABOUT_US';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function privacy() {
|
|
|
|
$data = array();
|
|
$data['page_name'] = 'privacy';
|
|
$data['page_title'] = 'Privacy Policy';
|
|
$data['page_key'] = 'WRB_MAIN_PRIVACY';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function libraryedit() {
|
|
|
|
$lib_id = $this->input->get('lib_id');
|
|
if ($this->input->get('PROC') == 'EDIT' && $lib_id != '' && $lib_id > 0) {
|
|
|
|
echo 'Ameye';
|
|
}
|
|
}
|
|
|
|
public function library() {
|
|
|
|
$data = array();
|
|
$data = $this->bkoDashData();
|
|
$new_mode = true;
|
|
|
|
$data['lib_id'] = 0;
|
|
$data["lib_title"] = $data["lib_detail"] = $data["lib_flag"] = '';
|
|
$data["lib_flag"] = '0';
|
|
|
|
|
|
$lib_id = $this->input->get('lib_id');
|
|
if ($this->input->get('PROC') == 'EDIT' && $lib_id != '' && $lib_id > 0) {
|
|
|
|
$rs = $this->libraryContent($lib_id);
|
|
$data["lib_title"] = $rs['title'];
|
|
$data["lib_detail"] = $rs['detail'];
|
|
$data["lib_flag"] = 0;
|
|
$new_mode = false;
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($_POST) {
|
|
$lib_id = $this->input->post('lib_id');
|
|
|
|
$data['lib_title'] = trim($this->input->post('lib_title'));
|
|
$data['lib_detail'] = htmlspecialchars($this->input->post('lib_detail'));
|
|
$data['lib_flag'] = $this->input->post('lib_flag');
|
|
if ($lib_id == 0) {
|
|
$xar = array();
|
|
$query = $this->db->query("SELECT id FROM library WHERE lower(title)=lower('" . $data['lib_title'] . "') ");
|
|
if ($query->num_rows() > 0) {
|
|
echo "Duplicate!";
|
|
} else {
|
|
$xar['title'] = $data['lib_title'];
|
|
$xar['description'] = $data['lib_title']; // for now
|
|
$xar['detail'] = $data['lib_detail'];
|
|
// $xar['flags'] = $data['lib_flag'];
|
|
$this->db->insert('library', $xar);
|
|
}
|
|
} else {
|
|
// updating now
|
|
$xr = array(
|
|
'detail' => $data['lib_detail']
|
|
);
|
|
$this->db->where('id', $lib_id);
|
|
$this->db->update('library', $xr);
|
|
}
|
|
}
|
|
|
|
$data['lib_id'] = $lib_id;
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SELECT '<b>'||title||'</b><br>'||description||'<br>'||detail AS Library,"
|
|
. " '<a href=\"/bkouser/library?lib_id='||id||'&PROC=EDIT\">Edit</a><div id=\"subdel_'||id||'\" ><input type=button onclick=\"return post_nav_find_action('||id||')\" name=\"manage\" class=\"btn btn-info btn-xs\" value=\"Edit\">"
|
|
. " <input type=button id=\"dacc'||id||'\" onclick=\"return deleteFaq('||id||')\" name=\"delete\" class=\"btn btn-warning btn-xs\" value=\"Del\"></div>' AS option "
|
|
. " FROM library ORDER BY id DESC";
|
|
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Dates', 'Username', 'Name', 'Status', 'Verify Link', 'Action');
|
|
$this->table->function = 'smart_htmlspecialchars';
|
|
$data['lib_table'] = $this->table->generate($query);
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_library', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function deletelibrary() {
|
|
$lib_id = $this->input->get('lib_id');
|
|
$mysql = "DELETE FROM library WHERE id = " . $lib_id;
|
|
$this->db->query($mysql);
|
|
echo 'Deleted - ' . $lib_id;
|
|
}
|
|
|
|
/*
|
|
|
|
* CREATE TABLE library (
|
|
id SERIAL,
|
|
title VARCHAR(150) UNIQUE NOT NULL,
|
|
description VARCHAR(500) NOT NULL,
|
|
detail TEXT,
|
|
updated timestamp without time zone DEFAULT now()
|
|
);
|
|
ALTER TABLE ONLY library
|
|
ADD CONSTRAINT library_id_key UNIQUE (id);
|
|
|
|
*/
|
|
|
|
public function referterms() {
|
|
|
|
$data = array();
|
|
$data['page_name'] = 'referterms';
|
|
$data['page_title'] = 'Referer Terms';
|
|
$data['page_key'] = 'WRB_MAIN_REFER_TERM';
|
|
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function postjob() {
|
|
$data = array();
|
|
$data['page_name'] = 'postjob';
|
|
$data['page_title'] = 'Post Job Terms';
|
|
$data['page_key'] = 'WRB_POST_JOB_TERM';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function howitwork() {
|
|
$data = array();
|
|
$data['page_name'] = 'howitwork';
|
|
$data['page_title'] = 'How it works';
|
|
$data['page_key'] = 'WRB_MAIN_HOWIT_WORK';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function fundaccount() {
|
|
$data = array();
|
|
$data['page_name'] = 'fundaccount';
|
|
$data['page_title'] = 'Fund Account';
|
|
$data['page_key'] = 'WRB_FUND_ACCOUNT';
|
|
|
|
if ($this->input->post()) {
|
|
$this->savepagetext();
|
|
}
|
|
$data['txt_detail'] = $this->readFixedText($data['page_key']);
|
|
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_fixededitor', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function savepagetext() {
|
|
|
|
$textline = $this->sql_escape_func($this->input->post('txt_detail'));
|
|
$page_key = trim($this->input->post('page_key'));
|
|
$finalsql = "";
|
|
if ($page_key != '') {
|
|
$mysql = "SELECT id FROM general_text WHERE page_key='$page_key'";
|
|
$query = $this->db->query($mysql);
|
|
if ($query->num_rows() == 0) {
|
|
$finalsql = "INSERT INTO general_text (page_key,txt_detail) VALUES('$page_key',E'$textline')";
|
|
} else {
|
|
$row = $query->row();
|
|
$finalsql = "UPDATE general_text SET txt_detail=E'$textline' WHERE page_key='$page_key' AND id=" . $row->id;
|
|
}
|
|
}
|
|
|
|
if ($finalsql != '') {
|
|
$this->db->query($finalsql);
|
|
// echo 'Saved';
|
|
}
|
|
}
|
|
|
|
public function PrepPagination($perpage, $urlSegment, $pagePath) {
|
|
|
|
$config = array();
|
|
$config["base_url"] = base_url() . $pagePath;
|
|
$config["per_page"] = $perpage;
|
|
$config["uri_segment"] = $urlSegment;
|
|
$config["num_links"] = 5;
|
|
$config['full_tag_open'] = "<ul class='pagination'>";
|
|
$config['full_tag_close'] = "</ul>";
|
|
$config['num_tag_open'] = '<li>';
|
|
$config['num_tag_close'] = '</li>';
|
|
$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
|
|
$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
|
|
$config['next_tag_open'] = "<li>";
|
|
$config['next_tagl_close'] = "</li>";
|
|
$config['prev_tag_open'] = "<li>";
|
|
$config['prev_tagl_close'] = "</li>";
|
|
$config['first_tag_open'] = "<li>";
|
|
$config['first_tagl_close'] = "</li>";
|
|
$config['last_tag_open'] = "<li>";
|
|
$config['last_tagl_close'] = "</li>";
|
|
|
|
return $config;
|
|
}
|
|
|
|
public function locate() {
|
|
// $this->load->view('bko/view_bko_header', $data);
|
|
$data = array();
|
|
$data['page_title'] = 'Find User';
|
|
// $config = array();
|
|
|
|
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
|
|
$page = is_numeric($page) ? $page : 0;
|
|
|
|
|
|
|
|
$config = $this->PrepPagination(10, 3, '/bkouser/locate');
|
|
|
|
$mysql0 = "SELECT * FROM members";
|
|
$q = $this->db->query($mysql0);
|
|
$config["total_rows"] = $q->num_rows();
|
|
|
|
$this->load->library('pagination');
|
|
$this->pagination->initialize($config);
|
|
$data["pagination_links"] = $this->pagination->create_links();
|
|
|
|
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SElECT added::date||'<br>'||loc||'<br>'||(CASE WHEN last_login::date IS NULL THEN ' ' ELSE last_login::date::text END) AS Act,"
|
|
. " username||'<br>'||firstname||' '||lastname AS Name, "
|
|
. " '<div id=\"sdd'||id||'\"><button id=\"sel'||id||'\" class=\"btn btn-warning btn-xs\" onclick=\"return selectMember('''||id||''');\" >Select['||id||']</button></div>' AS select "
|
|
. " FROM members ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page; ;
|
|
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Account', 'Created', 'Action');
|
|
$data['member_search_table'] = $this->table->generate($query);
|
|
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_findmembers', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function memberdetail() {
|
|
// $this->load->view('bko/view_bko_header', $data);
|
|
$data = array();
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_dash', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function contact() {
|
|
// $this->load->view('bko/view_bko_header', $data);
|
|
$data = array();
|
|
$data['page_title'] = 'Site Contacts';
|
|
|
|
$this->load->library('table');
|
|
$this->table->set_template($this->template);
|
|
$mysql = "SElECT added::date||'<br>'||loc||'<br>'||(CASE WHEN last_login::date IS NULL THEN ' ' ELSE last_login::date::text END) AS Act,"
|
|
. " username||'<br>'||firstname||' '||lastname AS Name, "
|
|
. " '<div id=\"sdd'||id||'\"><button id=\"sel'||id||'\" class=\"btn btn-warning btn-xs\" onclick=\"return selectMember('''||id||''');\" >Select['||id||']</button></div>' AS select "
|
|
. " FROM members ORDER BY id DESC LIMIT 100";
|
|
$mysql = " SELECT created||'<br>'||email||'<br>'||member_id||'<div id=\"sdd'||id||'\"><button id=\"sel'||id||'\" class=\"btn btn-warning btn-xs\" onclick=\"return selectMessage('''||id||''');\" >Select['||id||']</button></div>' AS sender,your_message FROM contacts ORDER BY id desc";
|
|
$query = $this->db->query($mysql);
|
|
// $this->table->set_heading('Account', 'Created', 'Action');
|
|
|
|
$data['member_search_table'] = $this->table->generate($query);
|
|
|
|
$this->load->view('bko/view_bko_header', $data);
|
|
$this->load->view('bko/view_bko_contact', $data);
|
|
$this->load->view('bko/view_bko_footer', $data);
|
|
}
|
|
|
|
public function replymessage() {
|
|
//url: "/bkouser/seluser?proc=SEL&member_id="+link_id
|
|
$contact_id = $this->input->get('contact_id');
|
|
|
|
$mysql = "SElECT * "
|
|
. " FROM contacts WHERE id = " . $contact_id;
|
|
$query = $this->db->query($mysql);
|
|
|
|
$row = $query->row();
|
|
|
|
if (isset($row)) {
|
|
// echo $row->id;
|
|
// echo $row->firstname;
|
|
// echo $row->lastname;
|
|
//$_SESSION['bko_selected_id'] = $row->id;
|
|
//$_SESSION['bko_selected_username'] = $row->username;
|
|
//$_SESSION['bko_selected_row'] = $row;
|
|
//$_SESSION['bko_selected_memberd_id'] = $member_id;
|
|
}
|
|
|
|
echo 'aaaa ' . $contact_id;
|
|
}
|
|
|
|
public function resend_pending() {
|
|
$this->load->model('backend_model');
|
|
$link_id = $this->input->get('link_id');
|
|
$in = array();
|
|
$in['pending_id'] = $link_id;
|
|
$in['action'] = WRENCHBOARD_RESEND_PENDING_LINK;
|
|
$out = array();
|
|
$res = $this->backend_model->wrenchboard_api($in, $out);
|
|
|
|
echo 'Sent';
|
|
}
|
|
|
|
public function delete_pending() {
|
|
$this->load->model('backend_model');
|
|
$link_id = $this->input->get('link_id');
|
|
$in = array();
|
|
$in['pending_id'] = $link_id;
|
|
$in['action'] = WRENCHBOARD_DELETE_PENDING_LINK;
|
|
$out = array();
|
|
$res = $this->backend_model->wrenchboard_api($in, $out);
|
|
echo 'Deleted';
|
|
}
|
|
|
|
}
|