init
This commit is contained in:
25
application/controllers/Cart.php
Normal file
25
application/controllers/Cart.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Cart extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
25
application/controllers/Checkout.php
Normal file
25
application/controllers/Checkout.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Checkout extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
25
application/controllers/Home.php
Normal file
25
application/controllers/Home.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Home extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
25
application/controllers/Product.php
Normal file
25
application/controllers/Product.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Product extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
117
application/controllers/Template.php
Normal file
117
application/controllers/Template.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
/* Set internal character encoding to UTF-8 */
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
class Loader extends MY_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('file');
|
||||
}
|
||||
|
||||
/*
|
||||
* Load language javascript file
|
||||
*/
|
||||
|
||||
public function jsFile($file = null)
|
||||
{
|
||||
$contents = file_get_contents('.' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR . MY_LANGUAGE_FULL_NAME . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . $file);
|
||||
if (!$contents) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
return;
|
||||
}
|
||||
header("Content-type: application/javascript; charset: UTF-8");
|
||||
echo $contents;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load css generated from administration -> styles
|
||||
*/
|
||||
|
||||
public function cssStyle()
|
||||
{
|
||||
$this->load->Model('admin/Home_admin_model');
|
||||
$style = $this->Home_admin_model->getValueStore('newStyle');
|
||||
if ($style == null) {
|
||||
$template = $this->template;
|
||||
$style = file_get_contents(VIEWS_DIR . $template . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'default-gradient.css');
|
||||
if (!$style) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
return;
|
||||
}
|
||||
}
|
||||
header("Content-type: text/css; charset: UTF-8");
|
||||
echo $style;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load css file for template
|
||||
* Can call css file in folder /assets/css/ with templatecss/filename.css
|
||||
*/
|
||||
|
||||
public function templateCss($file)
|
||||
{
|
||||
$template = $this->template;
|
||||
$style = file_get_contents(VIEWS_DIR . $template . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . $file);
|
||||
if (!$style) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
return;
|
||||
}
|
||||
header("Content-type: text/css; charset: UTF-8");
|
||||
echo $style;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load js file for template
|
||||
* Can call css file in folder /assets/js/ with templatecss/filename.js
|
||||
*/
|
||||
|
||||
public function templateJs($file)
|
||||
{
|
||||
$template = $this->template;
|
||||
$js = file_get_contents(VIEWS_DIR . $template . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . $file);
|
||||
if (!$js) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
return;
|
||||
}
|
||||
header("Content-type: application/javascript; charset: UTF-8");
|
||||
echo $js;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load images comming with template in folder /assets/imgs/
|
||||
* Can call from view with template/imgs/filename.jpg
|
||||
*/
|
||||
|
||||
public function templateCssImage($file, $template = null)
|
||||
{
|
||||
if ($template == null) {
|
||||
$template = $this->template;
|
||||
} else {
|
||||
$template = DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$path = VIEWS_DIR . $template . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'imgs' . DIRECTORY_SEPARATOR . $file;
|
||||
$img = file_get_contents($path);
|
||||
if (!$img) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
return;
|
||||
}
|
||||
$image_mime = null;
|
||||
if (function_exists('mime_content_type')) {
|
||||
$image_mime = mime_content_type($path);
|
||||
} elseif (function_exists('finfo_open')) {
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$image_mime = finfo_file($finfo, $path);
|
||||
finfo_close($finfo);
|
||||
}
|
||||
if ($image_mime !== null) {
|
||||
header('Content-Type: ' . $image_mime . ' charset: UTF-8');
|
||||
}
|
||||
echo $img;
|
||||
}
|
||||
|
||||
}
|
25
application/controllers/Welcome.php
Normal file
25
application/controllers/Welcome.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Welcome extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
}
|
26
application/controllers/admin/Dashboard.php
Normal file
26
application/controllers/admin/Dashboard.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Dashboard extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$adm_template = 'sb_admin';
|
||||
$this->template->load('admin/' . $adm_template);
|
||||
}
|
||||
}
|
11
application/controllers/index.html
Normal file
11
application/controllers/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user