diff --git a/app/Http/Controllers/Admin/FolderCrudController.php b/app/Http/Controllers/Admin/FolderCrudController.php index a892c43c..de885e18 100644 --- a/app/Http/Controllers/Admin/FolderCrudController.php +++ b/app/Http/Controllers/Admin/FolderCrudController.php @@ -57,6 +57,10 @@ class FolderCrudController extends CrudController ], //Total Price ['label'=>'Umumy bahsy (Total price)','name'=>'total_price','type'=>'text'], + ['label'=>'TV','name'=>'on_tv','type'=>'checkbox'], + ['label'=>'Radio','name'=>'on_radio','type'=>'checkbox'], + ['label'=>'Subtitle','name'=>'on_subtitle','type'=>'checkbox'], + ['label'=>'Web','name'=>'on_web','type'=>'checkbox'], //checkBox ['label'=>'Ulanyjy wagt aralygyny saýlamaly.', 'name'=>'choice_time','type'=>'checkbox'], //Table diff --git a/app/Models/Folder.php b/app/Models/Folder.php index ac5540ad..abc55666 100644 --- a/app/Models/Folder.php +++ b/app/Models/Folder.php @@ -19,7 +19,7 @@ class Folder extends Model // protected $primaryKey = 'id'; public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['title','description','property_id','folder_table','total_price','choice_time']; + protected $fillable = ['title','description','property_id','folder_table','total_price','choice_time','on_tv','on_radio','on_subtitle','on_web']; // protected $hidden = []; // protected $dates = []; //json to array; diff --git a/database/migrations/2020_08_13_195658_changefolders_table.php b/database/migrations/2020_08_13_195658_changefolders_table.php new file mode 100644 index 00000000..da35b341 --- /dev/null +++ b/database/migrations/2020_08_13_195658_changefolders_table.php @@ -0,0 +1,36 @@ +boolean('on_tv')->nullable(); + $table->boolean('on_radio')->nullable(); + $table->boolean('on_subtitle')->nullable(); + $table->boolean('on_web')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('folders', function (Blueprint $table) { + // + }); + } +} diff --git a/resources/views/web/bukjalar.blade.php b/resources/views/web/bukjalar.blade.php index e41b9c7b..e4f6f3f4 100644 --- a/resources/views/web/bukjalar.blade.php +++ b/resources/views/web/bukjalar.blade.php @@ -23,9 +23,8 @@ margin-bottom: 1em; } - form .form-row > div{ + form .form-row > div{} - } .all_total_price{ font-size: 24px; font-weight: bold; @@ -48,6 +47,7 @@ /* color:#fff;*/ /*}*/ + a:hover,a:focus{ text-decoration: none; outline: none; @@ -59,7 +59,7 @@ .vertical-tab .nav-tabs{ display: table-cell; width: 28%; - min-width: 28%; + /*min-width: 28%;*/ vertical-align: top; border: none; } @@ -124,7 +124,7 @@ background: #fff; font-size: 14px; /*line-height: 25px;*/ - padding: 20px 20px 10px; + padding: 10px 10px; margin-top: 10px; border: 1px solid #187F7E; display: table-cell; @@ -136,6 +136,159 @@ /*text-transform: uppercase;*/ /*letter-spacing: 1px;*/ margin: 0 0 7px 0; + font-size: 18px !important; + } + .prop-desc > p{ + padding-left: 10px; + } + .folder_title{ + color:#fff; + background-color: #187F7E; + padding: 4px 0px; + margin-bottom: 0; + margin-top: 0; + } + .for-border-box{ + border:1px solid #090909; + border-right:0; + border-top:0; + } + .for-border-box div > p{ + padding-left: 10px; + } + .bukja-table{ + margin-bottom: 1.5em; + box-shadow: 3px 2px 3px #5C5C5C; + } + table tr td{ + border:1px solid #A19D9C; + border-top: 0; + border-bottom: 0; + text-align: center; + } + + table tr > td:first-child{ + border: 0; + text-align: left; + border-top: 1px solid #eaeaeb; + } + table tr > td:last-child{ + border: 0; + border-top: 1px solid #eaeaeb; + } + table tr > th{ + text-align: center; + } + table tr > th:first-child{ + text-align: left; + } + .tot_price_center_box{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + } + .tot_price_center_box > span { + font-weight: bold; + font-size: 18px; + } + .left-bar{ + display: flex; + flex-flow: column; + height: 65vh; + justify-content: space-between; + } + .contact-info-box{ + border-left: 5px solid #329996; + padding-left: .8em; + font-weight: bolder; + } + .contact-info-box > h4{ + + } + .contact-info-box ul > li{ + margin: .5em 0; + } + .calc_text{ + background: #329996; + color: #fff; + margin: 0; + padding: .2em; + font-weight: normal; + } + .order-text{ + font-size: 11px; + font-weight: bold; + + } + #calculator-fix{ + display: flex; + flex-flow: column; + justify-content: space-between; + height: 65vh; + } + .yaylym-tertip{ + margin-top: 1em; + } + .yaylym-btn{ + border: 1px solid #329996; + background-color: #329996; + color: #fff; + font-weight: bold; + border-radius: 2px; + } + .yaylym-btn:hover{ + color: #fff !important; + text-decoration: underline; + } + .yaylym_text{ + font-size: 12px; + margin-top: .2em; + } + + /*for filter buttons box*/ + .filter-buttons-box{ + display:flex; + justify-content:space-between; + margin-bottom:1em; + } + .filter-btn{ + width: 20%; + border-radius: 1px; + background-color: #fff; + border:1px solid #329996; + font-size: 1em; + font-weight: bolder; + color: #187F7E; + } + .filter-btn:focus{ + outline: none; + color:#187F7E; + outline-offset: 0; + } + .filter-btn:hover{ + color:#fff; + background-color: #187F7E; + } + .active-filter-btn{ + color:#fff !important; + background-color: #187F7E; + } + /*for filter buttons box end*/ + + @media only screen and (min-width: 992px) { + .sticky { + position: fixed; + top: 10px; + width: 100%; + transition:.2s; + width: 19.5% !important; + z-index: 2; + } } @media only screen and (max-width: 479px){ .vertical-tab .nav-tabs{ @@ -154,13 +307,29 @@ .m-p-0{ padding:0; } + .left-bar{ + flex-flow: column-reverse !important; + margin-top: 1em; + height: 35vh; + } .mt-1{ + margin-top: 2em; + } + .folders-tab{ + padding: 5px 1px 5px 1px !important; + } + .m-t-c{ + text-align: center !important; + } + .filter-btn{ + width: 30%; + } + .prop_ul{ margin-top: 1em; } } -

