<file_sep><section id="superSizedSlider" class="scrollMenu">
	<a id="prevslide" class="load-item"></a>
	<a id="nextslide" class="load-item"></a>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div id="slidecaption"></div>
			</div>
		</div>
	</div>
</section>
<section id="content">
	<section class="color0">
		<div class="container">
			<div class="row">
				<div class="col-md-6 pt40" data-nekoanim="fadeInLeftBig" data-nekodelay="200">
					<img src="<?php echo base_url('assets/frontend/images/'.$content_list['section-one']['content_media']); ?>" alt="" class="img-responsive" />
			</div>
			<div class="col-md-5 col-md-offset-1 pt40 mt40">
				<h1><?php echo $content_list['section-one']['content_header']; ?></h1>
				<p><?php echo $content_list['section-one']['content_body']; ?></p>
			</div>
		</div>
	</div>
</section>
<section class="color1">
	<div class="container">
		<div class="row">
			<div class="col-md-5 pt40 mt40">
				<h1><?php echo $content_list['section-two']['content_header']; ?></h1>
				<p><?php echo $content_list['section-two']['content_body']; ?></p>
			</div>
			<div class="col-md-6 col-md-offset-1 pt40 pb40" data-nekoanim="fadeInRightBig" data-nekodelay="300">
				<img src="<?php echo base_url('assets/frontend/images/'.$content_list['section-two']['content_media']); ?>" alt="" class="img-responsive"/>
			</div>
		</div>
	</div>
</section>
<section id="projectQuoteSection" class="pt40 pb40 color2">
	<div class="container">
		<div class="row"> 
			<div class="col-md-12 mb30 text-center" data-nekoanim="fadeInDown" data-nekodelay="300">
				<h1><?php echo $content_list['section-three']['content_header']; ?></h1>
				<p><?php echo $content_list['section-three']['content_body']; ?></p>
			</div>
		</div>
	</div>
