<?php
  include VIEWPATH.'includes/new_header.php';
  ?>
  
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
  <?php
  include VIEWPATH.'includes/new_top_menu.php';
  include VIEWPATH.'includes/new_menu_principal.php';
  ?>

  

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <?php 
    include 'includes/menu_entre_stock.php';
    ?>

    <!-- Main content -->
    <section class="content">

      <!-- Default box -->
      <div class="card">


            <?php 
             if(!empty($this->session->flashdata('message')))
               echo $this->session->flashdata('message');
            ?>



      
      <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Enregistrement d'un entree stock</h3>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
                <form role="form" action="<?=base_url('donnee/Consommables/update')?>" enctype="multipart/form-data" method="POST">
                <div class="card-body row">
                <input type="hidden" class="form-control" id="DATE_ENTREE_STOCK" name="ID_CONSOMMABLE" placeholder="Date entree stock" value="<?=$un_conso['ID_CONSOMMABLE']?>">

                <div class="form-group col-lg-6">
                    <label for="DATE_ENTREE_STOCK">Date entree stock <spam class="text-danger">*</spam></label>
                    <input type="date" class="form-control" id="DATE_ENTREE_STOCK" name="DATE_ENTREE_STOCK" placeholder="Date entree stock" value="<?=$un_conso['DATE_ENTREE_STOCK']?>">
                    <?php echo form_error('DATE_ENTREE_STOCK', '<div class="text-danger">', '</div>'); ?>
                  </div> 
                 <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Intitule <spam class="text-danger">*</spam> </label>
                    <select  class="custom-select" name="INTITULE" id="INTITULE">
                          <option value="">-- Select --</option>
                          <?php
                          foreach ($consommables as $typebous) {
                            if($typebous['ID_TYPE_CONSOMMABLES'] == $un_conso['INTITULE']){

                              echo"<option value='".$typebous['ID_TYPE_CONSOMMABLES']."' selected>".$typebous['DESCRIPTION_CONSO']."</option>";
                            }else{
                              echo"<option value='".$typebous['ID_TYPE_CONSOMMABLES']."'>".$typebous['DESCRIPTION_CONSO']."</option>";

                            }
                          }
                          ?>
                        </select>
                    
                    <?php echo form_error('INTITULE', '<div class="text-danger">', '</div>'); ?>
                  </div> 
                  <div class="form-group col-lg-6">
                    <label for="QUANTITE">Quantite <spam class="text-danger">*</spam></label>
                    <input type="text" class="form-control" id="QUANTITE" name="QUANTITE" placeholder="Quantite" value="<?=$un_conso['QUANTITE']?>">
                    <?php echo form_error('QUANTITE', '<div class="text-danger">', '</div>'); ?>
                  </div>                
                  <div class="form-group col-lg-6">
                    <label for="PRIX_ACHAT">Prix d'achat <spam class="text-danger">*</spam></label>
                    <input type="text" class="form-control" id="PRIX_ACHAT" name="PRIX_ACHAT" placeholder="Prix d'achat" value="<?=$un_conso['PRIX_ACHAT']?>">
                    <?php echo form_error('PRIX_ACHAT', '<div class="text-danger">', '</div>'); ?>
                  </div>
                    
                  
                </div>
                <!-- /.card-body -->

                <div class="card-footer">
                  <button type="submit" class="btn btn-primary btn-block">Enregistrer</button>
                </div>
              </form>
            </div>
        
        
        <!-- /.card-body -->
        <!-- <div class="card-footer">
          Footer
        </div> -->
        <!-- /.card-footer-->
      </div>
      <!-- /.card -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <?php
 include VIEWPATH.'includes/new_copy_footer.php';  
  ?>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<?php
  include VIEWPATH.'includes/new_script.php';
  ?>

<script>
  $(document).ready(function(){ 
    $('#message').delay(5000).hide('slow');
    });
    

</script>


  


</body>
</html>
