当前位置: 首页>>代码示例>>PHP>>正文


PHP users::delete方法代码示例

本文整理汇总了PHP中users::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP users::delete方法的具体用法?PHP users::delete怎么用?PHP users::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users的用法示例。


在下文中一共展示了users::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: users

// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['deleteUser']) && isset($_POST['id']) && isset($_SESSION['user']['access']['users'])) {
    require_once ROOT_PATH . "/apps/users/models/users.class.php";
    $cms = new users();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteUserGroup']) && isset($_POST['id']) && isset($_SESSION['user']['access']['users'])) {
    require_once ROOT_PATH . "/apps/users/models/groups.class.php";
    $cms = new groups();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteWithdraw']) && isset($_POST['id']) && isset($_SESSION['user']['access']['users'])) {
    require_once ROOT_PATH . "/apps/users/models/deposit.class.php";
    $cms = new deposit();
    $cms->deleteWithdraw(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteComment']) && isset($_POST['id']) && isset($_SESSION['user']['access']['users'])) {
    require_once ROOT_PATH . "/apps/items/models/comments.class.php";
    $cms = new comments();
    $cms->delete(intval($_POST['id']));
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:delete.php

示例2: header

<!-- All Will Write Their Code Here -->
<div class="row">
<div class="row table-responsive">
	
	<?php 
    if (isset($_GET['del_id'])) {
        $del_id = $_GET['del_id'];
        if ($validate->checkNotNull($del_id)) {
            if ($validate->checkNumeric($del_id)) {
                if ($validate->checkID($del_id)) {
                    if ($orders->checkFoundOrdersForId($del_id)) {
                        ?>
<div class="alert alert-danger text-center">Cannot Delete This User Becous he already Get  Orders</div><?php 
                    } else {
                        $users->delete($del_id);
                    }
                } else {
                    echo "No User Found With This Data";
                }
            } else {
                header("location:home.php");
            }
        } else {
            header("location:home.php");
        }
    }
    /*
    		if(isset($_GET['unavailable']))
    		{
    			$roomNum=$_GET['unavailable'];
开发者ID:Mayyad,项目名称:Tigers,代码行数:30,代码来源:users.php

示例3: function

$app->get('/admin/users/setStat/:userID/:status', $authenticateAdmin, function ($userID, $status) use($app) {
    $dbh = getConnection();
    users::setStatus($dbh, $userID, $status);
    die;
});
$app->post('/admin/users/New/', $authenticateAdmin, function () use($app) {
    $dbh = getConnection();
    $userData = $app->request->post();
    users::create($dbh, $userData);
    die;
});
$app->post('/admin/users/:userID/', $authenticateAdmin, function ($userID) use($app) {
    $dbh = getConnection();
    $userData = $app->request->post();
    users::update($dbh, $userID, $userData);
    die;
});
$app->get('/admin/users/setRole/:userID/:roleID/', $authenticateAdmin, function ($userID, $roleID) use($app) {
    $dbh = getConnection();
    users::setRole($dbh, $userID, $roleID);
    die;
});
$app->get('/admin/users/del/:userID/', $authenticateAdmin, function ($userID) use($app) {
    $dbh = getConnection();
    users::delete($dbh, $userID);
    die;
});
$app->post('/upload/:directory/', $authenticateAdmin, function ($directory) use($app) {
    $env = $app->environment();
    echo upload::handleUpload($env['baseDir'] . 'img/' . $directory . '/');
});
开发者ID:nbunney,项目名称:fulferSite,代码行数:31,代码来源:admin.php

示例4: header

    $valSurname = $a[0];
    $valName = $a[1];
    $valFname = $a[2];
}
//делаю апдейт
$b = $new->updateById($id);
if ($b == 1) {
    header("Location: http://site.dev/class/class.php");
    $valSurname = '';
    $valName = '';
    $valFname = '';
}
//вношу данные
$c = $new->insert();
//удаляю данные
$d = $new->delete($id);
//вытаскиваю всю базу
$all = $new->selectAll();
//Создаю заголовки таблицы и добавляю их в массив таблицы
$head = ['id' => 'ID', 'surname' => 'SURNAME', 'nam' => 'NAME', 'fname' => "FATHER'S NAME", 'bdel' => 'DELETE', 'up' => 'UPDATE'];
array_unshift($all, $head);
//создаю ссылки для апдейта и делита и добавляю их в массив таблицы
for ($t = 1; $t < count($all); $t++) {
    $del[$t] = '<a href="http://site.dev/class/class.php?action=delete&id=' . $all[$t]['id'] . '">DELETE</a>';
    $up[$t] = '<a href="http://site.dev/class/class.php?action=update&id=' . $all[$t]['id'] . '">UPDATE</a>';
}
for ($m = 1; $m < count($all); $m++) {
    $all[$m]['del'] = $del[$m];
    $all[$m]['up'] = $up[$m];
}
/*
开发者ID:aiskimzhi,项目名称:site.dev,代码行数:31,代码来源:class.php

示例5: database

<?php

if ($_POST) {
    include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php';
    include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/users.php';
    $database = new database();
    $db = $database->getConnection();
    $users = new users($db);
    $users->username = $_POST['object_id'];
    if ($users->delete()) {
        echo "User berhasil dihapus.";
    } else {
        echo "User tidak bisa dihapus.";
    }
}
开发者ID:ilhamdoanggg,项目名称:penjualan_salon,代码行数:15,代码来源:delete.php

示例6: users

print_r($_GET);
echo '</pre>';
echo '<pre>';
print_r($_POST);
echo '</pre>';
$new = new users();
echo 'table name is ' . $new->tableName() . '<br>';
if (isset($_GET['id'])) {
    $id = $_GET['id'];
} else {
    $id = 0;
}
echo 'id = ' . $id . '<br>';
$sellect = $new->selectForUpdate($id);
$update = $new->updateById($id);
$delete = $new->delete($id);
$insert = $new->insert();
$sellectAll = $new->selectAll();
?>

<!DOCTYPE HTML>
<html>
<head>
    <title>Class work</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="bootstrap.css">
    <script type="text/javascript" scr="bootstrap.js"></script>
</head>
<body>
<h4>Please, enter your data into the form below</h4>
    <form action="class.php" method="POST">
开发者ID:aiskimzhi,项目名称:site.dev,代码行数:31,代码来源:class.php


注:本文中的users::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。