本文整理汇总了PHP中Report::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::delete方法的具体用法?PHP Report::delete怎么用?PHP Report::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDelete
public function testDelete()
{
$rep = new Report();
$now = date("Y-m-d H:i:s");
$rep->setDescription("tester");
$rep->setInvolvementKindID(2);
$rep->setReportKindID(1);
$rep->setLocationID(1);
$rep->setPersonID(1);
$rep->setDepartmentID(2);
$rep->setDateTime($now);
$rep->setStatusID(2);
$rep->setActionTaken("nothing");
$rep->save();
$this->assertTrue(Report::reportExists($rep->getPersonID(), $rep->getDateTime()) != false);
$rep->delete();
$this->assertTrue(!Report::reportExists($rep->getPersonID(), $rep->getDateTime()));
}
示例2: ignoreReport
private function ignoreReport($id)
{
\PHPWS_Core::initModClass('properties', 'Report.php');
\PHPWS_Core::initModClass('properties', 'Message.php');
$report = new Report($id);
$message = new Message($report->message_id);
try {
$report->delete();
} catch (\Exception $e) {
\PHPWS_Core::log($e->getMessage(), 'properties.log');
exit('Could not remove report');
}
$message->reported = 0;
$message->save();
}
示例3: deleteReports
function deleteReports()
{
global $tool, $form, $report_types;
$name = $_GET[name];
if (!$name || $name == '') {
$form->warning("invalid name ");
return false;
}
$numreports = count(Report::get_reports_by_name($name));
if ($numreports == 0) {
$form->warning("No reports found for {$name} ");
return false;
}
// Confimration part
if (isset($_POST['deleteYes'])) {
$success = true;
$msg = '';
foreach (Report::get_reports_by_name($name) as $report_id => $profile_id) {
$report = new Report($report_id);
if ($report->delete()) {
} else {
$success = false;
$msg .= "<br>Could not delete report id {$report_id}. Reason: " . $report->get_error();
}
}
if ($success) {
echo "<meta http-equiv=\"REFRESH\" content=\"0;url=" . $_SERVER['PHP_SELF'] . "?action=list_reports&delete=success\">";
} else {
$form->warning("Could not delete reports:<br> {$msg} ");
return false;
}
} else {
if (isset($_POST['deleteNo'])) {
echo "<meta http-equiv=\"REFRESH\" content=\"0;url=" . $_SERVER['PHP_SELF'] . "?action=display_reports_by_name&name={$name}\">";
} else {
$form->prompt("Are you sure you want to delete {$numreports} for {$name}?");
}
}
}
示例4: report_delete_form_submit
function report_delete_form_submit($data)
{
$report = new Report();
$delete = $report->delete($data['id']);
if ($delete['code'] == 200) {
return $data['id'];
} else {
return FALSE;
}
}
示例5: header
*
* Admin area
*
* @copyright Copyright (c) Szilard Szabo
* @license GPL v3
* @package Admin
*/
include "./include/common.php";
include "Pager/Pager.php";
if (!User::is_logged_in() || User::get_id() != 1) {
header('Location: index.php');
exit;
}
if (isset($_GET['d'])) {
$d = (int) $_GET['d'];
Report::delete($d);
}
$tct = Report::count();
//total count
$rpp = 10;
//row per page
$pager_options = array('mode' => 'Sliding', 'perPage' => $rpp, 'delta' => 2, 'totalItems' => $tct, 'excludeVars' => array('o', 'r', 'd', 't', 'e'));
$pager = @Pager::factory($pager_options);
list($from, $to) = $pager->getOffsetByPageId();
$reports = Report::get_all(array(), '', $from - 1 . ", {$rpp}");
include "page-header.php";
?>
<div id="wrapper">
<?php
示例6: manageReport
public function manageReport($id, $action)
{
try {
$report = new Report($id);
if ($action == 'Show') {
if (User::can('view-any-report')) {
$report->setVisible(1);
$report->store();
fMessaging::create('success', "Report {$id} showed successfully.");
} else {
throw new fAuthorizationException('You are not allowed to show this report.');
}
} else {
if ($action == 'Hide') {
if (User::can('view-any-report')) {
$report->setVisible(0);
$report->store();
fMessaging::create('success', "Report {$id} hidden successfully.");
} else {
throw new fAuthorizationException('You are not allowed to hide this report.');
}
} else {
if ($action == 'Remove') {
if (User::can('remove-report')) {
$report->delete();
fMessaging::create('success', "Report {$id} removed successfully.");
} else {
throw new fAuthorizationException('You are not allowed to remove this report.');
}
}
}
}
} catch (fException $e) {
fMessaging::create('error', $e->getMessage());
}
fURL::redirect(Util::getReferer());
}