<?php session_start();
/*      Copyright 2023 Flávio Ribeiro

        This file is part of OCOMON.

        OCOMON is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 3 of the License, or
        (at your option) any later version.
        OCOMON is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with Foobar; if not, write to the Free Software
        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

if (!isset($_SESSION['s_logado']) || $_SESSION['s_logado'] == 0) {
    $_SESSION['session_expired'] = 1;
    echo "<script>top.window.location = '../../index.php'</script>";
    exit;
}

require_once __DIR__ . "/" . "../../includes/include_basics_only.php";
require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php";

use includes\classes\ConnectPDO;

$conn = ConnectPDO::getInstance();

$post = $_POST;

$html = "";
$exception = "";
$data = [];
$data['success'] = true;
$data['message'] = "";

$data['random'] = (isset($post['random']) ? noHtml($post['random']) : "");

$afterDomClass = "after-dom-ready";
$randomClass = $data['random'];

?>



<label for="<?= $randomClass; ?>_service_description" class="<?= $randomClass; ?> col-sm-2 col-md-2 col-form-label text-md-right text-secondary remove-service" data-random="<?= $randomClass; ?>"><i class="fas fa-minus"></i></label>
<div class="form-group col-md-6 <?= $randomClass; ?>">
    <textarea class="form-control <?= $afterDomClass; ?>" id="<?= $randomClass; ?>_service_description" name="service_description[]" required placeholder="<?= TRANS('SERVICE_DESCRIPTION'); ?>"></textarea>
</div>

<div class="form-group col-md-2 <?= $randomClass; ?>">
    <input type="number" class="form-control <?= $afterDomClass; ?>" id="<?= $randomClass; ?>_amount" name="amount[]" value="1" min="1" max="100" placeholder="<?= TRANS('COL_AMOUNT'); ?>" />
</div>
<div class="form-group col-md-2 <?= $randomClass; ?>">
    <input type="text" class="form-control <?= $afterDomClass; ?> unitary_price" id="<?= $randomClass; ?>_unitary_price" name="unitary_price[]" value="" placeholder="<?= TRANS('UNITARY_PRICE'); ?>" />
</div>


<?php
