<?php

    $id = $_GET['id'];

    /* Editar Premio */
	$select_db->ExeRead("*",  'fid_produto', " WHERE prod_id = :i ", "i={$id}");

?>
   
   
    <div class="widgets-holder">

       <div class="col-md-12">
       	
       
        <form id="form-premios" action="" method="post" style="width: 80%; float: left; margin-left: 10%" enctype="multipart/form-data">

            <div class="row">
                <div class="masonary">
                    <div class="col-md-8">

                        <label>Titulo</label>
                        <input type="text" name="prod_titulo" value="<?php echo $select_db->getResult()[0]['prod_titulo']; ?>" id="prod_titulo" class="form-control">

                    </div>
                </div><!-- Masonary -->
            </div>
            <div class="row">
                <div class="masonary">

                    <div class="col-md-8">

                        <label>Descrição</label>
                        <textarea name="prod_descricao" id="prod_descricao" class="form-control"><?php echo $select_db->getResult()[0]['prod_descricao']; ?></textarea>

                    </div>

                </div><!-- Masonary -->
            </div>
            <div class="row">
                <div class="masonary">

                    <div class="col-md-8">

                       <div class="col-md-12">
                       	<img src="<?php echo $select_db->getResult()[0]['prod_img']; ?>" width="60%;" style="float: left; margin-left: 20%" height="auto" />
                       	<input type="hidden" name="img_atual" value="<?php echo $select_db->getResult()[0]['prod_img']; ?>" />
                       </div>
                       
                        <label>Foto (jpg)</label>
                        <input type="file" name="prod_img" id="prod_img" class="form-control" />
                    </div>

                </div><!-- Masonary -->
            </div>
            <div class="row">
                <div class="masonary">

                    <div class="col-md-3">

                        <label>Pontos</label>
                        <input type="text" name="prod_pontos" value="<?php echo $select_db->getResult()[0]['prod_pontos']; ?>" id="prod_pontos" class="form-control">

                    </div>
                    
                    <div class="col-md-3">

                        <label>Valor</label>
                        <input type="text" name="prod_valor" id="prod_valor" value="<?php echo $select_db->getResult()[0]['prod_valor']; ?>" class="form-control">

                    </div>
                    
                         <div class="col-md-4">

                        <label>Status</label>
                      
							 <select name="prod_status">
							 <?php if($select_db->getResult()[0]['prod_status']==1){ echo '<option value="1">Ativo</option>'; }else{ echo '<option value="0">Inativo</option>'; } ?>
							 	<option value="1">Ativo</option>
							 	<option value="0">Inativo</option>
							 </select>

                    </div>

                </div><!-- Masonary -->
            </div>
            <div class="row">
                <div class="masonary">

                    <div class="col-md-12">

                        <button type="button" class="btn btn-success btn-lg" onclick="TerminalAdmin.ValidarCadastroPremio();">
                         Alterar
                        </button>
                        
                        <button type="button" class="btn btn-danger btn-lg" onclick="TerminalAdmin.dashboard();">
                            Voltar
                        </button>

                    </div>

                </div><!-- Masonary -->
            </div>
            
            <input type="hidden" name="premio_editar" value="<?php echo $id; ?>" />

        </form>
        
       </div>

    </div>
