Skip to content

Commit 1271ea3

Browse files
author
Shaun Kutch
committed
reports styles updated
1 parent f253761 commit 1271ea3

File tree

7 files changed

+67
-41
lines changed

7 files changed

+67
-41
lines changed

application/controllers/config.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ function mailchimpinfo()
1919

2020
function save()
2121
{
22-
if ($key = $this->input->post('mc_api_key')) {
23-
$this->load->library('MailChimp', array('api_key'=>$key), 'MailChimp');
24-
$success = ($this->MailChimp->ping() === "Everything's Chimpy!");
25-
$mc_message = $success ? 'Connected to MailChimp! '
26-
: "Unable to connect to MailChimp. Please check your connection and your API key. ";
27-
$validated_api_key = $success ? $this->input->post('mc_api_key') : '';
28-
}
2922

3023
$batch_save_data=array(
3124
'company'=>$this->input->post('company'),
@@ -41,7 +34,6 @@ function save()
4134
'return_policy'=>$this->input->post('return_policy'),
4235
'language'=>$this->input->post('language'),
4336
'timezone'=>$this->input->post('timezone'),
44-
'mc_api_key'=>$validated_api_key,
4537
'print_after_sale'=>$this->input->post('print_after_sale')
4638
);
4739

application/libraries/report_service.php

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ function graphical_summary_sales($start_date, $end_date, $sale_type)
266266
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type))
267267
);
268268

269-
//$this->_display($this->CI->load->view("reports/graphical",$data,true));
270-
$this->renderData = array('view'=>'reports/graphical', 'data'=>$data);
269+
$this->_display($this->CI->load->view("reports/graphical",$data,true));
271270
return $this;
272271
}
273272

@@ -806,6 +805,30 @@ function inventory_summary($export_excel=0)
806805
$this->renderData = array('view'=>'partial/tabular_report', 'data'=>$data);
807806
return $this;
808807
}
808+
809+
/**
810+
* Sets the option to suppress echo and return HTML.
811+
*
812+
* @param bool $val
813+
*/
814+
public function setSuppressEcho($val)
815+
{
816+
$this->_suppressEcho = $val;
817+
}
818+
819+
/**
820+
* We want the option to retain the HTML from the helper instead of echoing it out.
821+
* @param string $html
822+
*/
823+
private function _display($html)
824+
{
825+
if ($this->_suppressEcho) {
826+
return $html;
827+
} else {
828+
echo $html;
829+
return true;
830+
}
831+
}
809832

810833
public function render()
811834
{
@@ -821,5 +844,7 @@ public function loadWithView($view)
821844
{
822845
$data = array('report_service'=>$this);
823846
$this->CI->load->view($view,$data);
824-
}
847+
}
848+
849+
825850
}