</section><file_sep><!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>สนามฟุตบอล Play Maker | Backend</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link href="<?php echo base_url('assets/backend/css/bootstrap.min.css'); ?>" rel="stylesheet" type="text/css">
		<link href="<?php echo base_url('assets/backend/css/sb-admin.css'); ?>" rel="stylesheet" type="text/css">
		<style type="text/css">
			#page-wrapper { min-height: 600px; }
		</style>
		<script type="text/javascript" src="<?php echo base_url('assets/backend/js/jquery-1.11.0.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/backend/js/bootstrap.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/backend/js/view.'.$current_page.'.js'); ?>"></script>
	</head>
	<body>
		<div id="wrapper">
			<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="<?php echo site_url('backend/dashboard'); ?>">สนามฟุตบอล Play Maker | Backend</a>
				</div>
				<ul class="nav navbar-right top-nav">
					<li>
						<a href="javascript: void(0);"><span class="glyphicon glyphicon-user"></span>&nbsp;<?php echo $user_data['username']; ?></a>
					</li>
					<li>
						<a href="<?php echo site_url('backend/do_signout'); ?>"><span class="glyphicon glyphicon-log-out"></span>&nbsp;Logout</a>
					</li>
				</ul>
				<div class="collapse navbar-collapse navbar-ex1-collapse">
					<ul class="nav navbar-nav side-nav">
						<?php
							foreach ($menu_list as $menu) {
								$attr = ($menu['option_key'] === $current_page)? ' class="active"': NULL;
								$display = explode("|", $menu['option_value']);
						?>
						<li <?php echo $attr; ?>>
							<a href="<?php echo site_url('backend/'.$menu['option_key']); ?>"><span class="glyphicon <?php echo $display[1]; ?>"></span>&nbsp;<?php echo $display[0]; ?></a>
						</li>
						<?php } ?>
					</ul>
				</div>
			</nav>
			<div id="page-wrapper">
				<div class="container-fluid"><file_sep><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Backend extends CI_Controller {
	public function __construct() {
		parent::__construct();
	}
	
	public function index() {
		if ($this->session->userdata('user_data') === "") {
			redirect('backend/signin', 'refresh');
		} else {
			redirect('backend/dashboard', 'refresh');
		}
	}
	public function signin() {
		$params['signin_status'] = ($this->uri->segment(3))? $this->uri->segment(3): NULL;
		$this->load->view('backend/signin_view', $params);
	}
	
	public function do_signin() {
		$username = $this->input->post('input-username');
		$password = $this-><PASSWORD>->post('input-<PASSWORD>');
		$user = $this->user_model->user_authentication($username, $password);
		if (count($user) > 0) {
			$this->session->set_userdata('user_data', $user);
			redirect('backend', 'refresh');
		} else {
			redirect('backend/signin/failed', 'refresh');
		}
	}
	
	public function do_signout() {
		$this->session->sess_destroy();
		redirect('backend', 'refresh');
	}
	
	public function dashboard() {
		$params['user_data'] = $this->session->userdata('user_data');
		$params['current_page'] = ($this->uri->segment(2))? $this->uri->segment(2): 'dashboard';
		$params['menu_list'] = $this->utility_model->get_option_by_type('backend_menu');
		$this->load->view('backend/header_view', $params);
		$this->load->view('backend/dashboard_view', $params);
		$this->load->view('backend/footer_view', $params);
	}
	
	public function slider() {
		$params['user_data'] = $this->session->userdata('user_data');
		$params['current_page'] = ($this->uri->segment(2))? $this->uri->segment(2): 'dashboard';
		$params['add_photo_status'] = ($this->uri->segment(3))? $this->uri->segment(3): NULL;
		$params['menu_list'] = $this->utility_model->get_option_by_type('backend_menu');
		$params['super_sized_slider_list'] = $this->utility_model->get_option_by_type('super_sized_slider');
		$this->load->view('backend/header_view', $params);
		$this->load->view('backend/slider_view', $params);
		$this->load->view('backend/footer_view', $params);
	}
	
	public function do_insert_photo() {
		$params['user_data'] = $this->session->userdata('user_data');
		
		$config['upload_path'] = './assets/frontend/images/slider/super/';
		$config['allowed_types'] = 'gif|jpg|png';
		$config['max_size'] = '1024';
		$config['overwrite'] = false;
		$config['encrypt_name'] = true;
		
		$this->load->library('upload', $config);
		foreach($_FILES['userfile'] as $o_k => $o_v) {
			foreach($o_v as $i_k => $i_v) {
				$_FILES['userfile'.$i_k][$o_k] = $i_v;
			}
		}
		unset($_FILES['userfile']);
		foreach($_FILES as $key => $value) {
			if ($this->upload->do_upload($key)) {
				$photo = $this->upload->data();
				$sql = 'insert into pm_options values (null, now(), lower(?), now(), lower(?), ?, ?, ?, ?, ?);';
				$data = array(
						$params['user_data']['username'],
						$params['user_data']['username'],
						'super_sized_slider',
						$photo['file_name'],
						'Photo Description',
						0,
						'Y'
				);
				$query = $this->db->query($sql, $data);
				$params['update_result'] = $query;
			} else {
				$params['update_result'] = FALSE;
			}
		}
		$display = ($params['update_result'])? 'succeed': 'failed';
		redirect('backend/slider/'.$display, 'refresh');
	}
	
	public function do_edit_photo() {
		if ($this->uri->segment(3)) {
			$params['user_data'] = $this->session->userdata('user_data');
			$photo_description = $this->input->post('input-photo-description');
			$sql = 'update pm_options ';
			$sql .= 'set last_updated = now(), last_updated_by = ?, option_value = ? ';
			$sql .= 'where option_type = ? ';
			$sql .= 'and option_key = ? ';
			$sql .= 'limit 1;';
			$data = array(
				$params['user_data']['username'],
				$photo_description,
				'super_sized_slider',
				$this->uri->segment(3)
			);
			$this->db->query($sql, $data);
			redirect('backend/slider', 'refresh');
		}
	}
	
	public function do_delete_photo() {
		if ($this->uri->segment(3)) {
			$sql = 'delete from pm_options where option_type = ? and option_key = ?;';
			$data = array('super_sized_slider', $this->uri->segment(3));
			if ($this->db->query($sql, $data)) {
				if (unlink('./assets/frontend/images/slider/super/'.$this->uri->segment(3))) {
					redirect('backend/slider', 'refresh');
				}
			}
		}
	}
	
	public function contents() {
		$params['user_data'] = $this->session->userdata('user_data');
		$params['current_page'] = ($this->uri->segment(2))? $this->uri->segment(2): 'contents';
		$params['menu_list'] = $this->utility_model->get_option_by_type('backend_menu');
		$this->load->view('backend/header_view', $params);
		$this->load->view('backend/contents_view', $params);
		$this->load->view('backend/footer_view', $params);
	}
	
	public function users() {
		$params['user_data'] = $this->session->userdata('user_data');
		$params['current_page'] = ($this->uri->segment(2))? $this->uri->segment(2): 'contents';
		$params['menu_list'] = $this->utility_model->get_option_by_type('backend_menu');
		$this->load->view('backend/header_view', $params);
		$this->load->view('backend/users_view', $params);
		$this->load->view('backend/footer_view', $params);
	}
	
	public function setting() {
		$params['user_data'] = $this->session->userdata('user_data');
		$params['current_page'] = ($this->uri->segment(2))? $this->uri->segment(2): 'contents';
		$params['menu_list'] = $this->utility_model->get_option_by_type('backend_menu');
		$this->load->view('backend/header_view', $params);
		$this->load->view('backend/setting_view', $params);
		$this->load->view('backend/footer_view', $params);
	}
}

