Soruda ki kodlar biraz uzun oldu farkındayım, fakat projeyi yeni aldım tam olarak hakim değilim birde mouse bozuk olunca tam seçemedim.
Controller dosyam da return view kısmını screen.index'e göndermeye çalıştığım anda
"in_array(): Argument #2 ($haystack) must be of type array, null given"
bu şekilde bir hata fırlatıyor.
normal kendi url'ine giderken bir problem mevcut değil.
bunu tam olarak neden yapar acaba ?
controllerda ki sorguları silip ScreenGroup::all(); yaptığım da da aynı hata dönüyor bu URL'e istek geldiği anda
Controller dosyam
public function create()
{
$screenGroups = ScreenGroup::ofCustomer()->orderBy('title','desc')->get();
$playlists = Playlist::ofCustomer()->orderBy('title','asc')->get();
$schedules = Schedule::ofCustomer()->orderBy('title','asc')->get();
return view('screen.edit-modal',[
'screen_groups' => $screenGroups,
'playlists' => $playlists,
'schedules' => $schedules
]);
}
index dosyası
{% extends "layouts.new" %}
{% block content %}
<!--Screen ekranı tablosunun başladığı kısım -->
<div class="page-container flex items-end flex-col text-[#262C45]">
<div class="w-full item-container h-[calc(100%-5px)] overflow-y-auto">
<div class="w-full float-left flex h-[60px] items-center border-b-[2px] border-[#F6F6F6] justify-end">
<button data-bs-toggle="modal" data-bs-target="#filter-modal"
class="btn-container bg-[#8392A6] hover:bg-[#8392A6] hover:opacity-75 text-white ml-2 min-h-[38px]">
<img class='mr-2' src="./images/filter-icon.svg">
{{ __('ui.filter') }}
</button>
<button data-bs-toggle="modal" data-bs-target="#newscreen-modal"
class="btn-container bg-[#8392A6] hover:bg-[#8392A6] hover:opacity-75 text-white ml-2"
onclick="window.screenAdd()">
<span class="btn-icon text-white border-white">+</span>
{{ __("ui.add_new") }}
</button>
</div>
{% include "partials.table" %}
</div>
</div>
<div class="modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto"
id="newscreen-modal" tabindex="-1" aria-labelledby="newscreen-modalLabel" aria-modal="true" role="dialog">
<div class="modal-dialog modal-xl relative w-auto pointer-events-none">
<div
class="modal-content border-none shadow-lg relative flex flex-col w-full pointer-events-auto bg-white bg-clip-padding outline-none text-current">
<div class="modal-header flex flex-shrink-0 items-center justify-between p-4">
<h5 class="text-xl leading-normal text-[#110B56] font-semibold" id="newscreen-modalLabel">
New Screen
</h5>
<button type="button"
class="btn-close box-content w-[26px] h-[26px] text-black border-none rounded-none focus:shadow-none focus:outline-none focus:opacity-100 hover:text-black hover:opacity-75 hover:no-underline"
data-bs-dismiss="modal" aria-label="Close"><img class='origin-center'
src="./images/close-modal.svg"/>
</button>
</div>
<form action="{{ route('screens.store') }}" id="screen-form" method="POST">
<div class="modal-body relative p-4">
<ul class="modal-stepper">
<li class="modal-stepper-content xl:p-20 p-2">
<img class='xl:h-auto h-[60px]' src='images/new-screen-aut.svg'/>
<input type='text' id="screen-code" data-stepper-null
class='modal-input w-[80%] text-[#00CA00] text-center pb-2 text-6xl'
maxlength="7"
placeholder=""/>
<p class="mt-4 text-black">
7 Karakterli Doğrulama Kodunu Giriniz.
<img class="float-right w-[14px] ml-2" src="./images/question.svg"
data-bs-toggle="tooltip" data-bs-html="true" title='
<ul class="tooltip-container shadow p-3 rounded-lg text-left !text-[#676E89]">
<li>
OCTOPUS kurulu cihazınızda yer alan </br> 7 karakterli doğrulama kodunu yazınız.
</li>
</ul>
'/>
</p>
</li>
<li class="modal-stepper-content xl:p-20 p-2">
<div class="w-[80%] flex flex-col justify-center items-center">
<img class='xl:h-auto h-[60px]' src='images/new-screen.svg'/>
<input type='text' id="screen-name" data-stepper-null
class='modal-input w-full text-[#110b5685] text-center pb-2 font-bold'
placeholder="Yeni Ekranı İsimlendirin.."/>
</div>
</li>
<li class="modal-stepper-content xl:p-20 p-2 text-[#110B56]">
<div class="flex flex-col w-full hide-in-modal">
<div class="flex flex-col w-full mt-5">
<span class="font-semibold">
Oynatma Listesi Seç
</span>
<p>Daha önce oluşturmuş olduğunuz bir oynatma listesiniz seçiniz. İlk ekranınızı
</br> oluşturuyorsanız taslak varsayılan olarak atanacaktır.</p>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select
class="w-full border-[1px] border-[#EAEFFD] select2-modal playlist-select">
<option value="Group 1">Fırsat Ürünleri 1 saat gösterim listesi</option>
<option value="Group 2">Yaz Kampanyası 2022 Listesi</option>
<option value="Group 3">Kış 2022 Listesi</option>
</select>
</div>
</div>
<div class="flex flex-col w-full mt-8">
<span class="font-semibold">
Ekran Grubu Seç
</span>
<p>Daha önce oluşturmuş olduğunuz bir ekran gurubu seçiniz. İlk ekranınızı </br>
oluşturuyorsanız tanımsız gurub varsayılan olarak atanacaktır.</p>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select
class="w-full border-[1px] border-[#EAEFFD] select2-modal screen-group-select">
<option value="Group 1">Fırsat Ürünleri 1 saat gösterim listesi</option>
<option value="Group 2">Yaz Kampanyası 2022 Listesi</option>
<option value="Group 3">Kış 2022 Listesi</option>
</select>
</div>
</div>
<div class="xl:flex-row flex-col flex w-full mt-5 items-end">
<div class="flex flex-col w-full mt-8 mr-2">
<span class="font-semibold">
Zaman Dilimi
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/screen-modal-select-timezone.svg"
class="absolute left-[10px] top-[15px]">
<select
class="w-full border-[1px] border-[#EAEFFD] select2-modal timezone-select"">
<option value=" Group 1">Timezone 1</option>
<option value="Group 2">Timezone 2</option>
<option value="Group 3">Timezone 3</option>
</select>
</div>
</div>
<div class="flex flex-col w-full mt-8 ml-1 mr-1">
<span class="font-semibold flex items-center justify-between">
Kurumsal Saat
<button
class="add-new-time btn-container border-[#8392A6] border-[1px] bg-transparent border-[8392A6] hover:opacity-75 text-[#8392A6] py-1 px-2">
Yeni Saat
<span
class="btn-icon text-white border-[#8392A6] bg-[#8392A6] mr-0 ml-1">+</span>
</button>
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/screen-modal-select-timer.svg"
class="absolute left-[10px] top-[15px]">
<select
class="w-full border-[1px] border-[#EAEFFD] select2-modal timer-select">
<option value="Group 1">Timer 1</option>
<option value="Group 2">Timer 2</option>
<option value="Group 3">Timer 3</option>
</select>
</div>
</div>
<div class="flex flex-col w-full justify-start items-center">
<span
class="add-location rounded-lg w-full ml-3 border-[2px] border-[#EAEFFD] flex justify-start items-center h-[60px] cursor-pointer">
<img class="ml-6 mr-4" src="./images/settings-locaiton.svg"/>
<p class="location-text">Lokasyon Ekle</p>
</span>
<span
class="location-pos-container flex hidden mt-[-3px] ml-3 border-[2px] w-full border-[#EAEFFD] justify-between items-center !border-t-0 px-2 rounded-lg rounded-tl-none rounded-tr-none">
<button
class="bg-[#110B56] w-[68px] h-[20px] add-location text-[10px] text-white mr-2 flex justify-center items-center rounded-lg">
Düzenle
</button>
<p class="location-pos text-sm"></p>
</span>
</div>
</div>
</div>
<div class="w-full flex flex-col items-center hidden visible-time-modal">
<h3 class="text-2xl text-[#110B56]"><b>Yeni Çalışma Saati Oluşturun.</b></h3>
<div class="flex flex-col w-full mt-10">
<table class="table border-separate rounded-lg">
<tr>
<td colspan="3">
<div class="form-floating mb-3 w-full">
<input type="text" placeholder='Çalışma Saatini isimlendirin'
class="time-modal-input border-[#EAEFFD] rounded-lg form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solidrounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none"
id="floatingInput">
<label for="floatingInput" class="text-gray-700">Çalışma Saatini
isimlendirin</label>
</div>
</td>
<td class="timemodal-table-item-checkbox">
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Pazartesi
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Salı
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Çarşamba
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Perşembe
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Cuma
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Cumartesi
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
<tr>
<td class="timemodal-table-item w-3/6 rounded-tl-lg rounded-bl-lg">
Pazar
</td>
<td class="timemodal-table-item text-center hidden timemobal-hide-check">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td
class="timemodal-table-item text-center hidden timemobal-hide-check rounded-tr-lg rounded-br-lg">
<input class='remove-focus' type="time" value='10:00'/>
</td>
<td class="timemodal-table-item text-center timemobal-show-check rounded-tr-lg rounded-br-lg"
colspan="2">
<p class="text-sm">Saat Ayarlanmadı. Ekran Uyku Modunda Kalacak</p>
</td>
<td class="timemodal-table-item-checkbox">
<div class="form-check form-switch">
<input
class="form-check-input appearance-none w-9 -ml-10 rounded-full float-left h-5 align-top bg-white bg-gray-300 bg-no-repeat bg-contain focus:outline-none cursor-pointer shadow-sm"
type="checkbox" role="switch" id="flexSwitchCheckDefault56">
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="w-full h-full flex flex-col items-center hidden visible-location-modal">
<div class="flex flex-col w-full h-full relative">
<span class="absolute left-[5%] top-4 z-50 w-[90%]">
<span
class="absolute right-[12px] top-[14px] z-30 w-[38px] h-[38px] flex justify-center items-center bg-[#EAEFFD] rounded-lg">
<img src="images/playlist-template-search.svg" class="">
</span>
<input id="pac-input" type="text" placeholder="Enter a location"
class="playlist-tab-templates-search w-full">
</span>
<div id="map" class="w-full h-full"></div>
<div id="infowindow-content">
<span id="place-name" class="title"></span><br/>
<span id="place-address"></span>
</div>
</div>
</div>
</li>
</ul>
</div>
</form>
<div class="modal-footer flex flex-shrink-0 items-center justify-center p-4">
<button class="btn-container modal-stepper-prev modal-stepper-button hide-in-modal" disabled>
<img class='absolute left-3 top-[calc(50%-11px)]' src='images/stepper-prev.svg'/>
<p>Previous</p>
</button>
<button class="btn-container modal-stepper-next modal-stepper-button ml-5 hide-in-modal">
<p>Continue</p>
<img class='absolute right-3 top-[calc(50%-11px)]' src='images/stepper-next.svg'/>
</button>
<button
class="btn-container modal-stepper-button close-in-modal ml-5 visible-time-modal visible-location-modal hidden">
<img class='absolute left-3 top-[calc(50%-11px)]' src='images/stepper-prev.svg'/>
<p>Previous</p>
</button>
<button
id='save-map-location'
class="btn-container modal-stepper-button close-in-modal ml-5 visible-time-modal visible-location-modal time-modal-disabled-null hidden">
<p>Save</p>
<img class='absolute right-3 top-[calc(50%-11px)]' src='images/stepper-next.svg'/>
</button>
</div>
</div>
</div>
</div>
<!--Screen ekranı filtreleme bittiği kısım -->
<div class="modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto"
id="filter-modal" tabindex="-1" aria-labelledby="filter-modalLabel" aria-modal="true" role="dialog">
<div class="modal-dialog modal-lg relative w-auto pointer-events-none">
<div
class="modal-content border-none shadow-lg relative flex flex-col w-full pointer-events-auto bg-white bg-clip-padding outline-none text-current">
<div class="modal-header flex flex-shrink-0 items-center justify-between p-4">
<h5 class="text-xl leading-normal text-[#110B56] font-semibold" id="screeninfo-modalLabel">
{{ __('ui.filter') }}
</h5>
<button type="button"
class="btn-close box-content w-[26px] h-[26px] text-black border-none rounded-none focus:shadow-none focus:outline-none focus:opacity-100 hover:text-black hover:opacity-75 hover:no-underline"
data-bs-dismiss="modal" aria-label="Close"><img class='origin-center'
src="./images/close-modal.svg"/>
</button>
</div>
<div class="modal-body relative p-4">
<div class="flex text-black px-10 justify-start flex-col w-5/6">
{{ csrf_field() }}
<input type="hidden" name="search" value="{{ request.search }}">
<div class="flex flex-col">
<div class="flex flex-col w-full mt-5">
<span class="font-semibold">
{{ __("ui.groups") }}
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select name="group_id"
class="w-full border-[1px] border-[#EAEFFD] select2-modal filter-select"
id="filter-group" multiple=""
data-select2-id="select2-data-filter-group" tabindex="-1"
aria-hidden="true">
<option value="">-- {{ __("ui.groups") }} --</option>
<option value="">{{ __("ui.all_groups") }}</option>
</select>
</div>
</div>
<div class="flex flex-col w-full mt-5">
<span class="font-semibold">
{{ __('ui.status') }}
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select name="status"
class="w-full border-[1px] border-[#EAEFFD] select2-modal filter-select"
id="filter-tag" multiple="" data-select2-id="select2-data-filter-tag"
tabindex="-1" aria-hidden="true">
<option value="">-- {{ __('ui.status') }} --</option>
<option value="">{{ __("ui.all_statuses") }}</option>
<option value="on"
{% if request.status == "on" %}selected="selected"{% endif %}>{{ __("ui.on") }}</option>
<option value="off"
{% if request.status == "off" %}selected="selected"{% endif %}>{{ __("ui.off") }}</option>
<option value="error"
{% if request.status == "error" %}selected="selected"{% endif %}>{{ __("ui.failing") }}</option>
</select>
</div>
</div>
<div class="flex flex-col w-full mt-5">
<span class="font-semibold">
{{ __('ui.position') }}
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select name="position"
class="w-full border-[1px] border-[#EAEFFD] select2-modal filter-select"
id="filter-status" multiple=""
data-select2-id="select2-data-filter-status" tabindex="-1"
aria-hidden="true">
<option value="">-- {{ __('ui.position') }} --</option>
<option value="3"
{% if request.position == "3" %}selected="selected"{% endif %}>270°
</option>
<option value="2"
{% if request.position == "2" %}selected="selected"{% endif %}>180°
</option>
<option value="1"
{% if request.position == "1" %}selected="selected"{% endif %}>90°
</option>
<option value="0"
{% if request.position == "0" %}selected="selected"{% endif %}>0°
</option>
</select>
</div>
</div>
<div class="flex flex-col w-full mt-5">
<span class="font-semibold">
Silinenler
</span>
<div class="w-full select2-modal-container mt-2 relative">
<img src="images/playlist-template-search.svg"
class="absolute left-[15px] top-[20px]">
<select name="deleted"
class="w-full border-[1px] border-[#EAEFFD] select2-modal filter-select"
id="filter-deleted" multiple=""
data-select2-id="select2-data-filter-deleted" tabindex="-1"
aria-hidden="true">
<option value="">-- Silinenler --</option>
<option value="yes"
{% if request.deleted == "yes" %}selected="selected"{% endif %}>Evet
</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer flex flex-shrink-0 items-center justify-center p-4">
<button class="btn-container modal-stepper-next modal-stepper-button ml-5" type="submit">
<p>{{ __("ui.apply") }}</p>
</button>
</div>
</div>
</div>
</div>
<!--Screen ekranı tablosunun bittiği kısım -->
{% endblock %}
{% block scripts %}
<script>
$(document).ready(function () {
$('.time-modal-input').on('input', function () {
if ($(this).val().trim().length > 0) {
$('.time-modal-disabled-null').removeAttr('disabled');
} else {
$('.time-modal-disabled-null').prop('disabled', 'disabled');
}
});
var oTable = $('#screen-list').DataTable({
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"bAutoWidth": false,
"searching": false,
responsive: true
});
modalStepper('#newscreen-modal .modal-stepper', '#newscreen-modal .modal-stepper-next', '#newscreen-modal .modal-stepper-prev', function () {
alert('gönderildi');
});
$('.delete-table-item').click(function () {
var selectedRow = $(this).closest('tr');
var screenName = selectedRow.find('.screen-name').text();
var screenID = selectedRow.attr('data-screen-id');
var settings = {}
settings.question = 'Ekranı <b>Silmek</b> İstediğinizden Emin misiniz?';
settings.hint = 'Ekran Adı : <b>' + screenName + '</b>';
settings.deleteName = screenName;
settings.icon = './images/modal-delete-icon.svg';
settings.option1 = 'Onayla';
modalConfirm(settings, function (a) {
oTable
.row(selectedRow)
.remove()
.draw();
});
});
$('.edit-table-item').click(function () {
var selectedRow = $(this).closest('tr');
var screenID = selectedRow.attr('data-screen-id');
$('#editscreen-modal').modal('toggle');
});
$('.device-play, .pause-table-item').click(function () {
var selectedRow = $(this).closest('tr');
var that = this;
var deviceID = selectedRow.attr('data-device-id');
if ($(selectedRow).hasClass('played')) {
$(selectedRow).find('.device-play img').attr('src', './images/device-status-play.svg');
$(selectedRow).find('.pause-table-item').text('Duraklat');
$(selectedRow).removeClass('played');
} else {
var settings = {}
settings.question = 'Ekranı <b>Duraklatmak</b> İstediğinizden Emin misiniz?';
settings.hint = 'Ekranı Duraklatmanız Ekran içeriğini temizlecektir. İşlem geri alınamaz.';
settings.icon = './images/screen-pause-button.svg';
settings.cancel = 'İptal';
settings.option1 = 'Duraklat';
modalConfirm(settings, function (a) {
$(selectedRow).find('.device-play img').attr('src', './images/device-status-pause.svg');
$(selectedRow).find('.pause-table-item').text('Başlat');
$(selectedRow).addClass('played');
});
;
}
});
$('.info-table-item').click(function () {
var selectedRow = $(this).closest('tr');
var deviceID = selectedRow.attr('data-device-id');
$('#screeninfo-modal').modal('toggle');
});
$('.preview-table-item').click(function () {
var selectedRow = $(this).closest('tr');
var deviceID = selectedRow.attr('data-device-id');
$('#screen-preview-modal').modal('toggle');
});
$('.btn-fullscreen').click(function () {
$('#screen-preview-modal .modal-xl').toggleClass('modal-full');
});
var playlistIconSvg = '<svg width="30" height="23" viewBox="0 0 30 23" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.921875 0.75C0.921882 0.604962 0.979502 0.465866 1.08206 0.363309C1.18462 0.260752 1.32371 0.203132 1.46875 0.203125H25.5312C25.6763 0.203125 25.8154 0.260742 25.9179 0.363301C26.0205 0.46586 26.0781 0.60496 26.0781 0.75C26.0781 0.89504 26.0205 1.03414 25.9179 1.1367C25.8154 1.23926 25.6763 1.29688 25.5312 1.29688H1.46875C1.32371 1.29687 1.18462 1.23925 1.08206 1.13669C0.979502 1.03413 0.921882 0.895038 0.921875 0.75V0.75ZM1.46875 10.0469H17.875C18.02 10.0469 18.1591 9.98926 18.2617 9.8867C18.3643 9.78414 18.4219 9.64504 18.4219 9.5C18.4219 9.35496 18.3643 9.21586 18.2617 9.1133C18.1591 9.01074 18.02 8.95312 17.875 8.95312H1.46875C1.32371 8.95312 1.18461 9.01074 1.08205 9.1133C0.979492 9.21586 0.921875 9.35496 0.921875 9.5C0.921875 9.64504 0.979492 9.78414 1.08205 9.8867C1.18461 9.98926 1.32371 10.0469 1.46875 10.0469V10.0469ZM11.3125 17.7031H1.46875C1.32371 17.7031 1.18461 17.7607 1.08205 17.8633C0.979492 17.9659 0.921875 18.105 0.921875 18.25C0.921875 18.395 0.979492 18.5341 1.08205 18.6367C1.18461 18.7393 1.32371 18.7969 1.46875 18.7969H11.3125C11.4575 18.7969 11.5966 18.7393 11.6992 18.6367C11.8018 18.5341 11.8594 18.395 11.8594 18.25C11.8594 18.105 11.8018 17.9659 11.6992 17.8633C11.5966 17.7607 11.4575 17.7031 11.3125 17.7031ZM29.3363 9.11027C29.3156 9.17906 29.2817 9.24311 29.2363 9.29877C29.1909 9.35442 29.135 9.40059 29.0718 9.43464C29.0085 9.46869 28.9392 9.48996 28.8678 9.49722C28.7963 9.50448 28.7241 9.4976 28.6554 9.47697L23.8906 8.0475V18.25C23.8921 19.1391 23.5844 20.0011 23.0204 20.6885C22.4564 21.3758 21.671 21.8457 20.7987 22.0179C19.9264 22.19 19.0214 22.0537 18.2385 21.6321C17.4557 21.2106 16.8436 20.5301 16.5072 19.7071C16.1707 18.884 16.1308 17.9697 16.3941 17.1204C16.6575 16.2712 17.2078 15.5399 17.9509 15.0517C18.694 14.5634 19.5836 14.3486 20.4676 14.444C21.3517 14.5394 22.175 14.939 22.7969 15.5745V7.3125C22.7969 7.22725 22.8168 7.14318 22.8551 7.067C22.8934 6.99083 22.9489 6.92465 23.0173 6.87376C23.0857 6.82287 23.1651 6.78867 23.249 6.7739C23.333 6.75912 23.4192 6.76417 23.5009 6.78866L28.9696 8.42928C29.0384 8.44992 29.1025 8.48391 29.1581 8.5293C29.2138 8.5747 29.26 8.63061 29.294 8.69384C29.328 8.75708 29.3493 8.8264 29.3566 8.89785C29.3638 8.9693 29.3569 9.04148 29.3363 9.11027V9.11027ZM22.7969 18.25C22.7969 17.7092 22.6365 17.1805 22.3361 16.7309C22.0356 16.2812 21.6085 15.9307 21.1089 15.7238C20.6093 15.5168 20.0595 15.4627 19.529 15.5682C18.9986 15.6737 18.5114 15.9341 18.129 16.3165C17.7466 16.6989 17.4862 17.1861 17.3807 17.7165C17.2752 18.247 17.3293 18.7968 17.5363 19.2964C17.7432 19.796 18.0937 20.2231 18.5434 20.5236C18.993 20.824 19.5217 20.9844 20.0625 20.9844C20.7875 20.9836 21.4825 20.6952 21.9951 20.1826C22.5077 19.67 22.7961 18.975 22.7969 18.25V18.25Z" fill="#676E89"/></svg>';
var screenGroupIconSvg = '<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.678809 8.09476L13.4177 13.8736C13.7896 14.0426 14.2101 14.0426 14.582 13.8736L27.3209 8.09476C28.226 7.68406 28.226 6.31633 27.3209 5.90562L14.5826 0.126248C14.3998 0.0427353 14.2013 -0.000488281 14.0004 -0.000488281C13.7995 -0.000488281 13.601 0.0427353 13.4183 0.126248L0.678809 5.90508C-0.22627 6.31578 -0.22627 7.68406 0.678809 8.09476ZM27.3215 12.9226L24.1447 11.4827L15.305 15.4896C14.8915 15.6772 14.4524 15.7723 14.0001 15.7723C13.5479 15.7723 13.1093 15.6772 12.6953 15.4896L3.85615 11.4827L0.678809 12.9226C-0.22627 13.3327 -0.22627 14.6999 0.678809 15.1101L13.4177 20.8845C13.7896 21.053 14.2101 21.053 14.582 20.8845L27.3215 15.1101C28.2265 14.6999 28.2265 13.3327 27.3215 12.9226ZM27.3215 19.9116L24.1567 18.4772L15.305 22.4896C14.8915 22.6772 14.4524 22.7723 14.0001 22.7723C13.5479 22.7723 13.1093 22.6772 12.6953 22.4896L3.84412 18.4772L0.678809 19.9116C-0.22627 20.3218 -0.22627 21.689 0.678809 22.0991L13.4177 27.8736C13.7896 28.042 14.2101 28.042 14.582 27.8736L27.3215 22.0991C28.2265 21.689 28.2265 20.3218 27.3215 19.9116Z" fill="#110B56"/></svg>';
function playlistSelectIcon(val) {
if (val.element) {
val = '<span class="select2-option-img">' + playlistIconSvg + ' <p class="ml-2">' + val.text + '<p></span>';
}
return val;
}
function groupSelectIcon(val) {
if (val.element) {
val = '<span class="select2-option-img">' + screenGroupIconSvg + ' <p class="ml-2">' + val.text + '<p></span>';
}
return val;
}
createSelect2({
select: "#newscreen-modal .playlist-select",
modal: "#newscreen-modal",
search: "Search a Playlist",
templateResult: playlistSelectIcon
});
createSelect2({
select: "#editscreen .playlist-select",
modal: "#editscreen-modal",
search: "Search a Playlist",
templateResult: playlistSelectIcon
});
createSelect2({
select: "#newscreen-modal .screen-group-select",
modal: "#newscreen-modal",
search: "Search a Group",
templateResult: groupSelectIcon
});
createSelect2({
select: "#editscreen-modal .screen-group-select",
modal: "#editscreen-modal",
search: "Search a Group",
templateResult: groupSelectIcon
});
createSelect2({
select: "#newscreen-modal .timezone-select, #newscreen-modal .timer-select",
modal: "#newscreen-modal"
});
createSelect2({
select: "#editscreen-edit- .timezone-select, #editscreen-modal .timer-select",
modal: "#editscreen-modal"
});
createSelect2({select: "#filter-position", modal: "#filter-modal", multiple: true, search: "Search"});
createSelect2({select: "#filter-status", modal: "#filter-modal", multiple: true, search: "Search"});
createSelect2({select: "#filter-tag", modal: "#filter-modal", multiple: true, search: "Search"});
createSelect2({select: "#filter-group", modal: "#filter-modal", multiple: true, search: "Search"});
createSelect2({select: "#filter-deleted", modal: "#filter-modal", multiple: true, search: "Search"});
var ms1 = $('.magic-sug').magicSuggest({
data: ['New York', 'Los Angeles', 'Chicago', 'Houston', 'Philadelphia', 'Phoenix', 'San Antonio', 'San Diego', 'Dallas', 'San Jose', 'Jacksonville']
});
var ms2 = $('.magic-sug-tag').magicSuggest({
placeholder: 'Etiketleyin',
data: ['New York', 'Los Angeles', 'Chicago', 'Houston', 'Philadelphia', 'Phoenix', 'San Antonio', 'San Diego', 'Dallas', 'San Jose', 'Jacksonville']
});
var tooltipTriggerList = [].slice.call(
document.querySelectorAll('[data-bs-toggle="tooltip"]')
);
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new Tooltip(tooltipTriggerEl);
});
$('.custom-tag-item').click(function () {
$(this).toggleClass('custom-tag-item-active');
});
$('.add-new-time').click(function () {
$(this).closest('.modal').find('.hide-in-modal').addClass('hidden');
$(this).closest('.modal').find('.visible-time-modal').removeClass('hidden');
$('.time-modal-disabled-null').prop('disabled', 'disabled');
});
$('.add-location').click(function () {
$(this).closest('.modal').find('.hide-in-modal').addClass('hidden');
$(this).closest('.modal').find('.visible-location-modal').removeClass('hidden');
});
$('.close-in-modal').click(function () {
$(this).closest('.modal').find('.hide-in-modal').removeClass('hidden');
$(this).closest('.modal').find('.visible-time-modal').addClass('hidden');
$(this).closest('.modal').find('.visible-location-modal').addClass('hidden');
});
$('.timemodal-table-item-checkbox input').click(function () {
var row = $(this).closest('tr');
if ($(this).prop('checked')) {
row.find('.timemobal-hide-check').removeClass('hidden');
row.find('.timemobal-show-check').addClass('hidden');
} else {
row.find('.timemobal-hide-check').addClass('hidden');
row.find('.timemobal-show-check').removeClass('hidden');
}
});
$(window).on('shown.bs.modal', function () {
$('.hide-in-modal').removeClass('hidden');
$('.visible-time-modal, .visible-location-modal').addClass('hidden');
});
});
</script>
<script>
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
function initMap() {
const map = new google.maps.Map(document.getElementById("map"), {
center: {lat: 40.749933, lng: -73.98633},
zoom: 13,
mapTypeControl: false,
});
const card = document.getElementById("pac-card");
const input = document.getElementById("pac-input");
const biasInputElement = document.getElementById("use-location-bias");
const strictBoundsInputElement = document.getElementById("use-strict-bounds");
const options = {
fields: ["formatted_address", "geometry", "name"],
strictBounds: false,
types: ["establishment"],
};
map.controls[google.maps.ControlPosition.TOP_LEFT].push(card);
const autocomplete = new google.maps.places.Autocomplete(input, options);
// Bind the map's bounds (viewport) property to the autocomplete object,
// so that the autocomplete requests use the current map bounds for the
// bounds option in the request.
autocomplete.bindTo("bounds", map);
const infowindow = new google.maps.InfoWindow();
const infowindowContent = document.getElementById("infowindow-content");
infowindow.setContent(infowindowContent);
const marker = new google.maps.Marker({
map,
anchorPoint: new google.maps.Point(0, -29),
});
autocomplete.addListener("place_changed", () => {
infowindow.close();
marker.setVisible(false);
const place = autocomplete.getPlace();
if (!place.geometry || !place.geometry.location) {
// User entered the name of a Place that was not suggested and
// pressed the Enter key, or the Place Details request failed.
window.alert("No details available for input: '" + place.name + "'");
return;
}
// If the place has a geometry, then present it on a map.
if (place.geometry.viewport) {
map.fitBounds(place.geometry.viewport);
} else {
map.setCenter(place.geometry.location);
map.setZoom(17);
}
marker.setPosition(place.geometry.location);
marker.setVisible(true);
infowindowContent.children["place-name"].textContent = place.name;
infowindowContent.children["place-address"].textContent =
place.formatted_address;
infowindow.open(map, marker);
});
// Sets a listener on a radio button to change the filter type on Places
// Autocomplete.
function setupClickListener(id, types) {
const radioButton = document.getElementById(id);
radioButton.addEventListener("click", () => {
autocomplete.setTypes(types);
input.value = "";
});
}
setupClickListener("changetype-all", []);
setupClickListener("changetype-address", ["address"]);
setupClickListener("changetype-establishment", ["establishment"]);
setupClickListener("changetype-geocode", ["geocode"]);
setupClickListener("changetype-cities", ["(cities)"]);
setupClickListener("changetype-regions", ["(regions)"]);
biasInputElement.addEventListener("change", () => {
if (biasInputElement.checked) {
autocomplete.bindTo("bounds", map);
} else {
// User wants to turn off location bias, so three things need to happen:
// 1. Unbind from map
// 2. Reset the bounds to whole world
// 3. Uncheck the strict bounds checkbox UI (which also disables strict bounds)
autocomplete.unbind("bounds");
autocomplete.setBounds({east: 180, west: -180, north: 90, south: -90});
strictBoundsInputElement.checked = biasInputElement.checked;
}
input.value = "";
});
strictBoundsInputElement.addEventListener("change", () => {
autocomplete.setOptions({
strictBounds: strictBoundsInputElement.checked,
});
if (strictBoundsInputElement.checked) {
biasInputElement.checked = strictBoundsInputElement.checked;
autocomplete.bindTo("bounds", map);
}
input.value = "";
});
}
window.initMap = initMap;
</script>
{% endblock %}
Burası da controller'a istek attığım kısım
window.screenAdd = () => {
window.startProgress();
// Düzenleme penceresini aç
modal.load('/screens/create').then(()=>{
// Modal slota ekle
modal.append();
getScript(document,'script');
window.endProgress();
// Formu oluştur
const form = new Form({
element: '#screen-form',
submitButton: '#screen-form-submit',
success: (response) => {
form.disableSubmitButton();
// window.startProgress();
// modal.remove();
swal.fire({
title: __('saved'),
text: __('redirecting_to_table'),
icon: "success",
confirmButtonText: __('okay'),
//button: __('okay')
});
setTimeout(()=>{
location.reload();
}, 1500);
}
});
document.getElementById('tag-input').addEventListener('keydown', function(e){
if (e.keyCode === 13) {
var tag = document.getElementById('tag-input').value;
var seoTag = urlTitle(tag);
document.getElementById('tags').innerHTML += `
<input id="tag-${seoTag}" name="tag-${seoTag}" class="flex justify-center items-center text-center rounded-md text-white m-2 p-2" value="${tag}" disabled="" style="background-color: rgb(144, 143, 143); width: 100px;">
`;
document.getElementById('tag-input').value = "";
}
});
});
}