Mahabat Nyrhnama bukjalary

@@ -170,417 +339,500 @@
-
- +
+
+ + + + +
-
+
@foreach($props as $prop) @if($prop->filter_value==1)
-

{{$prop->title}}

+

{{$prop->title}}

{!! $prop->description !!}

+
@foreach($folders as $folder) @if($folder->property->filter_value ==1) -
- +
@if(isset($folder->total_price) & $folder->total_price !== '') @php $k=0 @endphp -
-
-
- {{$folder->title}}
-

{!! $folder->description !!}

+
+

+ {{$folder->title}}

+
+
+
+
+
+

{!! $folder->description !!}

+
+
+ + + + + + + + + + + + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + + + + + + @if($folder->total_price !== '') + @if($k < 1) + + @endif + @endif + + @endforeach + @endisset + +
Wagt aralygyTVRadioSubtitleWebUmumy bahasy
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} @endisset@isset($table['set_radio']) {{$table['set_radio']}}@endisset@isset($table['set_sub']) {{$table['set_sub']}} @endisset@isset($table['set_web']) {{$table['set_web']}} @endisset +
+ @isset($folder->total_price) {{$folder->total_price}} TMT {{$k=$k+1}} @endisset +
+
- - Wagt aralygy - TV - Radio - Subtitle - Web - Umumy bahasy - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) - - @isset($table['time']) {{$table['time']}} @endisset - @isset($table['set_tv']) {{$table['set_tv']}} kan. @endisset - @isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset - @isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset - @isset($table['set_web']) {{$table['set_web']}} @endisset - @if($folder->total_price !== '') - @if($k < 1) - @isset($folder->total_price) {{$folder->total_price}} m/sek {{$k=$k+1}} @endisset - @endif - @endif - - @endforeach - @endisset - @endif @if(!isset($folder->total_price) & $folder->total_price == '') -
-
-
- {{$folder->title}}
-

{!! $folder->description !!}

+
+

+ {{$folder->title}}

+
+
+
+
+
+

{!! $folder->description !!}