/* End of file backend.php */
/* Location: ./application/controllers/backend.php */<file_sep><!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"><![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"><![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"><![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
	<head>
		<meta charset="utf-8">
		<title><?php echo $web_meta_list['title']; ?></title>
		<meta name="description" content="<?php echo $web_meta_list['description']; ?>">
		<meta name="author" content="<?php echo $web_meta_list['author']; ?>">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/bootstrap/css/bootstrap.min.css'); ?>">
		<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:100,300,400">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/supersized/css/supersized.css'); ?>" media="screen">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/supersized/theme/supersized.shutter.css'); ?>" media="screen">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/animation-framework/animate.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/magnific-popup/magnific-popup.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/owl.carousel/owl-carousel/owl.carousel.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/owl.carousel/owl-carousel/owl.transitions.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/owl.carousel/owl-carousel/owl.theme.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/js-plugin/appear/nekoAnim.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/font-icons/custom-icons/css/custom-icons.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/css/layout.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/css/sea-green.css'); ?>">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/frontend/css/custom.css'); ?>">
		<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
		<script src="<?php echo base_url('assets/frontend/js/modernizr-2.6.1.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/respond/respond.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/jquery/jquery-1.10.2.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/jquery-ui/jquery-ui-1.8.23.custom.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/bootstrap/js/bootstrap.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/easing/jquery.easing.1.3.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/owl.carousel/owl-carousel/owl.carousel.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/magnific-popup/jquery.magnific-popup.min.js'); ?>"></script>
		<?php if ($current_view === 'home') { ?>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/supersized/js/supersized.3.2.7.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/supersized/theme/supersized.shutter.min.js'); ?>"></script>
		<script type="text/javascript">
			$(function($){
				"use strict";
				if($('#superSizedSlider').length){
					$('#superSizedSlider').height($(window).height());
					$.supersized({
						// Functionality
						slideshow               :   1,          // Slideshow on/off
						autoplay                :   1,          // Slideshow starts playing automatically
						start_slide             :   1,          // Start slide (0 is random)
						stop_loop               :   0,          // Pauses slideshow on last slide
						random                  :   0,          // Randomize slide order (Ignores start slide)
						slide_interval          :   12000,      // Length between transitions
						transition              :   1,          // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
						transition_speed        :   1000,       // Speed of transition
						new_window              :   1,          // Image links open in new window/tab
						pause_hover             :   0,          // Pause slideshow on hover
						keyboard_nav            :   1,          // Keyboard navigation on/off
						performance             :   1,          // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
						image_protect           :   1,          // Disables image dragging and right click with Javascript
						// Size & Position     
						min_width               :   0,          // Min width allowed (in pixels)
						min_height              :   0,          // Min height allowed (in pixels)
						vertical_center         :   1,          // Vertically center background
						horizontal_center       :   1,          // Horizontally center background
						fit_always              :   0,          // Image will never exceed browser width or height (Ignores min. dimensions)
						fit_portrait            :   1,          // Portrait images will not exceed browser height
						fit_landscape           :   0,          // Landscape images will not exceed browser width
						// Components       
						slide_links             :   'blank',    // Individual links for each slide (Options: false, 'num', 'name', 'blank')
						thumb_links             :   0,          // Individual thumb links for each slide
						thumbnail_navigation    :   0,          // Thumbnail navigation
						slides: [ // Slideshow Images
						<?php
						foreach ($super_sized_slider_list as $key => $value) {
							echo "{image : './assets/frontend/images/slider/super/$value[option_key]', title : '<h1>$value[option_value]</h1>', thumb : '', url : ''}";
							echo (($key + 1) !== count($super_sized_slider_list))? ',': NULL;
						}
						?>
						],
						// Theme Options               
						progress_bar: 0, // Timer for each slide     
						mouse_scrub: 0
					});
				}
			});
		</script>
		<?php } ?>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/isotope/jquery.isotope.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/isotope/jquery.isotope.sloppy-masonry.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/neko-contact-ajax-plugin/js/jquery.form.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/neko-contact-ajax-plugin/js/jquery.validate.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/parallax/js/jquery.stellar.min.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/appear/jquery.appear.js'); ?>"></script>
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js-plugin/toucheeffect/toucheffects.js'); ?>"></script>	
		<script type="text/javascript" src="<?php echo base_url('assets/frontend/js/custom.js'); ?>"></script>
	</head>
	<body class="activateAppearAnimation header5">
		<div id="globalWrapper">
			<header class="navbar-fixed-top">
				<div id="preHeader" class="hidden-xs">
					<div class="container">
						<div class="row">
							<div class="col-xs-6"></div>
							<div class="col-xs-6">
								<div id="contactBloc" class="clearfix">
									<ul class="socialNetwork">
										<?php
											foreach ($social_network_list as $social_network) {
												$social_network_item = (strpos($social_network['option_value'], '|') !== 0)? explode('|', $social_network['option_value']): $social_network['option_value'];
										?>
										<li><a href="<?php echo $social_network_item[0]; ?>" class="tips" title="follow me on <?php echo $social_network['option_key']; ?>"><i class="<?php echo $social_network_item[1]; ?>"></i></a></li>
										<?php } ?>
									</ul>
									<span class="contactPhone"><i class="icon-phone"></i><?php echo $contact_us_list['phone'];?></span>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div id="mainHeader" role="banner">
					<div class="container">
						<nav class="navbar navbar-default scrollMenu" role="navigation">
							<div class="navbar-header">
								<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
									<span class="sr-only">Toggle navigation</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<a class="navbar-brand" href="<?php echo site_url('home'); ?>"><img src="<?php echo base_url('assets/frontend/images/'.$web_meta_list['main_logo']); ?>"/></a>
							</div>
							<div class="collapse navbar-collapse" id="mainMenu">
								<ul class="nav navbar-nav pull-right">
									<?php
										foreach ($menu_list as $menu) {
											$attr = ($menu['option_key'] === $current_view)? ' active': NULL;
									?>
									<li class="primary">
										<a href="<?php echo site_url($menu['option_key']); ?>" class="firstLevel<?php echo $attr; ?>"><?php echo $menu['option_value'] ?></a>
									</li>
									<?php } ?>
								</ul>
							</div>
						</nav>
					</div>
				</div>
			</header><file_sep><div class="row">
	<div class="col-lg-12">
		<input type="hidden" id="site_url" value="<?php echo site_url(); ?>">
		<h1 class="page-header">Slider</h1>
		<ol class="breadcrumb">
			<li><a href="<?php echo site_url('backend/dashboard');?>"><span class="glyphicon glyphicon-dashboard"></span>&nbsp;Dashboard</a></li>
			<li class="active"><span class="glyphicon glyphicon-picture"></span>&nbsp;Slider</li>
		</ol>
		<p class="text-right">
			<button class="btn btn-success" data-toggle="modal" data-target="#add-photo-modal"><span class="glyphicon glyphicon-plus"></span>&nbsp;Add Photo</button>
		</p>
		<?php
			if ($add_photo_status) {
				if ($add_photo_status === 'succeed') {
					echo '<div class="alert alert-success" role="alert">Add Photo Succeed</div>';
				} else {
					echo '<div class="alert alert-danger" role="alert">Add Photo Failed</div>';
				}
			}
		?>
	</div>
