<?php

use App\Classes\jDate;

$jDate = new jDate();
$persian = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
$english = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
$today = str_replace($persian, $english, $jDate::forge(time())->format('d'));
$url = explode('/', $_SERVER["SCRIPT_URL"]);
?>
{{--<form method="post" action="{{$task->id}}/doneAction">--}}
{{--    @csrf--}}
{{--    <input type="submit" value="done">--}}
{{--</form>--}}
<style>

    .bg-task0 {
        background: #ff6a00 !important;
    }

    .bg-task1 {
        background: #a2010c !important;
    }

    .bg-task2 {
        background: #a2010c !important;
    }

    .bg-task3 {
        background: #626262 !important;
    }

    .bg-task4 {
        background: #626262 !important;
    }

    .bg-task100 {
        background: #05875c !important;
    }
</style>
@extends('index')

@section('content')

    <div class="page-content">
        <div class="row">
            <div class="col-12">
                <div class="page-title-box d-flex align-items-center justify-content-between">
                    <h4 class="page-title mb-0 font-size-18">عناصر فرم</h4>

                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a>فرم ها</a></li>
                            <li class="breadcrumb-item active">عناصر فرم</li>
                        </ol>
                    </div>

                </div>
            </div>
        </div>
        <div class="row">
            <button onmousedown="document.getElementById('sidebar').action = 'https://admin.borjeweb.com/ticketCategory'"
                    onmouseup="document.getElementById('sidebar').submit()">ارسال تیکت جدید
            </button>

            @foreach($tasks as $task)
                @if($task->status != 4)
                    <div class="col-lg-4 " style="color: black">
                        <div class="card bg-task{{$task->status}} text-white-50 class{{$task->status}}"
                             onmousedown="document.getElementById('sidebar').action = 'https://admin.borjeweb.com/subTicket/{{$task->id}}'"
                             onmouseup="document.getElementById('sidebar').submit()">
                            <div class="card-body">
                                <h5 class="mt-0 mb-4 "><i class="mdi mdi-bullseye-arrow mr-3"></i>{{$task->title}}</h5>
                                <button type="button" class="btn btn-dark w-lg waves-effect waves-light"
                                        data-toggle="modal" data-target="#exampleModalScrollable{{$task->id}}">اطلاعات
                                </button>
                            </div>

                        </div>
                    </div>
                @endif

            @endforeach


        </div>
    </div>
@endsection