+
+ + + + + + + + + + + + + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + + + + + + + + @endforeach + @endisset + +
Wagt aralygyTVRadioSubtitleWebBahasy
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} @endisset@isset($table['set_radio']) {{$table['set_radio']}} @endisset@isset($table['set_sub']) {{$table['set_sub']}}@endisset@isset($table['set_web']) {{$table['set_web']}} @endisset@isset($table['price']) {{$table['price']}} TMT @endisset
- - Wagt aralygy - Bahasy - TV - Radio - Subtitle - Web - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) - - @isset($table['time']) {{$table['time']}} @endisset - @isset($table['price']) {{$table['price']}} m/sek. @endisset - @isset($table['set_tv']) {{$table['set_tv']}} kan.@endisset - @isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset - @isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset - @isset($table['set_web']) {{$table['set_web']}} @endisset - - @endforeach - @endisset - @endif -
@endif @endforeach -
@endif @if($prop->filter_value==2) -
-

{{$prop->title}}

-
-

{!! $prop->description !!}

+
+

{{$prop->title}}

+
+

{!! $prop->description !!}

+
@foreach($folders as $folder) - @if($folder->property->filter_value == 2) -
- - @if(isset($folder->total_price) & $folder->total_price !== '') - @php - $k=0 - @endphp - -
-
-
- {{$folder->title}}
+ @if($folder->property->filter_value ==2) +
+ @if(isset($folder->total_price) & $folder->total_price !== '') + @php + $k=0 + @endphp +
+
+

+ {{$folder->title}}

+
+
+
+
+

{!! $folder->description !!}

-
-
- - - - - - - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) +
Wagt aralygyTVRadioSubtitleWebUmumy bahasy
+ - - - - - - @if($folder->total_price !== '') - @if($k < 1) - - @endif - @endif + + + + + + - @endforeach - @endisset - - @endif - @if(!isset($folder->total_price) & $folder->total_price == '') - -
-
-
- {{$folder->title}}
+
+ + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + + + + + + @if($folder->total_price !== '') + @if($k < 1) + + @endif + @endif + + @endforeach + @endisset + +
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} kan. @endisset@isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset@isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset@isset($table['set_web']) {{$table['set_web']}} @endisset@isset($folder->total_price) {{$folder->total_price}} m/sek {{$k=$k+1}} @endissetWagt aralygyTVRadioSubtitleWebUmumy bahasy
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} @endisset@isset($table['set_radio']) {{$table['set_radio']}}@endisset@isset($table['set_sub']) {{$table['set_sub']}} @endisset@isset($table['set_web']) {{$table['set_web']}} @endisset +
+ @isset($folder->total_price) {{$folder->total_price}} TMT {{$k=$k+1}} @endisset +
+
+
+
+ @endif + @if(!isset($folder->total_price) & $folder->total_price == '') +
+
+

+ {{$folder->title}}

+
+
+
+
+

{!! $folder->description !!}

-
- - Wagt aralygy - Bahasy - TV - Radio - Subtitle - Web - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) + + - - - - - - + + + + + + - @endforeach - @endisset - - @endif -
@isset($table['time']) {{$table['time']}} @endisset@isset($table['price']) {{$table['price']}} m/sek. @endisset@isset($table['set_tv']) {{$table['set_tv']}} kan.@endisset@isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset@isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset@isset($table['set_web']) {{$table['set_web']}} @endissetWagt aralygyTVRadioSubtitleWebBahasy
+ + + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + @isset($table['time']) {{$table['time']}} @endisset + @isset($table['set_tv']) {{$table['set_tv']}} @endisset + @isset($table['set_radio']) {{$table['set_radio']}} @endisset + @isset($table['set_sub']) {{$table['set_sub']}}@endisset + @isset($table['set_web']) {{$table['set_web']}} @endisset + @isset($table['price']) {{$table['price']}} TMT @endisset + + @endforeach + @endisset + + +
+
+ @endif
@endif @endforeach
-
@endif @if($prop->filter_value==3) -
-

{{$prop->title}}

-
-

{!! $prop->description !!}

+
+

{{$prop->title}}

+
+

{!! $prop->description !!}

+
@foreach($folders as $folder) - @if($folder->property->filter_value == 3) -
- - @if(isset($folder->total_price) & $folder->total_price !== '') - @php - $k=0 - @endphp - -
-
-
- {{$folder->title}}
+ @if($folder->property->filter_value ==3) +
+ @if(isset($folder->total_price) & $folder->total_price !== '') + @php + $k=0 + @endphp +
+
+

+ {{$folder->title}}

+
+
+
+
+

{!! $folder->description !!}

