本文整理汇总了PHP中Update类的典型用法代码示例。如果您正苦于以下问题:PHP Update类的具体用法?PHP Update怎么用?PHP Update使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Update类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update
public function update()
{
$backup = new Backup($this->registry);
$update = new Update($this->registry);
//$backup->run();
$update->run();
}
开发者ID:josueaponte7,项目名称:necotienda_standalone,代码行数:7,代码来源:update.php
示例2: Update
private function Update()
{
$Update = new Update();
$Update->ExeUpdate(self::entidade, $this->dados, "WHERE id = :id", "id={$this->id}");
if ($Update->getRowCount() >= 1) {
$this->error = ["O registro de <b>{$this->dados['nome']}</b> foi atualizado com sucesso!", WS_ACCEPT];
$this->result = true;
}
}
开发者ID:angelomocbel,项目名称:proempenho,代码行数:9,代码来源:AdminBanco.class.php
示例3: postNewsPost
public function postNewsPost()
{
$posted = Input::get();
$update = new Update();
$update->message = $posted['message'];
$update->date = $posted['date'];
$update->save();
return Redirect::to('admin/news')->with('success', 'New update has been posted');
}
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:9,代码来源:UpdateController.php
示例4: getByVersionNumber
public static function getByVersionNumber($version)
{
$upd = new Update();
$updates = $upd->getLocalAvailableUpdates();
foreach ($updates as $up) {
if ($up->getUpdateVersion() == $version) {
return $up;
}
}
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:10,代码来源:application_update.php
示例5: ApTrabalho
public function ApTrabalho($Cod)
{
$this->Cod = $Cod;
$update = new Update();
$Dados = ["status" => "A"];
$update->ExeUpdate('trabalhos', $Dados, "where codigo = :c", "c={$this->Cod}");
if ($update->getResult()) {
echo "<script>alert('Trabalho Aprovado Com Sucesso!');</script>";
echo "<script>window.location.assign('painel/submetidos.php')</script>";
}
}
开发者ID:victorborgaco,项目名称:projetoSoftware,代码行数:11,代码来源:TrabalhoC.php
示例6: testChecarSeOSqlRetornaCorretoComWhere
public function testChecarSeOSqlRetornaCorretoComWhere()
{
$update = new Update();
$where = new Where();
$where->set('id', '=', 1);
$update->where($where);
$fields = ['name' => 'Erik'];
$update->fields($fields);
$sql = $update->sql();
$this->assertEquals('UPDATE `users` SET `name`=:name WHERE `id`=:id;', $sql);
}
开发者ID:Raro01,项目名称:php-praticas-modernas-turma-1,代码行数:11,代码来源:UpdateTest.php
示例7: admin_controller
function admin_controller()
{
global $mysqli, $session, $route, $updatelogin;
// Allow for special admin session if updatelogin property is set to true in settings.php
// Its important to use this with care and set updatelogin to false or remove from settings
// after the update is complete.
if ($updatelogin || $session['admin']) {
$sessionadmin = true;
}
// if ($session['userid']==4) $sessionadmin = true;
if ($sessionadmin) {
if ($route->action == 'view') {
$result = view("Modules/admin/admin_main_view.php", array());
}
if ($route->action == 'db') {
$applychanges = get('apply');
if (!$applychanges) {
$applychanges = false;
} else {
$applychanges = true;
}
require "Modules/admin/update_class.php";
require_once "Lib/dbschemasetup.php";
$update = new Update($mysqli);
$updates = array();
$updates[] = array('title' => "Database schema", 'description' => "", 'operations' => db_schema_setup($mysqli, load_db_schema(), $applychanges));
if (!$updates[0]['operations']) {
// In future versions we could check against db version number as to what updates should be applied
$updates[] = $update->u0001($applychanges);
//$updates[] = $update->u0002($applychanges);
$updates[] = $update->u0003($applychanges);
$updates[] = $update->u0004($applychanges);
}
$result = view("Modules/admin/update_view.php", array('applychanges' => $applychanges, 'updates' => $updates));
}
if ($route->action == 'users' && $session['write'] && $session['admin']) {
$result = view("Modules/admin/userlist_view.php", array());
}
if ($route->action == 'userlist' && $session['write'] && $session['admin']) {
$data = array();
$result = $mysqli->query("SELECT id,username,email FROM users");
while ($row = $result->fetch_object()) {
$data[] = $row;
}
$result = $data;
}
if ($route->action == 'setuser' && $session['write'] && $session['admin']) {
$_SESSION['userid'] = intval(get('id'));
header("Location: ../user/view");
}
}
return array('content' => $result);
}
开发者ID:EMT,项目名称:MyHomeEnergyPlanner,代码行数:53,代码来源:admin_controller.php
示例8: ModelUpdate
public function ModelUpdate($id, array $dados)
{
$this->instituicao = (int) $id;
$this->data = $dados;
$update = new Update();
$update->Updater(self::Entity, $this->data, 'where instituicao_id = :id', "id={$this->instituicao}");
if ($update->getResult()) {
$this->result = true;
} else {
$this->result = false;
}
}
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:12,代码来源:ModelInstituicao.class.php
示例9: Update
private function Update()
{
$Update = new Update();
$Update->ExeUpdate(self::entidade, $this->dados, "WHERE id = :id", "id={$this->id}");
if ($Update->getResult()) {
$this->error = ["A Pessoa <b>{$this->dados['nome']}</b> foi atualizada com sucesso!", WS_ACCEPT];
$this->result = true;
} else {
$this->error = ["Não foi possivel atualizar", WS_ERROR];
$this->result = false;
}
}
开发者ID:angelomocbel,项目名称:proempenho,代码行数:12,代码来源:AdminPessoa.class.php
示例10: ModelUpdate
public function ModelUpdate($id, array $dados)
{
$this->rota = (int) $id;
$this->data = $dados;
$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']);
$update = new Update();
$update->Updater(self::Entity, $dataRota, 'where rota_id = :id', "id={$this->rota}");
if ($update->getResult()) {
$this->result = true;
} else {
$this->result = false;
}
}
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:13,代码来源:ModelRotas.class.php
示例11: ModelUpdate
public function ModelUpdate($id, array $dados)
{
$this->motorista = (int) $id;
$this->data = $dados;
$this->data['motorista_nome_url'] = Asserts::CheckName($this->data['motorista_nome']);
$update = new Update();
$update->Updater(self::Entity, $this->data, 'where motorista_id = :id', "id={$this->motorista}");
if ($update->getResult()) {
$this->result = true;
} else {
$this->result = false;
}
}
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:13,代码来源:ModelMotorista.class.php
示例12: actionDashboard
public function actionDashboard()
{
$update = new Update();
$messages = $update->getMessages();
foreach ($messages as $message) {
Yii::app()->user->setFlash('error', "<h3>" . $message["title"] . "</h3><br>" . $message["data"]);
}
if (isset($_POST['Widget'])) {
$user = User::model()->findByPk(Yii::app()->user->id);
$user->saveWidget($_POST['Widget']);
Yii::app()->end();
}
$this->render('dashboard', array());
}
开发者ID:hkhateb,项目名称:linet3,代码行数:14,代码来源:SettingsController.php
示例13: GravarTrabalho
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, "telefone" => $this->dados['telefone']];
$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);
// 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" => "[email protected]", "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>";
}
开发者ID:jairophp,项目名称:projetoSoftware,代码行数:50,代码来源:PessoaC.php
示例14: ModelUpdate
public function ModelUpdate($id, array $dados)
{
$this->aluno = (int) $id;
$this->data = $dados;
$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'])));
$update = new Update();
$update->Updater(self::Entity, $this->data, 'where aluno_id = :id', "id={$this->aluno}");
if ($update->getResult()) {
$this->result = true;
} else {
$this->result = false;
}
}
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:14,代码来源:ModelAluno.class.php
示例15: setVaga
public function setVaga($veiculo)
{
$read = new Read();
$read->Reader(self::Entity, 'where veiculo_id = :id', "id={$veiculo}");
if ($read->getResult()) {
$vagas = (int) $read->getResult()[0]['veiculo_vagas'];
if (0 < $vagas) {
$update = new Update();
$update->Updater('tb_veiculos', array('veiculo_vagas' => $vagas - 1), 'where veiculo_id = :id', "id={$veiculo}");
return true;
} else {
return false;
}
}
}
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:15,代码来源:ModelVeiculo.class.php
示例16: action_update_check
public function action_update_check()
{
// add an extra GUID, in addition to the one in our .xml file to pretend a theme was registered
Update::add('Test', '10cbaf18-bdd2-48e1-b0d3-e1853a4c649d', '3.0.2');
// add an extra GUID, in addition to the one in our .xml file to pretend a plugin was registered
Update::add('Test', '7a0313be-d8e3-11d1-8314-0800200c9a66', '0.9');
}
开发者ID:habari-extras,项目名称:beacontest,代码行数:7,代码来源:beacontest.plugin.php
示例17: view
public function view()
{
Loader::library('update');
$this->set('latest_version', Update::getLatestAvailableVersionNumber());
$tp = new TaskPermission();
$updates = 0;
$local = array();
$remote = array();
if ($tp->canInstallPackages()) {
$local = Package::getLocalUpgradeablePackages();
$remote = Package::getRemotelyUpgradeablePackages();
}
// now we strip out any dupes for the total
$updates = 0;
$localHandles = array();
foreach ($local as $_pkg) {
$updates++;
$localHandles[] = $_pkg->getPackageHandle();
}
foreach ($remote as $_pkg) {
if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
$updates++;
}
}
$this->set('updates', $updates);
}
开发者ID:Zyqsempai,项目名称:amanet,代码行数:26,代码来源:dashboard_app_status.php
示例18: fromResponse
public static function fromResponse($data)
{
$arrayOfUpdates = array();
foreach ($data as $update) {
$arrayOfUpdates[] = Update::fromResponse($update);
}
return $arrayOfUpdates;
}
开发者ID:bhean,项目名称:Api,代码行数:8,代码来源:ArrayOfUpdates.php
示例19: getApplicationUpdateInformation
public function getApplicationUpdateInformation()
{
$r = Cache::get('APP_UPDATE_INFO', false);
if (!is_object($r)) {
$r = Update::getLatestAvailableUpdate();
}
return $r;
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:8,代码来源:update.php
示例20: __construct
private function __construct()
{
$data = DataTable::constructFromCsvFile(new CsvFile('data/updates.csv'))->get();
foreach ($data as $row) {
$year = $row['year'];
$month = $row['month'];
$day = $row['day'];
$version = $year . '-' . $month . '-' . $day;
$change = $row['change'];
if (!isset($this->updates[$version])) {
$update = new Update($year, $month, $day);
$this->updates[$version] = $update;
$this->latest_version = $update->getVersion();
}
$this->updates[$version]->addChange($change);
}
}
开发者ID:KeyWeeUsr,项目名称:Darkelf,代码行数:17,代码来源:UpdatesDB.php
注:本文中的Update类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论