</div>
<div class="row">
	<?php foreach($super_sized_slider_list as $super_sized_slider) { ?>
	<div class="col-lg-3">
		<a class="thumbnail get-photo-modal" href="#photo-modal" data-photo-description="<?php echo $super_sized_slider['option_value']; ?>" data-photo-name="<?php echo $super_sized_slider['option_key']; ?>" data-photo-row-id="<?php echo $super_sized_slider['row_id']; ?>" data-toggle="modal">
			<img alt="<?php echo $super_sized_slider['option_value']; ?>" src="<?php echo base_url('assets/frontend/images/slider/super/'.$super_sized_slider['option_key']); ?>">
        </a>
	</div>
	<?php } ?>
</div>
<div class="modal fade" id="add-photo-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<form enctype="multipart/form-data" action="<?php echo site_url('backend/do_insert_photo'); ?>" accept-charset="utf-8" method="post" role="form">
				<div class="modal-header">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<h4 id="myModalLabel" class="modal-title">Add Photo</h4>
				</div>
				<div class="modal-body">
					<div class="form-group">
						<input type="file" multiple="" name="userfile[]">
					</div>
				</div>
				<div class="modal-footer">
					<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
					<input type="submit" value="Save Changes" name="input-add-photos" class="btn btn-primary">
				</div>
			</form>
		</div>
	</div>
