本文整理汇总了PHP中crud::update方法的典型用法代码示例。如果您正苦于以下问题:PHP crud::update方法的具体用法?PHP crud::update怎么用?PHP crud::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类crud
的用法示例。
在下文中一共展示了crud::update方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: simpan
public function simpan()
{
if (akses::aksesLogin() == TRUE or akses::aksesUser() == TRUE) {
crud::update('tbl_pengaturan', 'id_pengaturan', '1', $_POST);
redirect('page=pengaturan');
} else {
$this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, anda session habis. Silahkan login ulang.</div>');
redirect(site_url());
}
}
示例2: menu_update
public function menu_update()
{
$kat = $this->input->post('kategori');
$kode = $this->input->post('kode');
$menu = $this->input->post('menu');
$harga = $this->input->post('harga');
$ket = $this->input->post('ket');
$id = $this->input->post('id');
$f_foto = $this->encrypt->decode_url($this->input->post('secure'));
$folder = realpath('../assets/gbr');
$file = $_FILES['file']['name'];
$this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
$this->form_validation->set_rules('kategori', 'Kategori', 'required');
$this->form_validation->set_rules('kode', 'Kode Menu', 'required');
$this->form_validation->set_rules('menu', 'Menu', 'required');
$this->form_validation->set_rules('harga', 'Harga', 'required');
// $this->form_validation->set_rules('file', 'File', 'required');
$this->form_validation->set_rules('ket', 'Keterangan', 'required');
if ($this->form_validation->run() == FALSE) {
$msg_error = array('kategori' => form_error('penjahit'), 'kode' => form_error('kode'), 'menu' => form_error('menu'), 'harga' => form_error('harga'), 'file' => form_error('file'));
$has_error = array('kategori' => 'has-error', 'kode' => 'has-error', 'menu' => 'has-error', 'harga' => 'has-error', 'file' => 'has-error');
$this->session->set_flashdata('form_error', $msg_error);
$this->session->set_flashdata('has_error', $has_error);
redirect('page=menu&act=menu_edit&id=' . $id);
} else {
if (!empty($file)) {
// Konfigurasi upload gambar
$config['upload_path'] = $folder;
$config['allowed_types'] = 'jpg|png';
$config['max_size'] = '4096';
$config['remove_spaces'] = TRUE;
// $config['file_name'] = 'menu_'.strtolower($menu);
$this->load->library('upload', $config);
if (!$this->upload->do_upload('file')) {
$this->session->set_flashdata('menu', '<div class="alert alert-danger">Error : <b>' . $this->upload->display_errors() . '</b></div>');
redirect('page=menu&act=menu_edit&id=' . $id);
} else {
if (!empty($f_foto)) {
unlink(realpath('../assets/gbr/') . '/' . $f_foto);
}
$f = $this->upload->data();
$data = array('id_kategori' => $kat, 'kode' => $kode, 'menu' => $menu, 'harga' => $harga, 'file' => $f['orig_name'], 'ket' => $ket);
}
} else {
$data = array('id_kategori' => $kat, 'kode' => $kode, 'menu' => $menu, 'harga' => $harga, 'ket' => $ket);
}
crud::update('tbl_menu', 'id_menu', $this->encrypt->decode_url($id), $data);
$this->session->set_flashdata('menu', '<div class="alert alert-success">Data menu sudah disimpan !!!</div>');
redirect('page=menu&act=menu_edit&id=' . $id);
}
}
示例3: cek_login
public function cek_login()
{
$capjay = strtoupper($this->input->post('capjay'));
$user = $this->input->post('user');
$pass = $this->encrypt->encode_url($this->input->post('pass'));
$this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
$this->form_validation->set_rules('user', 'Username', 'required');
$this->form_validation->set_rules('pass', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
$msg_error = array('user' => form_error('user'), 'pass' => form_error('pass'));
$has_error = array('user' => 'has-error', 'pass' => 'has-error');
$this->session->set_flashdata('form_error', $msg_error);
$this->session->set_flashdata('has_error', $has_error);
$this->session->set_flashdata('user', $user);
redirect('front/login.php');
} else {
$sess_cap = $this->session->userdata('capjay');
// Catch the user's answer
if ($sess_cap != $capjay) {
$this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, captcha tidak tervalidasi !!</div>');
$this->session->set_flashdata('user', $user);
redirect('front/login.php');
} else {
$login = akses::cek_login($user, $pass);
if ($login == TRUE) {
if ($login->level != 'waiter') {
$this->session->set_flashdata('login', '<div class="alert alert-danger">Administrator, silahkan login ke halaman admin !!!</div>');
redirect('front/login.php');
} else {
$data = array('nama' => $login->nama, 'username' => $login->username, 'level' => $login->level, 'is_logged_in' => TRUE);
crud::update('tbl_user', 'username', $user, array('last_login' => date('Y-m-d H:i:s')));
$this->session->set_userdata('login', $data);
$this->session->set_flashdata('login', 'Login berhasil, silahkan melanjutkan transaksi');
redirect('front/index.php');
}
} else {
$this->session->set_flashdata('login', '<div class="alert alert-danger">User / pass salah !!!</div>');
redirect('front/login.php');
}
}
}
}
示例4: cek_login
public function cek_login()
{
$capjay = strtoupper($this->input->post('capjay'));
$user = $this->input->post('user');
$pass = $this->encrypt->encode_url($this->input->post('pass'));
$this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
$this->form_validation->set_rules('user', 'Username', 'required');
$this->form_validation->set_rules('pass', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
$msg_error = array('user' => form_error('user'), 'pass' => form_error('pass'));
$has_error = array('user' => 'has-error', 'pass' => 'has-error');
$this->session->set_flashdata('form_error', $msg_error);
$this->session->set_flashdata('has_error', $has_error);
$this->session->set_flashdata('user', $user);
redirect(site_url());
} else {
// //$sess_cap = $this->session->userdata('capjay');
// // Catch the user's answer
// $captcha_answer = $this->input->post('g-recaptcha-response');
//
// // Verify user's answer
// $sess_cap = $this->recaptcha->verifyResponse($captcha_answer);
// if ($sess_cap['success'] != 1) {
// $this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, captcha tidak tervalidasi !!</div>');
// $this->session->set_flashdata('user', $user);
// redirect(site_url());
// } else {
$login = akses::cek_login($user, $pass);
if ($login == TRUE) {
$data = array('nama' => $login->nama, 'username' => $login->username, 'level' => $login->level, 'is_logged_in' => TRUE);
crud::update('tbl_user', 'username', $user, array('last_login' => date('Y-m-d H:i:s')));
$this->session->set_userdata('login', $data);
$this->session->set_flashdata('login', 'Login berhasil, silahkan melanjutkan transaksi');
redirect('page=home');
} else {
$this->session->set_flashdata('login', '<div class="alert alert-danger">User / pass salah !!!</div>');
redirect(base_url('index.php'));
}
}
// }
}
示例5: array
<?php
session_start();
// included files
include "../../../connection/phpmysqlconnect.php";
include "../../../library/CRUD_lib.php";
include "../../../library/miss_lib.php";
// post data
$user_id = $_POST['user_id'];
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$landline = $_POST['landline'];
$modifier = $_SESSION["user"];
// updation
$column = array('name', 'email_id', 'mobile', 'landline', 'modified_by');
$value = array("{$name}", "{$email}", "{$mobile}", "{$landline}", "{$modifier}");
$condition_column = array('user_id');
$condition_value = array("{$user_id}");
$update = new crud($conn, 'customer_details', $column, $value);
$update->update($condition_column, $condition_value);
$move->moveWithAlert('Your Profile has been updated', '../pages/editdetails.php');
示例6: array
</div>
</form>
</div>
</div>
</div>
</div>
<?php
if (empty($sidErr) && empty($websiteErr) && empty($mpErr) && !empty($sid) && !empty($website) && !empty($mp) && empty($widgetErr) && !empty($widget2) && !empty($pubid) && empty($pubidErr) && $submit === "update") {
$piwik = 2;
$cache = true;
$abtest = false;
$allowedParameters = array();
$crud = new crud();
$crud->update($pubid, $name, $website, $piwik, $cache, $allowedParameters, $abtest, $mp, $widget2);
} else {
if (empty($sidErr) && !empty($sid) && !empty($pubid) && empty($pubidErr) && $submit === "delete") {
$crud = new crud();
$crud->delete($sid, $pubid);
}
}
?>
</body>
</html>
l
示例7: crud
<?php
session_start();
$workerId = $_SESSION['workerId'];
if (!empty($_POST)) {
require_once 'classes/crud.php';
$dbObject = new crud('clients');
$dbObject->update();
}
示例8: crud
<?php
if (!empty($_POST['name']) && !empty($_POST['unit']) && !empty($_POST['priceOfUnit'])) {
require_once '../classes/crud.php';
$dbObject = new crud();
$dbObject->update('services');
}
示例9: url
<?php
include '../includes/form_validation_includes.php';
?>
<style type="text/css">
@import url("/css/main-css.css")
</style>
<?php
include_once '../mysql/hidden_files/database.php';
include_once '../classes/class.goals.crud.php';
$crud = new crud($conn);
if (isset($_POST['btn-update'])) {
$uid = $_GET['edit_id'];
$timeframe = $_POST['timeframe'];
$goal = nl2br2($_POST['goal']);
$actions = nl2br2($_POST['actions']);
if ($crud->update($uid, $timeframe, $goal, $actions)) {
$msg = "<div class='alert alert-info'>\n\t\t\t\t<strong>WOW!</strong> Record was updated successfully <a href='index.php'>HOME</a>!\n\t\t\t\t</div>";
} else {
$msg = "<div class='alert alert-warning'>\n\t\t\t\t<strong>SORRY!</strong> ERROR while updating record !\n\t\t\t\t</div>";
}
}
if (isset($_GET['edit_id'])) {
$id = $_GET['edit_id'];
extract($crud->getID($id));
}
?>
</head>
<body >
示例10: trans_u_status
public function trans_u_status()
{
$no_nota = $this->input->post('id');
$id_meja = $this->input->post('id_meja');
$status = $this->input->post('status');
crud::update('tbl_orderlist', 'no_nota', $this->encrypt->decode_url($no_nota), array('tgl_update' => date('Y-m-d H:i:s'), 'status_order' => $status));
redirect('pesan/detail.php?id=' . $id_meja);
}
示例11: meja_reset
public function meja_reset()
{
// if (akses::aksesLogin() == TRUE OR akses::aksesUser() == TRUE) {
$id = $this->encrypt->decode_url($_GET['id']);
crud::update('tbl_meja', 'id', $id, array('status' => '0'));
redirect('page=meja&act=meja_list');
// } else {
// $this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, anda session habis. Silahkan login ulang.</div>');
// redirect(site_url());
// }
}