<?php
if (isset($this->Dados[0])):
    $valorForm = $this->Dados[0];
    //var_dump($valorForm);
elseif (isset($this->Dados)):
    $valorForm = $this->Dados;
    //var_dump($valorForm);
endif;

?>
<div class="well">
    <div class="pull-right">
        <a href="<?php echo URL; ?>controle-carousel/index"><button type="button" class="btn btn-sm btn-success">Listar</button></a>
        <a href="<?php echo URL; ?>controle-carousel/visualizar/<?php echo $valorForm['id']; ?>"><button type="button" class="btn btn-sm btn-primary">Visualizar</button></a>
        <a href="<?php echo URL; ?>controle-carousel/apagar/<?php echo $valorForm['id']; ?>"><button type="button" class="btn btn-sm btn-danger">Apagar</button></a>
    </div>
    <div class="page-header">
        <h1>Alterar Resposta da Chamada de Encalhe</h1>
    </div>
    <H1></H1>
    <?php
    if (isset($_SESSION['msg'])):
        echo $_SESSION['msg'];
        unset($_SESSION['msg']);
    endif;
    ?>
    <form name="EditCarousel"  class="form-horizontal" action="" method="post" enctype="multipart/form-data">

        <input type="hidden" name="id" value="<?php
        if (isset($valorForm['id'])):
            echo $valorForm['id'];
        endif;
        ?>">

        <div class="form-group">
            <label class="col-sm-2 control-label">ID Produto:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="id_product" placeholder="ID Produto" value="<?php
                if (isset($valorForm['id_product'])): echo $valorForm['id_product'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Coleção:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="id_collection" placeholder="Coleção" value="<?php
                if (isset($valorForm['id_collection'])): echo $valorForm['id_collection'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">ID Edição:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="id_edition" placeholder="ID Edição" value="<?php
                if (isset($valorForm['id_edition'])): echo $valorForm['id_edition'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Edição-sistema Analista:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="edition_number" placeholder="Edição - sistema Analista" value="<?php
                if (isset($valorForm['edition_number'])): echo $valorForm['edition_number'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Codigo Produto:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="id_prod_Planeta" placeholder="Codigo Produto" value="<?php
                if (isset($valorForm['id_prod_Planeta'])): echo $valorForm['id_prod_Planeta'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">ID Cliente - sistema Analista:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="customercode" placeholder="ID Cliente - sistema Analista" value="<?php
                if (isset($valorForm['customercode'])): echo $valorForm['customercode'];
                endif;
                ?>">
            </div>
        </div>
        
         <div class="form-group">
            <label class="col-sm-2 control-label">Cnpj Cliente:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="cnpj" placeholder="Cnpj Cliente" value="<?php
                if (isset($valorForm['cnpj'])): echo $valorForm['cnpj'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Nº da CE:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="cde_number" placeholder="Nº da CE" value="<?php
                if (isset($valorForm['cde_number'])): echo $valorForm['cde_number'];
                endif;
                ?>">
            </div>
        </div>
        
         <div class="form-group">
            <label class="col-sm-2 control-label">Id Usuário:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="uid" placeholder="Id Usuário" value="<?php
                if (isset($valorForm['uid'])): echo $valorForm['uid'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Devolução:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="return_quantity" placeholder="Devolução" value="<?php
                if (isset($valorForm['return_quantity'])): echo $valorForm['return_quantity'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Venda:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="sales_quantity" placeholder="Venda" value="<?php
                if (isset($valorForm['sales_quantity'])): echo $valorForm['sales_quantity'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Valor Calculado:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="calculated_value" placeholder="Valor Calculado" value="<?php
                if (isset($valorForm['calculated_value'])): echo $valorForm['calculated_value'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Desconto Calculado:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="discount_calculated_value" placeholder="Desconto Calculado" value="<?php
                if (isset($valorForm['discount_calculated_value'])): echo $valorForm['discount_calculated_value'];
                endif;
                ?>">
            </div>
        </div>
        
         <div class="form-group">
            <label class="col-sm-2 control-label">Pedido:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="id_order" placeholder="Pedido" value="<?php
                if (isset($valorForm['id_order'])): echo $valorForm['id_order'];
                endif;
                ?>">
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-2 control-label">Data do Pedido:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="order_date" placeholder="Data do Pedido" value="<?php
                if (isset($valorForm['order_date'])): echo $valorForm['order_date'];
                endif;
                ?>">
            </div>
        </div>
        
         <div class="form-group">
            <label class="col-sm-2 control-label">Nota Ponto:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="nota_ponto" placeholder="Nota Ponto" value="<?php
                if (isset($valorForm['nota_ponto'])): echo $valorForm['nota_ponto'];
                endif;
                ?>">
            </div>
        </div>
        
        
        
        
        
        
        <!--<div class="form-group">
            <label class="col-sm-2 control-label">Titulo:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="titulo_carousel" placeholder="Nome do Carousel" value="<?php
                if (isset($valorForm['titulo_carousel'])): echo $valorForm['titulo_carousel'];
                endif;
                ?>">
            </div>
        </div>-->
        
        <!--<div class="form-group">
            <label class="col-sm-2 control-label">Link:</label>
            <div class="col-sm-10">
                <input type="text"  class="form-control" name="link" placeholder="Endereço da página de destino" value="<?php
                if (isset($valorForm['link'])): echo $valorForm['link'];
                endif;
                ?>">
            </div>
        </div>-->
        
        <input type="hidden" name="foto_antiga" value="<?php
        if (isset($valorForm['foto_antiga'])):
            echo $valorForm['foto_antiga'];
        elseif (isset($valorForm['foto'])):
            echo $valorForm['foto'];
        endif;
        ?>">
        
        <!--<div class="form-group">
            <label class="col-sm-2 control-label">Tamanho da Imagem:</label>
            <div class="col-sm-10">
                1902 x 448
            </div>
        </div>-->

        <!--<div class="form-group">
            <label class="col-sm-2 control-label">Foto:</label>
            <div class="col-sm-10">
                <input type="file"  name="foto"/>
            </div>
        </div>-->

        <!--<div class="form-group">
            <label class="col-sm-2 control-label">Situação Carousel:</label>
            <div class="col-sm-10">
                <select class="form-control" name="situacao_carousel">
                    <option value="">Selecione</option>
                    <?php
                    if ($valorForm['situacao_carousel'] == 1):
                        echo "<option value='1' selected>Habilitado</option>";
                    else:
                        echo "<option value='1'>Habilitado</option>";
                    endif;
                    
                    if ($valorForm['situacao_carousel'] == 2):
                        echo "<option value='2' selected>Desabilitado</option>";
                    else:
                        echo "<option value='2'>Desabilitado</option>";
                    endif;
                    ?>
                </select> 
            </div>
        </div>-->




        <input type="hidden" name="modified" value="<?php echo date("Y-m-d H:i:s"); ?>">

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" class="btn btn-warning" value="Alterar" name="SendEditCarousel">
            </div>
        </div>
    </form>
    <?php
    //var_dump($this->Dados);
    ?>
</div>