</div>
<div class="modal fade" id="photo-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title" id="myModalLabel">Photo</h4>
			</div>
			<div class="modal-body">
				<div class="row">
					<div class="col-xs-7"></div>
					<div class="col-xs-5">
						<div class="text-right">
							<div class="btn-group btn-group-sm">
								<a class="btn btn-default" id="edit-photo-description" href="javascript: void(0);">Edit</a>
								<a class="btn btn-default" id="do-delete-photo" href="">Delete This Photo</a>
							</div>
						</div>
						<form class="form-horizontal" role="form" method="post" accept-charset="utf-8" action="" id="edit-photo-description-form">
							<label for="input-photo-description">Photo description:</label>
							<textarea class="form-control" rows="4" name="input-photo-description" id="input-photo-description"></textarea>
							<br>
							<input class="btn btn-primary" name="input-edit-photo" type="submit" value="Save Changes">
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div><file_sep><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Content_Model extends CI_Model {

	public function __construct() {
		parent::__construct();
	}

	public function get_content_by_type($in_option_type, $in_rebuild_flag = 'n') {
		$sql = "select row_id, content_type, alias_name, content_header, content_body, content_media, active_flag ";
		$sql .= "from pm_contents ";
		$sql .= "where content_type = 'home' ";
		$sql .= "and active_flag = 'Y' ";
		$sql .= "order by row_id, alias_name;";
		$query = $this->db->query($sql, $in_option_type);
		if ($in_rebuild_flag === 'n') {
			return $query->result_array();
		} else {
			foreach ($query->result_array() as $row) {
				$result_array[$row['alias_name']] = $row;
			}
			return $result_array;
		}
	}
}

