#include "fivewin.ch"
REQUEST DBFCDX
REQUEST DBFFPT
static nStartTime, nDuration
FUNCTION CONTA_TELEFONATE()
LOCAL cAmIni := SUBSTR( DTOS( DATE() ) , 1 , 6 )
LOCAL cAmFin := SUBSTR( DTOS( DATE() ) , 1 , 6 )
LOCAL aLista := {}
LOCAL cChiamante := SPACE( 30 )
LOCAL cChiamato := SPACE( 30 )
LOCAL cDbf
LOCAL oExcel , oAs
local nMatches := 0
/*
local aFields := { { "EVENT", "C", 20, 0 },;
{ "TIME", "N", 14, 0 },;
{ "DATE", "C", 20, 0 },;
{ "REF", "C", 50, 0 },;
{ "DIR", "C", 5, 0 },;
{ "SRC_IF", "C", 20, 0 },;
{ "DST_IF", "C", 20, 0 },;
{ "SRC_CGPN", "C", 20, 0 },;
{ "SRC_CDPN", "C", 20, 0 },;
{ "SRC_NAME", "C", 30, 0 },;
{ "DST_CGPN", "C", 20, 0 },;
{ "DST_CDPN", "C", 20, 0 },;
{ "SRC_REG_NA", "C", 20, 0 },;
{ "BCAPS", "C", 20, 0 },;
{ "CAUSE", "C", 20, 0 },;
{ "XCODER", "C", 20, 0 },;
{ "RCODER", "C", 20, 0 },;
{ "XSTATS", "C", 20, 0 },;
{ "RSTATS", "C", 20, 0 },;
{ "ALERT_TIME", "N", 14, 0 },;
{ "CONNECT_TI", "N", 14, 0 },;
{ "DISC_TIME", "N", 14, 0 },;
{ "SRV_ID", "C", 20, 0 },;
{ "SECONDI", "N", 10, 0 },;
{ "DURATA", "C", 30, 0 },;
{ "TCOSTOUNI", "N", 10, 0 },;
{ "TCOSTOSEC", "N", 10, 0 },;
{ "TSEC", "N", 10, 0 },;
{ "DO", "C", 20, 0 },;
{ "TARIFFA", "C", 3, 0 },;
{ "COSTO", "N", 14, 5 },;
{ "COSTO2", "N", 14, 5 },;
{ "UTEMODI", "C", 3, 0 },;
{ "DATMODI", "C", 14, 0 } }
DbCreate( "myfile.dbf", aFields, "DBFCDX" )
*/
cChiamante := "351573******" //ALLTRIM( cChiamante )
cChiamato := ALLTRIM( cChiamato )
nInizio := SECONDS()
// use ( "s:\datamarco\myfile.dbf" ) new
// index on field->src_cgpn tag myidx
// USE
? "weiter"
nStartTime := SECONDS()
use ( "s:\datamarco\myfile.dbf" ) new alias I_OTTO // Öffne die DBF-Datei
// set index to "s:\datamarco\myfile.CDX" // Lade die bestehende Indexdatei
set order to tag myidx // Setze den Index-Tag
dbSeek( cChiamante )
DO WHILE FIELD->src_cgpn = cChiamante .and. .not. EOF()
IF !EMPTY( cChiamante )
nMatches ++
IF AT( cChiamante , FIELD->src_cgpn ) > 0
IF field->dir = "out" .AND. field->secondi > 0 .AND. field->event = "B:Rel"
AADD( aLista , { "IN" , field->src_cgpn , SPACE(20) , field->do , field->secondi, field->dst_cdpn } )
ENDIF
ENDIF
ENDIF
IF !EMPTY( cChiamato )
IF AT( cChiamato , FIELD->src_cdpn ) > 0
IF field->dir = "out" .AND. field->secondi > 0 .AND. field->event = "B:Rel"
AADD( aLista , { "OUT" , SPACE( 20 ) , field->src_cdpn , field->do , field->secondi , field->src_cgpn } )
ENDIF
ENDIF
ENDIF
SKIP
ENDDO
USE
nDuration := (SECONDS() - nStartTime)
xbrowse(aLista, "nDuration: "+str(nDuration) + "nMatches: " + str(nMatches))
RETURN NIL
INIT PROCEDURE PrgInit
SET CENTURY ON
SET EPOCH TO YEAR(DATE())-98
SET DELETED ON
SET EXCLUSIVE OFF
REQUEST HB_Lang_DE
HB_LangSelect("DE")
SET DATE TO GERMAN
rddsetdefault( "DBFCDX" )
EXTERN DESCEND
RETURN