$HTMLOUT .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t<html xmlns='http://www.w3.org/1999/xhtml'>\n\t\t<head>\n\t\t<title>Error!</title>\n\t\t</head>\n\t\t<body>\n\t<div style='font-size:33px;color:white;background-color:red;text-align:center;'>Incorrect access<br />You cannot access this file directly.</div>\n\t</body></html>"; echo $HTMLOUT; exit; } require_once INCL_DIR . 'user_functions.php'; require_once CLASS_DIR . 'class_check.php'; $class = get_access(basename($_SERVER['REQUEST_URI'])); class_check($class); $lang = array_merge($lang, load_language('ad_poll_manager')); $params = array_merge($_GET, $_POST); $params['mode'] = isset($params['mode']) ? $params['mode'] : ''; $INSTALLER09['max_poll_questions'] = 2; $INSTALLER09['max_poll_choices_per_question'] = 20; switch ($params['mode']) { case 'delete': delete_poll(); break; case 'edit': edit_poll_form(); break; case 'new': show_poll_form(); break; case 'poll_new': insert_new_poll(); break; case 'poll_update': update_poll(); break; default: show_poll_archive();
<?php include 'get_connection.php'; try { if (PHP_SAPI === 'cli') { $poll_id = $argv[1]; delete_poll($conn, $poll_id); } else { if (isset($_GET['poll_id'])) { $poll_id = $_GET['poll_id']; delete_poll($conn, $poll_id); } if (isset($_GET['post_id'])) { $post_id = $_GET['post_id']; delete_GET($conn, $post_id); } } } catch (PDOException $e) { echo "Connection failed: " . $e->getMessage(); return; } $conn = null; function delete_poll($conn, $poll_id) { $query = "\n\t\tDELETE polls\n\t\tFROM polls\n\t\twhere id = :poll_id;\n\t\t"; $query = $conn->prepare($query); $query->bindparam(':poll_id', $poll_id); $query->execute(); $query = "\n\t\tDELETE poll_replies\n\t\tFROM poll_replies\n\t\twhere poll_id = :poll_id;\n\t\t"; $query = $conn->prepare($query); $query->bindparam(':poll_id', $poll_id);
} if (!isset($action)) { $action = ''; } no_cache_header(); switch ($action) { case "new": $message = $lang["NewTitle"]; poll_new("{$message}"); break; case "show": poll_index(); break; case "delete": if (isset($id)) { delete_poll($id); } poll_index(); break; case "create": $question = trim($question); if (!empty($question)) { create_poll(); poll_index(); } else { $message = $lang["EditMis"]; poll_new("{$message}"); } break; default: poll_index();
<?php /* 설문조사 (신규등록) 2001.06 by Jungjoon Oh */ require "db-lib.php"; require "poll-lib.php"; if ($m == 'end') { set_end($idx); } elseif ($m == 'start') { set_start($idx); } elseif ($m == 'del') { delete_poll($idx); } function delete_poll($idx) { global $URL, $pn; $dbh = dbconnect(); $query = "select poll_idx from poll_data where poll_idx={$idx}"; $sth = dbquery($dbh, $query); list($poll_idx, $status) = dbselect($sth); if (!$poll_idx) { print_alert("존재하지 않는 데이터입니다. ", 'back'); exit; } /* 설문 삭제 */ $query = "delete from poll_data where poll_idx={$idx}"; $sth = dbquery($dbh, $query); /* 결과 삭제 */ $query = "delete from poll_result where poll_idx={$idx}";
/** * Standard aed_module delete actualiser. * * @param ID_TEXT The entry being deleted */ function delete_actualisation($id) { $rows = $GLOBALS['SITE_DB']->query_select('poll', array('is_current', 'submitter'), array('id' => intval($id)), '', 1); if (!array_key_exists(0, $rows)) { warn_exit(do_lang_tempcode('MISSING_RESOURCE')); } $is_current = $rows[0]['is_current']; $submitter = $rows[0]['submitter']; check_delete_permission($is_current == 1 ? 'high' : 'mid', $submitter); delete_poll(intval($id)); }