|
|
@@ -121,6 +121,9 @@
|
|
|
<div class="row text-right">
|
|
|
<div class="col-md-12" style="text-align:right">
|
|
|
<button style="display:none; width:200px;" class="btn--ui btNewPayment" onclick="newPayment()">NUOVA ENTRATA</button>
|
|
|
+ <button class="btn--ui primary btStopPayment" style="display:none; width:200px; color:white" onclick="suspendPayment()">Sospendi</button>
|
|
|
+ <button class="btn--ui primary btResumePayment" style="display:none; width:200px; color:white" onclick="resumePayment()">Riattiva</button>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -593,6 +596,10 @@
|
|
|
{
|
|
|
var ret = '<a style="width:100%;float:right; text-align:right; display:block; ' + (x[0] == 1 ? '' : 'cursor:pointer;') + '" class="' + (x[0] == 1 ? 'green' : 'orange') + ' sub_' + row["column_16"] + '" onclick="setSubscription(' + row["column_15"] + ', ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + (x[0] == 1 ? 'green' : 'orange') + '"><small>' + x[1] + '</small></a>';
|
|
|
@@ -610,6 +617,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_1_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 1, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_1_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 1, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -628,6 +639,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_2_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 2, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_2_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ',2, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -646,6 +661,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_3_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 3, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_3_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 3, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -664,6 +683,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_4_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 4, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_4_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 4, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -682,6 +705,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_5_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 5, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_5_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 5, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -700,6 +727,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_6_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 6, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_6_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 6, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -718,6 +749,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_7_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 7, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_7_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 7, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -736,6 +771,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_8_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 8, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_8_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 8, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -754,6 +793,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_9_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 9, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_9_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 9, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -772,6 +815,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_10_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 10, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_10_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 10, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -790,6 +837,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_11_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 11, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_11_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 11, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -808,6 +859,10 @@
|
|
|
{
|
|
|
ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_12_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 12, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
}
|
|
|
+ else if (x[0] == 'yellow')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_9_' + row["column_17"] + '" onclick="resumePayMonth(' + row["column_15"] + ', 12, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
if (x[0] != 'wgrey')
|
|
|
@@ -1000,8 +1055,11 @@
|
|
|
var selectedCourseId = 0;
|
|
|
var selectedMemberId = 0;
|
|
|
var selectedMemberCourseId = 0;
|
|
|
+ var selectedMonth = 0;
|
|
|
+
|
|
|
function setPayMonth(course_id, month, member_id, id)
|
|
|
{
|
|
|
+
|
|
|
if (selectedMemberId > 0 && selectedMemberId != member_id)
|
|
|
{
|
|
|
months = [];
|
|
|
@@ -1015,7 +1073,7 @@
|
|
|
selectedCourseId = course_id;
|
|
|
selectedMemberId = member_id;
|
|
|
selectedMemberCourseId = id;
|
|
|
-
|
|
|
+ selectedMonth = month;
|
|
|
if(!months.includes(month))
|
|
|
{
|
|
|
months.push(month);
|
|
|
@@ -1029,10 +1087,52 @@
|
|
|
if (months.length > 0)
|
|
|
{
|
|
|
$(".btNewPayment").show();
|
|
|
+ $(".btStopPayment").show();
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$(".btNewPayment").hide();
|
|
|
+ $(".btStopPayment").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function resumePayMonth(course_id, month, member_id, id)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (selectedMemberId > 0 && selectedMemberId != member_id)
|
|
|
+ {
|
|
|
+ months = [];
|
|
|
+ subscription = false;
|
|
|
+ }
|
|
|
+ if (selectedMemberCourseId != id)
|
|
|
+ {
|
|
|
+ $(".sub_" + selectedMemberCourseId).removeClass("orange").addClass("blue").addClass("selected");
|
|
|
+ $(".lnk_" + selectedMemberCourseId).removeClass("orange").addClass("blue").addClass("selected");
|
|
|
+ }
|
|
|
+ selectedCourseId = course_id;
|
|
|
+ selectedMemberId = member_id;
|
|
|
+ selectedMemberCourseId = id;
|
|
|
+ selectedMonth = month;
|
|
|
+ console.log(month);
|
|
|
+ if(!months.includes(month))
|
|
|
+ {
|
|
|
+ months.push(month);
|
|
|
+ $("#lnk_" + course_id + "_" + month + "_" + member_id).removeClass("blue").removeClass("selected").addClass("orange").addClass("selected");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ months.splice(months.indexOf(months), 1);
|
|
|
+ $("#lnk_" + course_id + "_" + month + "_" + member_id).removeClass("orange").addClass("blue").addClass("selected");
|
|
|
+ }
|
|
|
+ if (months.length > 0)
|
|
|
+ {
|
|
|
+ $(".btResumePayment").show();
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $(".btResumePayment").hide();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1067,6 +1167,16 @@
|
|
|
@this.newPayment(selectedCourseId, months.toString(), selectedMemberId, selectedMemberCourseId, subscription);
|
|
|
}
|
|
|
|
|
|
+ function suspendPayment()
|
|
|
+ {
|
|
|
+ @this.suspendPayment(selectedCourseId, selectedMonth, selectedMemberId, selectedMemberCourseId, subscription);
|
|
|
+ }
|
|
|
+
|
|
|
+ function resumePayment()
|
|
|
+ {
|
|
|
+ @this.resumePayment(selectedCourseId, selectedMonth, selectedMemberId, selectedMemberCourseId, subscription);
|
|
|
+ }
|
|
|
+
|
|
|
$( document ).ready( function(){
|
|
|
|
|
|
setMaxWidth();
|