$updated = $spread->save($vals); } if (!$updated) { flash("action_failed"); } else { flash("success", '', 0); } } if (isset($_GET['do'])) { $do = trim($_GET['do']); if (isset($_GET['id'])) { $id = intval($_GET['id']); } if ($do == "edit") { if (!empty($id)) { $linkinfo = $spread->read("*", $id, null, $conditions); setvar("item", $linkinfo); } $tpl_file = "spread_edit"; vtemplate($tpl_file); exit; } } $amount = $spread->findCount(null, $conditions); $page->setPagenav($amount); $fields = "*"; $result = $spread->findAll($fields, null, $conditions, "id DESC", $page->firstcount, $page->displaypg); for ($i = 0; $i < count($result); $i++) { $result[$i]['exp_date'] = df($result[$i]['expiration']); } setvar("CheckStatus", cache_read('typeoption', 'check_status'));
} else { flash('success', 'spread.php'); } } } if (isset($_GET['do'])) { $do = trim($_GET['do']); if (!empty($_GET['id'])) { $id = intval($_GET['id']); } if ($do == "del" && !empty($id)) { $result = $spread->del($_GET['id']); } if ($do == "edit") { if (!empty($id)) { $item = $spread->read("*", $id); if (!empty($item['expiration'])) { $item['exp_date'] = df($item['expiration']); } setvar("item", $item); } $tpl_file = "spread.edit"; template($tpl_file, true); } } if (isset($_POST['del']) && !empty($_POST['id'])) { $result = $spread->del($_POST['id']); } if (isset($_POST['pb_action']) && !empty($_POST['id'])) { $status = $_POST['pb_action']; $ids = "(" . implode(",", $_POST['id']) . ")";