The loaded screen is correct but the data is saved in another BD table

Asked

Viewed 58 times

2

on the company website, we are doing some tests with scheduling. Problem is that although you are loading the correct screen on the website (the scheduling form), the data that the client types, are being saved in the budget table. Making it clear that it was not I who made the system, nor the front-end, I am only providing maintenance and inserting more features. Does anyone have any idea what it might be? It’s Codeigniter and Mysql

My view

<section class="section_mod-d border-top">
  <div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3 wow bounceInLeft txt-center" data-wow-duration="1s">
            <h1 class="ui-title-block">AGENDE O SERVIÇO</h1>
        </div>
      <!-- end col -->

        <div class="container">
            <div class="row">

            <style>
                .panel-tabs {
                    position: relative;
                    bottom: 30px;
                    clear:both;
                    border-bottom: 1px solid transparent;
                }

                .panel-tabs > li {
                    float: left;
                    margin-bottom: -1px;
                }

                .panel-tabs > li > a {
                    margin-right: 2px;
                    margin-top: 4px;
                    line-height: .85;
                    border: 1px solid transparent;
                    border-radius: 4px 4px 0 0;
                    color: #ffffff;
                }

                .panel-tabs > li > a:hover {
                    border-color: transparent;
                    color: #ffffff;
                    background-color: transparent;
                }

                .panel-tabs > li.active > a,
                .panel-tabs > li.active > a:hover,
                .panel-tabs > li.active > a:focus {
                    color: #fff;
                    cursor: default;
                    -webkit-border-radius: 2px;
                    -moz-border-radius: 2px;
                    border-radius: 2px;
                    background-color: rgba(255,255,255, .23);
                    border-bottom-color: transparent;
                }
                /*========================================  MODIFICAÇÕES TEMPORARIAS ===========================*/
                .panel-primary > .panel-heading {
                    color: #ffffff;
                    background-color: #486d8b !important;
                    border-color: #355671 !important;
                }
                .panel-title{color:#fff !important;}
                .panel-primary{border-color: #355671 !important; padding-bottom: 10px; margin-top: 40px;}
            </style>



                <div class="col-md-7 wow bounceInRight" data-wow-duration="1s">
                    <div class="section-list-block">
                        <ul class="list-block list-unstyled">
                            <?php foreach($textoBlocos as $key => $texto) { ?>
                            <li class="list-block__item"> 
                                <a class="list-block__link">                                        
                                    <img src="<?php echo base_url('assets/img/icon_cad_' . ($key + 1) . '.png'); ?> " alt="icone 1" style="float: left; padding: 0px 25px 0px 0px;">
                                    <div class="list-block__title"><?php echo $texto->complemento; ?></div>
                                    <div class="list-block__info"><?php echo $texto->valor; ?></div>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>                            
                    </div>
                </div>



                <div class="col-md-4 col-md-offset-1 margin_g form_cadastro">                        
                    <?php echo form_open('cadastro/pedidos', array('id' => 'formCadastro', 'class' => 'bounceInLeft form-b', 'data-wow-duration' => '2s')); ?>
                        <div class="form-request__text form-b col-sm-12">Faça seu Agendamento</div>
                        <div class="col-sm-6"><h6>* campos obrigatórios</h6></div><br clear=all/>
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="text" placeholder="* Nome Completo" name="nome" id="nome" required>
                        </div>
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="mail" placeholder="* email" name="email" required>
                        </div>
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="text" id="celular" placeholder="* Celular" name="celular">
                        </div>
                        <div class="col-sm-6">
                            <select name="estado" id="estado" class="form-control form-b" required>
                                <option value="" class="option_cad"> ESTADO</option>
                                <?php foreach($estados as $estado) { ?>
                                <option value="<?php echo $estado->id; ?>" class="option_cad"><?php echo $estado->nome; ?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="col-sm-6">
                            <select name="cidade" id="cidade" class="form-control form-b" required>
                                <option value="" class="option_cad">* CIDADE</option>
                            </select>
                        </div>
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="text" placeholder="* Bairro" name="bairro" id="bairro" required>
                        </div>
                        <div class="col-sm-6">
                            <select name="categoria" id="categoria" class="form-control form-b" required>
                                <option value="" class="option_cad">* CATEGORIA</option>
                                <?php foreach($listaCategorias as $categoria) { ?>
                                <option value="<?php echo $categoria->id_categoria; ?>" class="option_cad"><?php echo $categoria->categoria; ?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="col-sm-6">
                            <select name="subcategoria" id="subcategoria" class="form-control form-b" required>
                                <option value="" class="option_cad">* SUB CATEGORIA</option>
                            </select>
                        </div>
                        <div class="col-sm-12"><h6>Entre quais dias você quer o serviço agendado?</h6></div><br clear=all/>

                        <div class="col-sm-6">
                            <input class="form-control form-b" type="text" id="data_de" placeholder="* De" name="data_de">
                        </div>
                        <div class="col-sm-6">
                            <input class="form-control form-b" type="text" id="data_ate" placeholder="* Até" name="data_ate">
                        </div>
                        <div class="col-sm-12"><h6>Em qual horário?</h6></div><br clear=all/>
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="text" placeholder="* Horário" name="horario" id="horario" required>
                        </div>                            
                        <div class="col-sm-12">
                            <input class="form-control form-b" type="text" placeholder="* Descrição do Serviço" name="descricao" id="descricao" required>
                        </div>
                        <div class="col-md-8 col-md-offset-2">
                            <button class="btn btn-default btn-block btn-second btn-effect">Agendar</button>
                        </div>
                    <?php echo form_close(); ?>
                </div>
            </div>

            <div class="row margin-g">
                <div class="section-default  border-bottom_thin wow zoomIn" data-wow-duration="1s">
                    <div class="container">
                        <div class="row">
                            <div class="col-xs-12 txt-center">
                                <h2 class="ui-title-block">Por que anunciar na sossegue</h2>
                                <div class="decor-1 decor-1_mod-a decor-1_mod-d"></div>
                            </div>

                            <div class="col-xs-12">
                                <ul class="advantages advantages_mod-a list-unstyled">
                                    <li class="advantages__item clearfix">
                                        <i class="icon flaticon-rocketship4"></i>
                                        <div class="advantages__inner">
                                            <div class="advantages__name"><?php echo $config['vantagens_left_complemento']; ?></div>
                                            <div class="advantages__text"><?php echo $config['vantagens_left']; ?></div>
                                        </div>
                                    </li>
                                    <li class="advantages__item clearfix">
                                        <i class="icon flaticon-badges3"></i>
                                        <div class="advantages__inner">
                                            <div class="advantages__name"><?php echo $config['vantagens_center_complemento']; ?></div>
                                            <div class="advantages__text"><?php echo $config['vantagens_center']; ?></div>
                                        </div>
                                    </li>
                                    <li class="advantages__item clearfix">
                                        <i class="icon flaticon-house158"></i>
                                        <div class="advantages__inner">
                                            <div class="advantages__name"><?php echo $config['vantagens_right_complemento']; ?></div>
                                            <div class="advantages__text"><?php echo $config['vantagens_right']; ?></div>
                                        </div>
                                    </li>
                                </ul>
                            </div><!-- end col -->
                        </div><!-- end row -->
                    </div><!-- end container -->
                </div><!-- end section-default -->

            </div>
        </div>

    </div>
  </div>
</section>

<?php if($this->session->flashdata('msg')) { ?>
<div class="modal fade" id="modalCadastro" tabindex="-1" role="dialog" style="margin-top: 80px">
  <div class="modal-dialog modal-sm" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><?php echo $this->session->flashdata('msg'); ?></h4>
      </div>
      <div class="modal-body">
        <button type="button" class="btn btn-info" data-dismiss="modal">Cancelar</button>
        <a href="<?php echo base_url('login'); ?>" type="button" class="btn btn-primary">Login</a>
      </div>
    </div>
  </div>
</div>
<?php } ?>

My Controller (which is not by my will, has Model stuff in the middle)

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Agendamentos extends MY_Front {

    public function agendar() {
        if($this->form_validation->run('agendamentos/agendar')) {


                $agendamento = array(
                    'nome'              => $this->input->post('nome'),
                    'email'             => $this->input->post('email'),
                    'telefone'          => $this->input->post('telefone'),
                    'celular'           => $this->input->post('celular'),
                    'id_cidade'         => $this->input->post('cidade'),
                    'bairro'            => $this->input->post('bairro'),
                    'id_subcategoria'   => $this->input->post('subcategoria'),
                    'data_de'           => convertData($this->input->post('data_de')), 
                    'data_ate'          => convertData($this->input->post('data_ate')),
                    'horario'           => $this->input->post('horario'),
                    'descricao'         => $this->input->post('descricao'),
                    'data_agendamento'  => date('Y-m-d H:i:s')
                );


                $idAgendamento = $this->superModel->insert('agendamento', $agendamento);


                $this->db->select('cidade.nome AS cidade');
                $this->db->join('cidade', 'cidade.id = agendamento.id_cidade');
                $this->db->where('id_agendamento', $idAgendamento);
                $endereco = $this->db->get('agendamento')->row();

                if($endereco) {
                    $data['cidade'] = $endereco->cidade;
                }

                $this->session->set_userdata($data);
            //    $this->enviaEmailAgendamento($data);

        $this->layout->view('confirmacao-agendamento', $this->data);
        } else {

            $clausulas = array(
            'order' => array(
                array(
                    'campo' => 'ordem',
                    'valor' => 'ASC'
                )
            )
        );

            $clausulas['order'] = array(
            array(
                'campo' => 'categoria'
            )
        );

        $this->data['listaCategorias'] = $this->superModel->select('categoria', $clausulas);


        $this->data['estados'] = $this->superModel->select('estado');
            $data = array(
                'select' => 'valor, complemento',
                'condicoes' => array(
                    array(
                        'campo' => 'campo',
                        'valor' => 'cadastro_bloco',
                        'like' => 'after',
                        'escape' => true
                    )
                ),
                'order' => array(
                    array(
                        'campo' => 'campo'
                    )
                )
            );

            $this->data['textoBlocos'] = $this->superModel->select('configuracoes', $data);

            insertTag('js', 'jquery.maskedinput.min.js', $this->data);
            $this->layout->view('agendamentos', $this->data);
        }

    }


    private function enviaEmailAgendamento($data) {
        $configEmail = $this->superModel->getRow('config_email');
        $this->load->library('email');

        $mensagem = '<!DOCTYPE html>
                <html lang="pt-br">
                <head>
                    <title>Sossegue - Solicitação de serviço</title>
                    <meta charset="utf-8">
                    <meta name="viewport" content="width=device-width">
                    <style type="text/css">
                        /* CLIENT-SPECIFIC STYLES */
                        #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" message */
                        .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
                        .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} /* Force Hotmail to display normal line spacing */
                        body, table, td, a{-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;} /* Prevent WebKit and Windows mobile changing default text sizes */
                        table, td{mso-table-lspace:0pt; mso-table-rspace:0pt;} /* Remove spacing between tables in Outlook 2007 and up */
                        img{-ms-interpolation-mode:bicubic;} /* Allow smoother rendering of resized image in Internet Explorer */
                        /* RESET STYLES */
                        body{margin:0; padding:0;}
                        img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
                        table{border-collapse:collapse !important;}
                        body{height:100% !important; margin:0; padding:0; width:100% !important;}
                        /* iOS BLUE LINKS */
                        .appleBody a {color:#68440a; text-decoration: none;}
                        .appleFooter a {color:#999999; text-decoration: none;}
                        /* MOBILE STYLES */
                        @media screen and (max-width: 525px) {
                            /* ALLOWS FOR FLUID TABLES */
                            table[class="wrapper"]{
                              width:100% !important;
                            }
                            /* ADJUSTS LAYOUT OF LOGO IMAGE */
                            td[class="logo"]{
                              text-align: left;
                              padding: 20px 0 20px 0 !important;
                            }
                            td[class="logo"] img{
                              margin:0 auto!important;
                            }
                            /* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */
                            td[class="mobile-hide"]{
                              display:none;}
                            img[class="mobile-hide"]{
                              display: none !important;
                            }
                            img[class="img-max"]{
                              max-width: 100% !important;
                              height:auto !important;
                            }
                            /* FULL-WIDTH TABLES */
                            table[class="responsive-table"]{
                              width:100%!important;
                            }
                            /* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */
                            td[class="padding"]{
                              padding: 10px 5% 15px 5% !important;
                            }
                            td[class="padding-copy"]{
                              padding: 10px 5% 10px 5% !important;
                              text-align: center;
                            }
                            td[class="padding-meta"]{
                              padding: 30px 5% 0px 5% !important;
                              text-align: center;
                            }
                            td[class="no-pad"]{
                              padding: 0 0 20px 0 !important;
                            }
                            td[class="no-padding"]{
                              padding: 0 !important;
                            }
                            td[class="section-padding"]{
                              padding: 50px 15px 50px 15px !important;
                            }
                            td[class="section-padding-bottom-image"]{
                              padding: 50px 15px 0 15px !important;
                            }
                            /* ADJUST BUTTONS ON MOBILE */
                            td[class="mobile-wrapper"]{
                                padding: 10px 5% 15px 5% !important;
                            }
                            table[class="mobile-button-container"]{
                                margin:0 auto;
                                width:100% !important;
                            }
                            a[class="mobile-button"]{
                                width:80% !important;
                                padding: 15px !important;
                                border: 0 !important;
                                font-size: 16px !important;
                            }
                        }
                    </style>
                </head>
                <body style="margin: 0; padding: 0;">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td bgcolor="#ffffff">
                                <div align="center" style="padding: 0px 15px 0px 15px;">
                                    <table border="0" cellpadding="0" cellspacing="0" width="500" class="wrapper">
                                        <tr>
                                            <td style="padding: 20px 0px 0px 0px;" class="logo">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td bgcolor="#ffffff" width="100" align="left"><a href="'.base_url().'" target="_blank"><img alt="Logo Sossegue" src="'.base_url("assets/img/logo_mod-a.png").'" width="130" style="display: block;" border="0"></a></td>
                                                        <td bgcolor="#ffffff" width="400" align="right" class="mobile-hide">
                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td align="right" style="padding: 0 0 5px 0; font-size: 14px; font-family: Arial, sans-serif; color: #666666; text-decoration: none;"><span style="color: #666666; text-decoration: none;"><a href="'.base_url().'" target="_blank">SOSSEGUE</a><br>Sua vida mais tranquila</span></td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#ffffff" align="center" style="padding: 30px 15px 70px 15px;" class="section-padding">
                                <table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td align="center" style="padding: 20px 0 0 0; font-size: 16px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #666666;" class="padding-copy">Olá, um novo cliente está precisando de agendamento de serviços. Cheque os agendamentos na área administrativa e entre em contato.</td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mobile-button-container">
                                                            <tr>
                                                                <td align="center" style="padding: 20px 0 0 0;font-size: 16px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #666666;" class="padding-copy">

                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </body>
                </html>';

        $emailEnviado = $this->email
            ->from($configEmail->username, 'Sossegue')
            ->to('[email protected], [email protected]')
            ->subject("Sossegue - Solicitação de agendamento")
            ->message($mensagem)
            ->send();

    }


}
  • But because his action calls another page that is not that of scheduling?

  • @Andrébaill you refer to the confirmation page?

  • 1

    The Action is pointing to registration/ requests, so you need to take a look at the registration controller and the order method, dai sim da para saber!

  • Managed to use?

  • @Andrébaill thank you very much, silly that I missed.

  • For nothing, the disposition

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.