/* End of file content_model.php */
/* Location: ./application/models/content_model.php */<file_sep><section id="page">
	<header class="page-header">
		<div class="container">
			<div class="row">
				<div class="col-sm-6">
					<h1><?php echo ucwords(str_replace('-', ' ', $current_view)); ?></h1>
					<p>Lorem ipsum dolor sit amet,</p>
				</div>
				<div class="col-sm-6 hidden-xs">
					<ul id="navTrail">
						<li><a href="index.html">Home</a></li>
						<li id="navTrailLast"><?php echo ucwords(str_replace('-', ' ', $current_view)); ?></li>
					</ul>
				</div>
			</div>
		</div>
	</header>
	<section id="content" class="mt30 pb30">
		<div class="container">
			<div class="row">
				<div class="col-md-8">
					<article class="post clearfix">
						<div class="postPic">
							<div class="imgBorder mb15">
								<a href="blog-post.html"><img src="<?php echo base_url('assets/frontend/images/blog/blog-pic2.jpg'); ?>" alt="" class="img-responsive"/></a>
							</div>
						</div>
						<div class="row">
							<section class="col-sm-12 col-xs-12">
								<h2><a href="blog-post.html">Okay, Houston, we’ve had a problem here</a></h2>
								<p>
									Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor lacus ac justo varius in vehicula nibh mattis. Aenean ac diam metus. Aliquam tempor tincidunt pretium. Suspendisse bibendum, sapien venenatis vestibulum commodo, eros lectus iaculis magna, sit amet pellentesque ligula turpis a nibh... <a href="blog-post.html" class="readMore">read more</a>
								</p>
								<ul class="entry-meta">
									<li class="entry-date"><a href="#"><i class="icon-pin"></i>&nbsp;12 Oct. 2027</a></li>
									<li class="entry-author"><a href="#"><i class="icon-male"></i>&nbsp;Admin</a></li>
								</ul>
							</section>
						</div>
					</article>
					<hr class="lineLines mb40 mt30">
					<article class="post clearfix">
						<div class="postPic">
							<div class="imgBorder mb15">
								<a href="blog-post.html"><img src="<?php echo base_url('assets/frontend/images/blog/blog-pic2.jpg'); ?>" alt="" class="img-responsive"/></a>
							</div>
						</div>
						<div class="row">
							<section class="col-sm-12 col-xs-12">
								<h2><a href="blog-post.html">I feel fine. How about you?</a></h2>
								<p>
									Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor lacus ac justo varius in vehicula nibh mattis. Aenean ac diam metus. Aliquam tempor tincidunt pretium. Suspendisse bibendum, sapien venenatis vestibulum commodo, eros lectus iaculis magna, sit amet pellentesque ligula turpis a nibh... <a href="blog-post.html" class="readMore">read more</a>
								</p>
								<ul class="entry-meta">
									<li class="entry-date"><a href="#"><i class="icon-pin"></i>&nbsp;12 Oct. 2027</a></li>
									<li class="entry-author"><a href="#"><i class="icon-male"></i>&nbsp;Admin</a></li>
								</ul>
							</section>
						</div>
					</article>
				</div>
				<!-- Sidebar -->
				<aside class="col-md-4">
					<section>
						<h1>Latest news from planet earth</h1>
						<p>Nullam sed tortor odio. Suspendisse tincidunt dictum nisi, nec convallis odio lacinia ac. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.</p>
					</section>
					<section class="widget">
						<h3>Categories</h3>
						<ul class="list-unstyled iconList">
							<li><a href="#">Solace of a lonely highway</a></li>
							<li><a href="#">Write with purpose</a></li>
							<li><a href="#">Tree on a lake</a></li>
							<li><a href="#">Don’t stop questioning</a></li>
							<li><a href="#">Overheard this morning</a></li>
						</ul>
					</section>
					<section class="widget">
						<h3>Archives</h3>
						<ul class="list-unstyled iconList">
							<li><a href="#">March 2012</a></li>
							<li><a href="#">September 2011</a></li>
							<li><a href="#">July 2011</a></li>
							<li><a href="#">June 2011</a></li>
						</ul>
					</section>
				</aside>
			</div>
		</div>
	</section>
