function SiteCreator_css(&$smarty, $form = false) { $mysql = new MYSQL($smarty); $tabela = $smarty->cfg['prefix'] . 'bilder_site'; $mysql->SqlSelect("SELECT ID_SITE FROM {$tabela} WHERE site_dominio = '{$form['site_dominio']}'", __FILE__, __LINE__); if (mysql_affected_rows() > 0) { return $smarty->getFinishError('sitecreator_erro_01', array("", " - " . htmlspecialchars($this->form['site_dominio']))); } switch ($form['action']) { case "selectcss": $smarty->assign('ID_CSSCLASS', $form['ID_CSSCLASS']); return $smarty->fetch($smarty->modulo_dir . "select_css.tpl"); break; default: $form['ID_MEMBER'] = $smarty->perfil['ID_MEMBER']; $sql = $mysql->SqlInsert($tabela, $form); $mysql->SqlSelect($sql, __FILE__, __LINE__); $idde = mysql_insert_id(); $cam = './sites/' . $idde; //$cam = './sites/21'; $site = new SiteCreator(); $site->CopyDefultSite($cam); $site->createCfgfile($cam, array('ID_SITE' => $idde)); $site->CopyCss($form['ID_CSS'], $cam); $site->createTemplates($cam, $form['site_pages']); unset($_POST); unset($_GET); return $smarty->getFinish('sitecreator_sucesso_01'); break; } }
function NewRegistro(&$smarty, &$form) { $this->form = $form; if ($e = $this->RegAgree($smarty)) { $error[] = $e; } if ($e = $this->RegAntiFlood($smarty)) { $error[] = $e; } if ($e = $this->RegUser($smarty)) { $error[] = $e; } if ($e = $this->RegPass($smarty)) { $error[] = $e; } if ($e = $this->RegEmail($smarty)) { $error[] = $e; } if ($e = $this->RegReservedName($smarty)) { $error[] = $e; } $this->form['member_registro'] = time(); $this->form['member_ip'] = $_SERVER['REMOTE_ADDR']; $mysql = new MYSQL($smarty); $request = $mysql->SqlSelect("SELECT ID_MEMBER FROM {$smarty->cfg[prefix]}members", __FILE__, __LINE__); if (mysql_affected_rows() < 1) { $this->form['member_group'] = 'Administrador'; $this->form['member_nivel'] = 5; } else { $this->form['member_group'] = ''; $this->form['member_nivel'] = 1; } if (count($error) > 0) { foreach ($error as $saida) { $out .= $saida; } return $out; } else { $pass = $this->form['member_password']; $this->form['member_password'] = $this->md5_hmac($this->form['member_password'], strtolower($this->form['member_name'])); $tabela = $smarty->cfg['prefix'] . 'members'; $sql = $mysql->SqlInsert($tabela, $this->form); $request = $mysql->SqlSelect($sql, __FILE__, __LINE__); return $smarty->getFinish("registro_sucesso_01"); } }
<?php $tabela = 'produtos'; $mysql = new MYSQL($cfg); if ($_POST['add']) { // adicionar registro. array_pop($_POST); $sql = $mysql->SqlInsert($tabela, $_POST); $request = $mysql->SqlSelect($sql, __FILE__, __LINE__); if ($request) { print "<h4>Registro Realizado com sucesso!!!</h4>"; } } if ($_POST['del']) { // adicionar registro. $idde = trim($_POST['id']); $sql = $mysql->SqlDelete($tabela, "id = '{$idde}'"); $request = $mysql->SqlSelect($sql, __FILE__, __LINE__); if ($request) { print "<h4>Registro Deletado com sucesso!!!</h4>"; } } $result = $mysql->SqlSelect("SELECT id, nome, descricao, preco FROM {$tabela}"); if ($result) { ?> <div class="col-md-6"> <table class="table table-striped"> <thead> <tr> <th>#</th>
/** * executa um insert no banco de dados de um objeto po * @param unknown_type $entry * @param unknown_type $group * @return Ambigous <Ambigous, resource> * @todo atualizar para que o insert também faça um update */ function insertTranslation(&$entry, $group = 'default') { global $cfg; $mysql = new MYSQL($cfg); $args = po_db($entry, $group); return $mysql->SqlSelect($mysql->SqlInsert($args), __FILE__, __LINE__); }
function getError($msgerro, $tipo = false) { $valores['err_who'] = $this->perfil['ID_MEMBER'] > 0 ? $this->perfil['ID_MEMBER'] : $this->perfil['member_name']; $valores['err_where'] = !$this->actualpage ? serialize(array('page_name' => 'index')) : serialize($this->actualpage); $valores['err_type'] = $tipo == false ? FALSE : TRUE; $valores['err_ip'] = $_SERVER['REMOTE_ADDR']; $valores['err_how'] = is_array($msgerro) ? implode("</br>", $msgerro) : $msgerro; $mysql = new MYSQL($this); $tabela = $this->cfg['db_prefix'] . 'logError'; $sql = $mysql->SqlInsert($tabela, $valores); //$request = $mysql->SqlSelect($sql,__FILE__,__LINE__); $tipo = $tipo == false ? 'ms_error' : 'ms_success'; $this->assign('MS_ERROR_TYPE', $tipo); $this->assign('MS_ERROR', $this->language->translate($msgerro)); return $this->fetch($tipo . '.tpl'); }