本文整理汇总了PHP中Employee::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::delete方法的具体用法?PHP Employee::delete怎么用?PHP Employee::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Employee
<?php
require_once "../initialise_files.php";
include_once "sessioninc.php";
$employee = new Employee();
$smarty->assign('employee_id', $_POST['employee_id']);
###################### DELETE ####################################
if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "delete") {
$employee->id = (int) $_GET['id'];
$employee->delete();
}
if (isset($_POST['delete_all']) && $_POST['employee_id'] != "" && sizeof($_POST['employee_id']) != 0) {
//$employee->admin_comments = $_POST['reject_reason'];
foreach ($_POST['employee_id'] as $key => $value) {
if ($value != "") {
$employee->id = (int) $value;
if ($employee->delete()) {
$success = true;
}
}
}
if ($success) {
$session->message("<div class='success'>Employee(s) has been deleted </div>");
redirect_to($_SERVER['PHP_SELF']);
die;
}
}
###################### activate ###################################
if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "activate") {
$employee->id = $_GET['id'];
if ($employee->active_user()) {
示例2: uninstallDB
public function uninstallDB()
{
// Delete NetEven employee
$employee = new Employee((int) Gateway::getConfig('ID_EMPLOYEE_NETEVEN'));
$employee->delete();
// Delete NetEven customer
$customer = new Customer((int) Gateway::getConfig('ID_CUSTOMER_NETEVEN'));
$customer->delete();
// Removing tables from the database
$result = Db::getInstance()->Execute('
DROP TABLE IF EXISTS
`' . _DB_PREFIX_ . 'orders_gateway`,
`' . _DB_PREFIX_ . 'orders_gateway_order_state`,
`' . _DB_PREFIX_ . 'orders_gateway_customer`,
`' . _DB_PREFIX_ . 'orders_gateway_configuration`,
`' . _DB_PREFIX_ . 'orders_gateway_feature_link`,
`' . _DB_PREFIX_ . 'orders_gateway_feature`
');
if (!$result) {
return false;
}
return true;
}
示例3: Employee
<?php
//Imports
require_once 'db.php';
require_once 'Employee.php';
if (!isset($_POST['id']) || !is_numeric($_POST['id'])) {
http_response_code(422);
echo 'Invalid user ID';
exit;
}
$con = connect_db();
$employee = new Employee();
$employee->id = intval($_POST['id']);
$employee->delete($con);
$con->close();
header('Location: ../employees');