⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 close.php

📁 jsp程序开发系统
💻 PHP
字号:
<?php
// +-------------------------------------------------------------+
// | DeskPRO v [2.0.1 Production]
// | Copyright (C) 2001 - 2004 Headstart Solutions Limited
// | Supplied by WTN-WDYL
// | Nullified by WTN-WDYL
// | Distribution via WebForum, ForumRU and associated file dumps
// +-------------------------------------------------------------+
// | DESKPRO IS NOT FREE SOFTWARE
// +-------------------------------------------------------------+
// | License ID : Full Enterprise License =) ...
// | License Owner : WTN-WDYL Team
// +-------------------------------------------------------------+
// | $RCSfile: close.php,v $
// | $Date: 2004/02/10 01:34:25 $
// | $Revision: 1.15 $
// +-------------------------------------------------------------+
// | File Details:
// | - Old ticket expiration (auto-close).
// +-------------------------------------------------------------+

error_reporting(E_ALL ^ E_NOTICE);

cron_check();

############################### CLOSE USER AWAITING REPLY TICKETS ###############################

if ($options['days_user_reply'] != "0" AND $options['days_user_reply'] != "") {

	$report .= "Auto-closed because last user response was more than $options[days_user_reply] days ago:\n\n";
	
	$expire_date = mktime() - ($options['days_user_reply'] * 60 * 60 * 24);
	
	$db->query("
		SELECT * FROM ticket 
		WHERE !awaiting_tech
		AND date_reply < '$expire_date' 
		AND is_open
	");
	
	while ($ticket = $db->row_array()) {
		
		$user_details = $db2->query("SELECT * user WHERE id = '$ticket[userid]'");

		$db2->query("UPDATE ticket SET 
			is_open = '0', 
			awaiting_reply = '0' 
			WHERE id = '$ticket[id]'
		");

		ticketlog($id, 'close');

		$report .= "Ticket $ticket[id] closed\n";
		
		if ($options['notify_user'] == "1") {
			$user_details = update_user_details($user_details);
			eval(makeemaileval('body', 'BODY_question_closed', $subject));
			dp_mail($user_details['email'], $subject, $body);
		}		
	}
}

############################### CLOSE TECH AWAITING REPLY TICKETS ###############################

if ($options['days_tech_reply'] != "0" AND $options['days_tech_reply'] != "") {

	$report .= "Auto-closed because last technician response was more than\n$options[days_user_reply] days ago:\n\n";
	
	$expire_date = mktime() - ($options['days_tech_reply'] * 60 * 60 * 24);
	
	$db->query("
		SELECT * FROM ticket 
		WHERE awaiting_tech
		AND date_reply < '$expire_date'  
		AND is_open
	");
	
	while ($ticket = $db->row_array()) {
		
		$user_details = $db2->query("SELECT * user WHERE id = '$ticket[userid]'");

		$db2->query("UPDATE ticket SET 
			is_open = '0', 
			awaiting_reply = '0' 
			WHERE id = '$ticket[id]'
		");
		ticketlog($id, 'close');
		
		$report .= "Ticket $ticket[id] closed\n";
	
		if ($options['notify_user'] == "1") {
			$user_details = update_user_details($user_details);
			eval(makeemaileval('body', 'BODY_question_closed', $subject));
			dp_mail($ticket['email'], $subject, $body);
		}	
	}
}

//////////////////// PART 6: SEND EMAIL TO ADMIN ////////////////////

if ($options['email_log'] AND $report) {
	dp_mail($options['email_log'], "$settings[site_name]Automatic Ticket Closure Report", $report, "From: $email_report");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -