Evaluating bids

Programador Web php mvc

Published on the February 16, 2020 in IT & Programming

About this project

Open

Bom dia, preciso que na função abaixo, a varável $recibo envie para bd conjunto de caracteres, numeros, espaço, traçço e _ (anderline),

exemplo:  po 123456-2020 - rj banco bradesco_rj

também vou precisar de um campo enviando data


public function getdespesasos($id)
    {
        $selectparams = array();
        $select = $this->select('*',
            'pdf_pedidos_despesas', 'where id_pedido = ?', 'i', [$id]);
        while ($data = $select->fetch_object()) {
            $return[] = $data;
        }
        if (!isset($return)) {
            $return = false;
        } else if ($return == null) {
            $return = false;
        }
        return $return;
    }

    public function insertdespesa($data)
    {
        $idpedido  = $data['id_pedido'];
        $arraydesp = $data['despesa'];
       
       
        $arraydespcount = (is_array($arraydesp) ? count($arraydesp) : 1);
        for ($i = 0; $i < $arraydespcount; $i++) {
         
            $quantidade = str_replace('', '', $arraydesp[$i]['quantidade']);
       
           
              $recibo = preg_match('/^[a-za-z0-9-]+$/u', '', $arraydesp[$i]['despesa_recibo']);
           
         
           
            $valor = str_replace('.', '', $ArrayDesp[$i]['valor']);
            $valor = (int)str_replace(',', '', $valor);
            $paramsDespesas = array(
                $idPedido,
                $arrayDesp[$i]['id'],
                $recibo,
                $valor,
                $quantidade
             
            );
           
           
           
            $insertDespesa = $this->insert(
                'tb_vistos_despesas (id_pedido, id_lst_despesa, despesa_recibo, desp_v_unit , desp_quant )',
                '?, ?, ?, ?, ?', 'iiiii', $paramsDespesas);
            if ($insertDespesa) {
                $return = array(
                    'error' => false,
                    'msg' => 'Despesa incluída para a OS: ' . $IdPedido
                );
            } else {
                $return = array(
                    'error' => true,
                    'msg' => 'Erro ao inserir Despesa.'
                );
            }
        }
        return $return;
    }

    public function deleteDespesa($id)
    {
        $return =  $this->delete('tb_vistos_despesas','WHERE id_despesa = ?', 'i', $id);
        if($return){
            return true;
        } else {
            return false;
        }

    }

}

Category IT & Programming
Subcategory Web development
What is the scope of the project? Small change or bug
Is this a project or a position? Project
I currently have I have an idea
Required availability As needed
API Integrations Other (Other APIs)
Roles needed Developer

Delivery term: Not specified

Skills needed