<h4>Contas a Pagar</h4>
<a class="btn btn-primary" href="?pagina=home&action=add"><i class="glyphicon glyphicon-plus" ></i> Cadastrar</a>
<a class="btn btn-info" href="#">Listar</a>
<br>
<?php

	$action = '';
	if(!empty($_GET['action']))
	{
		$action = $_GET['action'];
	}
	if($action =='insert')
	{
		echo 'inserir no banco de dados';
	}
	if($action == 'add')
	{
		?>
		<form action="?pagina=home&action=insert" method="post" name="form1" id="form1" >
			
			<label style="margin-top: 5px;">Empresa</label>
			<select class="form-control" id="empresa" required name="empresa">
	            <option value="Brasil">BRASIL ORTOPEDIA</option>
	            <option value="Ajumed">AJUMED</option>
	            <option value="Orthomac">ORTHOMAC</option>
	            <option value="Best Care">BEST CARE</option>
	      	</select>

	      	<label>Fornecedor:</label>
            <select class="form-control" id="fornecedor"  required name="fornecedor">
                <option value="">Selecione o Fornecedor...</option>
                  <?php
                      while($l_fornecedor=mysql_fetch_array($r_fornecedor)){
                        echo "<option value='" .$l_fornecedor['0']."'>".$l_fornecedor['0']."</option>";
                      }
                  ?>
            </select>

            <label >Grupo de Custo:</label>
			<select class="form-control" id="grupo" required name="grupo">
			<option value="">Selecione o Grupo de Custo...</option>
			  <?php
			      while($l_grupo=mysql_fetch_array($r_grupo)){
			        echo "<option value='" .$l_grupo['0']."'>".$l_grupo['0']."</option>";
			      }
			  ?>
			</select>

			<label >Centro de Custo:</label>
			<select class="form-control" id="centro" required name="centro">
			<option value="">Selecione o Grupo de Custo...</option>
			  <?php
			      while($l_centro=mysql_fetch_array($r_centro)){
			        echo "<option value='" .$l_centro['0']."'>".$l_centro['0']."</option>";
			      }
			  ?>
			</select>

			<div class="form-group">
			<label>Conta de Custo:</label>
			<select class="form-control" id="conta" required name="conta">
			<option value="">Selecione a Conta de Custo...</option>
			  <?php
			      while($l_conta=mysql_fetch_array($r_conta)){
			        echo "<option value='" .$l_conta['0']."'>".$l_conta['0']."</option>";
			      }
			  ?>
			</select>
			
			<label>Vencimento:</label>
            <input class="form-control" required type="date" name="vencimento" id="vencimento">

            <label >Valor R$:</label>
            <input class="form-control text-left" placeholder="R$ 0,00" required type="number" name="dataini" id="valor">

            <button type="submit" class="btn btn-success" style="margin-top: 5px;">Salvar</button>
            <a class="btn btn-warning" style="margin-top: 5px;" href="?">Cancelar</a>
    	

		</form>
		<?php
	}

?>