</section><file_sep><?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$route['home'] = 'frontend/home';
$route['(playmaker-academy|rate-and-promotion)'] = 'frontend/home/content';
$route['(league-and-tournament|new-and-event)'] = 'frontend/home/list_content';
$route['contact-us'] = 'frontend/home/contact_us';
$route['404_override'] = '';

/* End of file routes.php */
/* Location: ./application/config/routes.php */<file_sep>			<footer id="footerWrapper" class="footer3">
				<section id="mainFooter">
					<div class="container">
						<div class="row">
							<div class="col-sm-12">
								<div class="footerWidget text-center">
									<h1 class="bigTitle text-center"><?php echo $contact_us_list['phone'];?></h1> 
									<address class="text-center"><?php echo $contact_us_list['address'];?></address>
									<ul class="socialNetwork">
										<?php
											foreach ($social_network_list as $social_network) {
												$social_network_item = (strpos($social_network['option_value'], '|') !== 0)? explode('|', $social_network['option_value']): $social_network['option_value'];
										?>
										<li><a href="<?php echo $social_network_item[0]; ?>" class="tips" title="" data-original-title="follow me on <?php echo $social_network['option_key']; ?>"><i class="<?php echo $social_network_item[1]; ?> iconRounded iconSmall"></i></a></li>
										<?php } ?>
									</ul>    
								</div>
							</div>
						</div>
					</div>
				</section>
				<section id="footerRights">
					<div class="container">
						<div class="row">
							<div class="col-md-12">
								<p>Copyright &copy; 2014 <a href="<?php echo site_url('/'); ?>" target="blank"><?php echo $web_meta_list['copyright']; ?></a> / All rights reserved.</p> 
							</div>
						</div>
					</div>
				</section>
			</footer>
		</div>
	</body>
</html><file_sep><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Utility_Model extends CI_Model {

	public function __construct() {
		parent::__construct();
	}

	public function get_option_by_type($in_option_type, $in_rebuild_flag = 'n') {
		$sql = "select row_id, option_key, option_value ";
		$sql .= "from pm_options ";
		$sql .= "where option_type = lower(?) ";
		$sql .= "order by option_sequence, option_key";
		$query = $this->db->query($sql, $in_option_type);
		if ($in_rebuild_flag === 'n') {
			return $query->result_array();
		} else {
			foreach ($query->result_array() as $row) {
				$result_array[$row['option_key']] = $row['option_value'];
			}
			return $result_array;
		}
	}
	
	public function get_default_language($arg) {
		if ($arg === FALSE) {
			$default_language = $this->get_option_by_type('default_language', 'customize');
			return $default_language['language'];
		} else {
			return $arg;
		}
	}
}

/* End of file utility_model.php */
/* Location: ./application/models/utility_model.php */<file_sep><div class="row">
	<div class="col-lg-12">
		<h1 class="page-header">Users</h1>
		<ol class="breadcrumb">
			<li><a href="<?php echo site_url('backend/dashboard');?>"><span class="glyphicon glyphicon-dashboard"></span>&nbsp;Dashboard</a></li>
			<li class="active"><span class="glyphicon glyphicon-user"></span>&nbsp;Users</li>
		</ol>
	</div>
