本文整理汇总了PHP中paloSantoGrid::isExportAction方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::isExportAction方法的具体用法?PHP paloSantoGrid::isExportAction怎么用?PHP paloSantoGrid::isExportAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::isExportAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportCDR
function reportCDR($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = '';
$pCDR = new paloSantoCDR($pDB);
$pORGZ = new paloSantoOrganization($arrConf['elastix_dsn']["elastix"]);
$pPBX = new paloAsteriskDB($arrConf['elastix_dsn']["elastix"]);
if ($credentials['userlevel'] == 'superadmin') {
$domain = getParameter('organization');
$domain = empty($domain) ? 'all' : $domain;
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$domain = $credentials['domain'];
}
$date_start = getParameter('date_start');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_start)) {
$date_start = date("d M Y");
}
$date_end = getParameter('date_end');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_end)) {
$date_end = date("d M Y");
}
$src = getParameter("src");
if (isset($src) && $src != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($src);
if ($expression === false) {
$src = '';
}
}
$dst = getParameter("dst");
if (isset($dst) && $dst != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($dst);
if ($expression === false) {
$dst = '';
}
}
$src_channel = getParameter("src_channel");
$dst_channel = getParameter("dst_channel");
$calltype = getParameter("calltype");
$arrCallType = array("all" => _tr("ALL"), 'incoming' => _tr('Incoming'), 'outgoing' => _tr("Outgoing"));
$calltype = array_key_exists($calltype, $arrCallType) ? $calltype : "all";
$status = getParameter("status");
$arrStatus = array("all" => _tr("ALL"), 'ANSWERED' => _tr('ANSWERED'), 'BUSY' => _tr("BUSY"), 'FAILED' => _tr("FAILED"), "NO ANSWER " => _tr("NO ANSWER"));
$status = array_key_exists($status, $arrStatus) ? $status : "all";
$accountcode = getParameter('accountcode');
$url['menu'] = $module_name;
$url['organization'] = $paramFiltro['organization'] = $domain;
$url['date_start'] = $paramFiltro['date_start'] = $date_start;
$url['date_end'] = $paramFiltro['date_end'] = $date_end;
$url['src'] = $paramFiltro['src'] = $src;
$url['dst'] = $paramFiltro['dst'] = $dst;
$url['src_channel'] = $paramFiltro['src_channel'] = $src_channel;
$url['dst_channel'] = $paramFiltro['dst_channel'] = $dst_channel;
$url['calltype'] = $paramFiltro['calltype'] = $calltype;
$url['status'] = $paramFiltro['status'] = $status;
$url['accountcode'] = $paramFiltro['accountcode'] = $accountcode;
//permission
$delete = in_array("delete", $arrPermission);
$export = in_array("export", $arrPermission);
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("CDR Report"));
$oGrid->pagingShow(true);
if ($export) {
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("CDRReport"));
}
$oGrid->setURL($url);
if ($delete && !$oGrid->isExportAction()) {
$arrColumns[] = "<input type='checkbox' name='cdrcheckall' class='cdrcheckall' id='cdrcheckall' onclick='jqCheckAll(this.id)';>";
}
if ($credentials['userlevel'] == 'superadmin') {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Date");
$arrColumns[] = _tr("Source");
if ($credentials['userlevel'] != 'superadmin') {
$arrColumns[] = _tr("Ring Group");
}
$arrColumns[] = _tr("Destination");
$arrColumns[] = _tr("Src. Channel");
$arrColumns[] = _tr("Account Code");
$arrColumns[] = _tr("Dst. Channel");
$arrColumns[] = _tr("Call Direction");
$arrColumns[] = _tr("Status");
$arrColumns[] = _tr("Duration");
$oGrid->setColumns($arrColumns);
//get NumCDR
$total = $pCDR->getNumCDR($paramFiltro);
if ($total === false) {
$total = 0;
$error = _tr("An error has ocurred to retrieve CDR data") . " " . "DATABASE ERROR";
}
$arrData = array();
$arrResult = array();
//.........这里部分代码省略.........
示例2: reportListadodeCallTypes
function reportListadodeCallTypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pListadodeCallTypes = new paloSantoListadodeCallTypes($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Listado de Call Types"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Listado de Call Types"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña"), _tr("Call Type"), _tr("Clase de Call Type"), _tr("Peso"), _tr("Status"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pListadodeCallTypes->getNumListadodeCallTypes($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pListadodeCallTypes->getListadodeCallTypes($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['campania'];
$arrTmp[1] = $value['call_type'];
$arrTmp[2] = $value['clase'];
$arrTmp[3] = $value['peso'];
$arrTmp[4] = $value['status'] == "A" ? "Activo" : "Inactivo";
$arrTmp[5] = "<a href=index.php?menu={$module_name}&id={$value['id']}&id_campania={$value['id_campania']}&action=change_status&status=";
if ($value['status'] == "A") {
$arrTmp[5] .= "I";
$accion = "Desactivar";
} else {
$arrTmp[5] .= "A";
$accion = "Activar";
}
$arrTmp[5] .= ">{$accion}</a>";
$arrTmp[5] .= " <a href=index.php?menu=hispana_call_types&id={$value['id']}&id_campania={$value['id_campania']}&action=view_edit>Editar</a>";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例3: report_adress_book
function report_adress_book($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2, $arrLang, $arrConf, $dsn_agi_manager, $dsnAsterisk)
{
$padress_book = new paloAdressBook($pDB);
$arrBooker = $padress_book->getBookerList();
$arrPayment_type = array(0 => 'Khách lẻ không thường xuyên', 1 => 'Khách lẻ thường xuyên', 2 => 'Khách hàng công ty', 3 => 'Khách hàng đại lý');
$arrComboElements = array("customer_code" => "Mã khách hàng", "firstname" => "Tên khách hàng", "phone" => "Số điện thoại", "email" => "Email", "agent_id" => "Booker", "sale" => "Kinh Doanh", "booker" => "Kế Toán", "type" => "Loại khách hàng");
$arrFormElements = array("field" => array("LABEL" => "Tìm theo", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrComboElements, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), "pattern" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "TEXT", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => "", "INPUT_EXTRA_PARAM" => array('id' => 'filter_value')), "booker" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrBooker, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), "payment" => array("LABEL" => "", "REQUIRED" => "no", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arrPayment_type, "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""));
$oFilterForm = new paloForm($smarty, $arrFormElements);
$smarty->assign("SHOW", "Tìm");
$smarty->assign("module_name", $module_name);
$field = NULL;
$pattern = NULL;
$namePattern = NULL;
if (isset($_POST['field']) and isset($_POST['pattern']) and $_POST['pattern'] != "") {
$field = $_POST['field'];
$pattern = "%" . trim($_POST['pattern']) . "%";
$namePattern = trim($_POST['pattern']);
//$nameField=$arrComboElements[$field];
//$agent_id = $_POST['booker'];
//$payment_type = $_POST['booker'];
}
$arrFilter = array("field" => $field, "pattern" => $namePattern);
$startDate = $endDate = date("Y-m-d H:i:s");
$oGrid = new paloSantoGrid($smarty);
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export("HNH_KhachHang");
$oGrid->addFilterControl(_tr("Filter applied ") . $field . " = {$namePattern}", $arrFilter, array("field" => "name", "pattern" => ""));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter_adress_book.tpl", "", $arrFilter);
$total = $padress_book->getAddressBook(NULL, NULL, $field, $pattern, TRUE);
$total_datos = $total[0]["total"];
//Paginacion
if ($oGrid->isExportAction()) {
$total = $total_datos;
$limit = $total;
$arr_cols = array(0 => array("name" => "Mã KH", "property1" => ""), 1 => array("name" => "Tên khách hàng", "property1" => ""), 2 => array("name" => "Họ/Hình thức", "property1" => ""), 3 => array("name" => "Điện thoại/Liên hệ", "property1" => ""), 4 => array("name" => "Email/Liên hệ", "property1" => ""), 5 => array("name" => "Booker", "property1" => ""), 6 => array("name" => "Kinh doanh", "property1" => ""), 7 => array("name" => "Kế toán", "property1" => ""), 8 => array("name" => "Phân loại", "property1" => ""), 9 => array("name" => "Thẻ thành viên", "property1" => ""), 10 => array("name" => "Cách thanh toán", "property1" => ""));
} else {
$limit = 20;
$total = $total_datos;
$arr_cols = array(0 => array("name" => "", "property1" => ""), 1 => array("name" => "Mã KH", "property1" => ""), 2 => array("name" => "Tên khách hàng", "property1" => ""), 3 => array("name" => "Họ/Hình thức", "property1" => ""), 4 => array("name" => "Điện thoại/Liên hệ", "property1" => ""), 5 => array("name" => "Email/Liên hệ", "property1" => ""), 6 => array("name" => "Booker", "property1" => ""), 7 => array("name" => "Kinh doanh", "property1" => ""), 8 => array("name" => "Kế toán", "property1" => ""), 9 => array("name" => "Phân loại", "property1" => ""), 10 => array("name" => "Thẻ thành viên", "property1" => ""), 11 => array("name" => "Cách thanh toán", "property1" => ""), 12 => array("name" => "Lựa chọn", "property1" => ""));
}
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$inicio = $total == 0 ? 0 : $offset + 1;
$end = $offset + $limit <= $total ? $offset + $limit : $total;
//Fin Paginacion
$arrResult = $padress_book->getAddressBook($limit, $offset, $field, $pattern, FALSE);
//var_dump($arrResult);die;
$arrData = null;
//echo print_r($arrResult,true);
if (is_array($arrResult) && $total > 0) {
if ($oGrid->isExportAction()) {
foreach ($arrResult as $key => $adress_book) {
$typeContact = "";
switch ($adress_book['type']) {
case '0':
$typeContact = "Khách hàng lẽ";
break;
case '1':
$typeContact = "Khách lẽ thường xuyên";
break;
case '2':
$typeContact = 'Khách hàng công ty';
break;
case '3':
$typeContact = "Khách hàng đại lý";
break;
default:
break;
}
$phone_list = '';
if (isset($adress_book['number']) && count($adress_book['number']) > 0) {
foreach ($adress_book['number'] as $phone) {
$phone_list .= is_null($phone) || trim($phone) == '' ? '' : $phone . '\\n';
}
}
//SDT column
$email_list = '';
if (count($adress_book['email']) > 0) {
foreach ($adress_book['email'] as $email) {
$email_list .= is_null($email) || trim($email) == '' ? '' : $email . '\\n';
}
}
$arrTmp[] = $adress_book['customer_code'];
//Ten column
$arrTmp[] = $adress_book['firstname'];
//Ten column
$arrTmp[] = $adress_book['lastname'];
//Ten column
$arrTmp[] = $phone_list;
$arrTmp[] = $email_list;
$arrTmp[] = $adress_book['booker'];
$arrTmp[] = $adress_book['sale'];
$arrTmp[] = $adress_book['accountant'];
$arrTmp[] = $typeContact;
$arrTmp[] = $adress_book['membership'];
$arrTmp[] = $adress_book['payment'];
$arrData[] = $arrTmp;
}
//.........这里部分代码省略.........
示例4: reportReportedeCalltypes
function reportReportedeCalltypes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pReportedeCalltypes = new paloSantoReportedeCalltypes($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
$id_campania = getParameter("id_campania");
$filter_field_adicional = getParameter("adicionales");
$filter_value_adicional = getParameter("filtro_adicional");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte Ultima Gestion Recargables"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte Ultima Gestion Recargables"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value, "id_campania" => $id_campania, "adicionales" => $filter_field_adicional, "filtro_adicional" => $filter_value_adicional);
$oGrid->setURL($url);
// Columnas base
$arrColumns = array(_tr("Fecha"), _tr("Hora"), _tr("Campaña"), _tr("Base"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Contactabilidad"), _tr("Calltype"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo Personal"), _tr("Correo Trabajo"), _tr("Estado Civil"), _tr("Formulario"));
// Otras columnas
if ($id_campania != "") {
// Columnas adicionales
$arrColumnasAdicionales = $pReportedeCalltypes->getColumnasAdicionales($id_campania);
$arrColumns = array_merge($arrColumns, $arrColumnasAdicionales);
$smarty->assign("mostrarAdicional", "si");
$smarty->assign("filtro_adicionales", filter_adicionales($arrColumnasAdicionales, null));
// Columnas de gestión
$arrTmp = $pReportedeCalltypes->getFormFields($id_campania);
$i = 0;
foreach ($arrTmp as $formField) {
$arrOrden[] = $formField['id'];
$arrColumnsAdicionales[$i] = $formField['etiqueta'];
$i++;
}
$arrColumns = array_merge($arrColumns, $arrColumnsAdicionales);
}
$oGrid->setColumns($arrColumns);
$total = $pReportedeCalltypes->getNumReportedeCalltypes($filter_field, $filter_value, $id_campania, $filter_field_adicional, $filter_value_adicional);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
// default 20
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pReportedeCalltypes->getReportedeCalltypes($limit, $offset, $filter_field, $filter_value, $id_campania, $filter_field_adicional, $filter_value_adicional);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$fecha = date("Y-m-d", strtotime($value['fecha']));
$hora = date("H:i:s", strtotime($value['fecha']));
$arrTmp[0] = $fecha;
$arrTmp[1] = $hora;
$arrTmp[2] = $value['campania'];
$arrTmp[3] = $value['base'];
$arrTmp[4] = $value['cliente'];
$arrTmp[5] = $value['ci'];
$arrTmp[6] = $value['telefono'];
$arrTmp[7] = $value['agente'];
$arrTmp[8] = $value['contactabilidad'];
$arrTmp[9] = $value['calltype'];
$arrTmp[10] = $value['provincia'];
$arrTmp[11] = $value['ciudad'];
$arrTmp[12] = $value['nacimiento'];
$arrTmp[13] = $value['correo_personal'];
$arrTmp[14] = $value['correo_trabajo'];
$arrTmp[15] = $value['estado_civil'];
// $arrTmp[8] = $value['formulario'];
// Así lo requiere RUBENING
$arrTmp[16] = "<a href=modules/{$module_name}/gestion_info.php?id_gestion={$value['id_gestion']} target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400'); return false;\">Ver gestión</a>" . "<br>" . "<a href=modules/{$module_name}/gestion_edit.php?id_gestion={$value['id_gestion']}&user=" . $_SESSION["elastix_user"] . " target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=600,height=400,scrollbars=1'); return false;\">Editar</a>";
// Datos adicionales
$arrDatosAdicionales = $pReportedeCalltypes->getDatosAdicionales($value['id_cliente'], $value['id_base']);
$i = 17;
foreach ($arrColumnasAdicionales as $k => $columnaAdicional) {
$arrTmp[$i] = $arrDatosAdicionales[$columnaAdicional];
$i++;
}
unset($arrDatosAdicionales);
$numColumnasFijas = $i;
// Datos de gestión
$arrFormValues = $pReportedeCalltypes->getFormValues($value['id_gestion']);
// array_search retorna el key dado el valor a buscar
foreach ($arrFormValues as $formValue) {
// echo $formValue['valor'] . " " . array_search($formValue['id_form_field'],$arrOrden) . "<br>";
$ubicacionReal = array_search($formValue['id_form_field'], $arrOrden) + $numColumnasFijas;
if (is_array($formValue['valor'])) {
$formValue['valor'] = print_r($formValue['valor'], true);
}
$arrTmp[$ubicacionReal] = $formValue['valor'];
}
$arrData[] = $arrTmp;
unset($arrTmp);
}
}
//.........这里部分代码省略.........
示例5: _moduleContent
//.........这里部分代码省略.........
if ($sExtension != '') {
$paramFiltro['extension'] = $sExtension;
}
// Ejecutar el borrado, si se ha validado.
if (isset($_POST['delete'])) {
if ($isAdministrator) {
if ($paramFiltro['date_start'] <= $paramFiltro['date_end']) {
$r = $oCDR->borrarCDRs($paramFiltro);
if (!$r) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oCDR->errMsg));
}
} else {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Please End Date must be greater than Start Date")));
}
} else {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => _tr("Only administrators can delete CDRs")));
}
}
$oGrid->setTitle(_tr("CDR Report"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("CDRReport"));
$oGrid->setURL($url);
//if($isAdministrator)
//$oGrid->deleteList("Are you sure you wish to delete CDR(s) Report(s)?","delete",_tr("Delete"));
$arrData = null;
if (!isset($sExtension) || $sExtension == "" && !$isAdministrator) {
$total = 0;
} else {
$total = $oCDR->contarCDRs($paramFiltro);
}
if ($oGrid->isExportAction()) {
$limit = $total;
$offset = 0;
$arrColumns = array(_tr("Date"), _tr("Source"), _tr("Ring Group"), _tr("Destination"), _tr("Src. Channel"), _tr("Account Code"), _tr("Dst. Channel"), _tr("Status"), _tr("Duration"));
$oGrid->setColumns($arrColumns);
$arrResult = $oCDR->listarCDRs($paramFiltro, $limit, $offset);
if (is_array($arrResult['cdrs']) && $total > 0) {
foreach ($arrResult['cdrs'] as $key => $value) {
$arrTmp[0] = date("d-m-Y H:i:s", strtotime($value[0]));
$arrTmp[1] = $value[1];
$arrTmp[2] = $value[11];
$arrTmp[3] = $value[3];
$arrTmp[4] = $value[9];
$arrTmp[5] = $value[5];
$iDuracion = $value[8];
$iSec = $iDuracion % 60;
$iDuracion = (int) (($iDuracion - $iSec) / 60);
$iMin = $iDuracion % 60;
$iDuracion = (int) (($iDuracion - $iMin) / 60);
$sTiempo = "{$value[6]}s";
if ($value[6] >= 60) {
if ($iDuracion > 0) {
$sTiempo .= " ({$iDuracion}h {$iMin}m {$iSec}s)";
} elseif ($iMin > 0) {
$sTiempo .= " ({$iMin}m {$iSec}s)";
}
}
$arrTmp[7] = $sTiempo;
$arrData[] = $arrTmp;
}
}
if (!is_array($arrResult)) {
$smarty->assign(array('mb_title' => _tr('ERROR'), 'mb_message' => $oCDR->errMsg));
示例6: reportReportsBreak
function reportReportsBreak($smarty, $module_name, $local_templates_dir, &$pDB)
{
// Obtener rango de fechas de consulta. Si no existe, se asume día de hoy
$sFechaInicio = date('d M Y');
if (isset($_GET['txt_fecha_init'])) {
$sFechaInicio = $_GET['txt_fecha_init'];
}
if (isset($_POST['txt_fecha_init'])) {
$sFechaInicio = $_POST['txt_fecha_init'];
}
$sFechaFinal = date('d M Y');
if (isset($_GET['txt_fecha_end'])) {
$sFechaFinal = $_GET['txt_fecha_end'];
}
if (isset($_POST['txt_fecha_end'])) {
$sFechaFinal = $_POST['txt_fecha_end'];
}
$arrFilterExtraVars = array("txt_fecha_init" => $sFechaInicio, "txt_fecha_end" => $sFechaFinal);
$arrFormElements = createFieldFilter();
$oFilterForm = new paloForm($smarty, $arrFormElements);
// Validación de las fechas recogidas
if (!$oFilterForm->validateForm($arrFilterExtraVars)) {
$smarty->assign("mb_title", _tr("Validation Error"));
$arrErrores = $oFilterForm->arrErroresValidacion;
$strErrorMsg = '<b>' . _tr('The following fields contain errors') . '</b><br/>';
foreach ($arrErrores as $k => $v) {
$strErrorMsg .= "{$k}, ";
}
$smarty->assign("mb_message", $strErrorMsg);
$arrFilterExtraVars = array("txt_fecha_init" => date('d M Y'), "txt_fecha_end" => date('d M Y'));
}
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $arrFilterExtraVars);
// Obtener fechas en formato yyyy-mm-dd
$sFechaInicio = translateDate($arrFilterExtraVars['txt_fecha_init']);
$sFechaFinal = translateDate($arrFilterExtraVars['txt_fecha_end']);
$oReportsBreak = new paloSantoReportsBreak($pDB);
//begin grid parameters
$bElastixNuevo = method_exists('paloSantoGrid', 'setURL');
$oGrid = new paloSantoGrid($smarty);
$oGrid->enableExport();
// enable export.
$oGrid->showFilter($htmlFilter);
$arrColumnas = array(_tr('Agent Number'), _tr('Agent Name'));
$bExportando = $bElastixNuevo ? $oGrid->isExportAction() : isset($_GET['exportcsv']) && $_GET['exportcsv'] == 'yes' || isset($_GET['exportspreadsheet']) && $_GET['exportspreadsheet'] == 'yes' || isset($_GET['exportpdf']) && $_GET['exportpdf'] == 'yes';
$datosBreaks = $oReportsBreak->getReportesBreak($sFechaInicio, $sFechaFinal);
$mapa = array();
// Columna del break dado su ID
$sTagInicio = !$bExportando ? '<b>' : '';
$sTagFinal = $sTagInicio != '' ? '</b>' : '';
$filaTotales = array($sTagInicio . _tr('Total') . $sTagFinal, '');
foreach ($datosBreaks['breaks'] as $idBreak => $sNombreBreak) {
$mapa[$idBreak] = count($arrColumnas);
$arrColumnas[] = $sNombreBreak;
$filaTotales[] = 0;
// Total de segundos usado por todos los agentes en este break
}
$mapa['TOTAL'] = count($arrColumnas);
$filaTotales[] = 0;
// Total de segundos usado por todos los agentes en todos los breaks
$arrColumnas[] = _tr('Total');
$arrData = array();
foreach ($datosBreaks['reporte'] as $infoAgente) {
$filaAgente = array($infoAgente['numero_agente'], $infoAgente['nombre_agente']);
$iTotalAgente = 0;
// Total de segundos usados por agente en breaks
// Valor inicial de todos los breaks es 0 segundos
foreach (array_keys($datosBreaks['breaks']) as $idBreak) {
$filaAgente[$mapa[$idBreak]] = '00:00:00';
}
// Asignar duración del break para este agente y break
foreach ($infoAgente['breaks'] as $tuplaBreak) {
$sTagInicio = !$bExportando && $tuplaBreak['duracion'] > 0 ? '<font color="green">' : '';
$sTagFinal = $sTagInicio != '' ? '</font>' : '';
$filaAgente[$mapa[$tuplaBreak['id_break']]] = $sTagInicio . formatoSegundos($tuplaBreak['duracion']) . $sTagFinal;
$iTotalAgente += $tuplaBreak['duracion'];
$filaTotales[$mapa[$tuplaBreak['id_break']]] += $tuplaBreak['duracion'];
$filaTotales[$mapa['TOTAL']] += $tuplaBreak['duracion'];
}
// Total para todos los breaks de este agente
$filaAgente[$mapa['TOTAL']] = formatoSegundos($iTotalAgente);
$arrData[] = $filaAgente;
}
$sTagInicio = !$bExportando ? '<b>' : '';
$sTagFinal = $sTagInicio != '' ? '</b>' : '';
foreach ($mapa as $iPos) {
$filaTotales[$iPos] = $sTagInicio . formatoSegundos($filaTotales[$iPos]) . $sTagFinal;
}
$arrData[] = $filaTotales;
if ($bElastixNuevo) {
$oGrid->setURL(construirURL($arrFilterExtraVars));
$oGrid->setData($arrData);
$oGrid->setColumns($arrColumnas);
$oGrid->setTitle(_tr("Reports Break"));
$oGrid->pagingShow(false);
$oGrid->setNameFile_Export(_tr("Reports Break"));
$smarty->assign("SHOW", _tr("Show"));
return $oGrid->fetchGrid();
} else {
$url = construirURL($arrFilterExtraVars);
$offset = 0;
//.........这里部分代码省略.........
示例7: reportListadodebases
function reportListadodebases($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pListadodebases = new paloSantoClientesManuales($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Clientes manuales"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Clientes manuales"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("CI"), _tr("Nombre"), _tr("Apellido"), _tr("Provincia"), _tr("Ciudad"), _tr("Nacimiento"), _tr("Correo personal"), _tr("Correo trabajo"), _tr("Estado civil"), _tr("Origen"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pListadodebases->getNumListadodebases($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
//$limit = 20;
$limit = 200;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pListadodebases->getListadodebases($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['ci'];
$arrTmp[1] = $value['nombre'];
$arrTmp[2] = $value['apellido'];
$arrTmp[3] = $value['provincia'];
$arrTmp[4] = $value['ciudad'];
$arrTmp[5] = $value['nacimiento'];
$arrTmp[6] = $value['correo_personal'];
$arrTmp[7] = $value['correo_trabajo'];
$arrTmp[8] = $value['estado_civil'];
$arrTmp[9] = $value['origen'];
$arrTmp[10] = "<a href=index.php?menu={$module_name}&action=agregar&ci={$value['ci']}>Agregar a campaña</a><br><a href='?menu=hispana_clientes_datosbasicos&ci=" . $value['ci'] . "'>Editar</a>";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例8: getParameter
function reportReportedetalladodegestión($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pReportedetallado = new paloSantoReportedetalladodegestión($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte detallado de gestión"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte detallado de gestión"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña"), _tr("Fecha"), _tr("Cliente"), _tr("CI"), _tr("Teléfono"), _tr("Agente"), _tr("Calltype"));
$numColumnasFijas = sizeof($arrColumns);
if (isset($filter_field) && is_numeric($filter_field)) {
// si está seteado el número de campaña, busca los campos del form de dicha campaña
$arrTmp = $pReportedetallado->getFormFields($filter_field);
// _pre($arrTmp);
$i = 0;
foreach ($arrTmp as $formField) {
$arrOrden[] = $formField['id'];
$arrColumnsAdicionales[$i] = $formField['etiqueta'];
$i++;
}
$arrColumns = array_merge($arrColumns, $arrColumnsAdicionales);
}
// _pre($arrOrden);
// _pre($arrColumns);
unset($arrTmp);
$oGrid->setColumns($arrColumns);
$total = $pReportedetallado->getNumReportedetalladodegestion($filter_field);
// $filter_field sólo contien el id de la campaña
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 200;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
// $arrResult =$pReportedetallado->getReportedetalladodegestion($limit, $offset, $filter_field); // $filter_field sólo contien el id de la campaña
$arrResult = $pReportedetallado->getReportedeCalltypes($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['campania'];
$arrTmp[1] = $value['campania'];
$arrTmp[2] = $value['cliente'];
$arrTmp[3] = $value['ci'];
$arrTmp[4] = $value['telefono'];
$arrTmp[5] = $value['agente'];
$arrTmp[6] = $value['mejor_calltype'];
// $arrFormValues = $pReportedetallado->getFormValues($value['id_gestion_campania']);
$arrFormValues = $pReportedetallado->getFormValues($value['id_gestion_mejor_calltype']);
// array_search retorna el key dado el valor a buscar
foreach ($arrFormValues as $formValue) {
// echo $formValue['valor'] . " " . array_search($formValue['id_form_field'],$arrOrden) . "<br>";
$ubicacionReal = array_search($formValue['id_form_field'], $arrOrden) + $numColumnasFijas;
$arrTmp[$ubicacionReal] = $formValue['valor'];
}
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter($pReportedetallado));
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例9: reportOtrosdatos
function reportOtrosdatos($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pOtrosdatos = new paloSantoOtrosdatos($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Datos complementarios"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Datos complementarios"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
switch ($filter_field) {
case "cliente_direccion":
$arrColumns = array(_tr("Descripción"), _tr("Dirección"), _tr("Acción"));
break;
case "cliente_adicional":
$arrColumns = array(_tr("Descripción"), _tr("Dato adicional"), _tr("Acción"));
break;
case "cliente_telefono":
default:
$arrColumns = array(_tr("Descripción"), _tr("Número"), _tr("Acción"));
break;
}
$oGrid->setColumns($arrColumns);
if (!empty($_SESSION["id_campania_cliente_recargable"])) {
$total = $pOtrosdatos->getNumOtrosdatosRecargable($filter_field, $filter_value, $_SESSION['id_campania_cliente_recargable']);
} elseif (!empty($_SESSION['id_cliente'])) {
$total = $pOtrosdatos->getNumOtrosdatosIdCliente($filter_field, $filter_value, $_SESSION['id_cliente']);
} else {
$total = $pOtrosdatos->getNumOtrosdatos($filter_field, $filter_value, $_SESSION['ci']);
}
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
if (!empty($_SESSION["id_campania_cliente_recargable"])) {
$arrResult = $pOtrosdatos->getOtrosdatosRecargable($limit, $offset, $filter_field, $filter_value, $_SESSION["id_campania_cliente_recargable"]);
} elseif (!empty($_SESSION['id_cliente'])) {
$arrResult = $pOtrosdatos->getOtrosdatosIdCliente($limit, $offset, $filter_field, $filter_value, $_SESSION['id_cliente']);
} else {
$arrResult = $pOtrosdatos->getOtrosdatos($limit, $offset, $filter_field, $filter_value, $_SESSION['ci']);
}
//_pre($arrResult);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['descripcion'];
$arrTmp[1] = $value['valor'];
$arrTmp[2] = "<a href=index.php?menu=hispana_clientes_datosotros_reporte&id={$value['id']}&action=delete&filter_field={$filter_field} onclick = \"if (! confirm('¿Realmente desea desactivarlo?')) return false;\">Desactivar</a>";
if ($filter_field == "cliente_adicional") {
// se pueden editar los adicionales del cliente
$arrTmp[2] .= " <a href=index.php?menu=hispana_clientes_datosotros_reporte&id={$value['id']}&action=view_edit&filter_field={$filter_field}>Editar</a>";
}
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例10: reportMonitoring
function reportMonitoring($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = '';
$pMonitoring = new paloSantoMonitoring($pDB);
$pORGZ = new paloSantoOrganization($arrConf['elastix_dsn']["elastix"]);
$pPBX = new paloAsteriskDB($arrConf['elastix_dsn']["elastix"]);
if ($credentials['userlevel'] == 'superadmin') {
$domain = getParameter('organization');
$domain = empty($domain) ? 'all' : $domain;
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$domain = $credentials['domain'];
}
$date_start = getParameter('date_start');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_start)) {
$date_start = date("d M Y");
}
$date_end = getParameter('date_end');
if (!preg_match("/^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}\$/", $date_end)) {
$date_end = date("d M Y");
}
$arrType = array("" => "", "conference" => _tr("Conference"), "group" => _tr("Group"), "queue" => _tr("Queue"), 'incoming' => _tr('Incoming'), 'outgoing' => _tr("Outgoing"));
$type = getParameter("type");
$type = array_key_exists($type, $arrType) ? $type : "";
$source = getParameter("source");
if (isset($source) && $source != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($source);
if ($expression === false) {
$source = '';
}
}
$destination = getParameter("destination");
if (isset($destination) && $destination != '') {
$expression = $pPBX->getRegexPatternFromAsteriskPattern($destination);
if ($expression === false) {
$destination = '';
}
}
$url['menu'] = $module_name;
$url['organization'] = $arrProp['organization'] = $domain;
$url['date_start'] = $arrProp['date_start'] = $date_start;
$url['date_end'] = $arrProp['date_end'] = $date_end;
$url['source'] = $arrProp['source'] = $source;
$url['destination'] = $arrProp['destination'] = $destination;
$url['type'] = $arrProp['type'] = $type;
//permission
$delete = in_array("delete", $arrPermission);
$export = in_array("export", $arrPermission);
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Monitoring"));
$oGrid->setIcon("web/apps/{$module_name}/images/pbx_monitoring.png");
$oGrid->pagingShow(true);
// show paging section.
if ($export) {
$oGrid->enableExport();
}
// enable export.
$oGrid->setNameFile_Export(_tr("Monitoring"));
$oGrid->setURL($url);
if ($delete && !$oGrid->isExportAction()) {
$arrColumns[] = "";
}
if ($credentials['userlevel'] == 'superadmin') {
$arrColumns[] = _tr('organization');
}
$arrColumns[] = _tr("Date");
$arrColumns[] = _tr("Time");
$arrColumns[] = _tr("Source");
$arrColumns[] = _tr("Destination");
$arrColumns[] = _tr("Duration");
$arrColumns[] = _tr("Type");
$arrColumns[] = _tr("File");
if (!$oGrid->isExportAction()) {
$arrColumns[] = "";
//to display audio
}
$oGrid->setColumns($arrColumns);
$totalMonitoring = $pMonitoring->getNumMonitoring($arrProp);
if ($totalMonitoring === false) {
$error = _tr('Recordings could not be retrieved.') . " " . "DATABASE ERROR";
$totalMonitoring = 0;
}
$arrData = array();
$arrResult = array();
if ($totalMonitoring != 0) {
if ($oGrid->isExportAction()) {
$arrResult = $pMonitoring->getMonitoring($arrProp);
} else {
$limit = 20;
$total = $totalMonitoring;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$arrProp['limit'] = $limit;
//.........这里部分代码省略.........
示例11: reportMonitoring
function reportMonitoring($smarty, $module_name, $local_templates_dir, &$pDB, $pACL, $arrConf, $user, $extension, $esAdministrador)
{
$pMonitoring = new paloSantoMonitoring($pDB);
//var_dump($arrConfg);
$pMonitoring->setConfig($arrConf);
$filter_field = getParameter("filter_field");
switch ($filter_field) {
case "dst":
$filter_field = "dst";
$nameFilterField = _tr("Destination");
break;
case "userfield":
$filter_field = "userfield";
$nameFilterField = _tr("Type");
break;
default:
$filter_field = "src";
$nameFilterField = _tr("Source");
break;
}
if ($filter_field == "userfield") {
$filter_value = getParameter("filter_value_userfield");
$filter = "";
$filter_userfield = $filter_value;
} else {
$filter_value = getParameter("filter_value");
$filter = $filter_value;
$filter_userfield = "";
}
switch ($filter_value) {
case "outgoing":
$smarty->assign("SELECTED_2", "Selected");
$nameFilterUserfield = _tr("Outgoing");
break;
case "queue":
$smarty->assign("SELECTED_3", "Selected");
$nameFilterUserfield = _tr("Queue");
break;
case "group":
$smarty->assign("SELECTED_4", "Selected");
$nameFilterUserfield = _tr("Group");
break;
default:
$smarty->assign("SELECTED_1", "Selected");
$nameFilterUserfield = _tr("Incoming");
break;
}
$date_ini = getParameter("date_start");
$date_end = getParameter("date_end");
$path_record = $arrConf['records_dir'];
$_POST['date_start'] = isset($date_ini) ? $date_ini : date("d M Y");
$_POST['date_end'] = isset($date_end) ? $date_end : date("d M Y");
if ($date_ini === "") {
$_POST['date_start'] = " ";
}
if ($date_end === "") {
$_POST['date_end'] = " ";
}
if (!empty($pACL->errMsg)) {
echo "ERROR DE ACL: {$pACL->errMsg} <br>";
}
$date_initial = date('Y-m-d', strtotime($_POST['date_start'])) . " 00:00:00";
$date_final = date('Y-m-d', strtotime($_POST['date_end'])) . " 23:59:59";
$_DATA = $_POST;
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Monitoring"));
$oGrid->setIcon("modules/{$module_name}/images/pbx_monitoring.png");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Monitoring"));
if ($esAdministrador) {
$totalMonitoring = $pMonitoring->getNumMonitoring($filter_field, $filter_value, null, $date_initial, $date_final);
} elseif (!($extension == "" || is_null($extension))) {
$totalMonitoring = $pMonitoring->getNumMonitoring($filter_field, $filter_value, $extension, $date_initial, $date_final);
} else {
$totalMonitoring = 0;
}
$url = array('menu' => $module_name);
$paramFilter = array('filter_field' => $filter_field, 'filter_value' => $filter, 'filter_value_userfield' => $filter_userfield, 'date_start' => $_POST['date_start'], 'date_end' => $_POST['date_end']);
$url = array_merge($url, $paramFilter);
$oGrid->setURL($url);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $totalMonitoring;
$offset = 0;
$arrColumns = array(_tr("Date"), _tr("Time"), _tr("Source"), _tr("Destination"), _tr("Duration"), _tr("Type"), _tr("File"));
$oGrid->setColumns($arrColumns);
if ($esAdministrador) {
$arrResult = $pMonitoring->getMonitoring($limit, $offset, $filter_field, $filter_value, null, $date_initial, $date_final);
} elseif (!($extension == "" || is_null($extension))) {
$arrResult = $pMonitoring->getMonitoring($limit, $offset, $filter_field, $filter_value, $extension, $date_initial, $date_final);
} else {
$arrResult = array();
}
if (is_array($arrResult) && $totalMonitoring > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = date('d M Y', strtotime($value['calldate']));
//.........这里部分代码省略.........
示例12: report_CashCollection
function report_CashCollection($smarty, $module_name, $local_templates_dir, &$pDB, $pDB_2)
{
$pCashCollection = new Cash_Collection($pDB);
$pACL = new paloACL($pDB_2);
// get filter parameters
$filter = array('date_start' => trim($_POST['date_start']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_start'])), 'date_end' => trim($_POST['date_end']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_end'])), 'customer_name' => trim($_POST['customer_name']), 'customer_phone' => trim($_POST['customer_number']), 'ticket_code' => trim($_POST['ticket_code']), 'status' => trim($_POST['status']));
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle("Thu tiền giao vé");
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export("Cash_Collection");
$url = array("menu" => $module_name);
$oGrid->setURL($url);
$arrColumns = array("ID", "Tên Khách Hàng", "Số điện thoại", "Ngày mua vé", "Booker", "Địa chỉ", "Tiền trả", "Mã số vé", "Tình trạng", "Nhân viên giao", "Ngày phân công", "Nhân viên nhận tiền", "Ngày nhận tiền", " ");
$oGrid->setColumns($arrColumns);
$total = $pCashCollection->getNumCash_Collection($filter);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pCashCollection->getCash_Collection($limit, $offset, $filter);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$ticket = '';
$name = $pACL->getUsers($value['accounting_id']);
$elastix_user = is_null($value['accounting_id']) ? '(Chưa nhận)' : $name[0][1];
foreach ($value['ticket_code'] as $row) {
$ticket .= $row . '<br>';
}
$arrTmp[0] = $value['id'];
$arrTmp[1] = $value['customer_name'];
$arrTmp[2] = $value['customer_phone'];
$arrTmp[3] = is_null($value['purchase_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['purchase_date']));
$arrTmp[4] = $value['agent_name'];
$arrTmp[5] = '<a href="javascript:void(1)" onclick="alert(\'' . $value['deliver_address'] . '\')">Xem</a>';
$arrTmp[6] = $value['pay_amount'];
$arrTmp[7] = $ticket;
$arrTmp[8] = showStatus($value['status']);
$arrTmp[9] = $value['delivery_name'];
$arrTmp[10] = is_null($value['delivery_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['delivery_date']));
$arrTmp[11] = $elastix_user;
$arrTmp[12] = is_null($value['collection_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['collection_date']));
$arrTmp[13] = $value['status'] == 'Đang giao' ? '<a href="javascript:void(1)" onclick="collect_form(\'' . $value['id'] . '\')">Nhận tiền</a>' : '';
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
// get delivery man list
$delivery_man_list = $pCashCollection->getDeliveryMan();
$smarty->assign("DELIVERY_MAN_LIST", $delivery_man_list);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例13: reportReporteEfectividad
function reportReporteEfectividad($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
$pReporteEfectividad = new paloSantoReporteEfectividad($pDB);
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Reporte de efectividad"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Reporte de efectividad"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$oGrid->setURL($url);
$arrColumns = array(_tr("Campaña"), _tr("Acción"));
$oGrid->setColumns($arrColumns);
$total = $pReporteEfectividad->getNumReporteEfectividad($filter_field, $filter_value);
$arrData = null;
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
} else {
$limit = 20;
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
}
$arrResult = $pReporteEfectividad->getReporteEfectividad($limit, $offset, $filter_field, $filter_value);
if (is_array($arrResult) && $total > 0) {
foreach ($arrResult as $key => $value) {
$arrTmp[0] = $value['nombre'];
$arrTmp[1] = "<a href=index.php?menu={$module_name}&id={$value['id']}&action=efectividad>Ver reporte de efectividad</a>";
$arrData[] = $arrTmp;
}
}
$oGrid->setData($arrData);
//begin section filter
$oFilterForm = new paloForm($smarty, createFieldFilter());
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}
示例14: listadoLoginLogout
function listadoLoginLogout($pDB, $smarty, $module_name, $local_templates_dir)
{
$oCalls = new paloSantoLoginLogout($pDB);
$smarty->assign(array('SHOW' => _tr('Show'), 'Filter' => _tr('Find')));
$arrFormElements = array('date_start' => array('LABEL' => _tr('Date Init'), 'REQUIRED' => 'yes', 'INPUT_TYPE' => 'DATE', 'INPUT_EXTRA_PARAM' => '', 'VALIDATION_TYPE' => 'ereg', 'VALIDATION_EXTRA_PARAM' => '^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}$'), 'date_end' => array('LABEL' => _tr('Date End'), 'REQUIRED' => 'yes', 'INPUT_TYPE' => 'DATE', 'INPUT_EXTRA_PARAM' => '', 'VALIDATION_TYPE' => 'ereg', 'VALIDATION_EXTRA_PARAM' => '^[[:digit:]]{1,2}[[:space:]]+[[:alnum:]]{3}[[:space:]]+[[:digit:]]{4}$'), 'detailtype' => array('LABEL' => _tr('Tipo'), 'REQUIRED' => 'no', 'INPUT_TYPE' => 'SELECT', 'INPUT_EXTRA_PARAM' => array('D' => _tr('Detallado'), 'G' => _tr('General')), 'VALIDATION_TYPE' => 'text', 'VALIDATION_EXTRA_PARAM' => ''), 'queue' => array('LABEL' => _tr('Incoming Queue'), 'REQUIRED' => 'no', 'INPUT_TYPE' => 'SELECT', 'INPUT_EXTRA_PARAM' => generarComboColasEntrantes($oCalls), 'VALIDATION_TYPE' => 'text', 'VALIDATION_EXTRA_PARAM' => '^\\d+$'));
$oFilterForm = new paloForm($smarty, $arrFormElements);
// Parámetros base y validación de parámetros
$url = array('menu' => $module_name);
$paramFiltroBase = $paramFiltro = array('date_start' => date('d M Y'), 'date_end' => date('d M Y'), 'detailtype' => 'D', 'queue' => '');
foreach (array_keys($paramFiltro) as $k) {
if (!is_null(getParameter($k))) {
$paramFiltro[$k] = getParameter($k);
}
}
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $paramFiltro);
if (!$oFilterForm->validateForm($paramFiltro)) {
$smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
$paramFiltro = $paramFiltroBase;
}
// Tradudir fechas a formato ISO para comparación y para API de CDRs.
$url = array_merge($url, $paramFiltro);
$paramFiltro['date_start'] = translateDate($paramFiltro['date_start']) . ' 00:00:00';
$paramFiltro['date_end'] = translateDate($paramFiltro['date_end']) . ' 23:59:59';
// Consulta y recorte de registros
$recordset = $oCalls->leerRegistrosLoginLogout($paramFiltro['detailtype'], $paramFiltro['date_start'], $paramFiltro['date_end'], trim($paramFiltro['queue']) == '' ? NULL : $paramFiltro['queue']);
if (!is_array($recordset)) {
$smarty->assign(array('mb_title' => _tr('Query Error'), 'mb_message' => $oCalls->errMsg));
$recordset = array();
}
$oGrid = new paloSantoGrid($smarty);
$bExportando = $oGrid->isExportAction();
$oGrid->setLimit(LIMITE_PAGINA);
$oGrid->setTotal(count($recordset));
$offset = $oGrid->calculateOffset();
// Formato del arreglo de datos a mostrar
$arrData = array();
$sTagInicio = !$bExportando ? '<b>' : '';
$sTagFinal = $sTagInicio != '' ? '</b>' : '';
$recordSlice = $bExportando ? $recordset : array_slice($recordset, $offset, LIMITE_PAGINA);
foreach ($recordSlice as $tupla) {
$arrData[] = array($tupla['number'], $tupla['name'], $tupla['datetime_init'], $tupla['estado'] == 'ONLINE' ? $sTagInicio . $tupla['datetime_end'] . $sTagFinal : $tupla['datetime_end'], format_time($tupla['duration']), format_time($tupla['total_incoming']), format_time($tupla['total_outgoing']), format_time($tupla['total_incoming'] + $tupla['total_outgoing']), number_format(100.0 * ($tupla['duration'] <= 0 ? 0 : ($tupla['total_incoming'] + $tupla['total_outgoing']) / $tupla['duration']), 2), _tr($tupla['estado']));
}
// Calcular totales de pie de página
$ktotales = array('duration', 'total_incoming', 'total_outgoing');
$totales = array_combine($ktotales, array_fill(0, count($ktotales), 0));
foreach ($recordset as $tupla) {
foreach ($ktotales as $k) {
$totales[$k] += $tupla[$k];
}
}
$arrData[] = array($sTagInicio . _tr('Total') . $sTagFinal, '', '', '', $sTagInicio . format_time($totales['duration']) . $sTagFinal, $sTagInicio . format_time($totales['total_incoming']) . $sTagFinal, $sTagInicio . format_time($totales['total_outgoing']) . $sTagFinal, $sTagInicio . format_time($totales['total_incoming'] + $totales['total_outgoing']) . $sTagFinal, '', '');
$oGrid->enableExport();
$oGrid->setURL($url);
$oGrid->setData($arrData);
$arrColumnas = array(_tr('Agente'), _tr('Nombre'), _tr('Date Init'), _tr('Date End'), _tr('Total Login'), _tr('Llamadas entrantes'), _tr('Llamadas salientes'), _tr('Tiempo en Llamadas'), _tr('Service(%)'), _tr('Estado'));
$oGrid->setColumns($arrColumnas);
$oGrid->setTitle(_tr('Login Logout'));
$oGrid->pagingShow(true);
$oGrid->setNameFile_Export(_tr('Login Logout'));
$oGrid->showFilter($htmlFilter);
return $oGrid->fetchGrid();
}
示例15: reportMissedCalls
function reportMissedCalls($smarty, $module_name, $local_templates_dir, &$pDB, &$pDBACL, $pACL, $arrConf)
{
ini_set('max_execution_time', 3600);
$pCallingReport = new paloSantoMissedCalls($pDB);
$oFilterForm = new paloForm($smarty, createFieldFilter());
$filter_field = getParameter("filter_field");
$filter_value = getParameter("filter_value");
$date_start = getParameter("date_start");
$date_end = getParameter("date_end");
//begin grid parameters
$oGrid = new paloSantoGrid($smarty);
$oGrid->setTitle(_tr("Missed Calls"));
$oGrid->pagingShow(true);
// show paging section.
$oGrid->enableExport();
// enable export.
$oGrid->setNameFile_Export(_tr("Missed Calls"));
$url = array("menu" => $module_name, "filter_field" => $filter_field, "filter_value" => $filter_value);
$date_start = isset($date_start) ? $date_start : date("d M Y") . ' 00:00';
$date_end = isset($date_end) ? $date_end : date("d M Y") . ' 23:59';
$_POST['date_start'] = $date_start;
$_POST['date_end'] = $date_end;
$parmFilter = array("date_start" => $date_start, "date_end" => $date_end);
if (!$oFilterForm->validateForm($parmFilter)) {
$smarty->assign(array('mb_title' => _tr('Validation Error'), 'mb_message' => '<b>' . _tr('The following fields contain errors') . ':</b><br/>' . implode(', ', array_keys($oFilterForm->arrErroresValidacion))));
$date_start = date("d M Y") . ' 00:00';
$date_end = date("d M Y") . ' 23:59';
}
$url = array_merge($url, array('date_start' => $date_start, 'date_end' => $date_end));
$oGrid->setURL($url);
$arrColumns = array(_tr("Date"), _tr("Source"), _tr("Destination"), _tr("Time since last call"), _tr("Number of attempts"), _tr("Status"));
$oGrid->setColumns($arrColumns);
$arrData = null;
$date_start_format = date('Y-m-d H:i:s', strtotime($date_start . ":00"));
$date_end_format = date('Y-m-d H:i:s', strtotime($date_end . ":59"));
// Para usuarios que no son administradores, se restringe a los CDR de la
// propia extensión
$sExtension = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']) ? '' : $pACL->getUserExtension($_SESSION['elastix_user']);
$total = $pCallingReport->getNumCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
if ($oGrid->isExportAction()) {
$limit = $total;
// max number of rows.
$offset = 0;
// since the start.
$arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
$arrData = $pCallingReport->showDataReport($arrResult, $total);
$size = count($arrData);
$oGrid->setData($arrData);
} else {
$limit = 20;
$oGrid->setLimit($limit);
$arrResult = $pCallingReport->getCallingReport($date_start_format, $date_end_format, $filter_field, $filter_value, $sExtension);
$arrData = $pCallingReport->showDataReport($arrResult, $total);
if ($pCallingReport->errMsg != '') {
$smarty->assign('mb_message', $pCallingReport->errMsg);
}
//recalculando el total para la paginación
$size = count($arrData);
$oGrid->setTotal($size);
$offset = $oGrid->calculateOffset();
//echo $size." : ".$offset;
$arrResult = $pCallingReport->getDataByPagination($arrData, $limit, $offset);
$oGrid->setData($arrResult);
}
//begin section filter
$smarty->assign("SHOW", _tr("Show"));
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
//end section filter
$oGrid->showFilter(trim($htmlFilter));
$content = $oGrid->fetchGrid();
//end grid parameters
return $content;
}