public function sms() { $funcionalidades = new funcionalidades(); $conn = new conn(); $conn->insert(array('dtCad' => $this->data, 'campanha' => utf8_encode($this->nome), 'palavra_chave' => $this->palavras_chaves, 'descricao' => $this->descricao, 'validadeIni' => $funcionalidades->ChecaVariavel($this->valiadeDe, "data"), 'validadeFim' => $funcionalidades->ChecaVariavel($this->validadeAte, "data"), 'patrocinador' => $this->patrocinador, 'qtdCupons' => $this->qtd, 'contato' => $this->contato, 'mensagem' => $funcionalidades->removeAcentos($this->msg), 'dt_limiteCupom' => $funcionalidades->ChecaVariavel($this->dt_limiteCupom, "data"), 'mensagem_encerrado' => $funcionalidades->removeAcentos($this->mensagem_encerrado), 'status' => 1), "", "campanha_sms"); exit("<script>alert('Campanha cadastrada com sucesso!');document.location.href='painel-index.php';</script>"); }
function converteComandosTxt($txt, $campanha, $dtvalidade) { //altera variaveis $conn = new conn(); $codigo = token(); $conn->insert(array('dtCad' => date("Y-m-d"), 'campanha' => $campanha, 'codigo_cupom' => $codigo, 'dtvalidade' => $dtvalidade, 'usuario_acao' => $_SESSION["login"]["usuario"], 'status' => 0), "", "cupom"); $txt = str_replace("&CODE&", $codigo, $txt); return $txt; }
private function validacao() { $funcoes = new funcionalidades(); $this->usuario = $funcoes->ChecaVariavel($this->usuario, "texto"); $this->senha = $this->senha == "" ? $this->senha : $this->sha_senha($this->senha); $this->data = $this->data; $conn = new conn(); if ($this->op != "alterar") { $conn->insert(array('dtCad' => $this->data, 'dtAlt' => $this->data, 'dtCad' => $this->data, 'usuario' => $this->usuario, 'senha' => $this->senha, 'cpf' => $this->cpf, 'faz_validacao ' => $this->validador, 'status' => $this->status), "", "usuario"); exit("<script>alert('Seu cadastro foi efetuado com sucesso!');document.location.href='painel-index.php';</script>"); } else { if ($this->senha == "") { $conn->update(array('dtAlt' => $this->data, 'usuario' => $this->usuario, 'cpf' => $this->cpf, 'faz_validacao ' => $this->validador, 'status' => $this->status), "id=" . $this->idCliente . "", "usuario"); } else { $conn->update(array('dtAlt' => $this->data, 'usuario' => $this->usuario, 'senha' => $this->senha, 'cpf' => $this->cpf, 'faz_validacao ' => $this->validador, 'status' => $this->status), "id=" . $this->idCliente . "", "usuario"); } exit("<script>alert('Seu cadastro foi alterado com sucesso!');document.location.href='painel-index.php';</script>"); } }
if ($action == "addNew") { // ALL FORM INPUTS MUST BE SANITIZED $ProductId = $DB->sanitize($_REQUEST["ProductId"]); $LocationId = $DB->sanitize($_REQUEST["LocationId"]); $Invoice = $DB->sanitize($_REQUEST["Invoice"]); $DateReceived = $DB->sanitize($_REQUEST["receivedDate"]); $serials = array(); foreach ($_REQUEST as $key => $value) { $pos = strpos($key, "Serial"); if ($pos !== false) { $serials[] = $DB->sanitize($value); } } foreach ($serials as $serial) { $sql = "INSERT INTO inventory (product_id, storagelocation_id, invoice, serial, status, status_data, AddedBy, DateReceived) VALUES (" . $ProductId . ", " . $LocationId . ", '" . $Invoice . "', '" . $serial . "', '1', " . $LocationId . ", " . $_SESSION["user_id"] . ", STR_TO_DATE('" . $DateReceived . "', '%m/%d/%Y') )"; $newId = $DB->insert($sql); $sql = "SELECT storagelocation_name from storagelocations where storagelocation_id = " . $LocationId; $locText = $DB->query_scalar($sql); $statusdate = date("m/d/y"); $sql = "UPDATE inventory set status_data_text = '" . $locText . "', status_date = STR_TO_DATE('" . $statusdate . "', '%m/%d/%Y') WHERE inventory_id = " . $newId; $DB->execute_nonquery($sql); } header("Location: ManageInventory.php"); } } } if ($_GET) { } } $DB->close(); ?>
} if (isset($_REQUEST["templateName"])) { $name = $DB->sanitize($_REQUEST["templateName"]); } else { $success = "failure"; return false; } if (isset($_REQUEST["templateElements"])) { $elements = $DB->sanitize($_REQUEST["templateElements"]); } else { $success = "failure"; return false; } $sql = "INSERT INTO commission_templates (template_name, template_elements, min_price, max_price) "; $sql .= " VALUES ('" . $name . "', '" . $elements . "', " . $min . ", " . $max . ")"; $newRow = $DB->insert($sql); $output = $newRow; } if ($id == "addTemplateBlockToDatabase") { if (!UserMay("Admin_EditComm")) { AccessDenied(); } $DB = new conn(); $DB->connect(); $user = getLoggedUser($DB); if (isset($_REQUEST["maximum"])) { $max = $DB->sanitize($_REQUEST["maximum"]); } else { $max = 9999999; } $min = $DB->sanitize($_REQUEST["minimum"]);