fix
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Dash extends Admin_Controller {
|
||||
|
||||
public $template = array(
|
||||
'table_open' => "<table datatable-scroll-y class='table table-striped table-hover table-bordered table-condensed'>",
|
||||
'thead_open' => '<thead class=\'bg-indigo\'>',
|
||||
'thead_close' => '</thead>',
|
||||
'heading_row_start' => '<tr>',
|
||||
'heading_row_end' => '</tr>',
|
||||
'heading_cell_start' => '<th>',
|
||||
'heading_cell_end' => '</th>',
|
||||
'tbody_open' => '<tbody>',
|
||||
'tbody_close' => '</tbody>',
|
||||
'row_start' => '<tr>',
|
||||
'row_end' => '</tr>',
|
||||
'cell_start' => '<td>',
|
||||
'cell_end' => '</td>',
|
||||
'row_alt_start' => '<tr>',
|
||||
'row_alt_end' => '</tr>',
|
||||
'cell_alt_start' => '<td>',
|
||||
'cell_alt_end' => '</td>',
|
||||
'table_close' => '</table>',
|
||||
);
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->load->helper('url');
|
||||
$data = array();
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-primary\">View</button>' AS View,name,username,email,added,last_login from practice ORDER BY id DESC LIMIT 7";
|
||||
$data['recent_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_practice'] = $this->table->generate($query);
|
||||
|
||||
$mysql="SELECT '<a href=\"/practice/viewPendingPractice/'||id||'\"><button type=\"button\" class=\"btn btn-warning\"><i class=\"fa fa-check-circle\"></i></button></a>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" id=\"bremail'||id||'\" onclick=\"resendEmail('||id||');\"><i class=\"fa fa-bars\"></i></button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 7";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$this->renderAdminPage('view_dash', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function pendingpractice(){
|
||||
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Practice";
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-warning\" onclick=\"approvePractice('||id||');\">Approve</button>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" onclick=\"resendEmail('||id||');\">Email</button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 20";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingpractice', $data);
|
||||
}
|
||||
|
||||
public function pendingusers(){
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Members";
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingusers', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function renderAdminPage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('admin/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Logout extends Start_Controller {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
/* THIS IS HE BACK office Login
|
||||
*/
|
||||
// DESTROY SESSION HERE
|
||||
$_SESSION['session_id'] = ""; //'sessionid']; // "";
|
||||
$_SESSION['username'] = ""; //'username']; // "";
|
||||
$_SESSION['backoffice_id'] = ""; //'backoffice_id'];
|
||||
$_SESSION['user_firstname'] = ""; //'firstname'];
|
||||
$_SESSION['user_lastname'] = ""; //'lastname'];
|
||||
$_SESSION['user_email'] = ""; //'email'];
|
||||
$_SESSION['user_id'] = ""; //'backoffice_id'];
|
||||
$_SESSION['current_user'] = ""; //'firstname']." " . ""; //'lastname']
|
||||
unset($_SESSION);
|
||||
redirect('/welcome');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Payment extends Admin_Controller {
|
||||
|
||||
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->load->helper('url');
|
||||
$data = array();
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-primary\">View</button>' AS View,name,username,email,added,last_login from practice ORDER BY id DESC LIMIT 7";
|
||||
$data['recent_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_practice'] = $this->table->generate($query);
|
||||
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-warning\" onclick=\"selectPendingPractice('||id||');\"><i class=\"fa fa-check-circle\"></i></button>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" onclick=\"resendEmail('||id||');\"><i class=\"fa fa-bars\"></i></button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 7";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$this->renderAdminPage('view_dash', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function invoices(){
|
||||
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Practice";
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-warning\" onclick=\"approvePractice('||id||');\">Approve</button>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" onclick=\"resendEmail('||id||');\">Email</button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 20";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingpractice', $data);
|
||||
}
|
||||
|
||||
public function pendingusers(){
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Members";
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingusers', $data);
|
||||
|
||||
}
|
||||
|
||||
public function resendEmail() {
|
||||
|
||||
$data['pending_practice_id'] = trim($this->input->get('pending_practice_id'));
|
||||
|
||||
echo "Sending ".$data['pending_practice_id'];
|
||||
|
||||
// return false;
|
||||
}
|
||||
|
||||
public function viewPendingPractice() {
|
||||
|
||||
$data = array();
|
||||
$data['pending_practice_id'] = $this->uri->segment(3);
|
||||
$data['page_title'] = "Pending Practice - ".$data['pending_practice_id'];
|
||||
|
||||
$mysql = "SELECT * FROM practice_pending WHERE id = ".$data['pending_practice_id'];
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$this->renderPracticePage('view_pending_practice', $data);
|
||||
|
||||
}
|
||||
|
||||
protected function renderPracticePage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('practice/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
protected function renderAdminPage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('admin/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Practice extends Admin_Controller {
|
||||
|
||||
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->load->helper('url');
|
||||
$data = array();
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-primary\">View</button>' AS View,name,username,email,added,last_login from practice ORDER BY id DESC LIMIT 7";
|
||||
$data['recent_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_practice'] = $this->table->generate($query);
|
||||
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-warning\" onclick=\"selectPendingPractice('||id||');\"><i class=\"fa fa-check-circle\"></i></button>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" onclick=\"resendEmail('||id||');\"><i class=\"fa fa-bars\"></i></button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 7";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
|
||||
|
||||
$this->renderAdminPage('view_dash', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function pendingpractice(){
|
||||
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Practice";
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$mysql="SELECT '<button type=\"button\" class=\"btn btn-warning\" onclick=\"approvePractice('||id||');\">Approve</button>' AS process,
|
||||
'<button type=\"button\" class=\"btn btn-danger\" onclick=\"resendEmail('||id||');\">Email</button>' AS semail,
|
||||
status,
|
||||
practice_name,username,email,added::date from practice_pending ORDER BY id DESC LIMIT 20";
|
||||
$data['pending_practice'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['pending_practice'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingpractice', $data);
|
||||
}
|
||||
|
||||
public function pendingusers(){
|
||||
$data = array();
|
||||
$data["page_title"] = "Pending Members";
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
$data['recent_members'] = "";
|
||||
$mysql = "SELECT id,username,firstname,lastname,added::date,loc,last_login,acc_link FROM members ORDER by id DESC LIMIT 15";
|
||||
$query = $this->db->query($mysql);
|
||||
//$this->table->set_heading( array('data' => 'ID', 'style' => 'width:50px'),'Email', 'Firstname', 'Lastname','Last Login','Location', array('data' => 'ACTION', 'style' => 'width:40px'), array('data' => 'Select', 'style' => 'width:40px'));
|
||||
$data['recent_members'] = $this->table->generate($query);
|
||||
$this->renderAdminPage('view_pendingusers', $data);
|
||||
|
||||
}
|
||||
|
||||
public function resendEmail() {
|
||||
|
||||
$data['pending_practice_id'] = trim($this->input->get('pending_practice_id'));
|
||||
|
||||
echo "Sending ".$data['pending_practice_id'];
|
||||
|
||||
// return false;
|
||||
}
|
||||
|
||||
public function viewPendingPractice() {
|
||||
|
||||
$data = array();
|
||||
$data['pending_practice_id'] = $this->uri->segment(3);
|
||||
$data['page_title'] = "Pending Practice - ".$data['pending_practice_id'];
|
||||
|
||||
$mysql = "SELECT * FROM practice_pending WHERE id = ".$data['pending_practice_id'];
|
||||
$query = $this->db->query($mysql);
|
||||
|
||||
$this->renderPracticePage('view_pending_practice', $data);
|
||||
|
||||
}
|
||||
|
||||
protected function renderPracticePage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('practice/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
protected function renderAdminPage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('admin/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user