<?php
session_start();
include_once 'head.html';
require 'script_php/conexao.php';
require_once 'gerador/Sqlserver.php';
require_once 'script_php/ConexaoSql.php';

//chamada da classe sqlserver
$sql = new Sqlserver();
?>
  
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<?php include_once 'header.php'; ?>

<h3>

<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-box-fill" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M15.528 2.973a.75.75 0 0 1 .472.696v8.662a.75.75 0 0 1-.472.696l-7.25 2.9a.75.75 0 0 1-.557 0l-7.25-2.9A.75.75 0 0 1 0 12.331V3.669a.75.75 0 0 1 .471-.696L7.443.184l.004-.001.274-.11a.75.75 0 0 1 .558 0l.274.11.004.001zm-1.374.527L8 5.962 1.846 3.5 1 3.839v.4l6.5 2.6v7.922l.5.2.5-.2V6.84l6.5-2.6v-.4l-.846-.339Z"/>
</svg>

Novo pedido </h3>
<p></p>

<section class="formulariocorpo">

 <form action="script_php/cadastrar.php" method="post">

        <div class="panel panel-default">
          <div class="panel-body">

   Fornecedor:
   <select class="form-control form_forn" name="fornecedor">

    <?php
    //invocando o metodo que retorna a lista de fornecedores
    $listagem = $sql->BuscarFornecedor();
    foreach ($listagem as $listage)
      {
          //atribuindo o valor a uma variavel
          $cnpj = $listage[1];
          $fornecedor = $listage[1];
      ?>

      <option value="<?php echo $fornecedor; ?>" /> <?php echo $fornecedor; ?> </option>
    
      <?php
      $prazo = 0;
      $valor2 = 0;
     
      } ?>

    </select> 
    <?php $data = date('Y-m-d'); ?>

          Data Pedido:
          <input type="date" value=<?php echo $data;?> class="form-control form_data form_forn" name="datapedido">
          Fabricante:
          <input type="text" placeholder="Fabricante" class="form-control form_forn" name="fabricante">
          Prazo de entrega:
          <input type="number" placeholder="Prazo de entrega em dias" value=<?php echo $prazo?>  class="form-control form_data form_forn" name="prazo"> Observação / Acordo:
          <textarea class="form-control form_forn" rows="3" name="observacao"></textarea>
            <p>

<hr>

<h6> Replicar para lojas ?</h6> 
<hr>
<div class="checkbox">
  <label>
    <input type="checkbox" value="matriz" name="loja[]">
     MATRIZ
  </label>
</div>

Valor:
<input type="text" value=<?php echo $valor2?> name="matriz" >

<p><p></p>
<!--
  <button class="btn btn-primary" type="button" data-toggle="collapse" data-target=".multi-collapse" aria-expanded="false" aria-controls="multiCollapseExample1 multiCollapseExample2">Pendências / Acordos</button>
</p>
<div class="row">
  <div class="col">
    <div class="collapse multi-collapse" id="multiCollapseExample1">
      <div class="card card-body">
    input
      </div>
    </div>
  </div>
  <div class="col">
    <div class="collapse multi-collapse" id="multiCollapseExample2">
      <div class="card card-body">
       input
      </div>
    </div>
  </div>
</div>
-->

<div class="checkbox">
  <label>
    <input type="checkbox" value="loja02" name="loja[]">
    LOJA 02
  </label>
</div>

Valor:
<input type="text"value=<?php echo $valor2?>  name="loja02" >

<div class="checkbox">
  <label>
    <input type="checkbox" value="loja03" name="loja[]">
    LOJA 03
  </label>
</div>


Valor:
<input type="text" value=<?php echo $valor2?>  name="loja03" >

<div class="checkbox">
  <label>
    <input type="checkbox" value="loja04" name="loja[]">
    LOJA 04
  </label>
</div>

Valor:
<input type="text" value=<?php echo $valor2?>  name="loja04" >

<div class="checkbox">
  <label>
    <input type="checkbox" value="loja05" name="loja[]">
    LOJA 05
  </label>
</div>

Valor:
<input type="text" value=<?php echo $valor2?>  name="loja05" >

<div class="checkbox">
  <label>
    <input type="checkbox" value="loja06" name="loja[]">
    LOJA 06
  </label>
</div>

Valor:
<input type="text" value=<?php echo $valor2?>  name="loja05" >

<hr>
<!--
<p></p>
<div class="checkbox">
  <label>
    <input type="checkbox" value="sim" name="aprovacao">
    Pedido precisa de aprovação do compras para dar entrada na nota ?
  </label>
</div>

<p></p>
<div class="checkbox">
  <label>
    <input type="checkbox" value="sim" name="vinculo">
    Obrigar vinculo de NFE de bonificacao ?
  </label>
</div>
-->
<p>
               <p></p>
                <button type="submit" class="btn  btn-warning"> Cadastrar Novo Pedido</button>
              </form>
      </section>

<?php include_once 'footer.php' ?>