<?php
require_once('core.php');
require_once('referer.php');
require_once('utils.php');
require_once('Date.php');
$date_from = new Date;
$date_from->hour = 0;
$date_from->minute = 0;
$date_from->second = 0;
$date_from->partsecond = 0;
$date_to = new Date;
$date_to->hour = 23;
$date_to->minute = 59;
$date_to->second = 59;
$date_to->partsecond = 99;
$date_from = datetime_from_userfriendly(_post_arg('date_from', datetime_to_userfriendly($date_from)));
$date_to = datetime_from_userfriendly(_post_arg('date_to', datetime_to_userfriendly($date_to)));
if (isset($_POST['calculate']))
{
$r = ukm_report_payments2jp(
$core->m_db->dsn['hostspec']
, ($core->m_db->dsn['port'] ? $core->m_db->dsn['port'] : 3306)
, $core->m_db->dsn['database']
, $core->m_db->dsn['username']
, $core->m_db->dsn['password']
, $_SESSION['current_cashline']
, $date_from->format('%Y-%m-%d %H:%M:%S')
, $date_to->format('%Y-%m-%d %H:%M:%S')
);
if(is_array($r))
{
$core->assign('report', $r);
}
else
{
$tutor->set(TUTOR_STOP, $r);
}
}
$core->assign('date_from', datetime_to_userfriendly($date_from));
$core->assign('date_to', datetime_to_userfriendly($date_to));
$core->assign('cashlines', $core->cashline_list());
$core->display('report_payments2jp.tpl');
?>