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()); } }
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); } }
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'); } } } }
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')); } } // } }
<?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');
</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
<?php session_start(); $workerId = $_SESSION['workerId']; if (!empty($_POST)) { require_once 'classes/crud.php'; $dbObject = new crud('clients'); $dbObject->update(); }
<?php if (!empty($_POST['name']) && !empty($_POST['unit']) && !empty($_POST['priceOfUnit'])) { require_once '../classes/crud.php'; $dbObject = new crud(); $dbObject->update('services'); }
<?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 >
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); }
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()); // } }
<?php if (!empty($_POST['name']) && !empty($_POST['Bik']) && !empty($_POST['Rs'])) { require_once '../classes/crud.php'; $dbObject = new crud(); $dbObject->update('organizations'); }