Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Great Software!!!
We are a small company and your script was a great value for the dollar!!
I would like to run reports on tickets that have been closed at the end of each month. I see where I can view tickets by date, but not between dates, such as between 7-1-09 and 7-31-09. I can view all tickets, depending on the attributes I choose, but sorting through them by the name of the tech that closed the ticket throughout a given month would be very time consuming.
Is this possible and I have just missed the setting?
Reporting by Dates
Moderator: mkoch227
As a quick fix you can try this:
- open file "find_tickets.php" (located in admin folder) in Notepad
- change to this:
- save changes and upload to the server
You should be able to list all tickets closed in a month by entering YYYY-MM-% in the date field. For example to list all tickets closed in June 2009 you would enter:
2009-06-%
For all tickets closed in November 2008:
2008-11-%
and so on...
- open file "find_tickets.php" (located in admin folder) in Notepad
- change
Code: Select all
if (!preg_match("/\d{4}-\d{2}-\d{2}/",$extra))
{
hesk_error($hesklang['date_not_valid']);
}
$sql .= "(`dt` LIKE '$extra%' OR `lastchange` LIKE '$extra%')";
Code: Select all
$sql .= " `lastchange` LIKE '$extra%' ";
You should be able to list all tickets closed in a month by entering YYYY-MM-% in the date field. For example to list all tickets closed in June 2009 you would enter:
2009-06-%
For all tickets closed in November 2008:
2008-11-%
and so on...
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
A bit more complicated. In find_tickets.php try changing to
Haven't tested it though...
Code: Select all
if (preg_match("/(\d{4})-(\d{2})-(\d{2})/",$_GET['dt'],$m))
{
$_GET['dt']=$m[2].$m[3].$m[1];
}
/* -> Now process the date value */
$dt = preg_replace('/[^0-9]/','',$_GET['dt']);
if (strlen($dt) == 8)
{
$date = substr($dt,4,4) . '-' . substr($dt,0,2) . '-' . substr($dt,2,2);
$date_input= substr($dt,0,2) . '/' . substr($dt,2,2) . '/' . substr($dt,4,4);
/* This search is valid even if no query is entered */
if ($no_query)
{
$hesk_error_buffer = str_replace($hesklang['fsq'],'',$hesk_error_buffer);
}
else
{
$sql .= ' AND ';
}
$sql .= " (`dt` LIKE '".hesk_dbEscape($date)."%' OR `lastchange` LIKE '".hesk_dbEscape($date)."%') ";
}
Code: Select all
if (preg_match("/(\d{4})-(\d{2})/",$_GET['dt'],$m))
{
$_GET['dt']=$m[2].'01'.$m[1];
}
/* -> Now process the date value */
$dt = preg_replace('/[^0-9]/','',$_GET['dt']);
if (strlen($dt) == 8)
{
$date = substr($dt,4,4) . '-' . substr($dt,0,2);
$date_input= substr($dt,0,2) . '/01/' . substr($dt,4,4);
/* This search is valid even if no query is entered */
if ($no_query)
{
$hesk_error_buffer = str_replace($hesklang['fsq'],'',$hesk_error_buffer);
}
else
{
$sql .= ' AND ';
}
$sql .= " (`dt` LIKE '".hesk_dbEscape($date)."%' OR `lastchange` LIKE '".hesk_dbEscape($date)."%') ";
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 1
- Joined: Thu Nov 11, 2010 7:11 pm
Re: Reporting by Dates
This worked great for us! Thank you so much Klemen! (the v2.2 fix)