<!DOCTYPE html>
<html lang="en">
<head>
	<!-- header -->
		<?php $this->load->view('admin/common_header'); ?>
	<!-- /header -->


	<!-- file upload JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/uploaders/fileinput.min.js"></script>

	<!-- date picker JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/interactions.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/widgets.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/effects.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/extensions/mousewheel.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/globalize/globalize.js"></script>

	<!-- Bootsrap swith and validation css files -->	
	<link href="<?php echo base_url();?>/assets/boots/css/bootstrap-switch.css" rel="stylesheet" type="text/css">
	<link href="<?php echo base_url();?>/assets/boots/css/formValidation.min.css" rel="stylesheet" type="text/css">
	
	<!-- Bootsrap form validation JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/formValidation.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.js"></script>
	

	<!-- Theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/app.js"></script>
	<!-- /theme JS files -->

	<!-- date picker JS files 
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/jqueryui_forms.js"></script>-->

	
	
	<!-- bootsrap switch checkbox JS files -->
    <script src="<?php echo base_url();?>/assets/boots/js/bootstrap-switch.js"></script>

    <!-- notify JS files -->
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/jgrowl.min.js"></script>

</head>

<body class="navbar-top-md-md">
	<!-- <div class="pre_loader"></div> -->
	<!-- Fixed navbars wrapper -->
	<div class="navbar-fixed-top">

		<!-- Main navbar -->
		<?php $this->load->view('admin/mainnav'); ?>
		<!-- /main navbar -->


		<!-- Second navbar -->
		<?php $this->load->view('admin/secondnav'); ?>
		<!-- /second navbar -->

	</div>
	<!-- /fixed navbars wrapper -->


	<!-- Page header -->
	<div class="page-header">
		<div class="page-header-content">
			<div class="page-title">
				<h4><i id="icon-bck" class="icon-arrow-left52 position-left"></i> <span class="text-semibold"><?php echo $this->lang->line('statistics_page_title'); ?></span></h4>

				<ul class="breadcrumb breadcrumb-caret position-right">
					<?php foreach ($breadcrumbs as $breadcrumb) { if(isset($breadcrumb['href'])){?>
					    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
					<?php } else { ?> <li><?php echo $breadcrumb['text']; ?></li><?php } } ?>
				</ul>
			</div>
			<?php $this->load->view('admin/'.$module_name.'_header'); ?>
		</div>
	</div>
	<!-- /page header -->
	
	<!-- Page container -->
	<div class="page-container">

		<!-- Page content -->
		<div class="page-content">

			<!-- Main content -->
			<div class="content-wrapper">

				<!-- Horizontal form -->
				<div class="panel panel-flat">
					<div class="panel-heading">
						<h5 class="panel-title"><?php echo $this->lang->line('statistics_page_title'); ?></h5>
						<div class="heading-elements">
							<ul class="icons-list">
		                		<li><a data-action="collapse"></a></li>
		                		<li><a data-action="close"></a></li>
		                	</ul>
	                	</div>
                	</div>
                	
					<div class="panel-body">
						<form class="form-horizontal statistics" action="<?php echo $action;?>" method="post">
							<?php 
								if(validation_errors()) { 
									$form_err_data = str_replace('<p>', '', validation_errors());
									$form_err_data = str_replace('</p>', '', $form_err_data);
									$form_err_data = str_replace('.', '', $form_err_data);
								}
							?>

							<div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_started'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_started_date" <?php if($show_started_date==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						    </div>

						    <div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_running_days'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_running_days" <?php if($show_running_days==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						    </div>

						    <div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_total_accounts'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_total_accounts" <?php if($show_total_accounts==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						    </div>

						    <div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_active_accounts'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_active_accounts" <?php if($show_active_accounts==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						    </div>

						    <div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_deposited_funds'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_deposited_funds" <?php if($show_deposited_funds==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						   	</div>

						   	<div class="form-group">
                               	<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('lbl_show_withdraw_funds'); ?></label>
                                <div class="col-lg-2">
	                                <div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" name="show_deposited_funds" <?php if($show_withdraw_funds==='1'){ echo 'checked="checked"'; } ?> data-on-color="success" data-off-color="danger" class="switchery" data-on-text="<?php echo $this->lang->line('lbl_show'); ?>" data-off-text="<?php echo $this->lang->line('lbl_hide'); ?>" value="1">
										</label>
								    </div>
							    </div>
						   	</div>

						   	<input type="hidden" name="status" value="1"/>

							<div class="text-right col-lg-5">
								<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('button_update'); ?> <i class="icon-arrow-right14 position-right"></i></button>
							</div>
						</form>
					</div>
				</div>
				<!-- /horizotal form -->

			</div>
			<!-- /main content -->

		</div>
		<!-- /page content -->
		

		<!-- Footer -->
		<div class="footer text-muted">
			<?php echo site_footer();?>
		</div>
		<!-- /footer -->

	</div>
	<!-- /page container -->

	<script type="text/javascript">
	jQuery.noConflict();
	(function( $ ) {
	$(function() {

		$(document).ready(function() {

			$.jGrowl.defaults.closer = false;

			/*  Return form errors */
			<?php if(isset($form_err_data)) { ?>
				$.jGrowl('<?php echo trim($form_err_data);?>', {
		            header: '<?php echo $this->lang->line("error");?>',
		            theme: 'bg-danger'
		        });
			<?php } ?>

			<?php if($this->session->flashdata('error_message')) { ?>
				$.jGrowl("<?php echo $this->session->flashdata('error_message');?>", {
		            header: '<?php echo $this->lang->line("error");?>',
		            theme: 'bg-danger'
		        });
            <?php } ?>
                    
            <?php if($this->session->flashdata('success_message')) { ?>
                $.jGrowl("<?php echo $this->session->flashdata('success_message');?>", {
		            header: '<?php echo $this->lang->line("success");?>',
		            theme: 'bg-success'
		        });
            <?php } ?>

            
		    $('.statistics').formValidation({
		    	framework: 'bootstrap',
		    	excluded: [':disabled'],
		        icon: {
		            // valid: 'glyphicon glyphicon-ok',
		            // invalid: 'glyphicon glyphicon-remove',
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        row: {
				    // valid: 'has-success1',
				    invalid: 'has-error'
				},
		        fields: {
		            name: {
		                message: '<?php echo $this->lang->line("site_name_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_name_empty");?>'
		                    },
		                    stringLength: {
		                        min: 4,
		                        message: '<?php echo $this->lang->line("site_name_min");?>'
		                    },
		                    regexp: {
		                        regexp: /^[a-z\d\-\s]+$/i,
		                        message: '<?php echo $this->lang->line("site_name_must");?>'
		                    }
		                }
		            },
		            url: {
		                validators: {
		                	notEmpty: {
		                        message: '<?php echo $this->lang->line("site_url_empty");?>'
		                    },
		                    refexp: {
		                    	regexp: /^[`~,.<>;':"\/\[\]\|{}()=_+-]/,
		                    	message: '<?php echo $this->lang->line("site_name_must");?>'
		                    },
		                    uri: {
		                        message: '<?php echo $this->lang->line("site_url_valid");?>'
		                    },

		                }
		            },
		            logo: {
			            validators: {
			                file: {
			                    extension: 'jpg,jpeg,png,gif',
			                    type: 'image/jpg,image/jpeg,image/png, image/png',
			                    message: '<?php echo $this->lang->line("site_log_must");?>'
			                }
			            }
			        },
		            start_date: {
		                message: '<?php echo $this->lang->line("site_date_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_start_date_empty");?>'
		                    }
		                }
		            },
		            meta_title: {
		                message: '<?php echo $this->lang->line("site_meta_title_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_meta_title_empty");?>'
		                    },
		                    stringLength: {
		                        min: 6,
		                        message: '<?php echo $this->lang->line("site_meta_title_min");?>'
		                    }
		                }
		            },
		            meta_key: {
		                message: '<?php echo $this->lang->line("site_meta_key_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_meta_key_empty");?>'
		                    },
		                    stringLength: {
		                        min: 6,
		                        message: '<?php echo $this->lang->line("site_meta_key_min");?>'
		                    }
		                }
		            },
		            meta_description: {
		                message: '<?php echo $this->lang->line("site_met_desc_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_meta_desc_empty");?>'
		                    },
		                    stringLength: {
		                        min: 5,
		                        message: '<?php echo $this->lang->line("site_meta_desc_min");?>'
		                    }
		                }
		            },
		            analytical_code: {
		                message: '<?php echo $this->lang->line("site_analytical_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_analytical_empty");?>'
		                    },
		                    stringLength: {
		                        min: 10,
		                        message: '<?php echo $this->lang->line("site_analytical_min");?>'
		                    }
		                }
		            },
		            offline_msg: {
		                message: '<?php echo $this->lang->line("site_off_msg_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("site_off_msg_empty");?>'
		                    },
		                    stringLength: {
		                        min: 10,
		                        message: '<?php echo $this->lang->line("site_off_msg_min");?>'
		                    }
		                }
		            }
		        }
		    })
			
		});
	    
	    $(".file-input-extensions").fileinput({
		    uploadUrl: "http://localhost/file-upload-single/1", // server upload action
		    uploadAsync: false,
		    minFileCount: 1,
		    maxFileCount: 1,
		    overwriteInitial: true,
		    showUpload: false,
		    <?php if(isset($this->data['site_logo'])) { ?>
		    	initialPreview: ["../content/site/<?php echo $this->data['site_logo'];  ?>"],
		    	initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
		    	initialPreviewFileType: 'image', // image is the default and can be overridden in config below
		    <?php } ?>
		    allowedFileExtensions: ["jpg", "gif", "png", "jpeg"],
		    uploadExtraData: {
		        img_key: "1000"
		    }
		});
		
	    $(".switchery").bootstrapSwitch();

	    $('#icon-bck').on('click',function() {
			window.history.back();
		});

		$(window).load(function() {
			$(".pre_loader").fadeOut("slow");;
		});

	});
	})(jQuery);

	
	</script>

</body>
</html>
