public function adddummypost() { $validator = Validator::make(array('count' => $count), array('count' => 'required|integer')); for ($i = 0; $i < $count; $i++) { $title = $i . "Penny The Miracle Pup Celebrates A Birthday No One Thought She Would Live To See"; $post = new Posts(); $post->title = $title; $post->image = 'http://awsd007-atpict.rhcloud.com/uploads/penny-the-miracle-pup-celebrates-a-birthday-no-one-thought-she-would-live-to-see-1457978235.jpg'; $post->des = 'Candice a devoted rescue and foster pawrent rescued Penny who was Born to an inexperienced mother bred too soon Penny was the only pup in her litter of five to make it to four-days-old.Now Penny has now grown bigger and stronger and is a year old and as hearty as can be Meanwhile Candice is devoting her life to transform the 12-acre ranch into a rescue and rehab facility for dogs.'; $post->category = '17,1'; $post->link = 'penny-the-miracle-pup-celebrates-a-birthday-no-one-thought-she-would-live-to-see-70'; $post->url = 'http://barkpost.com/good/pup-celebrates-birthday-no-one-thought-she-would-see'; $post->created_at = '2016-03-15 00:20:00'; $post->updated_at = '2016-03-30 04:42:28'; $post->is_approved = 1; $post->title_tag = 'Penny Birthday'; $post->meta_des = 'Penny the miracle puppy'; $post->timestamp = 'hi'; $post->share_cat = 1; $post->author = 'admin'; $post->publisher = 1; $post->user_id = 2; $post->publisher_id = 1; $post->share_title = 'penny-the-miracle-pup-celebrates-a-birthday-no-one-thought-she-would-live-to-see'; $post . save(); } }
function publish($table, $menu) { global $mysql; // get the new menu $section = $_POST['menu']; $menu = $_POST['menu']; $title = $_POST['title']; // CLEAR CURRENT TABLE $sql = "TRUNCATE TABLE " . $table; $query = $mysql->sql_query($sql); // INSERT NEW DATA IN THE TABLE $fields = array('type', 'txt_fr', 'txt_en', 'price'); $insert = array(); foreach ($_POST['type'] as $key => $_) { $item = array(); foreach ($fields as $field) { $var = $_POST[$field][$key]; $value = $var ? '\'' . mysqli_real_escape_string($mysql->cndb, stripslashes($var)) . '\'' : 'NULL'; array_push($item, $value); } array_push($insert, '(' . implode(',', $item) . ')'); } $sql = 'INSERT INTO ' . $table . ' (' . implode(',', $fields) . ') VALUES ' . implode(',', $insert) . ';'; $query = $mysql->sql_query($sql); write($table, 2); save($table, $menu); }
public function addQuestion($title, $type) { $q = new QuestionRecord(array('poll_id' => $this->data['id'], 'title' => $title, 'type' => $type)); $questions[] = $q; $q . save(); return $q; }
public function update(EditAsignaturasCursadasRequest $request, $id) { $cursadas = AsignaturaCursada::findOrFail($id); $cursadas->fill(Request::all()); $cursadas > save(); return redirect()->route('asignaturas.cursadas.index'); }
function gzip($filename) { mkdir_recursive($filename); $data = file_get_contents($filename); $gzdata = gzcompress($data, 9); save($filename, $data); }
function displayList() { if ($_SERVER["REQUEST_METHOD"] == "POST") { //Remove Reminder if (isset($_POST['action']) && $_POST['action'] == "delete") { //delete is pressed echo "Question " . $_POST['action2'] . " has been removed from the test.</br>"; if (isset($this->reminders[$_POST['action2']])) { unset($this->reminders[$_POST['action2']]); $this->reminders = array_values($this->reminders); save(); } } else { if (isset($_POST['action5']) && $_POST['action5'] == "add3") { //edit confirmed $this->reminders[$_POST['action6']]->edit(get_input($_POST['recipient']), get_input(get_input($_POST['time']))); save(); } } } for ($i = 0; $i < count($this->reminders); $i++) { $this->reminders[$i]->display($i); if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['action3']) && $_POST['action3'] == $i) { echo "<form method='post'>"; echo "<input type='text' name = 'recipient' value='Recipient Email'>"; echo "<input type='text' name = 'time' value='Time to Email'>"; echo "<input type='submit' name = 'submit' value='Confirm Edit'>"; echo "<input type='hidden' name='action5' value='add3'>"; echo "<input type='hidden' name='action6' value='" . $_POST['action4'] . "'>"; echo "</form>"; } } }
function test() { $result = save("common/upload"); if ($result) { echo true; } else { echo json_encode($result); } }
function convert_dir($directory) { $dir = opendir($directory); while ($file = readdir($dir)) { if (is_file($directory . "/" . $file)) { $ext = getftype($file); if ($file == 'namedb.dat') { if (file_exists($directory . "/" . $file)) { $gbs = file($directory . "/" . $file); $open = fopen($directory . "/" . $file, "w"); $result = 0; for ($i = 0; $i < sizeof($gbs); $i++) { $data = unserialize($gbs[$i]); if (!preg_match('//u', $data['opisanie'])) { $data['opisanie'] = iconv('cp1251', 'utf-8', $data['opisanie']); } fwrite($open, serialize($data) . "\n"); $result++; } fclose($open); } } elseif ($ext == 'dat') { $txt = file_get_contents($directory . "/" . $file); if (!preg_match('//u', $txt)) { $txt = iconv('cp1251', 'utf8', $txt); } save($directory . "/" . $file, $txt, 'w'); $result++; } elseif ($ext == 'comment') { if (file_exists($directory . "/" . $file)) { $gbs = file($directory . "/" . $file); $open = fopen($directory . "/" . $file, "w"); $result = 0; for ($i = 0; $i < sizeof($gbs); $i++) { $data = unserialize($gbs[$i]); if (!preg_match('//u', $data['content'])) { $data['content'] = iconv('cp1251', 'utf-8', $data['content']); } if (!preg_match('//u', $data['name'])) { $data['name'] = iconv('cp1251', 'utf-8', $data['name']); } fwrite($open, serialize($data) . "\n"); $result++; } fclose($open); } } } else { if (is_dir($directory . "/" . $file) && $file != "." && $file != "..") { $result += convert_dir($directory . "/" . $file); } } } closedir($dir); return $result; }
public function update(Request $request) { // $this->validate($request, ['name' => 'required|max:255']); $user_id = $request->input('user_id'); $new_name = $request->input('name'); $user = Users::find($user_id); $user->name = $new_name; $user_ > save(); return redirect('user/{id}'); }
function drop($words) { $obj = $this->items[$words]; // Item from inventory to room if ($obj == 1) { save(USERFILE, 'inventory', $words, CURRENT_ROOM); return array('drop', '+' . $words); } // Not have item return array('drop', 'FAIL'); }
function check_visited_and_goto($room) { // go to new room save(USERFILE, 'info', 'room', $room); // check visited (and mark) if (!load(USERFILE, 'actions', $room . '_visited')) { save(USERFILE, 'actions', $room . '_visited', "1"); } // check if end $ends = new Ends($room); $ends->check(); return array('goto', 'OK'); }
function processAction() { $action = assign_input('action', 'R'); $folderID = assign_input('folderID', 'R'); $noteID = assign_input('noteID', 'R'); $parentFolder = assign_input('parentFolder', 'R'); $date = assign_input('date', 'R'); $name = assign_input('name', 'R'); $note = assign_input('note', 'P', 1); $sortByDate = assign_input('sortByDate', 'R'); switch ($action) { case 'newFolder': $res = newFolder($name, $parentFolder); break; case 'newNote': $res = newNote($name, $note, $parentFolder); break; case 'toNewFolder': $res = addToNewFolder($parentFolder, $noteID); break; case 'delete': $res = delete_($noteID ? $noteID : $folderID, $folderID); break; case 'rename': $res = rename_($name, $noteID ? $noteID : $folderID, $folderID); break; case 'save': $res = save($noteID, $note); break; case 'get': $res = getContent($parentFolder, $sortByDate ? 1 : 0); break; case 'loadNote': $res = loadNote($noteID); break; case 'search': break; default: $res = array("error" => "no action"); } /* if(( isset($res['error']))&&($res['error'])){echo 'Error occured : '.$res['error'].'<br/>';} if($action=='get'){ echo json_encode($res); } */ echo json_encode($res); }
function wicketpixie_toplevel_admin() { global $settings; if ($_POST['action'] == 'save_settings') { save($_POST, $settings); } if ('ccode' == $_REQUEST['action']) { if ('global_announcement' == $_POST['file']) { require_once TEMPLATEPATH . '/app/customcode.php'; writeto($_POST['code'], "global_announcement.php"); } } add_menu_page('WicketPixie Admin', 'WicketPixie', 'edit_themes', 'wicketpixie-admin.php', 'wicketpixie_admin_index', get_template_directory_uri() . '/images/wicketsmall.png'); }
function dispatch($data, $filePath) { $params = getParams(); if (count($params) > 0) { $response = save($data, $params, $filePath); } else { $id = getIdParam(); if ($id) { $response = detail($data, $id); } else { $response = $data; } } return $response; }
/** * 广度便利树形目录,找到code=>学科中文名字和树形结构 */ function trivalIndex($url, &$className) { $isReadCache = false; global $cacheDir; $pattern1 = '/<a.*?onclick="ClickNode\\(\'(.*?)\',.*?>(.*?)<\\/a>/'; //目录的根节点 $pattern2 = '/<input type="checkbox" id="selectbox" value="(.*?)".*?name="(.*?)" .*?>/'; //有子目录的节点 $dir = get_code($url); $fileName = "./index/{$cacheDir}/" . $dir . ".html"; $content = ""; if (file_exists($fileName)) { echo "get file {$fileName} from cache\n"; $content = file_get_contents($fileName); $isReadCache = true; } else { echo "get file {$fileName} from network\n"; $content = @file_get_contents($url); save($fileName, $content); $isReadCache = false; } $match = array(); $ret = preg_match_all($pattern1, $content, $match); if (!$ret) { $ret = preg_match_all($pattern2, $content, $match); echo "[WARNNING] use pattern 2\n {$content}\n"; if (!$ret) { //echo "not found $url\n"; save("./index/{$cacheDir}/{$cacheDir}.log", $url . "\n" . $content . "\n\n", "a+"); return; } } $code = $match[1]; $name = $match[2]; for ($i = 0; $i < count($code); $i++) { $namei = $name[$i]; $codei = $code[$i]; //var_dump($codei); echo "\n{$namei} => {$codei}\n"; addCode($namei, $codei); $className[$namei] = array(); $url = replace_code($codei); trivalIndex($url, $className[$namei]); if ($isReadCache == false) { sleep(4); } } }
function check() { // typecast fix for reverse order object (???) // (object)array_reverse((array)$this->ends) foreach ((object) $this->ends as $k => $v) { // No se cumplen los requisitos para este final if (property_exists($v, 'required')) { $required = new Required(); if (!$required->check($v->required)) { continue; } } save(USERFILE, 'info', 'end', $k); return TRUE; } return FALSE; // No hay final }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $validation = Validator::make($request->all(), Decision::$rules, Decision::$messages); if ($validation->passes()) { $decision = new Decision(); $decision->DecisionDate = $request->DecisionDate; //$decision->MeetingID = $request->MeetingID; //$decision->MeetingNumber = $request->MeetingNumber; //$decision->MeetingDate = $request->MeetingNumber; //$decision->Content = $request->MeetingNumber; //$decision->MinistryID = $request->MeetingNumber; //$decision->DecisionStatusID = $request->MeetingNumber; //$decision->DocumentID = $request->DocumentID; $decision > save(); return redirect('decision'); } return redirect('decision/create')->withInput()->withErrors($validation)->with('message', 'Validation Errors'); }
private function getEmail($email) { $config = new Zend_Config(array('database' => array('adapter' => 'Mysqli', 'params' => array('host' => 'localhost', 'dbname' => 'flisol', 'username' => 'root', 'password' => '')))); $db = Zend_Db::factory($config->database); $select = $db->select(); $select->from('usuario', '*')->where('email = ?', $email); $result = $db->fetchRow($select); if ($result == true) { $pwd = $this->gerarSenha(); $pwdMd5 = md5($pwd); $result->senha = $pwdMd5; $result - save(); $this->view->msg = "Senha enviada"; $this->_redirect('inscricoes/recuperasenha'); } else { $this->view->msg = "email inexistente"; $this->_redirect('inscricoes/recuperasenha'); } }
function readAndSave() { set_time_limit(0); $fileName = "imgslist2.txt"; $data = file_get_contents($fileName); $arr = explode("\n", $data); $len = count($arr); // echo "<pre>"; // print_r($arr); // echo count($arr); // foreach ($arr as $one) { // save($one); // } for ($i = 0; $i < $len; $i++) { $one = explode('==', trim($arr[$i])); $cid = trim($one[0]); $url = trim($one[1]); save($url, $cid); } }
function entry_audit() { global $_STATE; if (!isset($_POST["chkTable"])) { $_STATE->msgStatus = "No tables were saved"; return; } foreach ($_POST["chkTable"] as $ID => $value) { if (!array_key_exists($ID, $_STATE->records)) { throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid table name " . $_POST["chkTable"]); } if ($value == "on") { $_STATE->msgStatus .= "<br>" . $ID; if (!save($_STATE->records[$ID])) { $_STATE->msgStatus .= ": attempted save failed"; } } } return; }
public function save() { $group = AuthGroupModel::getUserGroup(UID); if ($group[0]['group_id'] == 1) { $_POST['uid'] = 1; } $id = I('param.id'); if ($id) { $Music = M('Muisc'); $gdlist = $Music->field('id')->where('ggid=' . $id)->select(); if (!empty($gdlist)) { foreach ($gdlist as $gd) { $Music->where('id=' . $gd['id'])->setField('del_flag', '2'); } } $_POST['update_date'] = NOW_TIME; if ($this->Notice->create() && $this->Notice->save()) { } else { $this->error('Err: ' . $this->Notice->getDbError()); } if ($this->Ndetail->create() && $this->Ndetail > save()) { $this->success('公告更新成功', U('index')); } else { $this->Notice->where('id=' . I('param.id'))->delete(); $this->error('Err: ' . $this->Notice->getDbError()); } } else { $_POST['update_date'] = NOW_TIME; $_POST['create_date'] = NOW_TIME; if ($this->Ndetail->create() && $this->Ndetail > add()) { $this->success('公告更新成功', U('index')); } else { $this->error('Err: ' . $this->Ndetail->getDbError()); } if ($this->Notice->create() && $this->Notice->add()) { $this->success('公告更新成功', U('index')); } else { $this->error('Err: ' . $this->Notice->getDbError()); } } }
public function play($pid, $shot) { // Load game based on PID // TODO: Possibly get rid of validate methods, // and delegate responsability to getters and setters. self::validatePlayerID($pid); $this->pid = $pid; // Restore game state load(); // Probably not going to be used, but throw // exception if the game has ended already if ($this->active === false) { throw new GameEndedException(); } // Set human shot $this->getHumanPlayer()->setShot($shot); // Play turn $response = $this->board->playTurn(); // Persist turn save(); }
function set($nickname) { $this->nickname = load(USERFILE, 'info', 'name'); if (!isset($_COOKIE['mzname'])) { // nickname already exist if ($this->nickname) { return array("nickname", "NONICK_EXIST"); } // check nickname empty if (strlen(trim($nickname)) == 0) { return array("nickname", "NONICK_EMPTY"); } // check nickname alphabetic or digits only if (!ctype_alnum($nickname)) { return array("nickname", "NONICK_ERROR"); } $this->setCookie($nickname); save(USERFILE, 'info', 'name', $nickname); return array("nickname", "OK"); } // nickname already exist return array("nickname", "NONICK_EXIST"); }
include_once 'ressources/class.computers.inc'; include_once 'ressources/class.ini.inc'; if (isset($_GET["form"])) { formulaire(); exit; } if (isset($_GET["ch-groupid"])) { groups_selected(); exit; } if (isset($_GET["ch-domain"])) { domain_selected(); exit; } if (isset($_REQUEST["password"])) { save(); exit; } js(); $users = new usersMenus(); if (!$users->AllowAddUsers) { die("alert('not allowed');"); } function js() { $tpl = new templates(); $page = CurrentPageName(); $title = $tpl->_ENGINE_parse_body('{add user explain}'); $html = "\nvar x_serid='';\n\nfunction OpenAddUser(){\n\tYahooWin5('590','{$page}?form=yes','{$title}');\n}\n\nvar x_ChangeFormValues= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tvar internet_domain='';\n\tvar ou=document.getElementById('organization').value;\n\tdocument.getElementById('select_groups').innerHTML=tempvalue;\n\tif(document.getElementById('internet_domain')){internet_domain=document.getElementById('internet_domain').value;}\n \t var XHR = new XHRConnection();\n \tXHR.appendData('ou',ou);\n\t\tXHR.appendData('ch-domain',internet_domain); \t\n XHR.sendAndLoad('{$page}', 'GET',x_ChangeFormValues2);\t\t\n}\n\n\nvar x_SaveAddUser= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){\n\t\talert(tempvalue);\n\t\tdocument.getElementById('ffform').innerHTML=\"<div style='width:100%;padding:15px'><center><img src='img/identity-add-96.png'></center></div>\"; \n\t\treturn false;\n\t}\n\tYahooWin5Hide();\n\t\tif(document.getElementById('main_config_pptpd')){\n\t\t\tRefreshTab('main_config_pptpd');\n\t\t\treturn;\n\t\t}\n\t\t\n}\n\nfunction SaveAddUser(){\n var gpid='';\n var internet_domain='';\n var ou=document.getElementById('organization').value;\n var email=document.getElementById('email').value;\n var firstname=document.getElementById('firstname').value;\n var lastname=document.getElementById('lastname').value; \n var login=document.getElementById('login').value;\n var password=document.getElementById('password').value;\n x_serid=login;\n if(document.getElementById('groupid')){gpid=document.getElementById('groupid').value;}\n if(document.getElementById('internet_domain')){internet_domain=document.getElementById('internet_domain').value;}\n var EnableVirtualDomainsInMailBoxes=domain=document.getElementById('EnableVirtualDomainsInMailBoxes').value;\n if(EnableVirtualDomainsInMailBoxes==1){x_serid=email+'@'+internet_domain;}\n\n \t var XHR = new XHRConnection();\n XHR.appendData('ou',ou);\n XHR.appendData('internet_domain',internet_domain);\n\t XHR.appendData('email',email);\n XHR.appendData('firstname',firstname);\n XHR.appendData('lastname',lastname);\n XHR.appendData('login',login);\n XHR.appendData('password',password);\n XHR.appendData('gpid',gpid); \n AnimateDiv('ffform'); \t\t \t\n XHR.sendAndLoad('{$page}', 'POST',x_SaveAddUser);\t\t \n}\n\n\n\nvar x_ChangeFormValues2= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tvar domain='';\n\tvar email='';\n\tvar login='';\n\tvar ou=document.getElementById('organization').value;\n\tdocument.getElementById('select_domain').innerHTML=tempvalue;\n\t\n\temail=document.getElementById('email').value;\n\tlogin=document.getElementById('login').value;\n\tif(login.length==0){\n\t\tif(email.length>0){\n\t\t\tdocument.getElementById('login').value=email;\n\t\t}\n\t}\n\t\t\n}\n\t\n\nfunction ChangeFormValues(){\n var gpid='';\n var ou=document.getElementById('organization').value;\n\n if(document.getElementById('groupid')){gpid=document.getElementById('groupid').value;}\n \t\tvar XHR = new XHRConnection();\n XHR.appendData('ch-groupid',gpid);\n XHR.appendData('ou',ou);\n XHR.sendAndLoad('{$page}', 'GET',x_ChangeFormValues);\t\n\n}\n\n\n\nOpenAddUser();"; echo $html; }
<?php require 'socket.php'; if (!empty($_POST['action'])) { switch ($_POST['action']) { case 'makes': findCarMakes(); break; case 'models': findCarModels($_POST['make']); break; case 'engines': findCarEngines($_POST['make'], $_POST['model']); break; case 'save': save($_POST); break; default: echo json_encode($_POST); break; } } function findCarMakes() { global $connection; $query = "SELECT * FROM makes"; $result = mysqli_query($connection, $query); $makes = mysqli_fetch_all($result); echo json_encode($makes); } function findCarModels($makeId)
if (isset($_GET['action'])) { $out = $_GET['action'] . "`"; switch ($_GET['action']) { case "initDate": $date = $_GET["date"]; $out .= mainDisplay($date, True); break; case 'reInit': $date = $_GET["date"]; $out .= mainDisplay($date, False); break; case 'save': $date = $_GET["date"]; $type = $_GET["type"]; $data = $_GET["data"]; save($date, $type, $data); if ($type == "X") { $out .= "Save successful"; } } echo $out; return; } if (!validateUserQuiet('mas90_journal')) { header("Location: {$FANNIE_URL}auth/ui/loginform.php?redirect={$FANNIE_URL}legacy/it/mas90/journal.php"); return; } function mainDisplay($date, $checkForSave = True) { global $sql; $ret = "";
<?php // add2cat добавляем товар к таблицу category (наш асортимент) include_once "db.inc.php"; //$connect здесь include_once "lib.inc.php"; if (isset($_POST['submit'])) { $author = m_r_e_sAll(htmlAll($_POST['author'])); // тут ничего не передаем в функцию она по умолчанию обработает на String $title = m_r_e_sAll(htmlAll($_POST['title'])); $pubyear = clearData($_POST['pubyear'], "i"); //обрабатіваем функцией на int $price = clearData($_POST['price'], "i"); // обрабатіваем функцией на int save($author, $title, $pubyear, $price); //вызываем функцию save и сохраняем переменные в таблице category header("Location: ../add2cat.php"); exit; }
/*************************************** * http://www.program-o.com * PROGRAM O * Version: 2.4.7 * FILE: members.php * AUTHOR: Elizabeth Perreau and Dave Morton * DATE: 12-12-2014 * DETAILS: Administers member (admin) accounts ***************************************/ ini_set('memory_limit', '128M'); ini_set('max_execution_time', '0'); $post_vars = filter_input_array(INPUT_POST); $user_name = ''; $action = isset($post_vars['action']) ? ucfirst(strtolower($post_vars['action'])) : 'Add'; if (!empty($post_vars)) { $msg = save($action); } $id = (isset($post_vars['id']) and $action != 'Add') ? $post_vars['id'] : getNextID(); $id = $id <= 0 ? getNextID() : $id; if (isset($post_vars['memberSelect'])) { $id = $post_vars['memberSelect']; $data = getMemberData($post_vars['memberSelect']); $id = $data['id']; $user_name = $data['user_name']; } $upperScripts = $template->getSection('UpperScripts'); $XmlEntities = array('&' => '&', '<' => '<', '>' => '>', ''' => '\'', '"' => '"'); $AdminsOpts = getAdminsOpts(); $membersForm = $template->getSection('MembersForm'); $members_list_form = $template->getSection('MembersListForm'); $showHelp = $template->getSection('MembersShowHelp');
include_once('ressources/class.templates.inc'); include_once('ressources/class.ldap.inc'); include_once('ressources/class.users.menus.inc'); include_once('ressources/class.squid.inc'); include_once('ressources/class.system.network.inc'); $user=new usersMenus(); if($user->AsSquidAdministrator==false){ $tpl=new templates(); echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');"; die();exit(); } if(isset($_GET["popup"])){popup();exit;} if(isset($_POST["dead_peer_timeout"])){save();exit;} js(); function js(){ $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{timeouts}"); $page=CurrentPageName(); $html="YahooWin3('1036','$page?popup=yes','$title');"; echo $html; } function popup(){
//tổng điểm trước đó $oid = intval($_POST['oid']); //order id $uid = intval($_POST['uid']); //user id if ($_POST['typeprocess'] == 'sucess') { //truong hop xu ly $order = array('id' => $oid, 'status_order' => 1, 'time_process' => date("Y-m-d H:i:s", time()), 'id_admin' => $_SESSION['login'][0]); //cap nhat lai thong tin diem khach hàng if ($statusorderbefore != 1) { //chua xu ly mới cộng lên $order['current_points'] = $totalpoints; save('user', array('id' => $uid, 'point' => $totalpoints + $points)); } //cap nhat lai bang orders save('orders', $order); } else { //truong hop huy bo //cap nhat lai bang orders $order = array('id' => $oid, 'status_order' => 2, 'time_process' => date("Y-m-d H:i:s", time()), 'current_points' => 0, 'id_admin' => $_SESSION['login'][0]); save('orders', $order); //cap nhat lai thong tin diem khach hàng if ($statusorderbefore == 1) { //đã xử lý thì trừ lại save('user', array('id' => $uid, 'point' => $totalpoints - $points)); } } header('location:admin.php?controller=order&action=view&oid=' . $oid . '&statusupdate=true'); } else { header('location:admin.php?controller=order'); }