<?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_client.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 du client</h3>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
                <form role="form" action="<?=base_url('donnee/Client/add')?>" enctype="multipart/form-data" method="POST">
                <div class="card-body row">
                
                
                
                <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Numero Client <spam class="text-danger">*</spam></label>
                    <input type="text" class="form-control" id="NUMERO_CLIENT" name="NUMERO_CLIENT" readonly="readonly" value="<?php echo $NUMERO_CLIENT;?>">
                    <?php echo form_error('NUMERO_CLIENT', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Type client<spam class="text-danger">*</spam> </label>
                    <select class="custom-select" name="ID_CLIENT_TYPE" id="ID_CLIENT_TYPE">
                          <option value="">-- Select --</option>
                          
                          <?php
                          foreach ($typeclient as $tclient) {
                           echo"<option value='".$tclient['ID_CLIENT_TYPE']."'>".$tclient['DESCRIPTION']."</option>";
                          }
                          ?>
                        </select>
                    
                    <?php echo form_error('ID_CLIENT_TYPE', '<div class="text-danger">', '</div>'); ?>
                  </div>

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Nom <spam class="text-danger">*</spam></label>
                    <input type="text" class="form-control" id="NOM" name="NOM" placeholder="Nom" value="<?=set_value('NOM')?>">
                    <?php echo form_error('NOM', '<div class="text-danger">', '</div>'); ?>
                  </div> 


                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Pr&eacute;nom </label>
                    <input type="text" class="form-control" id="PRENOM" name="PRENOM" placeholder="Prenom" value="<?=set_value('PRENOM')?>">
                    <?php echo form_error('PRENOM', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">T&eacute;l&eacute;phone <spam class="text-danger">*</spam></label>
                    <input type="text" class="form-control" id="TELEPHONE" name="TELEPHONE" placeholder="Telephone" value="<?=set_value('TELEPHONE')?>">
                    <?php echo form_error('TELEPHONE', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">Mail </label>
                    <input type="text" class="form-control" id="MAIL" name="MAIL" placeholder="mail" value="<?=set_value('MAIL')?>">
                    <?php echo form_error('MAIL', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">RC </label>
                    <input type="text" class="form-control" id="RC" name="RC" placeholder="" value="<?=set_value('RC')?>">
                    <?php echo form_error('RC', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-6">
                    <label for="exampleInputEmail1">NIF </label>
                    <input type="text" class="form-control" id="NIF" name="NIF" placeholder="" value="<?=set_value('NIF')?>">
                    <?php echo form_error('NIF', '<div class="text-danger">', '</div>'); ?>
                  </div> 

                  <div class="form-group col-lg-12">
                    <label for="exampleInputEmail1">Adresse <spam class="text-danger">*</spam></label>
                    <textarea class="form-control" name="ADRESSE" id="ADRESSE" rows="3"></textarea>

                    <?php echo form_error('ADRESSE', '<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');
    });



    function get_commune(prov){
    var form= new FormData();
    form.append("prov",prov);
    $.ajax({
            url: "<?php echo base_url('voiture/Garage/get_commune/');?>"+prov,
            type: "POST",
            data: form,
            processData: false,  
            contentType: false,
            success: function(data){
            $('#COMMUNE_ID').html(data);
           
          }
    }); 

  }

  $('#sandbox-container input').datepicker({
});
</script>


  


</body>
</html>