application/models/appconfig.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ function save($key,$value)
5050
function batch_save($data)
5151
{
5252
$success=true;
53-
var_dump($data);
54-
exit;
53+
5554
//Run these queries as a transaction, we want to make sure we do all or nothing
5655
$this->db->trans_start();
5756
foreach($data as $key=>$value)
5857
{
5958
if(!$this->save($key,$value))
6059
{
60+
var_dump($key);
61+
exit;
6162
$success=false;
6263
break;
6364
}

application/views/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@
277277
{
278278
if(response.success)
279279
{
280-
set_feedback(response.message,'success_message',false);
280+
set_feedback(response.message,'success',false);
281281
}
282282
else
283283
{
284-
set_feedback(response.message,'error_message',true);
284+
set_feedback(response.message,'error',true);
285285
}
286286
},
287287
dataType:'json'

application/views/reports/date_input.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php $this->load->view("partial/header"); ?>
2-
<div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang->line('reports_report_input'); ?></div>
2+
<h1><?php echo $this->lang->line('reports_report_input'); ?></h1>
3+
<hr>
34
<?php
45
if(isset($error))
56
{
@@ -9,30 +10,30 @@
910
<?php echo form_label($this->lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?>
1011
<div id='report_date_range_simple'>
1112
<input type="radio" name="report_type" id="simple_radio" value='simple' checked='checked'/>
12-
<?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '', 'id="report_date_range_simple"'); ?>
13+
<?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '', 'id="report_date_range_simple" class="selectpicker" data-width="auto"'); ?>
1314
</div>
1415

1516
<div id='report_date_range_complex'>
1617
<input type="radio" name="report_type" id="complex_radio" value='complex' />
17-
<?php echo form_dropdown('start_month',$months, $selected_month, 'id="start_month"'); ?>
18-
<?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day"'); ?>
19-
<?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year"'); ?>
18+
<?php echo form_dropdown('start_month',$months, $selected_month, 'id="start_month" class="selectpicker" data-width="auto"'); ?>
19+
<?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day" class="selectpicker" data-width="auto"'); ?>
20+
<?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year" class="selectpicker" data-width="auto"'); ?>
2021
-
21-
<?php echo form_dropdown('end_month',$months, $selected_month, 'id="end_month"'); ?>
22-
<?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day"'); ?>
23-
<?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year"'); ?>
22+
<?php echo form_dropdown('end_month',$months, $selected_month, 'id="end_month" class="selectpicker" data-width="auto"'); ?>
23+
<?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day" class="selectpicker" data-width="auto"'); ?>
24+
<?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year" class="selectpicker" data-width="auto"'); ?>
2425
</div>
2526

2627
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?>
2728
<div id='report_sale_type'>
28-
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'), 'sales' => $this->lang->line('reports_sales'), 'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type"'); ?>
29+
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'), 'sales' => $this->lang->line('reports_sales'), 'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type" class="selectpicker" data-width="auto"'); ?>
2930
</div>
3031
<?php
3132
echo form_button(array(
3233
'name'=>'generate_report',
3334
'id'=>'generate_report',
3435
'content'=>$this->lang->line('common_submit'),
35-
'class'=>'submit_button')
36+
'class'=>'btn btn-primary submit_button')
3637
);
3738
?>
3839

@@ -41,6 +42,8 @@
4142
<script type="text/javascript" language="javascript">
4243
$(document).ready(function()
4344
{
45+
$('.selectpicker').selectpicker();
46+
4447
$("#generate_report").click(function()
4548
{
4649
var sale_type = $("#sale_type").val();

application/views/reports/date_input_excel_export.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
<?php echo form_label($this->lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?>
1010
<div id='report_date_range_simple'>
1111
<input type="radio" name="report_type" id="simple_radio" value='simple' checked='checked'/>
12-
<?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '', 'id="report_date_range_simple"'); ?>
12+
<?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '', 'id="report_date_range_simple" class="selectpicker" data-width="auto"'); ?>
1313
</div>
1414

1515
<div id='report_date_range_complex'>
1616
<input type="radio" name="report_type" id="complex_radio" value='complex' />
17-
<?php echo form_dropdown('start_month',$months, $selected_month, 'id="start_month"'); ?>
18-
<?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day"'); ?>
19-
<?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year"'); ?>
17+
<?php echo form_dropdown('start_month',$months, $selected_month, 'id="start_month" class="selectpicker" data-width="auto"'); ?>
18+
<?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day" class="selectpicker" data-width="auto"'); ?>
19+
<?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year" class="selectpicker" data-width="auto"'); ?>
2020
-
21-
<?php echo form_dropdown('end_month',$months, $selected_month, 'id="end_month"'); ?>
22-
<?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day"'); ?>
23-
<?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year"'); ?>
21+
<?php echo form_dropdown('end_month',$months, $selected_month, 'id="end_month" class="selectpicker" data-width="auto"'); ?>
22+
<?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day" class="selectpicker" data-width="auto"'); ?>
23+
<?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year" class="selectpicker" data-width="auto"'); ?>
2424
</div>
2525

2626
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?>
2727
<div id='report_sale_type'>
28-
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'), 'sales' => $this->lang->line('reports_sales'), 'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type"'); ?>
28+
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'), 'sales' => $this->lang->line('reports_sales'), 'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type" class="selectpicker" data-width="auto"'); ?>
2929
</div>
3030

3131
<div>
@@ -38,7 +38,7 @@
3838
'name'=>'generate_report',
3939
'id'=>'generate_report',
4040
'content'=>$this->lang->line('common_submit'),
41-
'class'=>'submit_button')
41+
'class'=>'btn btn-primary submit_button')
4242
);
4343
?>
4444

@@ -47,6 +47,8 @@
4747
<script type="text/javascript" language="javascript">
4848
$(document).ready(function()
4949
{
50+
$('.selectpicker').selectpicker();
51+
5052
$("#generate_report").click(function()
5153
{
5254
var sale_type = $("#sale_type").val();

application/views/reports/graphical.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
$this->load->view("partial/header");
33
?>
4-
<div id="page_title" style="margin-bottom:8px;"><?php echo $title ?></div>
5-
<div id="page_subtitle" style="margin-bottom:8px;"><?php echo $subtitle ?></div>
4+
<h1>
5+
<?php echo $title ?>
6+
<small><?php echo $subtitle ?></small>
7+
</h1>
8+
<hr>
69
<div style="text-align: center;">
710
<script type="text/javascript">
811
swfobject.embedSWF(
@@ -14,11 +17,11 @@
1417
<div id="chart_wrapper">
1518
<div id="chart"></div>
1619
</div>
17-
<div id="report_summary">
18-
<?php foreach($summary_data as $name=>$value) { ?>
19-
<div class="summary_row"><?php echo $this->lang->line('reports_'.$name). ': '.to_currency($value); ?></div>
20-
<?php }?>
21-
</div>
20+
<ul class="list-group">
21+
<?php foreach($summary_data as $name=>$value) { ?>
22+
<li class="list-group-item"><?php echo $this->lang->line('reports_'.$name). ': '.to_currency($value); ?></li>
23+
<?php }?>
24+
</ul>
2225
<div id="feedback_bar"></div>
2326
<?php
2427
$this->load->view("partial/footer");

0 commit comments

Comments
 (0)