diff --git a/app/Controllers/ProjectPages.php b/app/Controllers/ProjectPages.php index b166f54..aa02ce7 100644 --- a/app/Controllers/ProjectPages.php +++ b/app/Controllers/ProjectPages.php @@ -25,6 +25,9 @@ class ProjectPages extends ProjectBaseController { //echo $page_key; $data=[]; + $projData = new \App\Models\projectData(); + $res1 = $projData->projectList(); + $data['page_data'] = $res1[$page_key]; return view('projects/projdetail',$data); } diff --git a/app/Models/baseModel.php b/app/Models/baseModel.php new file mode 100644 index 0000000..f1fdd3d --- /dev/null +++ b/app/Models/baseModel.php @@ -0,0 +1,146 @@ +db = \Config\Database::connect($this->con_name); + log_message('critical', "BaseModel-Entered" ); + } + +// public function insert_db($inserDataArray, $insertTable) +// { +// log_message('critical', "insert_db-WAS CALLED user 000=>" ); +// $insert_id=0; +// $ic = 0; +// $fl_part = ''; +// $val_part = ''; +// $sqlQ = ''; +// // try { +// +// $fields = array_keys($inserDataArray); +// log_message('critical', "insert_db-WAS CALLED user 009a=>" ); +// foreach ($fields as $field) { +// $fl_part .= $ic > 0 ? ',' : ''; +// $fl_part .= $field; +// +// $val_part .= $ic > 0 ? ',' : ''; +// $val_part .= "'" . $inserDataArray[$field] . "'"; +// $ic++; +// } +// log_message('critical', "insert_db-WAS CALLED user 009b=>" ); +// $sqlQ = "INSERT INTO $insertTable ($fl_part) VALUES ($val_part)"; +// log_message('critical', "SQL-WAS CALLED user =>". $sqlQ ); +// $query = $this->db->query($sqlQ); +// if(!$query){ +// $insert_id=-1; +// } +// //$db->affectedRows(); +// // $insert_id = $this->db->insert_id(); +// // $insert_id = $this->db->getInsertID(); +// // $this->db->insert($insertTable,$inserDataArray); +// // $insert_id = $this->db->insert_id(); +// // } catch (Exception $e) { +// //echo 'Caught exception: ', $e->getMessage(), "\n"; +// // log_message('critical', "Caught exception: => ".$e->getMessage() ); +// // } +// +// +// return $insert_id; +// } +// public function update_db($UupdateDataArray,$whereAray, $updateTable) +// { +// $ic = 0; +// $UP_part = ''; +// $val_part = ''; +// $sqlQ = ''; +// $fields = array_keys($UupdateDataArray); +// foreach ($fields as $field) { +// $UP_part .= $ic > 0 ? ',' : ''; +// $UP_part .= $field."='" . $UupdateDataArray[$field] . "'"; +// $ic++; +// } +// +// $ic = 0; +// $fields = array_keys($whereAray); +// foreach ($fields as $field) { +// $val_part .= $ic > 0 ? ' AND ' : ' WHERE '; +// $val_part .= $field."='" . $whereAray[$field] . "'"; +// $ic++; +// } +// +// $sqlQ = "UPDATE $updateTable SET $UP_part $val_part"; +// $query = $this->db->query($sqlQ); +// return 0; +// } +// +// public function select_db($selectItems,$whereAray, $updateTable) +// { +// $ic = 0; +// $UP_part = ''; +// $val_part = ''; +// $sqlQ = ''; +// $status = 0; +// $error_msg = ''; +// $record_count = -1; +// $result =[]; +// //$fields = array_keys($UupdateDataArray); +// foreach ($selectItems as $item) { +// $UP_part .= $ic > 0 ? ',' : ''; +// $UP_part .= $item; +// $ic++; +// } +// +// $ic = 0; +// $fields = array_keys($whereAray); +// foreach ($fields as $field) { +// $val_part .= $ic > 0 ? ' AND ' : ' WHERE '; +// $val_part .= $field."='" . $whereAray[$field] . "'"; +// $ic++; +// } +// $sqlQ = "SELECT $UP_part FROM $updateTable $val_part"; +// log_message('critical', "SQL:: ". $sqlQ ); +// $query = $this->db->query($sqlQ); +// if($query){ +// $status = 1; +// $result = $query->getResultArray(); +// $record_count = count($result); +// } +// else{ +// $status = -1; +// $error_msg = "Select falied"; +// } +// return [ +// 'status'=>$status, +// 'error_msg'=> $error_msg, +// 'record_count' => $record_count, +// 'result' => $result +// ]; +// } + + public function getIPAddress() + { + //whether ip is from the share internet + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } + //whether ip is from the proxy + elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + //whether ip is from the remote address + else { + $ip = $_SERVER['REMOTE_ADDR']; + } + return $ip; + } +} diff --git a/app/Models/projectData.php b/app/Models/projectData.php new file mode 100644 index 0000000..f60e0ed --- /dev/null +++ b/app/Models/projectData.php @@ -0,0 +1,170 @@ +[ + 'name' => 'myFit A.I', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'wrenchboard'=>[ + 'name' => 'WrenchBoard', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'coregrade'=>[ + 'name' => 'CoreGrade', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'float'=>[ + 'name' => 'Float (New)', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'legacyfloat'=>[ + 'name' => 'Float (Legacy)', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'kintcare'=>[ + 'name' => 'KintCare', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'merms'=>[ + 'name' => 'Merms EMR', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'chiefsoft'=>[ + 'name' => 'ChiefSoft', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + 'jubabox'=>[ + 'name' => 'JubaBox', + 'description' => 'This is the description of the project', + 'banner_image' => 'project_banner.jpg', + 'product_url' => 'www.chiefsoft.com', + ], + ]; + return $data; + } + private function projectListDetails(){ + $data =[ + 'chiefsoft'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'myfit'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'wrenchboard'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'coregrade'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'float'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + ]; + return $data; + } + private function devOpList(){ + $data =[ + 'chiefsoft'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'myfit'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'wrenchboard'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'coregrade'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + 'float'=>[ + 'DEV'=>[ + + ], + 'LIVE'=>[ + + ] + ], + ]; + return $data; + } + + + + + + +} diff --git a/app/Views/projects/projdetail.php b/app/Views/projects/projdetail.php index db2bfb2..189cd69 100644 --- a/app/Views/projects/projdetail.php +++ b/app/Views/projects/projdetail.php @@ -10,7 +10,7 @@