Skip to content

Commit b1e472b

Browse files
committed
new template
1 parent 7420bf1 commit b1e472b

File tree

13 files changed

+871
-473
lines changed

13 files changed

+871
-473
lines changed

fuel/app/classes/controller/quiz.php

+39-46
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
11
<?php
22

3-
class Controller_Quiz extends Controller_Template
4-
{
5-
6-
public function action_index()
7-
{
8-
$data["subnav"] = array('index'=> 'active' );
9-
$this->template->title = 'Quiz &raquo; Index';
10-
$this->template->content = View::forge('quiz/index', $data);
11-
}
12-
13-
public function action_online()
14-
{
15-
$data["subnav"] = array('index'=> 'active' );
16-
$this->template->title = 'Quiz &raquo; Index';
17-
$this->template->content = View::forge('quiz/season', $data);
18-
}
19-
20-
public function action_local()
21-
{
22-
$data["subnav"] = array('index'=> 'active' );
23-
$this->template->title = 'Quiz &raquo; Index';
24-
$this->template->content = View::forge('quiz/season', $data);
25-
}
26-
27-
public function action_flyers()
28-
{
29-
$data["subnav"] = array('index'=> 'active' );
30-
$this->template->title = 'Quiz &raquo; Index';
31-
$this->template->content = View::forge('quiz/season', $data);
32-
}
33-
34-
35-
public function action_season()
36-
{
37-
$data["subnav"] = array('index'=> 'active' );
38-
$this->template->title = 'Quiz &raquo; Index';
39-
$this->template->content = View::forge('quiz/season', $data);
40-
}
41-
42-
public function action_team()
43-
{
44-
$data['team'] = Model_Team::find('all');
45-
$data["subnav"] = array('index'=> 'active' );
46-
$this->template->title = 'Quiz &raquo; Index';
47-
$this->template->content = View::forge('quiz/team', $data);
48-
}
3+
class Controller_Quiz extends Controller_Template {
4+
5+
public function action_index() {
6+
$data["subnav"] = array('index' => 'active');
7+
$this->template->title = 'Quiz &raquo; Index';
8+
$this->template->content = View::forge('quiz/index', $data);
9+
}
10+
11+
public function action_online() {
12+
$data["subnav"] = array('index' => 'active');
13+
$this->template->title = 'Quiz &raquo; Index';
14+
$this->template->content = View::forge('quiz/season', $data);
15+
}
16+
17+
public function action_local() {
18+
$data["subnav"] = array('index' => 'active');
19+
$this->template->title = 'Quiz &raquo; Index';
20+
$this->template->content = View::forge('quiz/season', $data);
21+
}
22+
23+
public function action_flyers() {
24+
$data["subnav"] = array('index' => 'active');
25+
$this->template->title = 'Quiz &raquo; Index';
26+
$this->template->content = View::forge('quiz/season', $data);
27+
}
28+
29+
public function action_season() {
30+
$data['season'] = Model_Season::find('all');
31+
$data["subnav"] = array('index' => 'active');
32+
$this->template->title = 'Quiz &raquo; Index';
33+
$this->template->content = View::forge('quiz/season', $data);
34+
}
35+
36+
public function action_team() {
37+
$data['team'] = Model_Team::find('all');
38+
$data["subnav"] = array('index' => 'active');
39+
$this->template->title = 'Quiz &raquo; Index';
40+
$this->template->content = View::forge('quiz/team', $data);
41+
}
4942

5043
}

fuel/app/classes/model/season.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Model_Season extends \Orm\Model {
2323
'team3_3',
2424
'photo_small',
2525
'photo_large',
26-
'slides_id',
26+
'slides',
2727
'created_at',
2828
'updated_at',
2929
);
@@ -37,6 +37,6 @@ class Model_Season extends \Orm\Model {
3737
'mysql_timestamp' => false,
3838
),
3939
);
40-
protected static $_table_name = 'teams';
40+
protected static $_table_name = 'seasons';
4141

4242
}

fuel/app/classes/model/team.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Model_Team extends \Orm\Model {
77
'id',
88
'name',
99
'email',
10-
'phone',
10+
'post',
1111
'year',
1212
'photo',
1313
'created_at',

fuel/app/config/development/migrations.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'default' =>
88
array(
99
0 => '001_create_teams',
10+
1 => '002_create_seasons',
1011
),
1112
),
1213
'module' =>

