Example #1
0
function delete_action($id)
{
    $row = delete_row($id);
    $rows = get_all_rows();
    $html = render_template("view/admin.php", array('rows' => $rows));
    return $html;
}
Example #2
0
 function delete_staff_group()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = delete_row($this, 'usergroups', decryptValue($data['i']));
     }
     if (!empty($result) && $result) {
         $this->session->set_userdata('dsg', "The staff group has been deleted.");
         #Delete the staff group's permissions as well
         $this->db->query($this->Query_reader->get_query_by_code('delete_group_permissions', array('groupid' => decryptValue($data['i']))));
     } else {
         if (empty($data['msg'])) {
             #$this->session->set_userdata('dsg', "ERROR: The staff group could not be deleted or was not deleted correctly.");
         }
     }
     if (!empty($data['t']) && $data['t'] == 'super') {
         $tstr = "/t/super";
     } else {
         $tstr = "";
     }
     #redirect("user/manage_staff_groups/m/dsg".$tstr);
 }
Example #3
0
<?php

$a = loadVariable("a", '');
$v = loadVariable("v", "");
$page_type = loadVariable("page_type", "");
$id = loadVariable("id", "0");
if ($a != '') {
    switch ($a) {
        case "get_link_content":
            echo get_link_content($v);
            break;
        case 'delete':
            delete_row($page_type, $id);
            break;
        case 'status':
            status_change($page_type, $id);
            break;
        default:
            echo "Error";
    }
}
function delete_row($page_type, $id)
{
    if (empty($page_type)) {
        die(json_encode(array("error" => "Page Type not declared!!!")));
    } else {
        //Table information declaration
        $table_info['site menu']['tbl'] = "site_menu";
        $table_info['site menu']['key'] = "menu_id";
        $table_info['site content']['tbl'] = "site_content";
        $table_info['site content']['key'] = "content_id";
Example #4
0
header("Content-type: text/xml");
//encoding may differ in your case
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
//output update results
echo "<data>";
$ids = explode(",", $_POST["ids"]);
//for each row
for ($i = 0; $i < sizeof($ids); $i++) {
    $rowId = $ids[$i];
    //id or row which was updated
    $newId = $rowId;
    //will be used for insert operation
    $mode = $_POST[$rowId . "_!nativeeditor_status"];
    //get request mode
    switch ($mode) {
        case "inserted":
            //row adding request
            $action = add_row($rowId);
            break;
        case "deleted":
            //row deleting request
            $action = delete_row($rowId);
            break;
        default:
            //row updating request
            $action = update_row($rowId);
            break;
    }
    echo "<action type='" . $action . "' sid='" . $rowId . "' tid='" . $newId . "'/>";
}
echo "</data>";
Example #5
0
    $resDel = mysql_query($d_sql);
    return "delete";
}
//include XML Header (as response will be in xml format)
header("Content-type: text/xml");
//encoding may differ in your case
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
$mode = $_GET["!nativeeditor_status"];
//get request mode
$rowId = $_GET["gr_id"];
//id or row which was updated
$newId = $_GET["gr_id"];
//will be used for insert operation
switch ($mode) {
    case "inserted":
        //row adding request
        $action = add_row();
        break;
    case "deleted":
        //row deleting request
        $action = delete_row();
        break;
    default:
        //row updating request
        $action = update_row();
        break;
}
//output update results
echo "<data>";
echo "<action type='" . $action . "' sid='" . $rowId . "' tid='" . $newId . "'/>";
echo "</data>";
Example #6
0
function removeCrossAt($lines, &$matrix)
{
    //if ($this->debug) echo " remove index " . $index;
    $newLines = array();
    $n = count($lines);
    $m = count($matrix);
    for ($i = 0; $i < $n; $i++) {
        $newLines[$i] = $matrix[$lines[$i]][$m];
        //guardar indices originales
        //echo ($m) . " + old " . $lines[$i] . " new " . $newLines[$i] . "<br>";
    }
    for ($i = 0; $i < $n; $i++) {
        delete_col($matrix, $lines[$i]);
    }
    ///se eliminan las referencias &$matrix
    for ($i = 0; $i < $n; $i++) {
        delete_row($matrix, $lines[$i]);
    }
    return $newLines;
}
Example #7
0
 function delete_return()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $data['table'] = "borroweditems";
     if (delete_row($this, $data)) {
         $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_library', array('item' => $data['i'], 'isavailable' => '0')));
         if ($save_result) {
             $data['msg'] = "The return has been deleted.";
             //die($data['msg']);
             $this->session->set_userdata('sres', $data['msg']);
             redirect(base_url() . "library/manage_returns/m/sres");
         } else {
             $data['msg'] = "ERROR: The borrower was not deleted. Please contact your administrator.";
         }
     } else {
         $data['msg'] = "ERROR: The borrower was not deleted. Please contact your administrator.";
     }
 }
Example #8
0
<?php

session_start();
$user = @$_SESSION['myemail'];
if ($user != "admin") {
    header("location: ./../index.php");
    die;
}
require './../config.php';
require './../src/security.php';
$action = @$_POST['action'];
if ($action == 'show_table') {
    show_table();
}
if ($action == 'delete_row') {
    delete_row();
}
if ($action == 'new_row') {
    new_row();
}
if (preg_match('/change/', $action)) {
    change($action);
}
function show_table()
{
    $data = $GLOBALS['DB']->query("SELECT * FROM user");
    echo json_encode($data);
}
function delete_row()
{
    $id = (int) @$_POST['id'];
Example #9
0
---
title: Avatar Hotel - Delete Job
---
<?php 
include '../../php/db.php';
include '../../php/form.php';
$table = params('table');
$pk = params('pk');
$id = params('id');
delete_row($table, $pk, $id);
?>
<p>
<a href='list.php?table=<?php 
echo $table;
?>
'>Back to List</a>
</p>
<p>
<a href='table_list.php'>Back to Table List</a>
</p>
Example #10
0
File: index.php Project: cssguy/tds
    if ($param && $param != "remove" && $param != "page") {
        $query_string .= "&{$param}={$value}";
    }
}
if (isset($_GET['page'])) {
    $page = $_GET['page'] - 1;
} else {
    $page = 0;
}
get_control();
include_once dir . "/header_admin.php";
?>
<div class="content">
	<?php 
if (isset($_GET['remove']) && isset($_GET['view'])) {
    if (delete_row($_GET['remove'], $_GET['view'])) {
        echo "Запись с id=", $_GET['remove'], " успешно удалена<br><br>";
    } else {
        echo "Невозможно удалить запись с id=", $_GET['remove'];
    }
}
/*echo "<pre>";
		print_r($_POST);
		echo "</pre>";*/
if (isset($_POST['item'])) {
    if (isset($_POST['del_items'])) {
        if ($result = delete_items($view_list)) {
            echo "Записи с id={$result} успешно удалены.";
        } else {
            echo "Удаление невозможно.";
        }
Example #11
0
<?php

include '../functions.php';
$table = $_GET['table'];
$where_key = $_GET['where_key'];
$where_value = $_GET['where_value'];
$api_key = $_GET['api_key'];
if ($api_key !== $codame_api_key) {
    echo "Permission not granted.";
    die;
}
db_connect();
delete_row($table, $where_key, $where_value);