<?php 
    session_start();
    include "../modules/Class/autoload.php"; 
    $url = '217.11.177.108:9907/Fines/api/rbdaapi/index.php';
    $secret = 'shohinnewkey';
    $inputdate = date('ymdHis');
    $data = [
    "action"=>"getspor",
    "inputdate"=>$inputdate,
    "id"=>$_REQUEST['order'],
    "sign"=>md5('getspor'.$inputdate.$secret)
    ];
    $jsondata = json_encode($data);
    $sendcurl = sendcurl($jsondata,$url);
    $arraydata = customjsondecode($sendcurl);
    $dataforproceed = $arraydata[0];
    // dd($dataforproceed);
    //  return;
?>
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>РБДА</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="РБДА" name="description" />
    <meta content="Themesdesign" name="author" />
    <!-- App favicon -->
    <link rel="shortcut icon" href="../assets/images/nerufavicon.png">
    <!-- Bootstrap Css -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Icons Css -->
    <link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" />
    <!-- App Css-->
    <link href="../assets/css/app.min.css" rel="stylesheet" type="text/css" />

</head>

<body data-sidebar="dark">

    <!-- Begin page -->
    <div id="layout-wrapper">

        
        <?php include "header.php";?>
        <!-- ========== Left Sidebar Start ========== -->
        <?php include "menu.php"?>
        <!-- Left Sidebar End -->

        <!-- ============================================================== -->
        <!-- Start right Content here -->
        <!-- ============================================================== -->
        <div class="main-content">

            <div class="page-content">
                <div class="container-fluid">

                    <!-- start page title -->
                    <div class="row">
                        <div class="col-12">
                            <div class="page-title-box d-flex align-items-center justify-content-between">
                                <h4 class="mb-0 font-size-18">Спорные штрафы</h4>
                            </div>
                        </div>
                    </div>
                    <!-- end page title -->
                <div class="card">
                        <div class="card-body">
                            <div class="p-lg-3">
                                <div class="col" style="overflow-x:auto ;">
                                    <p class="lead">Детали штрафа</p>
                                    <hr>
                                    <table class="table table-light">
                                        <tbody>
                                            <tr>
                                                <td>Номер автомобиля</td>
                                                <td><?=$dataforproceed['account']?></td>                                                
                                            </tr>
                                            <tr>
                                                <td>Инвойс(ордер)</td>
                                                <td><?=$dataforproceed['orderID']?></td>
                                            </tr>
                                            <tr>
                                                <td>Штраф</td>
                                                <td><?=$dataforproceed['Name']?></td>
                                            </tr>
                                            <tr>
                                                <td>Дата штрафа</td>
                                                <td><?=$dataforproceed['dateFine']?></td>
                                            </tr>
                                            <tr>
                                                <td>Дата заявки</td>
                                                <td><?=$dataforproceed['inputdate']?></td>
                                            </tr>
                                            <tr>
                                                <td>Сумма</td>
                                                <td><?=$dataforproceed['summa']?></td>
                                            </tr>
                                            <tr>
                                                <td>Комментарий водителя</td>
                                                <td><?=$dataforproceed['reason']?></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>                                                                                                                 
                            </div>
                        <!--end card body-->
                    </div> <!-- end card-->
                </div> <!-- container-fluid -->

                <div class="card">
                        <div class="card-body">
                            <div class="p-lg-3">
                                <div class="col" style="overflow-x:auto ;">
                                    <p class="lead">Медиафайлы</p>
                                    <hr>
                                    <div class="row">
                                        <div class="col-md-4 col-12">
                                            <a target="_blank" href="<?=$dataforproceed['metaPlate']?>"> <img width="400" height="300" src="<?=$dataforproceed['metaPlate']?>" alt="" srcset=""></a>
                                        </div>

                                        <div class="col-md-4 col-12">
                                            <a target="_blank" href="<?=$dataforproceed['photo']?>"><img width="400" height="300" src="<?=$dataforproceed['photo']?>" alt="" srcset=""></a>
                                        </div>

                                        <div class="col-md-4 col-12">
                                            <a target="_blank" href="<?=$dataforproceed['additionalPhoto']?>"><img width="300" height="200" src="<?=$dataforproceed['additionalPhoto']?>" alt="" srcset=""></a>
                                        </div>
                                    </div>
                                    <br><br>
                                    <hr>
                                    <div class="row">
                                        <div class="col">
                                            <!-- <video src="<?=$dataforproceed['metaLinks']?>"></video> -->
                                            <video width="100%" height="500" controls>
                                                <source src="<?=$dataforproceed['metaLinks']?>" >
                                                <source src="video.ogg" type="video/ogg">
                                                Your browser does not support the video tag.
                                            </video>
                                        </div>
                                    </div>
                                </div>                                                                                                                 
                            </div>
                        <!--end card body-->
                    </div> <!-- end card-->
                </div> <!-- container-fluid -->

                <div class="card">
                        <div class="card-body">
                            <div class="p-lg-3">
                                <div class="col" style="overflow-x:auto ;">
                                    <p class="lead">Обработка</p>
                                    <hr>
                                    <form  method="post" action="../modules/crud.php?act=proceeddisput">
                                        <h5 class="h6">Выберите варианты ответа</h5>
                                        <div class="form-check">
                                            <input class="form-check-input" type="radio" name="reason" id="option1" value="Неправильно опознан номер" required >
                                            <label class="form-check-label" for="option1">
                                                Неправильно опознан номер
                                            </label>
                                        </div>

                                        <div class="form-check">
                                            <input class="form-check-input" type="radio" name="reason" id="option1" value="Препятсвие на полосе" required >
                                            <label class="form-check-label" for="option1">
                                                Препятсвие на полосе
                                            </label>
                                        </div>

                                        <div class="form-check">
                                            <input class="form-check-input" type="radio" name="reason" id="option1" value="Нет нарушения" required >
                                            <label class="form-check-label" for="option1">
                                                Нет нарушения
                                            </label>
                                        </div>
                                        <div class="form-check">
                                            <input class="form-check-input" type="radio" name="reason" id="option1" value="Нарушение имеется"  required>
                                            <label class="form-check-label" for="option1">
                                                Нарушение имеется
                                            </label>
                                        </div>

                                     

                                        <br>
                                        <div class="form-group">
                                            <label for="my-textarea">Введите комментарий</label>
                                            <textarea id="my-textarea" class="form-control" name="comment" rows="6"></textarea>
                                        </div>
                                        <input class="form-control" type="hidden" name="orderid" value="<?=$dataforproceed['orderID']?>">
                                        <input class="form-control" type="hidden" name="inspector" value="<?=$_SESSION['username']?>">
                                        <input class="form-control" type="hidden" name="phone" value="<?=$dataforproceed['phone']?>">
                                        <input class="form-control" type="hidden" name="plate" value="<?=$dataforproceed['account']?>">
                                        <button  class="btn btn-primary" onclick="return confirm('Вы уверены что хотите подтвердить?');" type="submit" name="accept">Подтвердить</button>
                                        <button  class="btn btn-danger" onclick="return confirm('Вы уверены что хотите отклонить?');"  type="submit" name="decline">Отклонить</button>

                                        
                                    </form>
                                </div>                                                                                                                 
                            </div>
                        <!--end card body-->
                    </div> <!-- end card-->
                </div> <!-- container-fluid -->
            </div>
            <!-- End Page-content -->
        </div>
        <!-- end main content-->

    </div>
    <!-- END layout-wrapper -->

    <!-- JAVASCRIPT -->
    <script src="../assets/libs/jquery/jquery.min.js"></script>
    <script src="../assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="../assets/libs/metismenu/metisMenu.min.js"></script>
    <script src="../assets/libs/simplebar/simplebar.min.js"></script>
    <script src="../assets/libs/node-waves/waves.min.js"></script>

    <script src="../assets/js/app.js"></script>
    <script src="../assets/js/myjs.js"></script>
    
</body>

</html>