fuel/app/migrations/001_create_teams.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function up()
1010
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
1111
'name' => array('constraint' => 50, 'type' => 'varchar'),
1212
'email' => array('constraint' => 30, 'type' => 'varchar'),
13-
'phone' => array('constraint' => 11, 'type' => 'varchar'),
13+
'post' => array('constraint' => 20, 'type' => 'varchar'),
1414
'year' => array('constraint' => 11, 'type' => 'int'),
1515
'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
1616
'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace Fuel\Migrations;
4+
5+
class Create_seasons
6+
{
7+
public function up()
8+
{
9+
\DBUtil::create_table('seasons', array(
10+
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true),
11+
'quiz_name' => array('constraint' => 50, 'type' => 'varchar'),
12+
'quiz_date' => array('constraint' => 50, 'type' => 'varchar'),
13+
'quiz_time' => array('constraint' => 50, 'type' => 'varchar'),
14+
'quiz_venue' => array('constraint' => 50, 'type' => 'varchar'),
15+
'quiz_details' => array('constraint' => 1000, 'type' => 'varchar'),
16+
'team1_name' => array('constraint' => 50, 'type' => 'varchar'),
17+
'team1_1' => array('constraint' => 50, 'type' => 'varchar'),
18+
'team1_2' => array('constraint' => 50, 'type' => 'varchar'),
19+
'team1_3' => array('constraint' => 50, 'type' => 'varchar'),
20+
'team2_name' => array('constraint' => 50, 'type' => 'varchar'),
21+
'team2_1' => array('constraint' => 50, 'type' => 'varchar'),
22+
'team2_2' => array('constraint' => 50, 'type' => 'varchar'),
23+
'team2_3' => array('constraint' => 50, 'type' => 'varchar'),
24+
'team3_name' => array('constraint' => 50, 'type' => 'varchar'),
25+
'team3_1' => array('constraint' => 50, 'type' => 'varchar'),
26+
'team3_2' => array('constraint' => 50, 'type' => 'varchar'),
27+
'team3_3' => array('constraint' => 50, 'type' => 'varchar'),
28+
'photo_small' => array('constraint' => 100, 'type' => 'varchar'),
29+
'photo_large' => array('constraint' => 100, 'type' => 'varchar'),
30+
'slides' => array('constraint' => 3, 'type' => 'int'),
31+
'created_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
32+
'updated_at' => array('constraint' => 11, 'type' => 'int', 'null' => true),
33+
34+
), array('id'));
35+
}
36+
37+
public function down()
38+
{
39+
\DBUtil::drop_table('seasons');
40+
}
41+
}

fuel/app/views/quiz/season.php

+1-212
Original file line numberDiff line numberDiff line change
@@ -1,213 +1,2 @@
1-
<style>
2-
#wapper {
3-
height: 100%;
4-
width: 100%;
5-
min-height: 650px;
6-
min-width: 900px;
7-
padding-top: 1px;
8-
}
9-
#slider {
10-
margin: 100px 0 0 0;
11-
height: 500px;
12-
overflow: hidden;
13-
background: url(http://127.0.0.1/quizinc/public/assets/img/ajax-loader.gif) center center no-repeat;
14-
}
151