-
-
- - - - - - - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) +
Wagt aralygyTVRadioSubtitleWebUmumy bahasy
+ - - - - - - @if($folder->total_price !== '') - @if($k < 1) - - @endif - @endif + + + + + + - @endforeach - @endisset - - @endif - @if(!isset($folder->total_price) & $folder->total_price == '') - -
-
-
- {{$folder->title}}
+
+ + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + + + + + + @if($folder->total_price !== '') + @if($k < 1) + + @endif + @endif + + @endforeach + @endisset + +
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} kan. @endisset@isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset@isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset@isset($table['set_web']) {{$table['set_web']}} @endisset@isset($folder->total_price) {{$folder->total_price}} m/sek {{$k=$k+1}} @endissetWagt aralygyTVRadioSubtitleWebUmumy bahasy
@isset($table['time']) {{$table['time']}} @endisset@isset($table['set_tv']) {{$table['set_tv']}} @endisset@isset($table['set_radio']) {{$table['set_radio']}}@endisset@isset($table['set_sub']) {{$table['set_sub']}} @endisset@isset($table['set_web']) {{$table['set_web']}} @endisset +
+ @isset($folder->total_price) {{$folder->total_price}} TMT {{$k=$k+1}} @endisset +
+
+
+
+ @endif + @if(!isset($folder->total_price) & $folder->total_price == '') +
+
+

+ {{$folder->title}}

+
+
+
+
+

{!! $folder->description !!}

-
- - Wagt aralygy - Bahasy - TV - Radio - Subtitle - Web - - - - @isset($folder->folder_table) - @foreach($folder->folder_table as $table) + + - - - - - - + + + + + + - @endforeach - @endisset - - @endif -
@isset($table['time']) {{$table['time']}} @endisset@isset($table['price']) {{$table['price']}} m/sek. @endisset@isset($table['set_tv']) {{$table['set_tv']}} kan.@endisset@isset($table['set_radio']) {{$table['set_radio']}} kan. @endisset@isset($table['set_sub']) {{$table['set_sub']}} kan. @endisset@isset($table['set_web']) {{$table['set_web']}} @endissetWagt aralygyTVRadioSubtitleWebBahasy
+ + + @isset($folder->folder_table) + @foreach($folder->folder_table as $table) + + @isset($table['time']) {{$table['time']}} @endisset + @isset($table['set_tv']) {{$table['set_tv']}} @endisset + @isset($table['set_radio']) {{$table['set_radio']}} @endisset + @isset($table['set_sub']) {{$table['set_sub']}}@endisset + @isset($table['set_web']) {{$table['set_web']}} @endisset + @isset($table['price']) {{$table['price']}} TMT @endisset + + @endforeach + @endisset + + +
+
+ @endif
@endif @endforeach
-
@endif @endforeach -
-
-

Kalkulýator

-
-
-
-
-
- - -
-
- - -
-
- - +
+
+ + +
+
+ + +
+ + + - - - + +
-
- - -
-
- -
0 TMT
-
-
- | - -
-
- {{-- For orders--}} -
+
+ + +
+
+ +
0 TMT
+
+
+ | + +
+
{{--For orders--}}
+
-
- +
+ ÝAÝLYM TERTIBI +

Sargyt edilen mahabatlaryň ýaýlyma goýberilişi bilen tanyşmak üçin ýaýlym tertibine basyň!

