Skip to content

Commit 54dfd14

Browse files
committed
Massive update and bug fix
1 parent f9012d5 commit 54dfd14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2989
-2735
lines changed

application/config/config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| path to your installation.
1515
|
1616
*/
17-
$config['base_url'] = 'http://localhost/fruitlab';
17+
$config['base_url'] = 'http://fruitlab.bizcept.com/';
1818

1919
/*
2020
|--------------------------------------------------------------------------

application/config/routes.php

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
$route['customise/(:num)'] = 'cart/customise/$1';
4848
$route['retrieveDesign/(:num)'] = 'design/browseDesignByUser/$1';
4949
$route['activity/(:num)'] = 'activity/activityList/$1';
50+
$route['friends/remove/(:num)'] = 'friends/removeFriends/$1';
5051

5152

5253
/* End of file routes.php */

application/controllers/account.php

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2-
3-
/**
4-
* Account Page
5-
*
6-
* Handles all page that involves account
7-
*
8-
* @package Fruitlab
9-
* @author Jason Tan
10-
*/
11-
12-
class Account extends CI_Controller {
13-
14-
public function index() {
15-
$this->load->library('form_validation');
16-
$this->form_validation->set_rules('email', 'email', 'required|valid_email|trim');
17-
}
18-
public function register_success() {
19-
$data['main_content'] = 'account/register_success';
20-
$this->load->view('includes/template', $data);
21-
}
22-
23-
}
24-
25-
26-
/* End of file account.php */
27-
/* Location: ./controllers/account.php */
1+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2+
3+
/**
4+
* Account Page
5+
*
6+
* Handles all page that involves account
7+
*
8+
* @package Fruitlab
9+
* @author Jason Tan
10+
*/
11+
12+
class Account extends CI_Controller {
13+
14+
public function index() {
15+
$this->load->library('form_validation');
16+
$this->form_validation->set_rules('email', 'email', 'required|valid_email|trim');
17+
}
18+
public function register_success() {
19+
$data['main_content'] = 'account/register_success';
20+
$this->load->view('includes/template', $data);
21+
}
22+
23+
}
24+
25+
26+
/* End of file account.php */
27+
/* Location: ./controllers/account.php */

application/controllers/cart.php

+19-9
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,35 @@ public function customise($id) {
2929
$data['image_path'] = $design['image_path'];
3030
}
3131

32-
32+
$data['role'] = 2;
3333
$data['main_content'] = 'cart/purchaseshirt';
3434
$this->load->view('includes/template', $data);
3535

3636
}
3737

3838

3939
public function addToCart() {
40-
$colorID = $this->input->post('colourID');
40+
$this->load->model('cart_model');
41+
$colorID = $this->input->post('colourID');
42+
$color = $this->cart_model->fetchColorName($colorID);
4143
$collarID = $this->input->post('collarID');
44+
$collar = $this->cart_model->fetchCollarName($collarID);
4245
$designID = $this->input->post('designID');
43-
$materialID = $this->input->post('materialID');
46+
$design = $this->cart_model->fetchDesignName($designID);
47+
$materialID= $this->input->post('materialID');
48+
$material = $this->cart_model->fetchMaterialName($materialID);
4449
$qty = $this->input->post('quantity');
4550
//$size = $this->input->post('size');
46-
$price = 1; //fetch price of design, collar and color from database and compute
47-
48-
$this->load->model('cart_model');
51+
//$price = 1; //fetch price of design, collar and color from database and compute
52+
$price = $this->cart_model->getCombinationPrice($designID, $collarID, $colorID, $materialID);
53+
$name = "$color $collar Custom $material T-Shirt with design titled $design";
54+
4955
if($this->cart_model->validateCombination($designID, $collarID, $colorID, $materialID)){
5056
$data = array(
5157
'id' => $designID,
5258
'qty' => $qty,
5359
'price' => $price,
54-
'name' => 'Custom T-Shirt with design by ',
60+
'name' => $name,
5561
'options' => array(
5662
//'Size' => $size,
5763
//'Color' => $color,
@@ -70,7 +76,8 @@ public function addToCart() {
7076

7177
//successfully added to cart
7278
//return message to user
73-
79+
80+
$data['role'] = 2;
7481
$data['main_content'] = 'cart/cart';
7582

7683

@@ -96,12 +103,14 @@ public function update() {
96103

97104
$data['updated'] = true;
98105

106+
$data['role'] = 2;
99107
$data['main_content'] = 'cart/cart';
100108
$this->load->view('includes/template', $data);
101109

102110
}
103111

104112
public function viewCart() {
113+
$data['role'] = 2;
105114
$data['main_content'] = 'cart/cart';
106115
$this->load->view('includes/template', $data);
107116
}
@@ -110,7 +119,7 @@ public function checkout() {
110119
//take current cart display out details of the cart
111120
//ask the user to confirm
112121

113-
122+
$data['role'] = 2;
114123
$data['main_content'] = "cart/cartpreview";
115124
$this->load->view('includes/template', $data);
116125
}
@@ -127,6 +136,7 @@ public function payment() {
127136

128137
$data['message_title'] = "Purchase Successful";
129138
$data['message'] = "We are currently processing your purchase.";
139+
$data['role'] = 2;
130140
$data['main_content'] = 'message';
131141
$this->load->view('includes/template', $data);
132142

application/controllers/dashboard.php

+44-35
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2-
3-
/**
4-
* Dashboard Page
5-
*
6-
* @package Fruitlab
7-
* @author Jason Tan
8-
*
9-
*/
10-
11-
class Dashboard extends CI_Controller {
12-
13-
public function index() {
14-
$this->load->model('activity_model');
15-
16-
$activityList = $this->activity_model->activityList($this->session->userdata('customer_id'));
17-
18-
if($activityList != false) {
19-
$data['listExist'] = true;
20-
$data['activity'] = $activityList;
21-
} else {
22-
$data['listExist'] = false;
23-
}
24-
25-
26-
$data['main_content'] = 'dashboard';
27-
$this->load->view('includes/template', $data);
28-
29-
}
30-
31-
}
32-
33-
34-
/* End of file dashboard.php */
35-
/* Location: ./controllers/dashboard.php */
1+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2+
3+
/**
4+
* Dashboard Page
5+
*
6+
* @package Fruitlab
7+
* @author Jason Tan
8+
*
9+
*/
10+
11+
class Dashboard extends CI_Controller {
12+
13+
public function index() {
14+
$this->load->model('activity_model');
15+
16+
$activityList = $this->activity_model->activityList($this->session->userdata('customer_id'), true);
17+
18+
if($activityList != false) {
19+
$data['listExist'] = true;
20+
$data['activity'] = $activityList;
21+
} else {
22+
$data['listExist'] = false;
23+
}
24+
25+
//load the latest designs of friends as well as globally
26+
//limit them to the latest 20
27+
//display message saying no design of respective segment found.
28+
29+
$this->load->model('design_model');
30+
31+
$data['globalDesignList'] = $this->design_model->fetchDesign();
32+
$data['friendDesignList'] = $this->design_model->fetchFriendsDesign($this->session->userdata('customer_id'));
33+
34+
$data['role'] = 2;
35+
$data['main_content'] = 'dashboard';
36+
$this->load->view('includes/template', $data);
37+
38+
}
39+
40+
}
41+
42+
43+
/* End of file dashboard.php */
44+
/* Location: ./controllers/dashboard.php */

0 commit comments

Comments
 (0)