diff --git a/providerwww/application/config/config.php b/providerwww/application/config/config.php
index e999e7f..370e00c 100644
--- a/providerwww/application/config/config.php
+++ b/providerwww/application/config/config.php
@@ -126,7 +126,7 @@ $config['enable_hooks'] = FALSE;
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
-$config['subclass_prefix'] = 'MY_';
+$config['subclass_prefix'] = 'MER_';
/*
|--------------------------------------------------------------------------
diff --git a/providerwww/application/controllers/Login.php b/providerwww/application/controllers/Login.php
index 06dbe76..2978625 100644
--- a/providerwww/application/controllers/Login.php
+++ b/providerwww/application/controllers/Login.php
@@ -1,20 +1,24 @@
input->get());
+ $data = array();
if ($_POST) {
$data['username'] = trim($this->input->post('username'));
$data['pass'] = htmlspecialchars($this->input->post('pass'));
- $this->load->view('provider/dash');
+ //$this->load->view('provider/dash');
+ $this->renderProviderSecurePage('dash',$data);
} else {
- $this->load->view('welcome_message');
+ //$this->load->view('welcome_message');
// $this->load->view('provider/dash');
+ $this->renderExternalPage('welcome_message', $data);
}
//$this->load->view('provider/dash');
@@ -22,11 +26,13 @@ class Login extends CI_Controller {
}
public function logout() {
+ $data = array();
$this->destroySession();
- $this->load->view('welcome_message');
+ $this->renderExternalPage('welcome_message', $data);
}
- private function destroySession(){
+ private function destroySession() {
}
+
}
diff --git a/providerwww/application/controllers/Register.php b/providerwww/application/controllers/Register.php
index 953755e..fddc1e9 100644
--- a/providerwww/application/controllers/Register.php
+++ b/providerwww/application/controllers/Register.php
@@ -1,11 +1,12 @@
renderExternalPage('register', $data);
+ }
- public function index()
- {
- $this->load->view('register');
- }
}
diff --git a/providerwww/application/controllers/Welcome.php b/providerwww/application/controllers/Welcome.php
index 9213c0c..2202649 100644
--- a/providerwww/application/controllers/Welcome.php
+++ b/providerwww/application/controllers/Welcome.php
@@ -1,7 +1,7 @@
"
",
+ 'thead_open' => '',
+ 'thead_close' => '',
+ 'heading_row_start' => '',
+ 'heading_row_end' => '
',
+ 'heading_cell_start' => '',
+ 'heading_cell_end' => ' | ',
+ 'tbody_open' => '',
+ 'tbody_close' => '',
+ 'row_start' => '',
+ 'row_end' => '
',
+ 'cell_start' => '',
+ 'cell_end' => ' | ',
+ 'row_alt_start' => '',
+ 'row_alt_end' => '
',
+ 'cell_alt_start' => '',
+ 'cell_alt_end' => ' | ',
+ 'table_close' => '
'
+ );
+ var $template_nohead = array(
+ 'table_open' => "",
+ 'thead_open' => '',
+ 'thead_close' => '',
+ 'heading_row_start' => '',
+ 'heading_row_end' => '
',
+ 'heading_cell_start' => '',
+ 'heading_cell_end' => ' | ',
+ 'tbody_open' => '',
+ 'tbody_close' => '',
+ 'row_start' => '',
+ 'row_end' => '
',
+ 'cell_start' => '',
+ 'cell_end' => ' | ',
+ 'row_alt_start' => '',
+ 'row_alt_end' => '
',
+ 'cell_alt_start' => '',
+ 'cell_alt_end' => ' | ',
+ 'table_close' => '
'
+ );
+ public $data = array();
+
+ function __construct() {
+ parent::__construct();
+
+ // $this->load->library(array('session', 'lib_login'));
+ }
+
+ public function wrenchboard_api($in, $out) {
+ $this->load->model('backend_model');
+ // $out = array();
+ return $this->backend_model->wrenchboard_api($in, $out);
+ }
+
+ protected function smart_htmlspecialchars($str) {
+ if (substr($str, 0, 1) == '<')
+ return $str;
+ return htmlspecialchars($str);
+ }
+
+ protected function getSessionArray() {
+ $data['username'] = $_SESSION['username']; // = $this->input->post('username');
+ $data['name'] = $_SESSION['name']; // = $this->input->post('username');
+ $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname;
+ $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname;
+ $data['email'] = $_SESSION['email']; // = $ret->email;
+ $data['member_id'] = $_SESSION['member_id'];
+
+ $this->load->model('dash_model');
+ $out = $this->dash_model->getDashData($data);
+ $data['active_task'] = $out['active_task'];
+ $data['active_pass_due'] = $out['active_pass_due'];
+ $data['current_balance'] = $out['current_balance'];
+ $data['new_message'] = $out['new_message'];
+ $_SESSION["active_offers_count"] = $out['active_offers_count'];
+
+ $data = $_SESSION['secure_data'];
+ $data['member_id'] = $_SESSION['member_id']; // = $ret->email;
+
+ $this->refreshAccountDetail($_SESSION['member_id']);
+ return $data;
+ }
+
+ protected function logUser($mlog) {
+ //
+ $data['action'] = WRENCHBOARD_LOG_MEMBER;
+ $data['mlog'] = $mlog;
+ $data['member_id'] = $_SESSION['member_id'];
+ $this->load->model('backend_model');
+ $out = array();
+ $res = $this->backend_model->wrenchboard_api($data, $out);
+
+ $this->load->model('userlog_model');
+ $xy["member_id"] = $_SESSION['member_id'];
+ $_SESSION['member_log'] = $this->userlog_model->loadUserLog($xy);
+ // print_r($out);
+ }
+
+ protected function myMessagesSnapshot() {
+
+ $str = "
+
+
+
+ ";
+
+
+ return $str;
+ /*
+
+
+
+
+
+
+
+
+
+
+
+ *
+ */
+ }
+
+ protected function sql_escape_func($inp) {
+ if (is_array($inp)) {
+ return array_map(__METHOD__, $inp);
+ }
+
+
+ if (!empty($inp) && is_string($inp)) {
+ return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp);
+ }
+
+ return $inp;
+ }
+
+ protected function findOffers($email) {
+ $this->load->model('offers_model');
+ $this->offers_model->attachOffers($email);
+ }
+
+ protected function home1($pagename = '') {
+ $data['sitename'] = 'home';
+ $res = $this->getExtJobList();
+
+ $data['market_data'] = $res;
+
+ $data['why_list'] = $this->getExtWhyList();
+
+
+ //$this->load->view('templates/header_boxed', $data);
+ //
+ $this->load->view('home/view_index1', $data);
+
+
+ //$this->load->view('users/view_external_footer');
+ }
+
+ protected function home2($pagename = '') {
+ $data['sitename'] = 'home';
+ $res = $this->getExtJobList();
+
+ $data['market_data'] = $res;
+
+ $data['why_list'] = $this->getExtWhyList();
+
+ $this->load->view('home2/header', $data);
+ if ($pagename == '') {
+ $this->load->view('home2/view_index2', $data);
+ } else {
+ $this->load->view($pagename, $data);
+ }
+ $this->load->view('home2/footer', $data);
+ }
+
+ protected function readFixedText($text_key) {
+
+ $page_key = trim($text_key);
+ $finaltxt = "";
+ if ($page_key != '') {
+ $mysql = "SELECT * FROM general_text WHERE page_key='$page_key'";
+ $query = $this->db->query($mysql);
+ if ($query->num_rows() == 0) {
+ $finaltxt = "";
+ } else {
+ $row = $query->row();
+ $finaltxt = $row->txt_detail;
+ }
+ }
+
+ return $finaltxt;
+ }
+
+ protected function libraryContent($content_id) {
+ $out = array();
+
+ $query = $this->db->query("SELECT * FROM library WHERE id = " . $content_id);
+ if ($query->num_rows() > 0) {
+ $row = $query->row();
+
+ $out['title'] = $row->title;
+ $out['description'] = $row->description;
+ $out['detail'] = $row->detail;
+ }
+ return $out;
+ }
+
+ protected function getExtJobList() {
+
+ $mysql = "SELECT j.title,j.description,m.job_id,m.expire "
+ . "FROM members_jobs_offer m "
+ . "LEFT JOIN members_jobs j ON j.id=m.job_id "
+ . "WHERE m.status = 1 AND m.client_id=0 "
+ . "AND m.expire IS NOT NULL "
+ . "AND m.public_view = 1 "
+ . "ORDER BY m.expire DESC LIMIT 6";
+ $query = $this->db->query($mysql);
+ return $query->result();
+ }
+
+ protected function getExtWhyList() {
+
+ $mysql = "SELECT * FROM why ORDER BY flags DESC";
+ $query = $this->db->query($mysql);
+ return $query->result();
+ }
+
+ protected function getClientJobStats($client_id) {
+ $out = array();
+ $out['total_jobs_completed'] = $out['total_jobs_active'] = $data['total_jobs_uncompleted'] = 0;
+ $out['total_pending_offers'] = 0;
+
+ $mysql = " SELECT count(*) AS total_jobs_completed FROM members_jobs_contract WHERE client_id =$client_id AND status = 5";
+ $q = $this->db->query($mysql);
+ if ($q->num_rows() > 0) {
+ $out['total_jobs_completed'] = $q->row()->total_jobs_completed;
+ }
+
+
+ $mysql = " SELECT count(*) AS total_jobs_active FROM members_jobs_contract WHERE client_id =$client_id AND status IN (1,2)";
+ $q = $this->db->query($mysql);
+ if ($q->num_rows() > 0) {
+ $out['total_jobs_active'] = $q->row()->total_jobs_active;
+ }
+
+
+ $mysql = " SELECT count(*) AS total_jobs_uncompleted FROM members_jobs_contract WHERE client_id =$client_id AND status NOT IN (1,2,5)";
+ $q = $this->db->query($mysql);
+ if ($q->num_rows() > 0) {
+ $out['total_jobs_uncompleted'] = $q->row()->total_jobs_uncompleted;
+ }
+
+ $mysql = " SELECT count(*) AS total_pending_offers FROM members_jobs_offer WHERE client_id =$client_id AND status=1";
+ $q = $this->db->query($mysql);
+ if ($q->num_rows() > 0) {
+ $out['total_pending_offers'] = $q->row()->total_pending_offers;
+ }
+
+
+
+
+ return $out; //['escrow_c_offer'] + $out['escrow_balance'];
+ }
+
+protected function renderProviderSecurePage($page_name, $data) {
+ $this->load->view('template/provider_header', $data);
+ $this->load->view('provider/' . $page_name, $data);
+ $this->load->view('template/provider_footer', $data);
+ }
+
+ /*
+ * wrenchboard=> \d library
+ Table "public.library"
+ Column | Type | Modifiers
+ -------------+-----------------------------+------------------------------------------------------
+ id | integer | not null default nextval('library_id_seq'::regclass)
+ title | character varying(150) | not null
+ description | character varying(500) | not null
+ detail | text |
+ updated | timestamp without time zone | default now()
+ Indexes:
+ "library_id_key" UNIQUE CONSTRAINT, btree (id)
+ "library_title_key" UNIQUE CONSTRAINT, btree (title)
+
+ */
+}
diff --git a/providerwww/application/libraries/Provider_Controller.php b/providerwww/application/libraries/Provider_Controller.php
new file mode 100644
index 0000000..0d6394d
--- /dev/null
+++ b/providerwww/application/libraries/Provider_Controller.php
@@ -0,0 +1,35 @@
+load->view('users/view_header_user', $data);
+ $this->load->view($page_name, $data);
+ $this->load->view('users/view_footer_user', $data);
+ }
+
+}
diff --git a/providerwww/application/libraries/Web_Controller.php b/providerwww/application/libraries/Web_Controller.php
new file mode 100644
index 0000000..5edb23f
--- /dev/null
+++ b/providerwww/application/libraries/Web_Controller.php
@@ -0,0 +1,19 @@
+load->view('template/header', $data);
+ $this->load->view('' . $page_name, $data);
+ $this->load->view('template/footer', $data);
+ }
+
+
+}
diff --git a/providerwww/application/views/register.php b/providerwww/application/views/register.php
index 19999a6..b1e5aa9 100644
--- a/providerwww/application/views/register.php
+++ b/providerwww/application/views/register.php
@@ -1,126 +1,96 @@
-
-
-
-
- MERMS-[All Health Center Agege]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
Merms Providers
-
Welcome, Please create your account.
-
+
+
+
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/providerwww/application/views/template/header.php b/providerwww/application/views/template/header.php
index 6e6969a..d040157 100644
--- a/providerwww/application/views/template/header.php
+++ b/providerwww/application/views/template/header.php
@@ -9,13 +9,13 @@
-
+
-
+
-
+
diff --git a/providerwww/application/views/welcome_message.php b/providerwww/application/views/welcome_message.php
index 3df9c85..08ab05d 100644
--- a/providerwww/application/views/welcome_message.php
+++ b/providerwww/application/views/welcome_message.php
@@ -1,25 +1,4 @@
-
-
-
-
-
MERMS-[Welcome]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -83,7 +62,7 @@
-
@@ -95,19 +74,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file