public function Create() { $Create = new Create(); $Create->ExeCreate(self::Entity, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Error = ["<b>Sucesso:</b> A categoria {$this->Data['category_title']} foi cadastrada no sistema!", WS_ACCEPT]; } }
private function Create() { $Create = new Create(); $Create->ExeCreate(DB_LOGS, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Error = ["Log gravado com sucesso!", TW_ACCEPT]; } }
private function Create() { $Create = new Create(); $Create->ExeCreate(self::entidade, $this->dados); if ($Create->getResult()) { $this->result = $Create->getResult(); $this->error = ["O registro de <b>{$this->dados['nome']}</b> foi cadastrado com sucesso no sistema!", WS_ACCEPT]; } }
private function Create() { $Create = new Create(); $Create->ExeCreate(self::Entity, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Msg = "<script>alert('Sucesso');</script>"; } }
public function inserir($dados) { $this->Dados = $dados; $cadastrar = new Create(); $cadastrar->ExeCreate('faleconosco', $this->Dados); if ($cadastrar->getResult()) { $this->result = true; } else { $this->result = false; } }
public function CriaCidade(array $data) { $this->data = $data; $create = new Create(); $create->Inserter(self::Cidade, $this->data); if ($create->getResult()) { $this->result = $create->getResult(); } else { $this->result = false; } }
private function Create() { $Create = new Create(); // $this->Data['nome'] = date('Y-m-d H:i:s'); // $this->Data['senha'] = md5($this->Data['senha']); $Create->ExeCreate(self::Entity, $this->Data); if ($Create->getResult()) { $this->Msg = ["O usuário <b>{$this->Data['user_name']}</b> foi cadastrado com sucesso no sistema!", WS_ACCEPT]; $this->Result = $Create->getResult(); } }
/** * <b>ModelCreator</b>: Método responsável por efetivar o cadastro da rota no sistema. * @param array $data Array com os dados necessários para cadastro da rota. * @return bool Retorna TRUE caso a função seja executada com sucesso, ou FALSE em caso de falha. */ public function ModelCreator(array $data) { $this->data = $data; $dataRota = array('rota_instituicoes' => json_encode($this->data['escolas']), 'tb_veiculos_veiculo_id' => (int) $this->data['rota_veiculo'], 'rota_inicio' => date('Y-m-d', strtotime(str_replace(array('/', '_', ' '), '-', $this->data['inicio']))), 'rota_fim' => date('Y-m-d', strtotime(str_replace(array('/', '_', ' '), '-', $this->data['fim']))), 'rota_saida' => (int) $this->data['rota_inicio'], 'rota_chegada' => (int) $this->data['rota_fim'], 'rota_observacoes' => $this->data['observacoes']); $create = new Create(); $create->Inserter(self::Entity, $dataRota); if ($create->getResult()) { $this->result = true; } else { $this->result = false; } }
public function cadastrar(array $dados) { try { $cadastrar = new Create(); $cadastrar->ExeCreate('produtos', $dados); if ($cadastrar->getResult() < 1) { throw new Exception('Verifique os valores antes de Enviar!', E_USER_ERROR); } else { JBErro('<p>Produto Cadastrado com Sucesso!</p>', JB_ACCEPT); } } catch (Exception $e) { } }
/** * Test if we can add and remove an IElement */ public function testIfWeCanAddAndRemoveAndValidate() { $obj1 = Create::factory(); $obj2 = Create::factory(); $obj1->add($obj2)->remove($obj2); $this->assertTrue($obj1->validate()); }
/** * Just whether movement has already been added to transaction * and adds it, if not. */ protected function _addMovementToTransactionIfNeeded() { if (!$this->_movementInTransaction) { $this->_movementCreator->setTransaction($this->_transaction); $this->_movementCreator->createWithoutAdjustments($this->_movement); $this->_movementInTransaction = true; } }
public function GravarTrabalho() { $this->dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (isset($_FILES['fileUpload'])) { $nome = $this->dados['titulo']; $ext = strtolower(substr($_FILES['fileUpload']['name'], -4)); //Pegando extensão do arquivo $new_name = $nome . $ext; //Definindo um novo nome para o arquivo $this->LinkAnexo = $new_name; $dir = 'uploads/'; //Diretório para uploads move_uploaded_file($_FILES['fileUpload']['tmp_name'], $dir . $new_name); //Fazer upload do arquivo } else { echo "<script>alert('nao foi possivel anexar o arquivo!');</script>"; } if ($this->dados['tipoAtividade'] == "Palestra") { $tipoA = 1; } elseif ($this->dados['tipoAtividade'] == "MiniCurso") { $tipoA = 2; } else { $tipoA = 3; } //cadastra Trabalho $cadastrarT = new Create(); $Dados = ["resumo" => $this->dados['resumo'], "data_submetido" => date("Y-m-d"), "tipo_atividade" => $tipoA, "anexo" => $this->LinkAnexo, "status" => "N", "titulo" => $this->dados['titulo']]; $cadastrarT->ExeCreate('trabalhos', $Dados); $this->idT = $cadastrarT->getResult(); // Vincula o auto trabalho $cadastraAT = new Create(); $DadosAT = ["codigo_trabalho" => (int) $this->idT, "codigo_autor" => (int) $this->dados['idPes'], "codigo_evento" => 1]; $cadastraAT->ExeCreate('autor_trabalho', $DadosAT); // pega dados da pessoa $pessoa = new Read(); $pessoa->ExeRead('pessoas', "where codigo = :id", "id={$this->dados['idPes']}"); foreach ($pessoa->getResult() as $resulPes) { extract($resulPes); //Enviar o Email. $enviarEmail = new Email(); $DadosEmail = ["Assunto" => "Confirmação da Submição de Trabalho DeepDay", "Mensagem" => "Seu Trabalho foi submetido com sucesso.", "RemetenteNome" => "Equipe DeepDay", "RemetenteEmail" => "*****@*****.**", "DestinoNome" => $nome, "DestinoEmail" => $email]; $enviarEmail->Enviar($DadosEmail); } echo "<script>alert('Seu trabalho foi submetido com sucesso!');</script>"; echo "<script>window.location.assign('" . BASE . "/painel')</script>"; }
protected function _configureCurl() { $ch = parent::_configureCurl(); $xml = $this->getPayload(); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml;type=entry', 'Content-Length: ' . strlen($xml))); return $ch; }
public function GravarTrabalho() { $this->dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (isset($_FILES['fileUpload'])) { $nome = $this->dados['titulo']; $ext = strtolower(substr($_FILES['fileUpload']['name'], -4)); //Pegando extensão do arquivo $new_name = $nome . $ext; //Definindo um novo nome para o arquivo $this->LinkAnexo = $new_name; $dir = 'uploads/'; //Diretório para uploads move_uploaded_file($_FILES['fileUpload']['tmp_name'], $dir . $new_name); //Fazer upload do arquivo } else { echo "<script>alert('nao foi possivel anexar o arquivo!');</script>"; } if ($this->dados['tipoAtividade'] == "Palestra") { $tipoA = 1; } elseif ($this->dados['tipoAtividade'] == "MiniCurso") { $tipoA = 2; } else { $tipoA = 3; } //atualiza pessoa $updateP = new Update(); $dadosUp = ["curriculo" => $this->dados['perfil'], "nivel" => 1, "senha" => $this->dados['senha']]; $updateP->ExeUpdate('pessoas', $dadosUp, "where codigo = :id", "id={$this->dados['idPes']}"); //cadastra Trabalho $cadastrarT = new Create(); $Dados = ["resumo" => $this->dados['resumo'], "data_submetido" => date("Y-m-d"), "tipo_atividade" => $tipoA, "anexo" => $this->LinkAnexo, "status" => "N", "titulo" => $this->dados['titulo']]; $cadastrarT->ExeCreate('trabalhos', $Dados); $this->idT = $cadastrarT->getResult(); // Vincula o auto trabalho $cadastraAT = new Create(); $DadosAT = ["codigo_trabalho" => (int) $this->idT, "codigo_autor" => (int) $this->dados['idPes'], "codigo_evento" => 1]; $cadastraAT->ExeCreate('autor_trabalho', $DadosAT); echo "<script>alert('Seu trabalho foi submetido com sucesso. Aguarde nosso contato');</script>"; echo "<script>window.location.assign('http://www.profile.vc/sigea')</script>"; }
/** * Register event listeners */ public function boot() { // Get config (again) $config = $this->app->make('config')->get('freezer::config'); $dir = $config['dir']; // Create caches by listening for the laravel lifecyle response as long as there // is a whitelist if (count($config['whitelist'])) { $lists = $this->app->make('freezer.lists'); $cookies = $this->app->make('cookie'); $queue = $this->app->make('freezer.queue'); $this->app->after(function ($request, $response) use($dir, $lists, $cookies, $queue) { // Iterate through the queue of operations and do clears or rebuilds. Check that // we're not currently fielding a request from Freezer, though. Otherwise infitine // loops if (!preg_match('#' . preg_quote(Facade::USER_AGENT, '#') . '#', $request->header('user-agent'))) { $queue->process(); } // Init create class and check if we should cache this request $create = new Create($response, $dir); $create->conditionallyCache($request, $lists, $cookies); }); } }
public function ModelCreator(array $data) { $this->data = $data; $this->data['instituicao_nome_url'] = Asserts::CheckName($this->data['instituicao_nome']); $create = new Create(); $create->Inserter(self::Entity, $this->data); if ($create->getResult()) { $this->result = $create->getResult(); $this->rowcount = $create->getRowCount(); $this->lastid = $create->getLastId(); } else { $this->result = $create->getResult(); $this->rowcount = 0; $this->lastid = false; } }
public function ModelCreator(array $data) { $this->data = $data; $this->data['veiculo_vagas'] = 0; $create = new Create(); $create->Inserter(self::Entity, $this->data); if ($create->getResult()) { $this->result = $create->getResult(); $this->rowcount = $create->getRowCount(); } else { $this->result = $create->getResult(); $this->rowcount = 0; } }
public function ModelCreator(array $data) { $this->data = $data; $this->data['motorista_nome_url'] = Asserts::CheckName($this->data['motorista_nome'] . ' ' . $this->data['motorista_sobrenome']); $create = new Create(); $create->Inserter(self::Entity, $this->data); if ($create->getResult()) { $this->result = $create->getResult(); $this->rowcount = $create->getRowCount(); } else { $this->result = $create->getResult(); $this->rowcount = 0; } }
public function ModelCreator(array $data) { $this->data = $data; $this->data['aluno_nome_url'] = Asserts::CheckName($this->data['aluno_nome']); $this->data['aluno_nascimento'] = date('Y-m-d', strtotime(str_replace(array('/', '_'), '-', $this->data['aluno_nascimento']))); $create = new Create(); $create->Inserter(self::Entity, $this->data); if ($create->getResult()) { $rota = new ModelRotas(); $veiculo = $rota->getRota($this->data['tb_rotas_rota_id']); if ($veiculo) { $idVeiculo = $veiculo[0]['tb_veiculos_veiculo_id']; $bus = new ModelVeiculo(); $bus->setVaga($idVeiculo); } $this->result = $create->getResult(); $this->rowcount = $create->getRowCount(); } else { $this->result = $create->getResult(); $this->rowcount = 0; } }
private function CreateReport() { $Create = new Create(); $Create->ExeCreate(DB_PSICO_GRUPO_SESSAO, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Error = ["Cadastro do grupo realizado com sucesso!", TW_ACCEPT]; } }
private function setUser() { $onlineSession = $_SESSION['useronline']; $onlineSession['agent_name'] = $this->Browser; $createUser = new Create(); $createUser->ExeCreate('wm_siteviews_online', $onlineSession); }
private function Create() { $Create = new Create(); $this->Data['user_registration'] = date('Y-m-d H:i:s'); $this->Data['user_password'] = crypt(sha1($this->Data['user_email'] . $this->Data['user_password']), sha1($this->Data['user_email'])); $Create->ExeCreate(DB_USERS, $this->Data); if ($Create->getResult()) { $this->Error = ["O usuário <b>{$this->Data['user_name']}</b> foi cadastrado com sucesso no sistema!", TW_ACCEPT]; $this->Result = $Create->getResult(); } }
/** * Initialize form. * * @return void */ public function initialize() { parent::initialize(); $this->setTitle('Edit Language')->setDescription('Edit this language.'); $this->getFieldSet(self::FIELDSET_FOOTER)->clearElements()->addButton('save')->addButtonLink('cancel', 'Cancel', ['for' => 'admin-languages']); }
private function Create() { $Create = new Create(); $Create->ExeCreate(DB_NUTRICAO_CATEGORIAS, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Error = ["Cadastro da categoria realizado com sucesso!", TW_ACCEPT]; } }
private function RegistraMatricula($motivo) { $educando = $this->getEducando(); if ($this->getEducando() !== null) { $create = new Create(); $create->ExeCreate(DB_EDUCANDOS_OCORRENCIAS, ['educando_id' => $this->EducandoId, 'tipo' => 'Matrícula de Educando', 'motivo' => $motivo, 'data' => date('d/m/Y'), 'hora' => date('H:i'), 'ocorrencia' => 'Educando ' . $educando['nome'] . ', matrícula nº ' . $educando['matricula'] . ', foi matriculado.', 'created_by' => $this->UserId, 'create_date' => date('Y-m-d H:i:s')]); } }
private function setUsuario() { $sesOnline = $_SESSION['useronline']; $sesOnline['agent_name'] = $this->Browser; $userCreate = new Create(); $userCreate->ExeCreate('ws_siteviews_online', $sesOnline); }
/** * 执行应用程序 * @access public * @return void */ public static function run(array $config = []) { if (version_compare(PHP_VERSION, '5.4.0', '<')) { throw new Exception('require PHP > 5.4.0 !'); } // 日志初始化 Log::init($config['log']); // 缓存初始化 Cache::connect($config['cache']); // 加载框架底层语言包 if (is_file(THINK_PATH . 'Lang/' . strtolower($config['default_lang']) . EXT)) { Lang::set(include THINK_PATH . 'Lang/' . strtolower($config['default_lang']) . EXT); } if (is_file(APP_PATH . 'build.php')) { // 自动化创建脚本 Create::build(include APP_PATH . 'build.php'); } // 监听app_init Hook::listen('app_init'); // 初始化公共模块 self::initModule(APP_PATH . $config['common_module'] . '/', $config); // 启动session if ($config['use_session']) { Session::init($config['session']); } // 应用URL调度 self::dispatch($config); // 监听app_run Hook::listen('app_run'); // 执行操作 if (!preg_match('/^[A-Za-z](\\/|\\w)*$/', CONTROLLER_NAME)) { // 安全检测 $instance = false; } elseif ($config['action_bind_class']) { // 操作绑定到类:模块\controller\控制器\操作 if (is_dir(MODULE_PATH . CONTROLLER_LAYER . '/' . CONTROLLER_NAME)) { $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . CONTROLLER_NAME . '\\'; } else { // 空控制器 $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . $config['empty_controller'] . '\\'; } $actionName = strtolower(ACTION_NAME); if (class_exists($namespace . $actionName)) { $class = $namespace . $actionName; } elseif (class_exists($namespace . '_empty')) { // 空操作 $class = $namespace . '_empty'; } else { throw new Exception('_ERROR_ACTION_:' . ACTION_NAME); } $instance = new $class(); // 操作绑定到类后 固定执行run入口 $action = 'run'; } else { $instance = Loader::controller(CONTROLLER_NAME, '', $config['empty_controller']); // 获取当前操作名 $action = ACTION_NAME . $config['action_suffix']; } if (!$instance) { throw new Exception('[ ' . MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . Loader::parseName(CONTROLLER_NAME, 1) . ' ] not exists'); } try { // 操作方法开始监听 $call = [$instance, $action]; Hook::listen('action_begin', $call); if (!preg_match('/^[A-Za-z](\\w)*$/', $action)) { // 非法操作 throw new \ReflectionException(); } //执行当前操作 $method = new \ReflectionMethod($instance, $action); if ($method->isPublic()) { // URL参数绑定检测 if ($config['url_params_bind'] && $method->getNumberOfParameters() > 0) { switch ($_SERVER['REQUEST_METHOD']) { case 'POST': $vars = array_merge($_GET, $_POST); break; case 'PUT': parse_str(file_get_contents('php://input'), $vars); break; default: $vars = $_GET; } $params = $method->getParameters(); $paramsBindType = $config['url_parmas_bind_type']; foreach ($params as $param) { $name = $param->getName(); if (1 == $paramsBindType && !empty($vars)) { $args[] = array_shift($vars); } if (0 == $paramsBindType && isset($vars[$name])) { $args[] = $vars[$name]; } elseif ($param->isDefaultValueAvailable()) { $args[] = $param->getDefaultValue(); } else { throw new Exception('_PARAM_ERROR_:' . $name); } } array_walk_recursive($args, 'Input::filterExp'); $data = $method->invokeArgs($instance, $args); } else { $data = $method->invoke($instance); } // 操作方法执行完成监听 Hook::listen('action_end', $data); // 返回数据 Response::returnData($data, $config['default_return_type']); } else { // 操作方法不是Public 抛出异常 throw new \ReflectionException(); } } catch (\ReflectionException $e) { // 操作不存在 if (method_exists($instance, '_empty')) { $method = new \ReflectionMethod($instance, '_empty'); $method->invokeArgs($instance, [$action, '']); } else { throw new Exception('[ ' . (new \ReflectionClass($instance))->getName() . ':' . $action . ' ] not exists ', 404); } } return; }
private function Create() { $Create = new Create(); $Create->ExeCreate(DB_VISITANTES, $this->Data); if ($Create->getResult()) { $this->Result = $Create->getResult(); $this->Error = ["Cadastro do visitante realizado com sucesso!", TW_ACCEPT]; } }
// ThinkPHP 引导文件 // 加载基础文件 require __DIR__ . '/base.php'; require CORE_PATH . 'loader.php'; // 注册自动加载 Loader::register(); // 注册错误和异常处理机制 register_shutdown_function(['think\\Error', 'appShutdown']); set_error_handler(['think\\Error', 'appError']); set_exception_handler(['think\\Error', 'appException']); // 加载模式定义文件 $mode = (require MODE_PATH . APP_MODE . EXT); // 加载模式别名定义 if (isset($mode['alias'])) { Loader::addMap(is_array($mode['alias']) ? $mode['alias'] : (include $mode['alias'])); } // 加载模式配置文件 if (isset($mode['config'])) { is_array($mode['config']) ? Config::set($mode['config']) : Config::load($mode['config']); } // 加载模式行为定义 if (APP_HOOK && isset($mode['tags'])) { Hook::import(is_array($mode['tags']) ? $mode['tags'] : (include $mode['tags'])); } // 自动生成 if ('sae' != APP_MODE && is_file(APP_PATH . 'build.php')) { Create::build(include APP_PATH . 'build.php'); } // 执行应用 !IN_UNIT_TEST && App::run(Config::get());
//加载公共函数库 define('SYS_Drive', SYS_URL . "/Drive/Extend.php"); include_once SYS_CONFIG; //加载配置项文件 include_once SYS_Drive; //加载驱动 include_once SYS_ACTION; //加载控制器文件 include_once SYS_MODEL; //加载模型文件 include_once SYS_COMM; //加载函数库文件 /** * 检查目录如果不存在则自动创建 */ Create::Start(APP_URL, 0777); include SYS_URL . "/Common/debug.php"; //加载DeBug模块 function run($G, $K, $F) { debug::Run($K); //运行DeBug模块,判断指定的模块文件是否存在。 if ($GLOBALS['Rotu']['Group'] == true) { include APP_URL . "/Lib/Controller/{$G}/{$K}.class.php"; } else { include APP_URL . "/Lib/Controller/{$K}.class.php"; } $obj = new $K(); debug::modify($obj, $F); //运行DeBug模块,判断指定的方法是否存在。 $obj->{$F}();