+
diff --git a/resources/views/web/layouts/app.blade.php b/resources/views/web/layouts/app.blade.php index ae04cfab..1c12f123 100644 --- a/resources/views/web/layouts/app.blade.php +++ b/resources/views/web/layouts/app.blade.php @@ -1,4 +1,4 @@ - + @@ -56,8 +56,10 @@ toggle between hiding and showing the dropdown content */ window.onclick = function(e) { if (!e.target.matches('.dropbtn')) { var myDropdown = document.getElementById("myDropdown"); - if (myDropdown.classList.contains('show')) { - myDropdown.classList.remove('show'); + if(myDropdown != null){ + if (myDropdown.classList.contains('show')) { + myDropdown.classList.remove('show'); + } } } } @@ -106,10 +108,54 @@ toggle between hiding and showing the dropdown content */ $('#searchId').click(function () { $('#searchContentId').toggleClass('visible'); }); + }); //Bukjalar uchin scriptler document.body.onload = function () { + //filter-script-start + $('.tv-filter-btn').click(function () { + $('.tv-filter-btn').addClass('active-filter-btn'); + $('.radio-filter-btn').removeClass('active-filter-btn'); + $('.sub-filter-btn').removeClass('active-filter-btn'); + $('.web-filter-btn').removeClass('active-filter-btn'); + + $('.bukja-table').css('display','none'); + $('.on_tv').css('display','block'); + }) + $('.radio-filter-btn').click(function () { + $('.radio-filter-btn').addClass('active-filter-btn'); + $('.tv-filter-btn').removeClass('active-filter-btn'); + $('.sub-filter-btn').removeClass('active-filter-btn'); + $('.web-filter-btn').removeClass('active-filter-btn'); + + $('.bukja-table').css('display','none'); + $('.on_radio').css('display','block'); + }) + $('.sub-filter-btn').click(function () { + $('.sub-filter-btn').addClass('active-filter-btn'); + $('.radio-filter-btn').removeClass('active-filter-btn'); + $('.tv-filter-btn').removeClass('active-filter-btn'); + $('.web-filter-btn').removeClass('active-filter-btn'); + + $('.bukja-table').css('display','none'); + $('.on_subtitle').css('display','block'); + }) + $('.web-filter-btn').click(function () { + $('.web-filter-btn').addClass('active-filter-btn'); + $('.radio-filter-btn').removeClass('active-filter-btn'); + $('.sub-filter-btn').removeClass('active-filter-btn'); + $('.tv-filter-btn').removeClass('active-filter-btn'); + + $('.bukja-table').css('display','none'); + $('.on_web').css('display','block'); + }) + //filter-script-end + + $('#opt_prop_1').attr('label',$('#prop-1').html()); + $('#opt_prop_2').attr('label',$('#prop-2').html()); + $('#opt_prop_3').attr('label',$('#prop-3').html()); + //Bukja button + var choices = []; @@ -123,6 +169,7 @@ toggle between hiding and showing the dropdown content */ //select folder script setInterval(function () { + var prop_id =$('.prop_ul > li.active').attr('prop-id'); if (($('#orders_table > tr').length <=0) || ($('#orders_table > tr').length == '')){ $('#order_it_box').css('display','none'); }else { @@ -130,59 +177,85 @@ toggle between hiding and showing the dropdown content */ } let title = $('#folder_select option:selected').text(); - let val = $('#folder_select option:selected').val(); - $('#selected_folder_id').html(val); + // let val = $('#folder_select option:selected').val(); + let f_val = $('#folder_select option:selected').attr('folderId'); + $('#selected_folder_id').html(f_val); $('#selected_folder_text').html(title); - let id=$('#selected_folder_id').text(); + // let id=$('#selected_folder_id').text(); let name=$('#selected_folder_text').text(); + let f_numb=parseInt(name.replace(/\D+/g,"")) var time=0; - if(id==1 && name=='Bukja 1'){ + if(f_val==1 && f_numb==1){ $('#bukja_1_1_wagt').css('display','inline-table'); $('#bukja_1_2_wagt').css('display','none'); $('#bukja_1_3_wagt').css('display','none'); - var time= 1; + var time= true; } - if(id==2 && name=='Bukja 1'){ + if(f_val==2 && f_numb==1){ $('#bukja_1_1_wagt').css('display','none'); $('#bukja_1_2_wagt').css('display','inline-table'); $('#bukja_1_3_wagt').css('display','none'); - var time= 1; + var time= true; } - if(id==3 && name=='Bukja 1'){ + if(f_val==3 && f_numb==1){ $('#bukja_1_1_wagt').css('display','none'); $('#bukja_1_2_wagt').css('display','none'); $('#bukja_1_3_wagt').css('display','inline-table'); - var time= 1; + var time= true; } - if(time !== 1){ + if(time !== true){ $('#bukja_1_1_wagt').css('display','none'); $('#bukja_1_2_wagt').css('display','none'); $('#bukja_1_3_wagt').css('display','none'); } + if(prop_id == 1){ + $('#opt_prop_1').css('display','inline-block'); + $('#opt_prop_2').css('display','none'); + $('#opt_prop_3').css('display','none'); + } + if(prop_id == 2){ + $('#opt_prop_1').css('display','none'); + $('#opt_prop_2').css('display','inline-block'); + $('#opt_prop_3').css('display','none'); + } + if(prop_id == 3){ + $('#opt_prop_1').css('display','none'); + $('#opt_prop_2').css('display','none'); + $('#opt_prop_3').css('display','inline-block'); + } + + if(($('#customer_cases').html().length > 100) ){ + $('#calculator-fix').css('height','100vh'); + $('#calculator-fix').removeClass('sticky'); + } }, 250); + + //calculator script $(document).ready(function () { $('#hasapla-btn').click(function () { var time_price=0; var bukja_price=0; var sec = $('#calc_second').val(); - var folder_id=$('#selected_folder_id').text(); + // var folder_id=$('#selected_folder_id').text(); + var folder_id=$('#folder_select option:selected').attr('folderId'); var folder_name=$('#selected_folder_text').text(); var day = $('#folder_day').val(); var str = $('#folder_select option:selected').attr('price'); + var f_numb=parseInt(folder_name.replace(/\D+/g,"")) var count = $('#choices_count').html(); if(count == ''){count=0} - if(folder_id == 1){ + if(folder_id == 1 && f_numb == 1){ var time= $('#select_time1 option:selected').text(); time_price = parseInt($('#select_time1 option:selected').val()); bukja_price=NaN; }else - if(folder_id == 2){ + if(folder_id == 2 && f_numb == 1){ var time= $('#select_time2 option:selected').text(); time_price = parseInt($('#select_time2 option:selected').val()); bukja_price=NaN; }else - if(folder_id == 3){ + if(folder_id == 3 && f_numb == 1){ var time= $('#select_time3 option:selected').text(); time_price = parseInt($('#select_time3 option:selected').val()); bukja_price=NaN; @@ -203,7 +276,7 @@ toggle between hiding and showing the dropdown content */ alert('Hasaplamak üçin ähli öýjükler saýlanan bolmaly!'); } $('#all_price').html(total); - console.log(total); + // console.log(total); }) $('#add_new_calc').click(function () { @@ -215,27 +288,30 @@ toggle between hiding and showing the dropdown content */ var time_price; var bukja_price; var sec = $('#calc_second').val(); - var folder_id=$('#selected_folder_id').text(); + // var folder_id=$('#selected_folder_id').text(); + var folder_id=$('#folder_select option:selected').attr('folderId'); var folder_name=$('#selected_folder_text').text(); var day = $('#folder_day').val(); - var str = $('#folder_select option:selected').html(); + var str = $('#folder_select option:selected').attr('price'); + var f_numb=parseInt(folder_name.replace(/\D+/g,"")) var count = $('#choices_count').html(); if(count == ''){count=0} count = parseInt(count); - if(folder_id == 1){ + if(folder_id == 1 && f_numb==1){ var time= $('#select_time1 option:selected').text(); time_price = parseInt($('#select_time1 option:selected').val()); }else - if(folder_id == 2){ + if(folder_id == 2 && f_numb==1){ var time= $('#select_time2 option:selected').text(); time_price = parseInt($('#select_time2 option:selected').val()); }else - if(folder_id == 3){ + if(folder_id == 3 && f_numb==1){ var time= $('#select_time3 option:selected').text(); time_price = parseInt($('#select_time3 option:selected').val()); } else {var time='Bukjada görkezilen hemme wagt aralyklary.' time_price = 0; - bukja_price=parseInt(str.replace(/\D+/g,"")); + // bukja_price=parseInt(str.replace(/\D+/g,"")); + bukja_price=parseInt(str); } if(sec>0 && day>0 && time_price >=1){ var total = sec*day*time_price; @@ -341,7 +417,7 @@ toggle between hiding and showing the dropdown content */ $('#alert_success').css('display','inline-block'); setTimeout(function () { location.reload(); - },2500) + },4000) }, error:function (data) { @@ -353,9 +429,9 @@ toggle between hiding and showing the dropdown content */ },5000) } }); - console.log(choices); + //console.log(choices); }else{ - alert('Ady we Telefon hokman girizmeli!') + alert('Ady we Telefon hökman girizmeli!') } }) //send order to backend end @@ -366,6 +442,26 @@ toggle between hiding and showing the dropdown content */ $(function () { $('[data-toggle="tooltip"]').tooltip() }) + + window.onscroll = function() {leftBarFix()}; + var leftBar = document.getElementById("left-prop-links-for-fix"); + var calculator = document.getElementById('calculator-fix'); + var sticky = leftBar.offsetTop; + var bottom = $(window).height()-sticky; + console.log(bottom); + function leftBarFix() { + if (window.pageYOffset > sticky+200) { + leftBar.classList.add("sticky"); + calculator.classList.add('sticky'); + } else{ + leftBar.classList.remove("sticky"); + calculator.classList.remove("sticky"); + } + if (window.pageYOffset > bottom-200 ){ + leftBar.classList.remove("sticky"); + calculator.classList.remove("sticky"); + } + } @yield('after_scripts')