first commit

This commit is contained in:
dev-chiefworks
2022-09-30 11:35:02 -04:00
commit 12df0652f9
2048 changed files with 276151 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
namespace App\Controllers;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
/**
* Class BaseController
*
* BaseController provides a convenient place for loading components
* and performing functions that are needed by all your controllers.
* Extend this class in any new controllers:
* class Home extends BaseController
*
* For security be sure to declare any new methods as protected or private.
*/
class BaseController extends Controller
{
/**
* Instance of the main Request object.
*
* @var CLIRequest|IncomingRequest
*/
protected $request;
/**
* An array of helpers to be loaded automatically upon
* class instantiation. These helpers will be available
* to all other controllers that extend BaseController.
*
* @var array
*/
protected $helpers = [];
/**
* Constructor.
*/
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
// Do Not Edit This Line
parent::initController($request, $response, $logger);
// Preload any models, libraries, etc, here.
// E.g.: $this->session = \Config\Services::session();
}
}
+54
View File
@@ -0,0 +1,54 @@
<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
$data=array();
$this->db = \Config\Database::connect($this->con_name);
try {
$mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 5";
$mysql = "SELECT p1.id AS id, p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1
ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' )
LEFT JOIN
wp_postmeta wm2
ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL )
WHERE
p1.post_status='publish'
AND p1.post_type='post'
ORDER BY p1.post_date DESC LIMIT 5";
$query = $this->db->query($mysql);
$row = $query->getResultArray();
// print_r( $row );
// $r = $this->db->query($mysql);
$data["blog_array"] = $row;
} catch (Exception $ex) {
}
// featured
try {
$mysql = "SELECT id, post_title, post_content,post_date,comment_count
FROM wp_posts WHERE post_type='post' AND post_status = 'publish' AND id = 263";
$query = $this->db->query($mysql);
$rowF = $query->getResultArray();
// print_r( $rowF );
// $r = $this->db->query($mysql);
$data["blog_featured"] = $rowF[0];
} catch (Exception $ex) {
}
//return view('welcome_message');
return view('chiefsoft',$data);
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
namespace App\Controllers;
class Office extends BaseController
{
public function index()
{
return view('office/index');
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
namespace App\Controllers;
class Projects extends BaseController
{
public function index()
{
return view('projects/index');
}
}