lbs71 - Version 0.1.0

Version Notes

First Version of 71lbs magento extension

Download this release

Release Info

Developer Jose
Extension lbs71
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/lbs71/Adminrefunds/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Lbs71_Adminrefunds_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
app/code/community/lbs71/Adminrefunds/controllers/AdminRefundsController.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Lbs71_Adminrefunds_AdminrefundsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ //Form template
7
+ $this->loadLayout()->_setActiveMenu('lbs71/example');
8
+
9
+ //create a text block with the name of "example-block"
10
+ $block = $this->getLayout()->createBlock('core/template', 'example-block')->
11
+ setTemplate('adminrefunds/loginform.phtml');
12
+
13
+ $this->_addContent($block);
14
+
15
+ $this->renderLayout();
16
+ }
17
+
18
+ public function postAction(){
19
+
20
+ //Form template
21
+ $this->loadLayout()->_setActiveMenu('lbs71/example');
22
+
23
+ //create a text block with the name of "example-block"
24
+ $block = $this->getLayout()->createBlock('core/template', 'example-block')->
25
+ setTemplate('adminrefunds/refunds.phtml');
26
+
27
+ $this->_addContent($block);
28
+ $this->renderLayout();
29
+
30
+ $email = '';
31
+ $password = '';
32
+
33
+
34
+
35
+ }
36
+
37
+ public function aboutAction(){
38
+ //Form template
39
+ $this->loadLayout()->_setActiveMenu('lbs71/example');
40
+
41
+ //create a text block with the name of "example-block"
42
+ $block = $this->getLayout()->createBlock('core/template', 'example-block')->
43
+ setTemplate('adminrefunds/about.phtml');
44
+
45
+ $this->_addContent($block);
46
+ $this->_setActiveMenu('lbs71/about');
47
+ $this->renderLayout();
48
+ }
49
+ }
app/code/community/lbs71/Adminrefunds/etc/adminhtml.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <lbs71 translate="title" module="lbs71_adminrefunds">
4
+ <title>71Lbs</title>
5
+ <sort_order>1</sort_order>
6
+ <children>
7
+ <example>
8
+ <title>View Refunds</title>
9
+ <sort_order>1</sort_order>
10
+ <action>adminhtml/adminrefunds/index</action>
11
+ </example>
12
+ </children>
13
+ <children>
14
+ <about>
15
+ <title>About</title>
16
+ <sort_order>2</sort_order>
17
+ <action>adminhtml/adminrefunds/about</action>
18
+ </about>
19
+ </children>
20
+ </lbs71>
21
+ </menu>
22
+
23
+ <acl>
24
+ <resources>
25
+ <admin>
26
+ <children>
27
+ <lbs71 translate="title" module="lbs71_adminrefunds">
28
+ <title>Top Level 71lbs Refunds Menu Item</title>
29
+ <sort_order>1</sort_order>
30
+ <children>
31
+ <example>
32
+ <title>Refunds Menu Item</title>
33
+ </example>
34
+ </children>
35
+ <children>
36
+ <about>
37
+ <title>About Menu Item</title>
38
+ </about>
39
+ </children>
40
+ </lbs71>
41
+ </children>
42
+ </admin>
43
+ </resources>
44
+ </acl>
45
+
46
+ </config>
app/code/community/lbs71/Adminrefunds/etc/config.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Lbs71_Adminrefunds>
5
+ <version>1.0.0</version>
6
+ </Lbs71_Adminrefunds>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <adminhtml>
11
+ <args>
12
+ <modules>
13
+ <Lbs71_Adminrefunds after="Mage_Adminhtml">Lbs71_Adminrefunds</Lbs71_Adminrefunds>
14
+ </modules>
15
+ </args>
16
+ </adminhtml>
17
+ </routers>
18
+ </admin>
19
+
20
+ <global>
21
+ <helpers>
22
+ <lbs71_adminrefunds>
23
+ <class>Lbs71_Adminrefunds_Helper</class>
24
+ </lbs71_adminrefunds>
25
+ </helpers>
26
+ </global>
27
+ </config>
app/design/adminhtml/default/default/layout/lbs71_refunds.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <adminhtml_adminrefunds_index>
4
+ <reference name="content">
5
+ <block type="lbs71_refunds/adminhtml_form" name="form" template="lbs71/loginform.phtml" />
6
+ </reference>
7
+ </adminhtml_adminrefunds_index>
8
+ </layout>
app/design/adminhtml/default/default/template/adminrefunds/about.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <iframe src="https://www.71lbs.com/about" width="100%" height="250">
2
+ <p>Your browser does not support iframes.</p>
3
+ </iframe>
4
+ <a href="https://www.71lbs.com/" target="_blank">More Information</a>
app/design/adminhtml/default/default/template/adminrefunds/loginform.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $user = Mage::getSingleton('admin/session')->getUser();
3
+ ?>
4
+ <div class="content-header">
5
+ <table cellspacing="0" class="grid-header">
6
+ <tr>
7
+ <td><h3><?= $this->__('71lbs Login form') ?></h3></td>
8
+ <td class="a-right">
9
+ <button onclick="editForm.submit()" class="scalable save" type="button"><span>Login</span></button>
10
+ </td>
11
+ </tr>
12
+ </table>
13
+ </div>
14
+ <div class="entry-edit">
15
+ <form id="edit_form" autocomplete="off" name="edit_form" method="post" action="<?php echo $this->getUrl('*/*/post') ?>">
16
+ <input name="form_key" type="hidden" value="<?php echo Mage::
17
+ getSingleton('core/session')->getFormKey() ?>" />
18
+ <h4 class="icon-head head-edit-form fieldset-legend"><?= $this->__('Enter the email address associated with your account of 71lbs') ?></h4>
19
+ <fieldset id="my-fieldset">
20
+ <table cellspacing="0" class="form-list">
21
+ <tr>
22
+ <td class="label"><?= $this->__('Email') ?> <span class="required">*</span></td>
23
+ <td class="input-ele"><input id="signupEmail" class="usr-form" type="email" name="email" placeholder="1. Enter your email..." defaultVal="1. Enter your email..." value="<?php echo $user['email']; ?>" required/></td>
24
+ </tr>
25
+ </table>
26
+ <a href="https://www.71lbs.com/" target="_blank">Sign Up into 71lbs</a>
27
+ </fieldset>
28
+ </form>
29
+ </div>
30
+ <script type="text/javascript">
31
+ var editForm = new varienForm('edit_form');
32
+ </script>
33
+ <div id='resultarea'>
34
+ </div>
app/design/adminhtml/default/default/template/adminrefunds/refunds.phtml ADDED
@@ -0,0 +1,519 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $email = $_POST['email'];
3
+ $password = $_POST['userPass'];
4
+
5
+
6
+ $opts = array('http' => array(
7
+ 'method' => 'GET',
8
+ 'header' => 'Content-type: application/json',
9
+ 'content' => '{"email": "' . $email . '","password":"' . $password .
10
+ '", "signup":"true"}'));
11
+
12
+ $context = stream_context_create($opts);
13
+
14
+ $url = 'https://54.221.203.199/api/session';
15
+
16
+ $result = file_get_contents($url, false, $context);
17
+ $result = json_decode($result);
18
+
19
+ //debug
20
+ //var_dump($result);
21
+ setlocale(LC_MONETARY, 'en_US');
22
+
23
+ if($result->error){
24
+ echo("<div style='color: red'><b>Error:</b> " . $result->msj) . "</div>";
25
+ echo '<a href="javascript:history.go(-1)" title="Back">&laquo; Go back</a>';
26
+ exit();
27
+ }
28
+ ?>
29
+
30
+ <!-- 1140px Grid styles for IE -->
31
+ <!--[if lte IE 9]><link rel="stylesheet" href="https://www.71lbs.com/assets/ie.css" type="text/css" media="screen" /><![endif]-->
32
+ <!-- The 1140px Grid - http://cssgrid.net/ -->
33
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/1140.css" type="text/css" media="screen" />
34
+ <!-- Jquery ui styles -->
35
+ <link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/redmond/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" />
36
+ <!-- Your styles -->
37
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/businesses.css" type="text/css" media="screen" />
38
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/style.css" type="text/css" media="screen" />
39
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/users.css" type="text/css" media="screen" />
40
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/signup.css" type="text/css" media="screen" />
41
+ <link rel="stylesheet" href="https://www.71lbs.com/assets/signup2.css" type="text/css" media="screen" />
42
+ <!-- JS libraries -->
43
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
44
+ <script type="text/javascript">
45
+ // <![CDATA[
46
+ // noConflict so we can use both libraries
47
+ var $j = jQuery.noConflict();
48
+ //]]>
49
+ </script>
50
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
51
+ <script type="text/javascript" src="https://www.google.com/jsapi"></script>
52
+ <script type="text/javascript">
53
+ //Google API charts
54
+ google.load("visualization", "1", {packages:["corechart"]});
55
+ google.setOnLoadCallback(drawChart);
56
+ function drawChart() {
57
+ var data = new google.visualization.DataTable();
58
+ //Add number of Columns
59
+ data.addColumn('string', 'Month');
60
+ data.addColumn('number', 'Refund');
61
+
62
+ var monthNames = [ "January", "February", "March", "April", "May", "June",
63
+ "July", "August", "September", "October", "November", "December" ];
64
+
65
+ //get first month and last month since business started
66
+ //if not fedex refunds is empty
67
+
68
+ //loop to display a chart with all the months since
69
+ //business started in current year
70
+ for (var i = <?php echo $result->first_month; ?>; i <= <?php echo $result->
71
+ last_month; ?>; i++) {
72
+ data.addRow([monthNames[i - 1],0]);//Add a row for each refund by month key
73
+ }
74
+
75
+ //Design chart
76
+ var options = {
77
+ title: 'Total of Refunds Month over Month',
78
+ titleTextStyle: {color:'979797', fontSize: 12},
79
+ hAxis: {title: 'Month', titleTextStyle: {color: '979797', fontSize: 12}},
80
+ vAxis: {title: 'Economic Value of Refunds Revenue', titleTextStyle: {color: '979797', fontSize: 12}, minValue:0, maxValue:<?php echo
81
+ $result->max_value; ?>},
82
+ fontName: 'Arial, Helvetica, sans-serif',
83
+ animation: { duration: 1000, easing: 'out'}
84
+ };
85
+
86
+ var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
87
+ chart.draw(data, options);
88
+
89
+ //create animation of bars going up
90
+ //Get hash of total refunds by months for fedex
91
+ //if not fedex empty do foreach
92
+ <?php if ($result->fdx_monthly_refunds): ?>
93
+ setTimeout(function(){
94
+ <?php foreach ($result->fdx_monthly_refunds as $key => $value): ?>
95
+ data.setValue(<?php echo $value[0]; ?> - <?php echo $result->
96
+ first_month; ?>,1,<?php echo
97
+ $value[1] ?>); //setValue(row index,column index, value)
98
+ <?php endforeach ?>
99
+ chart.draw(data, options);
100
+ },500);
101
+ <?php endif ?>
102
+
103
+ //create animation of bars going up
104
+ //Get hash of total refunds by months for ups
105
+ //if not ups empty do foreach
106
+ <?php if ($result->ups_monthly_refunds): ?>
107
+ setTimeout(function(){
108
+
109
+ <?php foreach ($result->ups_monthly_refunds as $key => $value): ?>
110
+ var preValue = data.getValue(<?php echo $value[0]; ?> - <?php echo
111
+ $result->first_month; ?>,1); //get value thats there now and add it to next value
112
+ data.setValue(<?php echo $value[0]; ?> - <?php echo $result->
113
+ first_month; ?>,1,<?php echo
114
+ $value[1] ?> + preValue); //setValue(row index,column index, value)
115
+ <?php endforeach ?>
116
+ chart.draw(data, options);
117
+ },2500);
118
+ <?php endif ?>
119
+
120
+ }
121
+
122
+ </script>
123
+ <script>
124
+
125
+ $j(function() {
126
+
127
+
128
+ <!-- Jquery ui datepicker -->
129
+ $j( "#fdx_from" ).datepicker({
130
+ defaultDate: "+1w",
131
+ changeMonth: true,
132
+ numberOfMonths: 1,
133
+ maxDate: -1,
134
+ autoSize: true,
135
+ onClose: function( selectedDate ) {
136
+ $j( "#fdx_to" ).datepicker( "option", "minDate", selectedDate );
137
+ },
138
+ onSelect: function()
139
+ {
140
+ if ($j("#fdx_to").datepicker("getDate") != null)
141
+ getDataForRange("fdx");
142
+ }
143
+ });
144
+
145
+ $j( "#fdx_to" ).datepicker({
146
+ defaultDate: "+1w",
147
+ changeMonth: true,
148
+ numberOfMonths: 1,
149
+ maxDate: 0,
150
+ autoSize: true,
151
+ onClose: function( selectedDate ) {
152
+ $j( "#fdx_from" ).datepicker( "option", "maxDate", selectedDate );
153
+ },
154
+ onSelect: function()
155
+ {
156
+ if ($j("#fdx_from").datepicker("getDate") != null)
157
+ getDataForRange("fdx");
158
+ }
159
+ });
160
+
161
+ $j( "#ups_from" ).datepicker({
162
+ defaultDate: "+1w",
163
+ changeMonth: true,
164
+ numberOfMonths: 1,
165
+ maxDate: -1,
166
+ autoSize: true,
167
+ onClose: function( selectedDate ) {
168
+ $j( "#ups_to" ).datepicker( "option", "minDate", selectedDate );
169
+ },
170
+ onSelect: function()
171
+ {
172
+ if ($j("#ups_to").datepicker("getDate") != null)
173
+ getDataForRange("ups");
174
+ }
175
+ });
176
+
177
+ $j( "#ups_to" ).datepicker({
178
+ defaultDate: "+1w",
179
+ changeMonth: true,
180
+ numberOfMonths: 1,
181
+ maxDate: 0,
182
+ autoSize: true,
183
+ onClose: function( selectedDate ) {
184
+ $j( "#ups_from" ).datepicker( "option", "maxDate", selectedDate );
185
+ },
186
+ onSelect: function()
187
+ {
188
+ if ($j("#ups_from").datepicker("getDate") != null)
189
+ getDataForRange("ups");
190
+ }
191
+ });
192
+
193
+ $j(".profile_li").hover(
194
+ function() {
195
+ $j(".profile_li").css({'background-color': '#ffffff', 'border-color': '#ffffff'});
196
+ $j(this).css({'background-color': '#FDFDFD', 'border-color': '#ECE3E3'})
197
+ },
198
+ function() {
199
+ $j(".profile_li").css({'background-color': '#ffffff', 'border-color': '#ffffff'});
200
+ }
201
+ );
202
+ });
203
+
204
+ function getDataForRange(acnt_type)
205
+ {
206
+ if (acnt_type == "fdx") {
207
+ var fromDate = $j("#fdx_from").datepicker("getDate");
208
+ var toDate = $j("#fdx_to").datepicker("getDate");
209
+ }
210
+ else {
211
+ var fromDate = $j("#ups_from").datepicker("getDate");
212
+ var toDate = $j("#ups_to").datepicker("getDate");
213
+ }
214
+
215
+ fromDate = $j.datepicker.formatDate('mm-dd-yy', fromDate);
216
+ toDate = $j.datepicker.formatDate('mm-dd-yy', toDate);
217
+
218
+ var json = { "id":"<?php echo $result->business_id ?>","from":fromDate, "to":toDate, "acnt":acnt_type, "callback":"data" };
219
+ var sid ="<?php echo $result->business_id ?>";
220
+ my_url = "https://54.221.203.199/api/session/selectRefundRange.jsonp?id="+ sid +"&from=" + fromDate + "&to="+toDate+"&acnt="+acnt_type+"&callback=data";
221
+
222
+ $j.ajaxSetup({
223
+ error: function(jqXHR, exception) {
224
+ if (jqXHR.status === 0) {
225
+ alert('Not connect.\n Verify Network.');
226
+ } else if (jqXHR.status == 404) {
227
+ alert('Requested page not found. [404]');
228
+ } else if (jqXHR.status == 500) {
229
+ alert('Internal Server Error [500].');
230
+ } else if (exception === 'parsererror') {
231
+ alert('Requested JSON parse failed.');
232
+ } else if (exception === 'timeout') {
233
+ alert('Time out error.');
234
+ } else if (exception === 'abort') {
235
+ alert('Ajax request aborted.');
236
+ } else {
237
+ alert('Uncaught Error.\n' + jqXHR.responseText);
238
+ }
239
+ }
240
+ });
241
+
242
+ $j.ajax({
243
+ url: my_url,
244
+ type: "GET",
245
+ dataType: "jsonp",
246
+ success: function (result) {
247
+ if (acnt_type == "fdx")
248
+ populateFedexTable(result);
249
+ else
250
+ populateUpsTable(result);
251
+ },
252
+ error: function (req, msg, obj) {
253
+ alert("The requested data could not be processed "+ msg);
254
+ }
255
+ });
256
+
257
+ }
258
+
259
+ function populateFedexTable(result)
260
+ {
261
+ if (result.totalRefunds > 0) {
262
+ fedexRefunds = result.refunds;
263
+ //links = result.links
264
+ dates = result.datesArray;
265
+ $j("#fdx").empty();
266
+ count = 1;
267
+
268
+ $j.each( fedexRefunds, function( i, value ) {
269
+ //url = '&nbsp; &nbsp;';
270
+
271
+ //if(links[i] != '-1')
272
+ //url = "<a href='" +links[i] +"'>refund capture</a>";
273
+
274
+ if (count) { //Appended elements belong to class 'even', use for background color white
275
+
276
+ $j("#fdx").append("<span class='even f_acnt'>"+fedexRefunds[i].payer_acnt+
277
+ "</span><span class='even f_track'>"+fedexRefunds[i].tracking+
278
+ "</span><span class='even f_date'>"+dates[i]+"</span><span class='even f_ref'>"+
279
+ fedexRefunds[i].refund_amt+"</span><br />");// <span class='even f_acnt'>"+ url +"</span><br />");
280
+ count = 0;
281
+ }
282
+ else { //Appended elements belong to class 'prime', use for background color gray
283
+ $j("#fdx").append("<span class='prime f_acnt'>"+fedexRefunds[i].payer_acnt+
284
+ "</span><span class='prime f_track'>"+fedexRefunds[i].tracking+
285
+ "</span><span class='prime f_date'>"+dates[i]+"</span><span class='prime f_ref'>"+
286
+ fedexRefunds[i].refund_amt+"</span><br />");// <span class='prime f_acnt'>"+ url +"</span><br />");
287
+ count = 1;
288
+ }
289
+ });
290
+
291
+ $j(".dash-wrapper").height($j(".dash-right").height() + 300); //recalculate new height for wrapper
292
+ $j(".vertical2").height($j(".dash-wrapper").height() - 290); //recalculate new height for image
293
+
294
+ $j("#refundsFdx").html("$"+result.totalRefunds);
295
+ }
296
+ else {
297
+ $j(alert("There are no refunds available for the selected dates"));
298
+ }
299
+ }
300
+
301
+ function populateUpsTable(result)
302
+ {
303
+ if (result.totalRefunds > 0) {
304
+ upsRefunds = result.refunds;
305
+ dates = result.datesArray;
306
+ $j("#ups").empty();
307
+ count = 1;
308
+
309
+ $j.each( upsRefunds, function( i, value ) {
310
+ if (count) {
311
+ $j("#ups").append("<span class='even f_acnt'>"+upsRefunds[i].acnt_nbr+"</span><span class='even f_track'>"+
312
+ upsRefunds[i].tracking+"</span><span class='even f_date'>"+dates[i]+
313
+ "</span><span class='even f_inv'>"+upsRefunds[i].invoice_nbr+
314
+ "</span><span class='even f_ref'>"+upsRefunds[i].refund_amt+"</span><br />");
315
+ count = 0;
316
+ }
317
+ else {
318
+ $j("#ups").append("<span class='even f_acnt'>"+upsRefunds[i].acnt_nbr+"</span><span class='even f_track'>"+
319
+ upsRefunds[i].tracking+"</span><span class='even f_date'>"+dates[i]+
320
+ "</span><span class='even f_inv'>"+upsRefunds[i].invoice_nbr+
321
+ "</span><span class='even f_ref'>"+upsRefunds[i].refund_amt+"</span><br />");
322
+ count = 1;
323
+ }
324
+
325
+ });
326
+
327
+ $j(".dash-wrapper").height($j(".dash-right").height() + 300); //recalculate new height for wrapper
328
+ $j(".vertical2").height($j(".dash-wrapper").height() - 290); //recalculate new height for image
329
+ $j("#refundsUps").html("$"+result.totalRefunds);
330
+ }
331
+ else {
332
+ $j(alert("There are no refunds available for the selected dates"));
333
+ }
334
+ }
335
+
336
+
337
+
338
+ //mimic folder tabs to display graph and table
339
+ $j(document).ready(function() {
340
+ $j("#content").children("div").hide(); // Initially hide all content
341
+ $j("#tabs li:first").attr("id","current"); // Activate first tab
342
+ $j("#content div:first").fadeIn(); // Show first tab content
343
+
344
+ $j('#tabs a').click(function(e) {
345
+ e.preventDefault();
346
+ if ($j(this).closest("li").attr("id") == "current"){ //detection for current tab
347
+ return
348
+ }
349
+ else{
350
+ $j("#content").children("div").hide(); //Hide all content
351
+ $j("#tabs li").attr("id",""); //Reset id's
352
+ $j(this).parent().attr("id","current"); // Activate this
353
+ $j('#' + $j(this).attr('name')).fadeIn(); // Show content for current tab
354
+ }
355
+ });
356
+ });
357
+ //Business profile selections
358
+ </script>
359
+
360
+ <form autocomplete="off">
361
+
362
+ <div class="dash-wrapper">
363
+
364
+ <span class="b_name"><?php echo $result->business_name ?></span>
365
+ <div style="clear:both"></div>
366
+
367
+ <div class="dash-left">
368
+ <!-- Void -->
369
+ </div><!-- end dash-left -->
370
+ <div class="vertical1"></div>
371
+ <!--<div class="vertical2"></div>-->
372
+
373
+ <div class="dash-right">
374
+ <div id="ref_content" class="contents" style="overflow:hidden">
375
+ <span class="welcome">Welcome to 71 Pounds</span>
376
+ <div class="yr_date">Year to date refunds: <?php echo $result->yearly_total ?></div>
377
+ <?php if ($result->yearly_total > 0): ?>
378
+ <p class="last_updated_refunds">Last updated: <?php echo $result->last_update ?></p>
379
+ <?php endif ?>
380
+
381
+ <div id="dataChartsTables">
382
+ <ul id="tabs">
383
+ <li><a href="#" name="tab1">Graph</a></li>
384
+ <li><a href="#" name="tab2">Table</a></li>
385
+ </ul>
386
+
387
+ <div id="content">
388
+
389
+ <div id="tab1">
390
+ <div id="chart_div"></div>
391
+ </div><!-- tab1 -->
392
+
393
+ <div id="tab2">
394
+ <div class="totals">
395
+ <span class="f_this"> <?php echo ($result->fdx_this_month); ?> </span>
396
+ <span class="f_last"><?php echo ($result->fdx_prev_month); ?> </span>
397
+ <span class="f_year"><?php echo ($result->yearly_fdx_ref); ?> </span>
398
+ <span class="u_this"><?php echo ($result->ups_this_month); ?> </span>
399
+ <span class="u_last"><?php echo ($result->ups_prev_month); ?> </span>
400
+ <span class="u_year"><?php echo ($result->yearly_ups_ref); ?> </span>
401
+ <span class="t_this"><?php echo ($result->month_total); ?> </span>
402
+ <span class="t_last"><?php echo ($result->prev_total); ?> </span>
403
+ <span class="t_year"><?php echo($result->yearly_total); ?> </span>
404
+ </div>
405
+ </div><!-- tab2 -->
406
+ </div>
407
+ </div>
408
+
409
+ <?php if ($result->fdx_uname !== null && $result->fdx_uname != ""): ?>
410
+ <span class="f_latest">Current month activity - FedEx</span>
411
+ <div style="margin-top: 50px"></div>
412
+ <div style="width:790px">
413
+ <div class="acnt_tbl2" style="border-left:1px solid #DADADA;width:140px">Account Number</div>
414
+ <div class="acnt_tbl2" style="width:140px;padding-left:50px">Tracking</div>
415
+ <div class="acnt_tbl2" style="width:85px">Date</div>
416
+ <div class="acnt_tbl2" style="width:130px;padding-left: 30px">Refund Amount</div>
417
+ <div style="clear:both"></div>
418
+
419
+ <div id="fdx">
420
+ <?php $count = 0 ?>
421
+ <?php foreach ($result->fedex_refunds as $key => $value): ?>
422
+ <?php if ($count == 0): ?>
423
+ <span class="even f_acnt"><?php echo $value->payer_acnt ?></span>
424
+ <span class="even f_track"><?php echo $value->tracking ?></span>
425
+ <span class="even f_date"><?php echo $value->invoice_dt ?></span>
426
+ <span class="even f_ref">$<?php echo $value->refund_amt ?></span>
427
+
428
+ <?php $count = 1 ?>
429
+ <?php else: ?>
430
+ <span class="prime f_acnt"><?php echo $value->payer_acnt ?></span>
431
+ <span class="prime f_track"><?php echo $value->tracking ?></span>
432
+ <span class="prime f_date"><?php echo $value->invoice_dt ?></span>
433
+ <span class="prime f_ref">$<?php echo $value->refund_amt ?></span>
434
+ <?php $count = 0 ?>
435
+ <?php endif ?>
436
+ <?php endforeach ?>
437
+ <div style="clear:both"></div>
438
+ <?php endif ?>
439
+
440
+ </div>
441
+ <div style="clear:both"></div>
442
+ <div class="totals_div1">
443
+ <span style="margin-left: 360px;">Total Refunds</span>
444
+ </div>
445
+ <div class="totals_div2">
446
+ <span id="refundsFdx" class="f_total"><?php echo $result->fdx_this_month ?></span>
447
+ </div>
448
+ </div>
449
+ <span class="from">From</span>
450
+ <input type="text" id="fdx_from" class="date_input" />
451
+ <span>to</span>
452
+ <input type="text" id="fdx_to" class="date_input" />
453
+ <br/>
454
+ <?php if ($result->ups_uname !== null && $result->ups_uname != ""): ?>
455
+ <span class="f_latest">Current month activity - UPS</span>
456
+ <div style="margin-top: 50px"></div>
457
+
458
+ <div style="width:900px">
459
+ <div class="acnt_tbl2" style="border-left:1px solid #DADADA;width:140px">Account Number</div>
460
+ <div class="acnt_tbl2" style="width:160px;padding-left:30px">Tracking</div>
461
+ <div class="acnt_tbl2" style="width:85px">Date</div>
462
+ <div class="acnt_tbl2" style="width:130px;padding-left:30px">Invoice Number</div>
463
+ <div class="acnt_tbl2" style="width:130px;padding-left: 30px">Refund Amount</div>
464
+ <div style="clear:both"></div>
465
+
466
+ <div id="ups">
467
+ <?php $count = 0 ?>
468
+ <?php foreach ($result->ups_refunds as $key => $value): ?>
469
+ <?php if ($count == 0): ?>
470
+ <span class="even f_acnt"><?php echo $value->acnt_nbr ?></span>
471
+ <span class="even f_track"><?php echo $value->tracking ?></span>
472
+ <span class="even f_date"><?php echo $value->invoice_dt ?></span>
473
+ <span class="even f_inv"><?php echo $value->invoice_nbr ?></span>
474
+ <span class="even f_ref">$<?php echo $value->refund_amt ?></span>
475
+ <?php $count = 1 ?>
476
+ <?php else: ?>
477
+ <span class="prime f_acnt"><?php echo $value->acnt_nbr ?></span>
478
+ <span class="prime f_track"><?php echo $value->tracking ?></span>
479
+ <span class="prime f_date"><?php echo $value->invoice_dt ?></span>
480
+ <span class="prime f_inv"><?php echo $value->invoice_nbr ?></span>
481
+ <span class="prime f_ref">$<?php echo $value->refund_amt ?></span>
482
+ <?php $count = 0 ?>
483
+ <?php endif ?>
484
+ <div style="clear:both"></div>
485
+ <?php endforeach ?>
486
+ </div>
487
+ </div>
488
+ <div style="clear:both"></div>
489
+ <div class="totals_div1" style="width:623px">
490
+ <span style="margin-left:520px;">Total Refunds</span>
491
+ </div>
492
+ <div class="totals_div2" style="margin-left:630px">
493
+ <span id="refundsUps" class="f_total"><?php echo $result->ups_this_month ?></span>
494
+ </div>
495
+
496
+ <span class="from">From</span>
497
+ <input type="text" id="ups_from" class="date_input" />
498
+ <span>to</span>
499
+ <input type="text" id="ups_to" class="date_input" />
500
+ <?php endif ?>
501
+
502
+ </div> <!-- end refunds -->
503
+
504
+ <!-- Accounts -->
505
+ <div id="acnt_content" class="contents" style="display:none">
506
+ <!-- Void -->
507
+ </div>
508
+
509
+ <!-- Users -->
510
+ <div id="usr_content" class="contents" style="display:none; overflow: hidden;">
511
+ <!-- Void -->
512
+ </div>
513
+ </div>
514
+ </div>
515
+ <a href="https://www.71lbs.com/businesses/<?php echo $result->business_id ?>" target="_blank">More Information</a>
516
+
517
+ </form>
518
+ <div id="test">
519
+ </div>
app/etc/modules/Lbs71_Adminrefunds.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Lbs71_Adminrefunds>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends></depends>
8
+ </Lbs71_Adminrefunds>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>lbs71</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>Apache Software License (ASL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>71lbs integrates functionality in magento, shows a graph, dasboard refunds.</summary>
10
+ <description>Every FedEx and UPS overnight and ground shipment comes with a Money-Back-Guarantee (MBG) refund. If your overnight or ground shipment is late, even by 60 seconds, you should get 100% of your money back. But you have to initiate the claim, and most companies don't. Research says there are $2 Billion dollars of unclaimed MBG every year. Your expected MBG refunds will depend on the type of services you ship to, destinations, and other factors. On average, you can expect refunds worth 4-6% of your shipping spend.&#xD;
11
+ &#xD;
12
+ 71lbs has built a "set-and-forget" system to automatically monitor the delivery times of your FedEx &amp; UPS shipments. You only need to provide us with your fedex.com and/or ups.com account info, we monitor your shipments and file the claims for you. And our service has zero upfront fee, we typically collect a 50% fee from the refund amount. There are no sign-up fees and no monthly fees. We only make money if we save you money first. 0&#xD;
13
+ &#xD;
14
+ And now with our partnership with Shopify, you can get your free shipping refunds as easily as clicking on the Shopify 'app' button.&#xD;
15
+ &#xD;
16
+ Contact Information: Any additional questions, please call 954-400-7194 or visit www.71lbs.com&#xD;
17
+ </description>
18
+ <notes>First Version of 71lbs magento extension</notes>
19
+ <authors><author><name>Jose</name><user>jose</user><email>jose@71lbs.com</email></author></authors>
20
+ <date>2013-09-23</date>
21
+ <time>14:46:43</time>
22
+ <contents><target name="magecommunity"><dir name="lbs71"><dir name="Adminrefunds"><dir name="Helper"><file name="Data.php" hash="f67bbcee1a0dc3ae098f1be7dbe8b8dd"/></dir><dir name="controllers"><file name="AdminRefundsController.php" hash="e34be3af35557f01cde71bba3155d1b7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="55ce2355972a6f5f291866632e58f5a9"/><file name="config.xml" hash="2973fe59a6d8bbfd4b7f5d4ef11a175c"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="adminrefunds"><file name="about.phtml" hash="bdef28c10b8e35233315a60c0bea8fcf"/><file name="loginform.phtml" hash="6b1a1c577af19f92ec957d487fdfc7b0"/><file name="refunds.phtml" hash="a21d36d3f491cfd9732cfe4cf51fd649"/></dir></dir><dir name="layout"><file name="lbs71_refunds.xml" hash="e51300247881edf596bb80c0dee3080a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Lbs71_Adminrefunds.xml" hash="ce98574fb38a544d2ea26c9e0243bcdd"/></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.1.0</min><max>5.4.16</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0</min><max>1.7.0</max></package></required></dependencies>
25
+ </package>