13 $ct[
'etc'][
'table'] =
'fatturati';
29 # if( isset( $_REQUEST[ $ct['etc']['table'] ]['id_cliente'] ) && !empty($_REQUEST[ $ct['etc']['table'] ]['id_cliente'] )) { 30 # $idAgente = mysqlSelectValue( $cf['mysql']['connection'], 'SELECT id_agente FROM anagrafica WHERE id = ?', array( array( 's' => $_REQUEST[ $ct['etc']['table'] ]['id_cliente'] ) ) ); 33 # $ct['etc']['id_cliente'] = mysqlQuery( $cf['mysql']['connection'], 'SELECT id, __label__ FROM anagrafica_clienti_view WHERE id = ?', array( array( 's' => $_REQUEST[ $ct['etc']['table'] ]['id_cliente'] ) ) ); 36 $ct[
'etc'][
'id_cliente'] =
mysqlQuery(
$cf[
'mysql'][
'connection'],
'SELECT id, __label__ FROM anagrafica_clienti_estesa_view' );
38 $ct[
'etc'][
'id_emittente'] =
mysqlQuery(
$cf[
'mysql'][
'connection'],
'SELECT id, __label__ FROM anagrafica_view WHERE se_azienda_gestita = 1' );
43 timerCheck(
$cf[
'speed'],
' -> fine generazione tendina clienti' );
47 timerCheck(
$cf[
'speed'],
' -> inizio generazione tendina agenti' );
49 if( isset(
$_REQUEST[
$ct[
'etc'][
'table'] ][
'id_agente'] ) ) {
52 # $ct['etc']['id_agente'] = mysqlQuery( $cf['mysql']['connection'], 'SELECT id, __label__ FROM anagrafica_view WHERE '.( ( isset( $idAgente ) ) ? ' id = '.$idAgente : NULL ).' OR id = ?', array( array( 's' => $_REQUEST[ $ct['etc']['table'] ]['id_agente'] ) ) ); 53 $ct[
'etc'][
'id_agente'] =
mysqlQuery(
$cf[
'mysql'][
'connection'],
'SELECT id, __label__ FROM anagrafica_view WHERE id = ?', array( array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_agente'] ) ) );
57 # $ct['etc']['id_agente'] = mysqlQuery( $cf['mysql']['connection'], 'SELECT id, __label__ FROM anagrafica_view ' ); 65 timerCheck(
$cf[
'speed'],
' -> fine generazione tendina agenti' );
70 # if( isset( $_REQUEST[ $ct['etc']['table'] ]['id_mandante'] ) && !empty( $_REQUEST[ $ct['etc']['table'] ]['id_mandante']) ) { 71 # $ct['etc']['id_mandante'] = mysqlCachedQuery( $cf['memcache']['connection'], $cf['mysql']['connection'], 'SELECT id, __label__ FROM anagrafica_view WHERE se_mandante = 1 OR id = ?', array( array( 's' => $_REQUEST[ $ct['etc']['table'] ]['id_mandante'] ) ) ); 73 $ct[
'etc'][
'id_mandante'] =
mysqlCachedQuery(
$cf[
'memcache'][
'connection'],
$cf[
'mysql'][
'connection'],
'SELECT id, __label__ FROM anagrafica_view WHERE se_mandante = 1' );
98 if( isset(
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_tipologia'] ) && !empty(
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_tipologia'])
99 && isset(
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id'] ) && !empty(
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id'] ) ) {
100 $ct[
'etc'][
'esistente'] =
mysqlQuery(
$cf[
'mysql'][
'connection'],
101 'SELECT id FROM fatturati WHERE anno = ? AND mese = ? AND id_cliente = ? AND id_mandante = ? '.
102 'AND id_agente = ? And id_tipologia = ? AND id <> ?',
104 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'anno'] ),
105 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'mese'] ),
106 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_cliente'] ),
107 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_mandante'] ),
108 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_agente'] ),
109 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id_tipologia'] ),
110 array(
's' =>
$_REQUEST[ $ct[
'etc'][
'table'] ][
'id'] )
131 $ct[
'etc'][
'id_tipologia'] =
mysqlQuery(
$cf[
'mysql'][
'connection'],
'SELECT id, __label__ FROM tipologie_progetti_view' );
137 timerCheck(
$cf[
'speed'],
' -> fine generazione tendina tipologia attività ' );
139 foreach( range( 1, 12 ) as $mese ) {
140 $ct[
'etc'][
'mese'][] = array(
'id' => $mese,
'__label__' =>
int2month( $mese ) );
165 require
DIRECTORY_BASE .
'_src/_inc/_macro/_default.gestione.php';
$cf['ricerca']['template']
$_REQUEST['__view__'][ $ct['view']['id']]['__restrict__']['id_progetto']['EQ']