16-
#slider .slide {
17-
position: relative;
18-
display: none;
19-
height: 500px;
20-
float: left;
21-
background-position: center right;
22-
cursor: pointer;
23-
border-left: 1px solid #fff;
24-
}
25-
26-
#slider .slide:first-child {
27-
border: none;
28-
}
29-
30-
#slider .slide.active {
31-
cursor: default;
32-
}
33-
34-
#slider .slide-block {
35-
position: absolute;
36-
left: 40px;
37-
bottom: 25px;
38-
display: inline-block;
39-
width: 435px;
40-
background-color: #fff;
41-
background-color: rgba(255,255,255, 0.8);
42-
padding: 20px;
43-
font-size: 14px;
44-
color: #134B94;
45-
border: 1px solid #fff;
46-
overflow: hidden;
47-
border-radius: 4px;
48-
}
49-
50-
#slider .slide-block h4 {
51-
font-size: 36px;
52-
font-weight: bold;
53-
margin: 0 0 10px 0;
54-
line-height: 1;
55-
}
56-
#slider .slide-block p {
57-
margin: 0;
58-
}
59-
60-
#donate-spacer {
61-
height: 0;
62-
}
63-
#donate {
64-
border-top: 1px solid #999;
65-
width: 750px;
66-
padding: 50px 75px;
67-
margin: 0 auto;
68-
overflow: hidden;
69-
}
70-
#donate p, #donate form {
71-
margin: 0;
72-
float: left;
73-
}
74-
#donate p {
75-
width: 650px;
76-
color: #999;
77-
}
78-
#donate form {
79-
width: 100px;
80-
}
81-
</style>
82-
<div class="col-sm-9 " style="margin-top:50px; margin-left:100px;padding-bottom: 40px">
83-
<div class="container">
84-
<div class="row structure " style="min-height: 650px;padding-right: 50px;padding-left: 50px;">
85-
<h2>Season Quiz</h2>
86-
<div id="wrapper">
87-
<div id="slider">
88-
89-
<div class="slide" style="background-image: url('http://127.0.0.1/quizinc/public/assets/img/tbt.jpg');">
90-
<div class="slide-block">
91-
<p>"I'm not crazy, My mother had me tested."<br />
92-
93-
Indian Quizzing League (IQL) and QuizInc proudly present - The Sheldon Cooper of all Quizzes, the one of its kind, imported straight from Pasadena - The Big Bang Theory Quiz!
94-
<br />
95-
Leonard: What do we do to those who don't participate?<br />
96-
Sheldon: bortaS bIr jablu'DI' reH QaQqu' nay.</p>
97-
</div>
98-
</div>
99-
100-
101-
<div class="slide" style="background-image: url('http://127.0.0.1/quizinc/public/assets/img/india.jpg');">
102-
<div class="slide-block">
103-
<h4>Ice Age</h4>
104-
<p>Heading south to avoid a bad case of global frostbite, a group of migrating misfit creatures embark on a hilarious quest to reunite a human baby with his tribe.</p>
105-
</div>
106-
</div>
107-
108-
109-
<div class="slide" style="background-image: url('http://127.0.0.1/quizinc/public/assets/img/up.jpg');">
110-
<div class="slide-block">
111-
<h4>UP</h4>
112-
<p>A comedy adventure in which 78-year-old Carl Fredricksen fulfills his dream of a great adventure when he ties thousands of balloons to his house and flies away to the wilds of South America.</p>
113-
</div>
114-
</div>
115-
116-
117-
</div>
118-
</div>
119-
</div>
120-
121-
</div>
122-
</div>
123-
</div>
124-
<?php echo Asset::js('jquery.carouFredSel-6.2.0-packed.js'); ?>
125-
<script type="text/javascript">
126-
$(function() {
127-
$('#slider').carouFredSel({
128-
width: '100%',
129-
align: false,
130-
items: 3,
131-
items: {
132-
width: $('#wrapper').width() * 0.15,
133-
height: 500,
134-
visible: 1,
135-
minimum: 1
136-
},
137-
scroll: {
138-
items: 1,
139-
timeoutDuration: 5000,
140-
onBefore: function(data) {
141-
142-
// find current and next slide
143-
var currentSlide = $('.slide.active', this),
144-
nextSlide = data.items.visible,
145-
_width = $('#wrapper').width();
146-
147-
// resize currentslide to small version
148-
currentSlide.stop().animate({
149-
width: _width * 0.15
150-
});
151-
currentSlide.removeClass('active');
152-
153-
// hide current block
154-
data.items.old.add(data.items.visible).find('.slide-block').stop().fadeOut();
155-
156-
// animate clicked slide to large size
157-
nextSlide.addClass('active');
158-
nextSlide.stop().animate({
159-
width: _width * 0.7
160-
});
161-
},
162-
onAfter: function(data) {
163-
// show active slide block
164-
data.items.visible.last().find('.slide-block').stop().fadeIn();
165-
}
166-
},
167-
onCreate: function(data) {
168-
169-
// clone images for better sliding and insert them dynamacly in slider
170-
var newitems = $('.slide', this).clone(true),
171-
_width = $('#wrapper').width();
172-
173-
$(this).trigger('insertItem', [newitems, newitems.length, false]);
174-
175-
// show images
176-
$('.slide', this).fadeIn();
177-
$('.slide:first-child', this).addClass('active');
178-
$('.slide', this).width(_width * 0.15);
179-
180-
// enlarge first slide
181-
$('.slide:first-child', this).animate({
182-
width: _width * 0.7
183-
});
184-
185-
// show first title block and hide the rest
186-
$(this).find('.slide-block').hide();
187-
$(this).find('.slide.active .slide-block').stop().fadeIn();
188-
}
189-
});
190-
191-
// Handle click events
192-
$('#slider').children().click(function() {
193-
$('#slider').trigger('slideTo', [this]);
194-
});
195-
196-
// Enable code below if you want to support browser resizing
197-
$(window).resize(function() {
198-
199-
var slider = $('#slider'),
200-
_width = $('#wrapper').width();
201-
202-
// show images
203-
slider.find('.slide').width(_width * 0.15);
204-
205-
// enlarge first slide
206-
slider.find('.slide.active').width(_width * 0.7);
207-
208-
// update item width config
209-
slider.trigger('configuration', ['items.width', _width * 0.15]);
210-
});
211-
212-
});
213-
</script>
2+
<? print_r($season) ?>

0 commit comments

Comments
 (0)