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


PHP Report::delete方法代码示例

本文整理汇总了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()));
 }
开发者ID:JakeDawkins,项目名称:NiceCatch,代码行数:18,代码来源:reportTest.php

示例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();
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:15,代码来源:Admin.php

示例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}?");
        }
    }
}
开发者ID:precurse,项目名称:netharbour,代码行数:39,代码来源:monitor.php

示例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;
    }
}
开发者ID:enettolima,项目名称:ceva-finance,代码行数:10,代码来源:report.controller.php

示例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 
开发者ID:noverkill,项目名称:classified-ads-script,代码行数:31,代码来源:report-list.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());
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:37,代码来源:DashboardController.php


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