コード例 #1
0
function check_consistency_with_database($root, $pdfs)
{
    $new_array_pdfs = array();
    foreach ($pdfs as $pdf) {
        $new_array_pdfs[] = $root . $pdf;
    }
    $sql = 'SELECT `filepath` from `*PREFIX*ebook_library`';
    $stmt = OCP\DB::prepare($sql);
    $res = $stmt->execute();
    while ($r = $res->fetchRow()) {
        if (!in_array($r['filepath'], $new_array_pdfs)) {
            delete_entry($r['filepath']);
        }
    }
}
コード例 #2
0
    //aadressireal on olemas muutuja logout
    //kustutame kõik session muutujad ja peatame sessiooni
    session_destroy();
    header("Location: login.php");
}
?>
<p>
<a href="?logout=1"> Logi välja <a> 
</p>
 <?php 
require_once "functions.php";
// kas kustutame
if (isset($_GET["delete"])) {
    //echo "Kustutame id ".$_GET["delete"];
    //käivitan funktsiooni, saadan kaasa id!
    delete_entry($_GET["delete"]);
}
//salvestan andmebaasi uuendused
if (isset($_POST["save"])) {
    update_entry($_POST["id"], $input['name'], $input['voit'], $input['kaotus'], $input['vslamm'], $input['ssamm'], $input['ristit']);
}
$keyword = "";
$id = "";
$time = "";
$times = date("Y-m-d");
//aadressireal on keyword
if (isset($_GET["keyword"]) && isset($_GET["time"])) {
    //otsin
    $keyword = $_GET["keyword"];
    $time = $_GET["time"];
    $data_array = get_Data($keyword, $time);
コード例 #3
0
ファイル: awl.php プロジェクト: kupschke/sgwi
if ($sort == $csort && $_GET["order"] == "desc") {
    $dir = "desc";
    $ndir = "asc";
}
//  Perform demanded action.
$clearit = '<br /><br /><a class="navlike" href="awl.php?mode=' . $mode . '">Clear this report</a>';
switch ($action) {
    case "del_selection":
        // For batch deleting.
        isset($_POST["chk"]) ? $chk = $_POST["chk"] : ($chk = "");
        if ($chk == "") {
            $report = '<br />Nothing was selected - nothing has been deleted.' . $clearit;
        } else {
            foreach ($chk as $args) {
                $parts = explode("@@", $args);
                delete_entry($mode, $parts[0], $parts[1], $parts[2]);
            }
            $report = $deleted . $clearit;
        }
        $report2 = "";
        break;
    case "del_undef":
        delete_undef($mode);
        $report = "";
        $report2 = $message;
        break;
    case "add_sender":
        isset($_POST["sender_name"]) ? $sn = $_POST["sender_name"] : ($sn = "");
        add_sender($mode, $sn, $_POST["sender_domain"], $_POST["src"]);
        $report = "";
        $report2 = $added;
コード例 #4
0
// end function
//***	Primary control.  Calls the function that matches the requested ACTION ***//
if (isset($_POST['action']) && $_POST['action'] != '') {
    switch ($_POST['action']) {
        case 'add_entry':
            $myReturn = add_entry($_POST);
            break;
        case 'update_entry':
            if (isset($_POST['status'])) {
                $myReturn = update_entry($_POST, true, false);
            } else {
                $myReturn = update_entry($_POST, false, true);
            }
            break;
        case 'delete_entry':
            $myReturn = delete_entry($_POST);
            break;
        case 'book_entry':
            $myReturn = book_entry($_POST);
            break;
        case 'get_entry':
            $myReturn = get_entry($_POST);
            if (isset($myReturn['minutes_locked']) && $myReturn['minutes_locked'] > 31) {
                $data = array('user_id' => $myReturn['fields']['lock'], 'id' => $myReturn['fields']['id']);
                release_lock($data);
                $myReturn = get_entry($_POST);
            }
            break;
        case 'get_table_data':
            $myReturn = get_table_data($_POST['access_level'] * 1);
            break;
コード例 #5
0
ファイル: index.php プロジェクト: nickgrossman/TheBoard
#
if (isset($_REQUEST['migrate'])) {
    require_once 'migrate.php';
} elseif ($_POST['action'] == 'create') {
    $person_id = $_REQUEST['person_id'];
    $project_id = $_REQUEST['project_id'];
    $startdate = $_REQUEST['startdate'];
    create_entry($person_id, $project_id, $startdate);
} elseif ($_POST['action'] == 'update') {
    $entry_id = $_REQUEST['entry_id'];
    $project_id = $_REQUEST['project_id'];
    $startdate = $_REQUEST['startdate'];
    update_entry($entry_id, $project_id, $startdate);
} elseif ($_POST['action'] == 'delete') {
    $entry_id = $_REQUEST['entry_id'];
    delete_entry($entry_id);
} elseif ($_POST['action'] == 'reorder') {
    $new_order = $_REQUEST['new_order'];
    reorder_entries($new_order);
} elseif ($_POST['action'] == 'add_project') {
    $project_name = $_REQUEST['project_name'];
    $project_url = $_REQUEST['project_url'];
    add_project($project_name, $project_url);
} elseif ($_POST['action'] == 'park_project') {
    $project_id = $_REQUEST['project_id'];
    park_project($project_id);
} elseif ($_POST['action'] == 'unpark_project') {
    $project_id = $_REQUEST['project_id'];
    unpark_project($project_id);
} elseif ($_GET['project_id']) {
    $project_id = $_REQUEST['project_id'];
コード例 #6
0
$diff_index = array_diff_key($local_index, $remote_index);
$debug = array();
$debug['new entries'] = $remote_entries;
$debug['old entries'] = get_entries();
foreach ($remote_index as $id => $item) {
    if (array_key_exists($id, $local_index)) {
        if ($item['timestamp'] == 0) {
            // Remote entry has been deleted, remove the local too
            $local_index[$id] = $item;
            delete_entry($id);
            unset($remote_index[$id]);
            unset($remote_entries[$id]);
        } elseif ($local_index[$id]['timestamp'] == 0) {
            // Local entry has been deleted, remove local entry too
            $remote_index[$id] = $local_index[$id];
            delete_entry($id);
            unset($remote_index[$id]);
            unset($remote_entries[$id]);
        } elseif ($item['timestamp'] > $local_index[$id]['timestamp']) {
            // Remote entry is newer, replace it and don't send it back
            $local_index[$id] = $item;
            store_entry($id, $_POST[$id]);
            unset($remote_entries[$id]);
            unset($local_entries[$id]);
        } elseif ($item['timestamp'] == $local_index[$id]['timestamp']) {
            // Local entry is already the latest, don't send it back
            unset($remote_entries[$id]);
            unset($local_entries[$id]);
        } else {
            // Local entry is newer, send it back
            $remote_index[$id] = $local_index[$id];
コード例 #7
0
ファイル: index3.php プロジェクト: osoconqueso/mediacatalog
</script>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="gunmetal/css/1.css" type="text/css" media="screen,projection" />
</head>
<body>

<?php 
if (isset($_GET['delete'])) {
    if (isset($_GET['id_num_upc'])) {
        $id_num = $_GET['id_num_upc'];
        $id_type = 'upc';
    } elseif (isset($_GET['id_num_isbn'])) {
        $id_num = $_GET['id_num_isbn'];
        $id_type = 'isbn';
    }
    delete_entry($id_num, $id_type);
    ?>
    <script>
        document.location="index3.php";
    </script>
    <?php 
}
?>

<div id="sidebar">
  <h1><a href="#">media catalog</a></h1>
  <p> keep track of your stuff </p>
  <ul id="nav">
    <li>
      <p>enter an 11 or 13 digit UPC number to search for dvd</p>
        <form action="prod_view1.php" method="get">
コード例 #8
0
ファイル: sharerules.php プロジェクト: helenadeus/s3db.map
             $rmproject_id = $_REQUEST['ext_project_id'];
         }
         $rule_info['oldpermission'] = $rule_info['permission'];
         #keep the old for the log
         $rule_info['permission'] = ereg_replace('(^|_)' . $rmproject_id . '_', '_', $rule_info['permission']);
         #remove the deleting project_id from permissions
         $rule_info['project_id'] = $rmproject_id;
         #trick to make rule log recognize this is a rule adition
         $rule_info['action_by'] = $user_id;
         $action = 'disconnect';
         $editrule = compact('db', 'user_id', 'rule_info', 'inputs', 'action');
         if (update_rule($editrule)) {
             echo "Rule disconnected";
             $match_values = array('project_id' => $rmproject_id, 'rule_id' => $_REQUEST['delete_rule_id']);
             if ($_REQUEST['action'] == 'delete') {
                 delete_entry('access_rules', $match_values, $db);
             } else {
                 update_entry('access_rules', $match_values, 'status', 'disconnected', $db);
             }
         }
     }
 } elseif ($_REQUEST['action'] == 'accept' && ($acl = '3')) {
     #find the important rule
     #find existing permissions on rules table (permissions field)
     #update s3db_rule set permissions = oldvalue._newvalue
     #Delete from pending permission
     $rule_info = get_info('rule', $_REQUEST['accept_rule_id'], $db);
     if (!$rule_info) {
         echo "Rule not found";
     } else {
         #let's see... is the permission for this project already set up? string string :-)
コード例 #9
0
ファイル: access_keys.php プロジェクト: helenadeus/s3db.map
    $s3ql = compact('user_id', 'db');
    $s3ql['insert'] = 'key';
    $s3ql['where']['key_id'] = $_REQUEST['input_key'];
    $s3ql['where']['expires'] = $_REQUEST['date'];
    $s3ql['where']['notes'] = $_REQUEST['notes'];
    $s3ql['where']['UID'] = strtoupper(substr($_REQUEST['resource'], 0, 1) . $_REQUEST['ID']);
    if ($_REQUEST['orderBy'] != '') {
        $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
    }
    $done = S3QLaction($s3ql);
    $done = html2cell($done);
    #ereg('<error>([0-9]+)</error>(.*)<message>(.*)</message>', $done, $s3qlout);
    $message = $done[2]['message'];
} elseif ($_REQUEST['action'] == 'delete') {
    $match_values = array('key_id' => $_REQUEST['key_id'], 'expires' => $_REQUEST['expires']);
    delete_entry('access_keys', $match_values, $db);
}
#Delete expired keys each time script is accessed
#$delete_expired = delete_expired_keys(date('Y-m-d'), $db);
if ($_REQUEST['random'] != '') {
    $random = random_string('15');
} else {
    $random = '';
}
$s3resources = array('', 'project', 'class', 'rule', 'instance', 'statement');
#Print a line for addition of an access key
$create_key_line .= '<form name="key" method="POST" action=access_keys.php>';
$create_key_line .= '<table width="100%"  align="center" border="0">';
$create_key_line .= '<tr bgcolor="#99CCFF"><td colspan="9" align="center">Create Key</td></tr>';
$create_key_line .= '<tr bgcolor="#FFFFCC"><td  width="10%">Key</td>';
$create_key_line .= '<td  width="10%">Expires</td>';
コード例 #10
0
ファイル: shout.php プロジェクト: GrumpyCrouton/ReconDatabase
             $error = 'Operation cancelled.';
         } else {
             echo '<div class="cssShoutText" style="padding:4px">';
             echo '<form name="f1" action="' . $PHP_SELF . '" method="post" style="margin:0px">';
             echo "<b>Table {$tbl_name} doesn't exist. Create it now?</b><br><br>";
             echo '<input type="radio" name="create" value="yes" onClick="document.f1.submit()">yes &nbsp; ';
             echo '<input type="radio" name="create" value="no" onClick="document.f1.submit()">no';
             echo '</form></div>';
         }
     }
 } else {
     if ($admin && $admin != $_SESSION['sb_admin']) {
         $error = $msg['wrongPass'];
     } else {
         if (is_admin() && $delete) {
             $error = delete_entry($delete);
         } else {
             if ($sbText) {
                 if (checkSpam($sbID, -1, $sbName, $sbEMail, '', $sbText, '', $sbSpr)) {
                     $error = $msg['noSpam'];
                 } else {
                     $error = new_entry($sbName, $sbEMail, $sbText);
                 }
             }
         }
     }
     if ($error) {
         echo '<div class="cssShoutError">' . $error . '</div>';
     }
     $User = $_SESSION['Name'];
     $Level = $_SESSION['Level'];
コード例 #11
0
ファイル: turn.php プロジェクト: aymericbouzy/cluedo-solver
function delete_turn($turn)
{
    delete_entry("turn", $turn);
}
コード例 #12
0
<?php

require "functions.php";
$book = search_file_for_id($_GET['id']);
$item = explode("\t", $book);
delete_entry($_GET['id']);
header("location:biags_library.php?title={$item['1']}&removed=true");
コード例 #13
0
ファイル: index.php プロジェクト: Abilis/SPD
    $netmask = $entry['netmask'];
    $gateway = $entry['gateway'];
    $vlan_id = $entry['vlan_id'];
    $customer_port = $entry['customer_port'];
    $termination_point = $entry['termination_point'];
    $commentary = $entry['commentary'];
    //Выводим в шаблоны
    include_once 'views/v-header.php';
    include_once 'views/v-menu.php';
    include_once 'views/v-edit.php';
    include_once 'views/v-footer.php';
    die;
} elseif ($_GET['action'] == 'delete') {
    if ($canDoDelete) {
        //проверка, есть ли права удалять записи
        if (delete_entry($link, $user, $_GET['id_entry'])) {
            header('Location: index.php');
            die;
        }
    }
} elseif (!empty($_POST)) {
    //если массив не пустой
    if (entry_edit($link, $user, $_POST['id_entry'], $_POST['numOrder'], $_POST['customer'], $_POST['tarif'], $_POST['ip_address'], $_POST['netmask'], $_POST['gateway'], $_POST['vlan_id'], $_POST['customer_port'], $_POST['termination_point'], $_POST['commentary'])) {
        //update в базе. Если успешно - редирект на главную
        header('Location: index.php');
        die;
    }
    //сохраняем введенные в поля данные, если что-то пошло не так
    $numOrder = $_POST['numOrder'];
    $customer = $_POST['customer'];
    $tarif = $_POST['tarif'];
コード例 #14
0
ファイル: guestbook.old.php プロジェクト: Razze/hamsterpaj
$userinfo = login_load_user_data($userid, $fetch);
$profile = profile_fetch(array('user_id' => $userid));
$ui_options['stylesheets'][] = 'profile_themes/' . $profile['profile_theme'] . '.css';
ui_top($ui_options);
echo '<div class="profile_' . $profile['profile_theme'] . '">' . "\n";
echo profile_head($profile);
echo '</div>' . "\n";
if (login_checklogin() == 1) {
    if ($_GET['action'] == 'delete') {
        if ($_POST['all'] == 'true') {
            $query = 'UPDATE traffa_guestbooks SET deleted = 1 WHERE recipient = "' . $_SESSION['login']['id'] . '" AND `read` = 1';
            mysql_query($query) or die(report_sql_error($query));
            $query = 'UPDATE traffa SET guestbook_entries = ' . count_unread_gb_entries($userid) . ' WHERE userid = "' . $_SESSION['login']['id'] . '" LIMIT 1';
            mysql_query($query) or die(report_sql_error($query));
        } else {
            delete_entry($_GET['entry_id'], $_SESSION['login']['id']);
        }
        jscript_location($_SERVER['PHP_SELF'] . '?offset=' . $_GET['return_offset']);
    } elseif ($_GET['action'] == 'send_new_message') {
        if (userblock_check($_GET['userid'], $_SESSION['login']['id']) == 1) {
            jscript_alert('Den användare som du har angivit som mottagare har blockerat dig, och ditt meddelande kan därför inte skickas!');
            echo '<script language="javascript">history.go(-1);</script>';
            die;
        }
        $spamval = spamcheck($_SESSION['login']['id'], $_POST['message'], $_GET['userid']);
        if ($spamval == 1 && is_numeric($_GET['userid'])) {
            new_entry($_GET['userid'], $_SESSION['login']['id'], $_POST['message'], $_POST['is_private']);
            draw_message_form($_GET['userid']);
            list_entries($_GET['userid'], $userinfo['traffa']['guestbook_entries']);
        } else {
            draw_message_form($_GET['userid'], $_POST['message'], $spamval);