D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
stage
/
resources
/
views
/
templates
/
Filename :
hours.blade.php
back
Copy
@if(!$hours) {{trans('client.shchedule.not working day')}} @else @foreach($hours as $one) <? $arrh = explode(':', $one); if ($arrh[1] == '30') { $a = 2; } else { $a = 1; } $two = $arrh[0] * 2 + $a; ?> <div class="radio" id="radio{{$two}}"> <label> <input type="radio" name="hour" data_id="{{$two}}" value="{{$one}}"/>{{$one}} </label> </div> @endforeach <script> $(function () { var ii; $('[name="hour"]:first').attr('required', 'required'); $('[name="hour"]').click(hour_click); $('[name="hour"]').each(hour_each); console.log(ii); function hour_each() { var time2 = Number($(this).attr('data_id')); var hours = Number($('#works_hours').text() * 2); var timeend = time2 + hours-1; if ($('[data_id=' + timeend + ']').length > 0) { var test = 'good'; for (var i = time2; i < timeend; i++) { if ($('#radio' + i + '').length >= 0) { ii = i; } else { var test = 'wrong'; } } if (test == 'wrong') { $(this).remove(); } } else { // alert('You can not choose this time'); $(this).remove(); } } function hour_click() { var payd = $('#payd').val(); $('#checkout').prop( "disabled", false ); if(payd){ $('#checkclient').prop( "disabled", false ); } var time2 = Number($(this).attr('data_id')); var hours = Number($('#works_hours').text() * 2); var timeend = time2 + hours; if ($('[data_id=' + time2 + ']').length > 0) { $('.radio').css('background', 'none'); console.log(time2 + ' - ' + timeend); var test = 'good'; for (var i = time2; i < timeend; i++) { if ($('#radio' + i + '').length > 0) { $('#radio' + i + '').css('background', '#787878'); } else { var test = 'wrong'; } } if (test == 'wrong') { $('#radio' + i + '').css('background', 'none'); $(this).prop('checked', false); } } } }) </script> @endif