ebay_syncronise.tpl
5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
<div class="page-header">
<div class="container-fluid">
<div class="pull-right">
<a href="<?php echo $return; ?>" data-toggle="tooltip" title="<?php echo $button_back; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
<h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="container-fluid">
<?php if ($error_warning) { ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?></div>
<?php } ?>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list"></i> <?php echo $text_sync; ?></h3>
</div>
<div class="panel-body">
<?php if ($validation == true) { ?>
<p><?php echo $text_sync_desc; ?></p>
<form id="form-ebay-sync" class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label" for="update-categories"><span data-toggle="tooltip" title="<?php echo $help_sync_categories; ?>"><?php echo $entry_sync_categories; ?></span></label>
<div class="col-sm-10">
<a class="btn btn-primary" id="update-categories"><?php echo $button_update; ?></a>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="update-store"><span data-toggle="tooltip" title="<?php echo $help_sync_shop; ?>"><?php echo $entry_sync_shop; ?></span></label>
<div class="col-sm-10">
<a class="btn btn-primary" id="update-store"><?php echo $button_update; ?></a>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="update-settings"><span data-toggle="tooltip" title="<?php echo $help_sync_setting; ?>"><?php echo $entry_sync_setting; ?></span></label>
<div class="col-sm-10">
<a class="btn btn-primary" id="update-settings"><?php echo $button_update; ?></a>
</div>
</div>
</form>
<?php }else{ ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_validation; ?>
<button type="button" class="close" data-dismiss="alert">×</button>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<script type="text/javascript"><!--
$('#update-categories').bind('click', function() {
$.ajax({
url: 'index.php?route=openbay/ebay/updatecategories&token=<?php echo $token; ?>',
beforeSend: function(){
$('#update-categories').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
alert('<?php echo $text_ebay_categories; ?>');
},
type: 'post',
dataType: 'json',
success: function(json) {
$('#update-categories').empty().removeClass('btn-primary').addClass('btn-success').html('<?php echo $text_complete; ?>');
alert(json.msg);
},
error: function (xhr, ajaxOptions, thrownError) {
$('#update-categories').empty().removeClass('btn-primary').addClass('btn-danger').html('<?php echo $error_failed; ?>').removeAttr('disabled');
if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); }
}
});
});
$('#update-settings').bind('click', function() {
$.ajax({
url: 'index.php?route=openbay/ebay/updatesettings&token=<?php echo $token; ?>',
beforeSend: function(){
$('#update-settings').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
},
type: 'post',
dataType: 'json',
success: function(json) {
$('#update-settings').empty().removeClass('btn-primary').addClass('btn-success').html('<?php echo $text_complete; ?>');
if (json.error == false){
alert('<?php echo $text_setting_import; ?>');
}else{
alert('<?php echo $error_settings; ?>');
}
},
error: function (xhr, ajaxOptions, thrownError) {
$('#update-settings').empty().removeClass('btn-primary').addClass('btn-danger').html('<?php echo $error_failed; ?>').removeAttr('disabled');
if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); }
}
});
});
$('#update-store').bind('click', function() {
$.ajax({
url: 'index.php?route=openbay/ebay/updatestore&token=<?php echo $token; ?>',
beforeSend: function(){
$('#update-store').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
},
type: 'post',
dataType: 'json',
success: function(json) {
$('#update-store').empty().removeClass('btn-primary').addClass('btn-success').html('<?php echo $text_complete; ?>');
if (json.error == 'false'){
alert('<?php echo $text_category_import; ?>');
}else{
alert(json.msg);
}
},
error: function (xhr, ajaxOptions, thrownError) {
$('#update-store').empty().removeClass('btn-primary').addClass('btn-danger').html('<?php echo $error_failed; ?>').removeAttr('disabled');
if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); }
}
});
});
//--></script>
<?php echo $footer; ?>