} switch ($quoifaire) { case 'add_note': add_note($idnote); break; case 'up_order': update_order(); break; case 'show_addcom': show_addcom($id); break; case 'update_com': update_contenu($id); break; case 'del_item': del_item($id_item); break; } /* * Ajout d'une note au rapport */ function add_note($idnote = 0) { global $dbh, $base_path, $idtype, $idobject, $comment, $ordre_cible; $iddemande = $idobject; $commentaire = trim($comment); if ($ordre_cible) { $ordre = $ordre_cible; } else { $req = "select max(ordre)+1 from rapport_demandes where num_demande='" . $iddemande . "'"; $res = mysql_query($req, $dbh);
function projectDispatch($op) { switch ($op) { case "project": project(); break; case "addprj": addprj(); break; case "addprj_now": if (!isset($_POST["undo"])) { addprj_now(); } else { project(); } break; case "showprj": show_prj(); break; case "manprjadmin": manprjadmin(); break; case "update_admins": update_admins(); break; case "prjadditem": if (isset($_POST["undo"])) { Util::jump_to("index.php?modname=project&op=showprj&id=" . $_GET["id"]); } else { if ($_GET["type"] == "news") { edit_news("new"); } if ($_GET["type"] == "todo") { edit_todo("new"); } if ($_GET["type"] == "task") { edit_tasks("new"); } if ($_GET["type"] == "file") { edit_files("new"); } } break; case "prjedititem": if (isset($_POST["undo"])) { Util::jump_to("index.php?modname=project&op=showprj&id=" . $_GET["id"]); } else { if ($_GET["type"] == "news") { edit_news(); } if ($_GET["type"] == "todo") { edit_todo(); } if ($_GET["type"] == "task") { edit_tasks(); } if ($_GET["type"] == "file") { edit_files(); } } break; case "prjdelitem": del_item(); break; case "prjsendmsg": send_msg(); break; case "prjreadmsg": read_msg(); break; case "modprj": if ($_GET["id"] == 0) { sel_prj("modprj"); } else { if (!isset($_POST["undo"])) { mod_prj($_GET["id"]); } else { project(); } } break; case "delprj": if ($_GET["id"] == 0) { sel_prj("delprj"); } else { del_prj(); } break; case "prjreaditem": read_item(); break; case "editprogtot": edit_progtot(); break; case "download": require_once _base_ . '/lib/lib.download.php'; $id = importVar('id', true, 0); $type = importVar('type'); $can_view = checkPerm('view', true); switch ($type) { case "file": $query = sql_query("SELECT * FROM " . $GLOBALS["prefix_lms"] . "_prj_msg WHERE pid='{$id}' {$filter} ORDER BY {$oby} {$ord}, id DESC;"); list($pid, $fname, $ftitle) = sql_fetch_row(sql_query("\r\n\t\t\t\t\tSELECT pid, fname, ftitle\r\n\t\t\t\t\tFROM " . $GLOBALS["prefix_lms"] . "_prj_files\r\n\t\t\t\t\tWHERE id = '{$id}'")); $myprj = user_projects(Docebo::user()->getIdSt()); if ($can_view && in_array($pid, $myprj)) { $expFileName = explode('.', $fname); $totPart = count($expFileName) - 1; sendFile(_FPATH_INTERNAL, $fname, $expFileName[$totPart], $ftitle); } else { die('You can\'t access'); } break; } break; } }
exit; } if (update_password($conn, $oldPassword, $newPassword) && update_info($conn, $nickname, $profile)) { header("location:./admin/setting.php?success"); } else { header("location:./admin/setting.php?failed"); } } else { header("location:./admin/setting.php?failed"); } } if ($_POST['action'] === "del") { if (isset($_POST['id']) && is_num($_POST['id'])) { try { $conn = connect(); del_item($conn, $_POST['id']); } catch (Exception $error) { header("location:./admin/admin.php"); exit; } } header("location:./admin/admin.php"); } if ($_POST['action'] === "save") { if (isset($_POST['title']) && isset($_POST['content']) && !empty($_POST['content'])) { $id = $_POST['id']; $title = $_POST['title']; $content = $_POST['content']; try { $conn = connect(); } catch (Exception $error) {
$length = LIMIT; $items = array_slice($ret, $offset, $length); } else { $p = 1; if (count($ret) > LIMIT) { $items = array_slice($ret, 0, LIMIT); } else { $items = $ret; } } echo "<b>" . count($ret) . "</b> in total~ <a href=?action=clear&p=all><b>delete all</b></a> <a href=?action=clear&p={$p}><b>delete page {$p}</b></a>"; if ($_GET['action'] == 'clear') { if ($_GET['p'] == 'all') { del_item($ret); } else { del_item($items); } } #重组数据 foreach ($items as $k => $item) { $tmp = explode('.', $item['name']); $file = DATA . "/" . $item['name']; $acc = unserialize(file_get_contents($file)); $acc = array_pop($acc); $item['wt'] = intval($acc['wt']); $item['pmu'] = intval($acc['pmu']); $item['viewurl'] = VIEWURL . "run=" . $tmp[0] . "&source=" . $tmp[1]; $items[$k] = $item; } #排序 if ($_GET['sort']) {