<?php require_once(APPPATH.'/views/header.php'); ?>
<body>
    <div id="wrapper">
    <?php require_once(APPPATH.'/views/menu_user.php'); ?>
        <div id="page-wrapper">
            <div class="container-fluid">
                <fieldset class="admin-border">
                    <fieldset class="scheduler-border">
                    <legend class="scheduler-border"><?php echo $title;?></legend>
                        <div class="row">
                        <form id="my_set" action="<?php echo base_url();?>adm/client/edit" method="POST" enctype="multipart/form-data">
                            <div class="col-lg-3 col-md-6 col-sm-8 col-xs-12">
                                <label>Denumire (*)</label><br />
                                <input class="form-control" type="text" id="denumire"  name="denumire"  placeholder="Denumire" value="<?=(isset($infoDB) && $infoDB)? $infoDB->denumire : '';?>" />
                            </div>
                            <div class="clearfix"></div><br/>
                            <div class="col-lg-3 col-md-6 col-sm-8 col-xs-12">
                                <label>Responsabil (*)</label><br />
                                <input class="form-control" type="text" id="responsabil"  name="responsabil"  placeholder="Responsabil" value="<?=(isset($infoDB) && $infoDB)? $infoDB->responsabil : '';?>" />
                            </div>
                            <div class="clearfix"></div><br/>
                            <div class="col-lg-3 col-md-6 col-sm-8 col-xs-12">
                                <label>E-mail (*)</label><br />
                                <input class="form-control" type="text" id="email"  name="email" placeholder="E-mail" value="<?=(isset($infoDB) && $infoDB)? $infoDB->email : '';?>" />
                            </div>                          
                            <div class="clearfix"></div><br/>
                            <div class="col-lg-3 col-md-6 col-sm-8 col-xs-12">
                            <input type="hidden" id="id_client"  name="id_client" value="<?=(isset($infoDB) && $infoDB)? $infoDB->id_client : '';?>" />
                            <button id="save_btn" type="submit" class="btn btn-primary">Salveaza</button>
                            </div><br />
                            </form>
                        </div>
                    <br/>
                    </fieldset>
                </fieldset>
            </div>
        </div>
        <!-- /#page-wrapper -->
    </div>
    <div id="gif" class="modal fade loading-gif">
        <div class="modal-dialog">
            <div>
                <img src="<?=base_url()?>img/loading.gif">
            </div>
        </div>
    </div>
    <!-- /#wrapper -->
<?php require_once(APPPATH.'/views/footer.php'); ?> 
<script>
            
        $(document).ready(function(){

            $("#my_set").validate({
                    // validation rules
                    rules: {
                        denumire: "required",
                        cod: "required",
                        responsabil: "required",
                        email: {
                            required: true,
                            email: true
                        }
                    },
                    // Specify validation error messages
                    messages: {
                        denumire: "Completeaza denumire destinatar.",
                        cod: "Completeaza cod destinatar.",
                        responsabil: "Completeaza nume responsabil.",
                        email: "Completeaza o adresa de e-mail valida.",
                        
                    },
                    submitHandler: function(form) {
                      form.submit();
                    }
            });
        });

</script>     
</body>
</html>