</div><file_sep><?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$route['home'] = 'frontend/index';
$route['contact-us'] = 'frontend/contact_us';
$route['(playmaker-academy|rate-and-promotion)'] = 'frontend/content';
$route['(league-and-tournament|new-and-event)'] = 'frontend/list_content';
$route['default_controller'] = 'frontend';
$route['404_override'] = '';

/* End of file routes.php */
/* Location: ./application/config/routes.php */<file_sep><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_Model extends CI_Model {

	public function __construct() {
		parent::__construct();
	}

	public function user_authentication($in_user_login, $in_user_password) {
		$sql = "select u.row_id user_id, u.username, u.password, u.last_signin ";
		$sql .= "from pm_users u ";
		$sql .= "where u.username = ? ";
		$sql .= "and u.password = md5(?) ";
		$sql .= "limit 1";
		$query = $this->db->query($sql, array($in_user_login, $in_user_password));
		return $query->row_array();
	}
}

/* End of file user_model.php */
/* Location: ./application/models/user_model.php */<file_sep><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Frontend extends CI_Controller {
	public function __construct() {
		parent::__construct();
	}
	
	public function index() {
		$params['current_view'] = ($this->uri->segment(1))? $this->uri->segment(1): 'home';
		$params['web_meta_list'] = $this->utility_model->get_option_by_type('web_meta', 'y');
		$params['contact_us_list'] = $this->utility_model->get_option_by_type('contact_us', 'y');
		$params['social_network_list'] = $this->utility_model->get_option_by_type('social_network');
		$params['menu_list'] = $this->utility_model->get_option_by_type('menu');
		$params['super_sized_slider_list'] = $this->utility_model->get_option_by_type('super_sized_slider');
		$params['content_list'] = $this->content_model->get_content_by_type('super_sized_slider', 'y');
// 		echo '<pre>';
// 		print_r($params);
// 		echo '</pre>';
		$this->load->view('frontend/header_view', $params);
		$this->load->view('frontend/home_view', $params);
		$this->load->view('frontend/footer_view', $params);
	}
	
	public function content() {
		$params['current_view'] = ($this->uri->segment(1))? $this->uri->segment(1): 'home';
		$params['web_meta_list'] = $this->utility_model->get_option_by_type('web_meta', 'y');
		$params['contact_us_list'] = $this->utility_model->get_option_by_type('contact_us', 'y');
		$params['social_network_list'] = $this->utility_model->get_option_by_type('social_network');
		$params['menu_list'] = $this->utility_model->get_option_by_type('menu');
		$this->load->view('frontend/header_view', $params);
		$this->load->view('frontend/content_view', $params);
		$this->load->view('frontend/footer_view', $params);
	}
	
	public function list_content() {
		$params['current_view'] = ($this->uri->segment(1))? $this->uri->segment(1): 'home';
		$params['web_meta_list'] = $this->utility_model->get_option_by_type('web_meta', 'y');
		$params['contact_us_list'] = $this->utility_model->get_option_by_type('contact_us', 'y');
		$params['social_network_list'] = $this->utility_model->get_option_by_type('social_network');
		$params['menu_list'] = $this->utility_model->get_option_by_type('menu');
		$this->load->view('frontend/header_view', $params);
		$this->load->view('frontend/list_content_view', $params);
		$this->load->view('frontend/footer_view', $params);
	}
	
	public function contact_us() {
		$params['current_view'] = ($this->uri->segment(1))? $this->uri->segment(1): 'home';
		$params['web_meta_list'] = $this->utility_model->get_option_by_type('web_meta', 'y');
		$params['contact_us_list'] = $this->utility_model->get_option_by_type('contact_us', 'y');
		$params['social_network_list'] = $this->utility_model->get_option_by_type('social_network');
		$params['menu_list'] = $this->utility_model->get_option_by_type('menu');
		$this->load->view('frontend/header_view', $params);
		$this->load->view('frontend/contact_us_view', $params);
		$this->load->view('frontend/footer_view', $params);
	}
}

/* End of file frontend.php */
/* Location: ./application/controllers/frontend.php */