Commit 3d36883a by Yaremko95

admin functionality is implemented

shopping cart using sessions, ajax, javascript
parent a426da3d
No preview for this file type
...@@ -58,7 +58,7 @@ $autoload['packages'] = array(); ...@@ -58,7 +58,7 @@ $autoload['packages'] = array();
| |
| $autoload['libraries'] = array('user_agent' => 'ua'); | $autoload['libraries'] = array('user_agent' => 'ua');
*/ */
$autoload['libraries'] = array('database', 'session', 'form_validation'); $autoload['libraries'] = array('database', 'session', 'form_validation', 'upload', 'cart');
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
...@@ -79,7 +79,7 @@ $autoload['libraries'] = array('database', 'session', 'form_validation'); ...@@ -79,7 +79,7 @@ $autoload['libraries'] = array('database', 'session', 'form_validation');
| $autoload['drivers'] = array('cache' => 'cch'); | $autoload['drivers'] = array('cache' => 'cch');
| |
*/ */
$autoload['drivers'] = array(); $autoload['drivers'] = array('session');
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
......
...@@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| a PHP script and you can easily do that on your own. | a PHP script and you can easily do that on your own.
| |
*/ */
$config['base_url'] = 'http://localhost/webapp/ci'; $config['base_url'] = 'https://wbt-2-ty.appspot.com';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
...@@ -324,7 +324,7 @@ $config['cache_query_string'] = FALSE; ...@@ -324,7 +324,7 @@ $config['cache_query_string'] = FALSE;
| https://codeigniter.com/user_guide/libraries/encryption.html | https://codeigniter.com/user_guide/libraries/encryption.html
| |
*/ */
$config['encryption_key'] = ''; $config['encryption_key'] = 'femEDWTX$AQ@6HggkKn8RWGf!*ufK?KC';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
...@@ -382,7 +382,7 @@ $config['sess_cookie_name'] = 'ci_session'; ...@@ -382,7 +382,7 @@ $config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200; $config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions'; $config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE; $config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300; $config['sess_time_to_update'] = 7200;
$config['sess_regenerate_destroy'] = FALSE; $config['sess_regenerate_destroy'] = FALSE;
/* /*
...@@ -432,7 +432,7 @@ $config['standardize_newlines'] = FALSE; ...@@ -432,7 +432,7 @@ $config['standardize_newlines'] = FALSE;
| for backwards compatibility purposes! | for backwards compatibility purposes!
| |
*/ */
$config['global_xss_filtering'] = FALSE; $config['global_xss_filtering'] = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
...@@ -448,7 +448,7 @@ $config['global_xss_filtering'] = FALSE; ...@@ -448,7 +448,7 @@ $config['global_xss_filtering'] = FALSE;
| 'csrf_regenerate' = Regenerate token on every submission | 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/ */
$config['csrf_protection'] = FALSE; $config['csrf_protection'] = true;
$config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200; $config['csrf_expire'] = 7200;
......
...@@ -75,9 +75,9 @@ $query_builder = TRUE; ...@@ -75,9 +75,9 @@ $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => '104.199.82.156',
'username' => 'root', 'username' => 'tetiana',
'password' => '', 'password' => 'yaremko_tetiana',
'database' => 'mydb', 'database' => 'mydb',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
......
<?php <?php
class Admin extends CI_Controller class Admin extends CI_Controller {
{
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
}
} public function index () {
$name = $this->session->userdata('name');
$this->load->view('admin/aside');
$this->load->view('admin/admin_home');
}
public function index () { public function add_product() {
$this->form_validation->set_rules("artist", "Atist", "required");
$this->form_validation->set_rules("title", "Title", "required");
$this->form_validation->set_rules("genre", "Genre", "required");
$this->form_validation->set_rules("quantity", "Quantity", "required");
$this->form_validation->set_rules("price", "Price", "required");
$this->form_validation->set_rules("description", "Description", "required");
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = 2048;
$file_name="image".time();
$config['file_name']=$file_name;
$this->upload->initialize($config);
$field_name = "image";
if ($this->form_validation->run() == TRUE) {
if(!$this->upload->do_upload($field_name)) {
$file_error = $this->upload->display_errors();
$this->session->set_flashdata("file_error", "<div class=\"alert alert-danger alert-dismissible fade show\" role=\"alert\">
'$file_error' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span></button></div>");
} else {
$this->load->model('Admin_model', 'admin');
$this->admin->add_product();
$this->session->set_flashdata("message", "<div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\">
Product has been added to the database<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span></button></div>");
redirect('admin/product_inventory');
}
}
$this->load->view('admin/aside');
$this->load->view('admin/add_product');
}
$name = $this->session->userdata('name'); public function product_inventory() {
$this->load->model('Admin_model', 'admin');
$data=$this->admin->get_data();
$this->load->view('admin/aside');
$this->load->view('admin/product_inventory', array('data'=>$data));
}
public function update_item($item_id) {
$this->load->model('Admin_model', 'admin');
$data=$this->admin->get_product($item_id);
$this->form_validation->set_rules("artist", "Atist", "required");
$this->form_validation->set_rules("title", "Title", "required");
$this->form_validation->set_rules("genre", "Genre", "required");
$this->form_validation->set_rules("quantity", "Quantity", "required");
$this->form_validation->set_rules("price", "Price", "required");
$this->form_validation->set_rules("description", "Description", "required");
$this->form_validation->set_rules("status", "Status", "required");
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = 2048;
$file_name="image".time();
$config['file_name']=$file_name;
$this->upload->initialize($config);
$field_name = "image";
if ($this->form_validation->run() == TRUE) {
if(!$this->upload->do_upload($field_name)) {
$file_error = $this->upload->display_errors();
$this->session->set_flashdata("file_error", "<div class=\"alert alert-danger alert-dismissible fade show\" role=\"alert\">
'$file_error' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span></button></div>");
} else {
$this->load->model('Admin_model', 'admin');
$this->admin->update_product($item_id);
redirect('admin/product_inventory');
}
}
$this->load->view('admin/aside');
$this->load->view('admin/update_item', array('data'=>$data));
}
public function delete_item($item_id) {
$this->load->model('Admin_model', 'admin');
$this->admin->delete_product($item_id);
redirect('admin/product_inventory');
} }
...@@ -30,4 +121,7 @@ class Admin extends CI_Controller ...@@ -30,4 +121,7 @@ class Admin extends CI_Controller
}
}
...@@ -31,6 +31,7 @@ class Auth extends CI_Controller ...@@ -31,6 +31,7 @@ class Auth extends CI_Controller
$this->form_validation->set_rules("password", "Password", "trim|required"); $this->form_validation->set_rules("password", "Password", "trim|required");
if ($this->form_validation->run() == true) { if ($this->form_validation->run() == true) {
$this->load->model('auth_model', 'auth'); $this->load->model('auth_model', 'auth');
$this->load->model('Cart_model', 'cmodel');
$status = $this->auth->validate(); $status = $this->auth->validate();
if ($status == ERR_INVALID_EMAIL) { if ($status == ERR_INVALID_EMAIL) {
$this->session->set_flashdata("error", "Email is not valid"); $this->session->set_flashdata("error", "Email is not valid");
...@@ -43,6 +44,12 @@ class Auth extends CI_Controller ...@@ -43,6 +44,12 @@ class Auth extends CI_Controller
$this->session->set_userdata("role_id", $user_role); $this->session->set_userdata("role_id", $user_role);
$this->session->set_userdata($this->auth->get_data()); $this->session->set_userdata($this->auth->get_data());
$this->session->set_userdata("logged_in", true); $this->session->set_userdata("logged_in", true);
$data=$this->cmodel->getAllFromCart();
$this->cmodel->set_user_cart($this->session->userdata('email'), $data);
if($user_role==1) { if($user_role==1) {
redirect("admin/index"); redirect("admin/index");
} }
......
...@@ -13,9 +13,11 @@ class User extends CI_Controller ...@@ -13,9 +13,11 @@ class User extends CI_Controller
public function user_profile() { public function user_profile() {
if($this->session->userdata("role_id")=='1') {
redirect('admin/index');
};
if(isset($_POST['update'])) { if(isset($_POST['update'])) {
$this->form_validation->set_rules('new_email', 'Email', 'required|valid_email', $this->form_validation->set_rules('new_email', 'Email', 'required|valid_email',
array('required' => 'Please, enter new email in order to update', 'valid_email' => 'Email not valid')); array('required' => 'Please, enter new email in order to update', 'valid_email' => 'Email not valid'));
$this->form_validation->set_rules('new_name', 'Name', 'required', $this->form_validation->set_rules('new_name', 'Name', 'required',
......
...@@ -15,29 +15,13 @@ class Home extends CI_Controller { ...@@ -15,29 +15,13 @@ class Home extends CI_Controller {
public function products() public function products()
{ {
$this->load->model('Admin_model', 'admin');
$data=$this->admin->get_data();
$this->load->view('templates/header'); $this->load->view('templates/header');
$this->load->view('templates/home_t'); $this->load->view('templates/home_t', array('data'=>$data));
/*if($_SESSION['user_logged']==true) {
//redirect("home/products");
$this->load->view('templates/header');
$this->load->view('templates/home_t');
}
else
{
redirect("auth/login");
}
*/
/*if ($this->session->userdata("logged_in")) {
$this->load->view('templates/header');
$this->load->view('templates/home_t');
}
else {
redirect("auth/login");
}*/
} }
......
...@@ -8,17 +8,33 @@ ...@@ -8,17 +8,33 @@
$allowAll['auth']['login']=true; $allowAll['auth']['login']=true;
$allowAll['auth']['register']=true; $allowAll['auth']['register']=true;
$allowAll['auth']['forgotPassword']=true; $allowAll['auth']['forgotPassword']=true;
$allowAll['home']['products']=true;
$allowAll['common']['unauthorized']=true;
$allowAll['auth']['logout']=true; $allowAll['auth']['logout']=true;
$allowAll['auth']['resetpassword']=true; $allowAll['auth']['resetPassword']=true;
$allowAll['auth']['changePassword']=true;
$allowAll['auth']['verify'] =true; $allowAll['auth']['verify'] =true;
$allowAll['home']['products']=true;
$allowAll['cart']['add_to_cart']=true;
$allowAll['cart']['show_cart']=true;
$allowAll['cart']['load_cart']=true;
$allowAll['cart']['delete_product_from_cart']=true;
$allowAll['cart']['increase_qty']=true;
$allowAll['cart']['decrease_qty']=true;
$allowAll['common']['unauthorized']=true;
$allowOnly['1']['admin']['index']=true; $allowOnly['1']['admin']['index']=true;
$allowOnly['1']['admin']['add_product']=true;
$allowOnly['1']['admin']['update_item']=true;
$allowOnly['1']['admin']['product_inventory']=true;
$allowOnly['1']['admin']['delete_item']=true;
$allowOnly['2']['user']['user_profile']=true; $allowOnly['2']['user']['user_profile']=true;
$allowOnly['2']['auth']['resetPassword']=true; $allowOnly['2']['cart']['user_cart']=true;
$allowOnly['2']['auth']['changePassword']=true;
//$allowOnly['2']['home']['products']=true; //$allowOnly['2']['home']['products']=true;
...@@ -115,4 +115,7 @@ class Auth_model extends CI_Model { ...@@ -115,4 +115,7 @@ class Auth_model extends CI_Model {
} }
} }
} }
} }
<html>
<head>
</head>
<body>
<h1>Admin page</h1>
</body>
</html>
<html> <html>
<head> <head>
<title>retro record</title> <title>retro record</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/stylee.css" type="text/css"> <link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/home.css" type="text/css">
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/bootstrap.min.css" type="text/css"> <link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head> </head>
<body> <body>
<header class="header-section" > <div class="container">
<div class="container-fluid" id="header-top"> <div class="header-wrapper">
<div class="inner-header"> <header class="header-section" >
<div class="logo"> <div class="header-top">
<a href="<?php echo base_url(); ?>index.php/home/products"><img src="<?= asset_url('img/logo.png')?>" alt=""></a> <div class="logo">
<a href="<?php echo base_url(); ?>index.php/home/products"><img src="<?= asset_url('img/logo.png')?>" alt=""></a>
</div>
<div class="menu-right">
<div class="cart-profile">
<div class="toggle-account active-btn">
<a href="<?php echo base_url(); ?>index.php/user/user_profile" >
<i class="fa fa-user-circle-o"></i>
</a>
<!--
<ul class="active-nav" style="display: block;">
<li class="profile">
<a href="/profile.html" title="Profile">
Profile
</a>
</li>
<li class="orders">
<a href="/orders.html" title="Order History">
Order History
</a>
</li>
<li class="logout">
<form method="post" action="/">
<button type="submit" title="Log Out" name="logout">
Log Out
</button>
</form>
</li>
</ul> -->
</div>
<div class="cart-box" style="margin-left: 10px;">
<a class="cart-link" href="#" >
<i class="fa fa-shopping-cart" ></i>
<span class="badge"></span>
</a>
</div>
<div id="mini-cart" class="cart-overlay" >
<div id="cart" class="cart">
<button type="button" class="close position-absolute top-0 right-0" aria-label="Close" style="float: left;">
<span aria-hidden="true">&times;</span>
</button>
<div style="display: flex; justify-content: space-between"> <span></span><a href="<?php echo base_url(); ?>index.php/cart/user_cart">View Basket &raquo;</a></div>
<div class="products-center" style="width: 100%">
<div id="detail-cart" class="mini-cart-item">
</div>
</div>
</div>
</div>
</div>
<div class="user-access">
<a href="<?php echo base_url(); ?>index.php/auth/register">Register</a>
<a href="<?php echo base_url(); ?>index.php/auth/login" class="in">Log in</a>
<a href="<?php echo base_url(); ?>index.php/auth/logout" class="out">Log Out</a>
</div>
<div class="about-menu">
<a href="">About</a>
</div>
<div class="contact-menu">
<a href="">Contact</a>
</div>
</div>
</div> </div>
<div class="header-right"> <nav>
<ul id="navigation" class="navigation">
<a href="<?php echo base_url(); ?>index.php/user/user_profile" >
<img src="<?= asset_url('img/icons/man.png')?>" alt=""> <li >
</a> <a href="">Metal</a>
<a href="#"> </li>
<img src="<?= asset_url('img/icons/bag.png')?>" alt=""> <li >
<span>2</span> <a href="">Pop</a>
</a> </li>
</div> <li>
<div class="user-access"> <a href="">Soundtracks</a>
<a href="<?php echo base_url(); ?>index.php/auth/register">Register</a> </li>
<a href="<?php echo base_url(); ?>index.php/auth/login" class="in">Log in</a> <li>
<a href="<?php echo base_url(); ?>index.php/auth/logout" class="out">Log Out</a> <a href="/">Jazz & Classical</a>
</div> </li>
<nav class="main-menu mobile-menu"> <li>
<ul> <a href="/">Soul & RNB</a>
</li>
<li>
<a href="">Hip Hop & Rap</a>
</li>
<li >
<a href="">Compilations</a>
</li>
<li id="cat_genres" class="cat_level_0">
<a class="parent-cat parent-cat-0" href="/">Dance & Electronica</a>
</li>
<li id="cat_sale" class="cat_level_0">
<a class="parent-cat parent-cat-0" href="">Ska + Reggae</a>
</ul>
</nav>
</header>
<li><a href="">About</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
</div>
</div>
<div class="container">
<nav>
<ul id="navigation" class="navigation">
<li id="cat_johnnycashreissues" class="cat_level_0">
<a href="">Metal</a>
</li>
<li id="cat_preorders" class="cat_level_0">
<a href="">Pop</a>
</li>
<li id="cat_newreleases" class="cat_level_0">
<a href="">Soundtracks</a>
</li>
<li id="cat_sovexclusives" class="cat_level_0">
<a href="/">Jazz & Classical</a>
</li>
<li id="cat_colouredvinyl" class="cat_level_0">
<a href="/">Soul & RNB</a>
</li>
<li id="cat_limitededition" class="cat_level_0">
<a href="">Hip Hop & Rap</a>
</li>
<li id="cat_merchandise" class="cat_level_0">
<a href="">Compilations</a>
</li>
<li id="cat_genres" class="cat_level_0">
<a class="parent-cat parent-cat-0" href="/">Dance & Electronica</a>
</li>
<li id="cat_sale" class="cat_level_0">
<a class="parent-cat parent-cat-0" href="">Ska + Reggae</a>
</ul>
</nav>
</div> </div>
</header>
<!-- Header Info Begin -->
</div>
<script type="text/javascript">
baseUrl = '<?php echo base_url(); ?>';
</script>
<!-- <script src="--><?php //echo base_url(); ?><!--asset/js/scrypt.js"></script>-->
<!-- Header Info Begin -->
<script src="<?php echo base_url(); ?>asset/js/jquery-3.3.1.min.js"></script> <script src="<?php echo base_url(); ?>asset/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url(); ?>asset/js/bootstrap.min.js"></script> <script src="<?php echo base_url(); ?>asset/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>asset/js/jquery.js"></script>
<script src="<?php echo base_url(); ?>asset/js/jquery-ui.js"></script>
</body> </body>
</html> </html>
......
...@@ -6,307 +6,139 @@ ...@@ -6,307 +6,139 @@
<title>Retro Record Home</title> <title>Retro Record Home</title>
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css?family=Amatic+SC:400,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/stylee.css" type="text/css">
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/home.css" type="text/css">
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/bootstrap.min.css" type="text/css"> <link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head> </head>
<body>
<ul class="head-info">
<li class="frontendsegment homepage-ctas"><a href="" class="card">
<h4><p style="color:#ffde26">Enjoy 10% off first order</h4></font>
<p>Join our Mailing List</p>
</a>
<a href="" class="card">
<h4><p style="color:#ffde26">We offer FREE UK RETURNS</h4></font>
<p>Click here for more info</p>
</a>
<body>
<div class="head-offer">
<div class="offer-list">
<ul class="navigation offer">
<li id="offer"><a href="" class="">
<h4>Enjoy 10% off first order</h4>
<p>Join our Mailing List</p>
</a>
</li>
<li id="offer">
<a href="" class="">
<h4>We offer FREE UK RETURNS</h4>
<p>Click here for more info</p>
</a>
</li>
<li>
<a href="" class="">
<h4>EXCLUSIVES</h4>
<p>SHOP NOW</p>
</a>
</li>
</ul>
</div>
</div>
<a href="" class="card">
<h4><p style="color:#ffde26">EXCLUSIVES</h4></font>
<p>SHOP NOW</p>
</a>
</li>
</ul>
<!-- Header Info End --> <!-- Header Info End -->
<!-- Header End --> <!-- Header End -->
<div class="new-function">
<div id="carousel" class="carousel slide" data-ride="carousel" data-interval="2000">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class=" item carousel-item active">
<a href="<?php echo base_url(); ?>index.php/items/item1" >
<img class="d-block w-100" src="<?= asset_url('img/sl-1.jpg')?>" alt="First slide">
</a>
</div>
<div class="item carousel-item">
<img class="d-block w-100" src="<?= asset_url('img/sl-2.jpg')?>" alt="Second slide">
</div> </div>
<div class="item carousel-item">
<img class="d-block w-100" src="<?= asset_url('img/sl-3.jpg')?>" alt="Third slide"> <div class="carousel-section">
<div id="carousel" class="carousel slide" data-ride="carousel" data-interval="2000">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class=" item carousel-item active">
<a href="<?php echo base_url(); ?>index.php/items/item1" >
<img class="d-block w-100" src="<?= asset_url('img/sl-1.jpg')?>" alt="First slide">
</a>
</div>
<div class="item carousel-item">
<img class="d-block w-100" src="<?= asset_url('img/sl-2.jpg')?>" alt="Second slide">
</div>
<div class="item carousel-item">
<img class="d-block w-100" src="<?= asset_url('img/sl-3.jpg')?>" alt="Third slide">
</div>
</div> </div>
<a class="carousel-control-prev" href="#carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> </div>
<a class="carousel-control-prev" href="#carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> </div>
<div class="h_sec"> <div class="h_sec">
<h3 class="section-header"><span>RECOMMENDED PRE-ORDERS</span></h3> <h3 class="section-header"><span> RECOMMENDED PRE-ORDERS</span></h3>
</div> </div>
<div class="shop-items">
<div class="shop-item"> <div class="shop-items">
<a href="<?php echo base_url(); ?>index.php/items/item1"> <?php if(count($data)): ?>
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/> <?php foreach ($data as $item) { ?>
</a> <div class="shop-item">
<div class="shop-item-details"> <div class="image">
<span class="brand">Ariana Grande</span> <a href="<?php echo base_url(); ?>index.php/items/item1">
</div> <img class="shop-item-image" src="<?php echo base_url("uploads/".$item->image) ?>" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<?php if($item->status=='sold'): ?>
<p class="sold-btn">Sold out</p>
<?php else: ?>
<button class="cart-btn" id="<?php echo $item->id;?>" data-butnid="<?php echo $item->id;?>" data-productid="<?php echo $item->id;?>" data-productartist="<?php echo $item->artist;?>"
data-producttitle="<?php echo $item->title;?>" data-productprice="<?php echo $item->price;?>" data-productimage="<?php echo $item->image;?>">
<i class="fa fa-shopping-cart"></i>
Add to cart
</button>
<?php endif; ?>
</div>
<div> <a class="artist" href="#">
<span class="format double-vinyl-lp">Double Vinyl LP</span> <div class="shop-item-details">
</div> <span class="brand"><?php echo $item->artist; ?></span>
<div> </div>
<span class="price">€31.00</span> </a>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div> <div class="title">
<span class="format double-vinyl-lp">Double Vinyl LP</span> <span class="format double-vinyl-lp"><?php echo $item->title; ?></span>
</div> </div>
<div> <div>
<span class="price">€31.00</span> <span class="price"><?php echo $item->price; ?></span>
</div> </div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div> </div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="/">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span> <?php } ?>
</div> <?php endif; ?>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div> </div>
<div class="shop-item"> <div id="detail-cart" class="mini-cart-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div> </div>
</div>
<div class="h_sec"> <div class="h_sec">
<h3 class="section-header"><span>RECOMMENDED PRE-ORDERS</span></h3> <h3 class="section-header"><span>RECOMMENDED PRE-ORDERS</span></h3>
</div> </div>
<div class="shop-items">
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
<div class="shop-item">
<a href="">
<img class="shop-item-image" src="https://dvfnvgxhycwzf.cloudfront.net/media/SharedImage/image550/.feUXup5W/SharedImage-96980.png?t=dc227e5bcb5adff101b3" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<div class="shop-item-details">
<span class="brand">Ariana Grande</span>
</div>
<div>
<span class="format double-vinyl-lp">Double Vinyl LP</span>
</div>
<div>
<span class="price">€31.00</span>
</div>
<div>
<span class="dispatch">In Stock</span>
</div>
<div class="add--to-cart">
<input type="submit" id="add-to-basket" name="add" value="Add to basket" class="submit"/>
</div>
</div>
</div> </div>
<script type="text/javascript">
baseUrl = '<?php echo base_url(); ?>';
</script>
<script src="<?php echo base_url(); ?>asset/js/scrypt.js"></script>
<script src="<?php echo base_url(); ?>asset/js/jquery-3.3.1.min.js"></script> <script src="<?php echo base_url(); ?>asset/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url(); ?>asset/js/bootstrap.min.js"></script> <script src="<?php echo base_url(); ?>asset/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>asset/js/hceader-top.js"></script> <script src="<?php echo base_url(); ?>asset/js/hceader-top.js"></script>
......
...@@ -41,6 +41,18 @@ h2 { ...@@ -41,6 +41,18 @@ h2 {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
margin-bottom: 1em; margin-bottom: 1em;
} }
.add-product-table {
width: 80%;
clear: both;
padding: 0 0 1em;
margin-right: 1.5em;
border-bottom: 1px solid #ddd;
margin-bottom: 1em;
}
.add-product-table td{
display: block;
}
.message-box { .message-box {
float: right; float: right;
width: 30%; width: 30%;
...@@ -105,6 +117,33 @@ label { ...@@ -105,6 +117,33 @@ label {
cursor: text; cursor: text;
} }
.add-product-table input, select {
width: 100%;
max-width: 25em;
font-size: 1em;
line-height: 1.6;
padding: .1em .2em;
border: 1px solid #ccc;
background: #fdfcfc;
margin: .1em 0;
color: #444;
background-clip: padding-box;
text-rendering: auto;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
cursor: text;
}
.add-product-table select {
height: 110%;
}
.add-product-table textarea {
}
.delivery-details input { .delivery-details input {
width: 100%; width: 100%;
max-width: 25em; max-width: 25em;
......
...@@ -164,49 +164,8 @@ header.sticky { ...@@ -164,49 +164,8 @@ header.sticky {
.navigation li{display:inline-block;list-style:none;margin:0;padding:0;} .navigation li{display:inline-block;list-style:none;margin:0;padding:0;}
.navigation li a{display:block;margin:0; max-width:auto;padding:.5em 1em;list-style:none;color:inherit;font-weight:inherit;cursor:pointer} .navigation li a{display:block;margin:0; max-width:auto;padding:.5em 1em;list-style:none;color:inherit;font-weight:inherit;cursor:pointer}
.navigation li a:hover{color:#666} .navigation li a:hover{color:#666}
.header-info li{
color: black;
}
.homepage-ctas{padding:1em 0 .5em;position:relative; margin-top: 195px;}
.homepage-ctas .card{transition:opacity .3s;vertical-align:top;text-align:center;position:relative;display:inline-block;width:33%; background: black;padding:.5em 0}
.homepage-ctas .card:hover{opacity: .6}
.homepage-ctas .card::after{content:"";height:1.5em;width:2px;position:absolute;top:50%;margin-top:-.75em;bottom:0;right:0;background:#ffffff}
.homepage-ctas .card:last-child::after{display:none}
.homepage-ctas h4{text-transform:uppercase;font-size:1.25em;margin:0; }
.homepage-ctas p{position:relative;margin:0; color:#ffffff;line-height:1.25}
.homepage-ctas::after,.homepage-ctas::before{content:"";height:100%;width:100vw;position:absolute;left:50%;right:50%;top:0;margin-left:-50vw;margin-right:-50vw}
.homepage-ctas::before{background:#0e0e0e}.homepage-ctas::after{height:1px;top:auto;bottom:0;background:#000000}
.header-info {
margin-top: 195px;
background: black;
overflow: hidden;
padding: 30px 45px;
}
.header-info .header-item {
overflow: hidden;
}
.header-info .header-item img {
display: inline-block;
margin-right: 13px;
}
.header-info .header-item p {
display: inline-block;
line-height: 1;
font-size: 20px;
color: yellow;
font-weight: 500;
margin-bottom: 0;
position: relative;
top: 3px;
}
.carousel { .carousel {
margin: 10px auto; margin: 10px auto;
padding: 10px 300px; padding: 10px 300px;
......
...@@ -101,6 +101,7 @@ header img{ ...@@ -101,6 +101,7 @@ header img{
.auth-section { .auth-section {
padding: 60px 0px; padding: 60px 0px;
display: flex; display: flex;
......
INSERT INTO 'users'(u_id, email, password, name, surname, country, city, street, zip, building) VALUES (1, 'email@gmail.com', 'pass', 'name', 'surname', 'country', 'city', 'street', 'zip', 'building');
INSERT INTO 'users'(u_id, email, password, name, surname, country, city, street, zip, building) VALUES (2, 'email2@gmail.com', 'pass2', 'name2', 'surname2', 'country2', 'city2', 'street2', 'zip2', 'building2');
INSERT INTO 'users'(u_id, email, password, name, surname, country, city, street, zip, building) VALUES (3, 'email3@gmail.com', 'pass3', 'name3', 'surname3', 'country3', 'city3', 'street3', 'zip3', 'building3');
INSERT INTO 'users'(u_id, email, password, name, surname, country, city, street, zip, building) VALUES (4, 'email4@gmail.com', 'pass4', 'name4', 'surname4', 'country4', 'city4', 'street4', 'zip4', 'building4');
INSERT INTO `user_role` (`id`, `role`) VALUES (NULL, 'administrator'), (NULL, 'member');
INSERT INTO 'product'(id, artist, title, genre, description, price, q_ty) VALUES (1, 'artist', 'title', 'genre', 'description', 100, 5);
INSERT INTO 'product'(id, artist, title, genre, description, price, q_ty) VALUES (2, 'artist2', 'title2', 'genre2', 'description2', 100, 5);
INSERT INTO 'product'(id, artist, title, genre, description, price, q_ty) VALUES (3, 'artist3', 'title3', 'genre3', 'description3', 100, 5);
INSERT INTO 'product'(id, artist, title, genre, description, price, q_ty) VALUES (4, 'artist4', 'title4', 'genre4', 'description4', 100, 5);
INSERT INTO 'cart'(id, user_id) VALUES (1,1);
INSERT INTO 'cart'(id, user_id) VALUES (2,2);
INSERT INTO 'cart'(id, user_id) VALUES (3,3);
INSERT INTO 'cart'(id, user_id) VALUES (4,4);
INSERT INTO 'prod_in_cart'(prod_q_ty, c_id, p_id) VALUES (5,1,1);
INSERT INTO 'prod_in_cart'(prod_q_ty, c_id, p_id) VALUES (5,2,2);
INSERT INTO 'prod_in_cart'(prod_q_ty, c_id, p_id) VALUES (5,3,3);
INSERT INTO 'prod_in_cart'(prod_q_ty, c_id, p_id) VALUES (5,4,4);
INSERT INTO 'status'(id_status, status) VALUES (1, 'succesful');
INSERT INTO 'status'(id_status, status) VALUES (2, 'processing');
INSERT INTO 'status'(id_status, status) VALUES (3, 'canceled');
INSERT INTO 'transaction'(id, id_user, id_status) VALUES (1, 1, 1);
INSERT INTO 'transaction'(id, id_user, id_status) VALUES (2, 1, 1);
INSERT INTO 'transaction'(id, id_user, id_status) VALUES (3, 1, 1);
INSERT INTO 'transaction'(id, id_user, id_status) VALUES (4, 1, 1);
INSERT INTO 'trans_products'(id_trans, id_prod, num_of_pr, price) VALUES (1, 1, 5, 120);
INSERT INTO 'trans_products'(id_trans, id_prod, num_of_pr, price) VALUES (2, 1, 5, 120);
INSERT INTO 'trans_products'(id_trans, id_prod, num_of_pr, price) VALUES (3, 1, 5, 120);
INSERT INTO 'trans_products'(id_trans, id_prod, num_of_pr, price) VALUES (4, 1, 5, 120);
https://app.moqups.com/unsaved/2585a64b/edit/page/a2ce38a45
\ No newline at end of file
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment