public function load_data($ar_data = null)
 {
     $result = array();
     $node_parkauto = $ar_data['nid_parkauto'];
     $query = new EntityFieldQuery();
     $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'pagamenti_cliente')->propertyCondition('status', 1)->fieldCondition('field_pag_ref_parkauto', 'nid', $node_parkauto)->addMetaData('account', user_load(1));
     $qryres = $query->execute();
     if (isset($qryres['node'])) {
         $items_nids = array_keys($qryres['node']);
         $items = entity_load('node', $items_nids);
         foreach ($items as $nodo => $elem) {
             $result[$nodo]['pag_uid_registrazione'] = $elem->field_pag_uid_registrazione[LANGUAGE_NONE][0]['uid'];
             $result[$nodo]['pag_dt_registrazione'] = DrupalDateTimeToDateTime($elem->field_pag_dt_registrazione[LANGUAGE_NONE][0]['value']);
             $result[$nodo]['pag_tp_pagamento'] = $elem->field_pag_tp_pagamento[LANGUAGE_NONE][0]['value'];
             $result[$nodo]['pag_importo'] = $elem->field_pag_importo[LANGUAGE_NONE][0]['value'];
         }
     }
     $this->ar_lista = $result;
 }
            <button type="button" id="btn_dati_pagamenti">Pagamenti</button>
            <button type="button" id="btn_dati_sconti">Sconti</button>
            
            <span id="dialog-dati-pagamenti" title="Pagamenti" class="all-stati dati-pagamenti">
                <fieldset>                  
                        <legend>Elenco Pagamenti effettuati</legend>
                        <?php 
$lista = $model->get_lista_pagamenti_clienti();
?>
    
                        <span style="float:left; margin-right: 20px;">
                        <?php 
foreach ($lista as $k => $v) {
    $importo = number_format($v['pag_importo'], 2, ',', '.');
    $nome_utente = user_load($v['pag_uid_registrazione'])->name;
    $dt_registrazione = DrupalDateTimeToDateTime($v['pag_dt_registrazione']);
    $html = "<p> pagato importo di: {$importo} ({$v['pag_tp_pagamento']}) in data: {$dt_registrazione} - utente: {$nome_utente}</p>";
    echo $html;
}
?>
                        </span>
                </fieldset>
                
            </span>          
        </div>        
        <br/>
        <div style="float: left">
            <span class="all-stati tbl-sop" >
                <?php 
$field = 'sop';
$ar_lista = json_decode($ar_data[$field]);
 protected function load_data()
 {
     $this->rs_parkauto = array();
     if (!$this->nid) {
         return;
     }
     $result = array();
     $query = new EntityFieldQuery();
     $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'parkauto')->propertyCondition('status', 1)->propertyCondition('nid', $this->nid)->addMetaData('account', user_load(1));
     $qryres = $query->execute();
     if (isset($qryres['node'])) {
         $items_nids = array_keys($qryres['node']);
         $items = entity_load('node', $items_nids);
         foreach ($items as $nodo => $elem) {
             $result['nid'] = $nodo;
             $result['rc_sito_parking'] = $elem->field_p_sito_parking[LANGUAGE_NONE][0]['nid'];
             $result['rc_p_online'] = $elem->field_p_online[LANGUAGE_NONE][0]['value'];
             $result['rc_uid_registrazione'] = $elem->field_p_uid_registrazione[LANGUAGE_NONE][0]['uid'];
             $result['rc_uid_walkin'] = $elem->field_p_uid_walkin[LANGUAGE_NONE][0]['uid'];
             $result['rc_uid_walkout'] = $elem->field_p_uid_walkout[LANGUAGE_NONE][0]['uid'];
             $result['rc_uid_walkout_closed'] = $elem->field_p_uid_walkout_closed[LANGUAGE_NONE][0]['uid'];
             $result['rc_dtreg_dttm_registrazione'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_registrazione[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_stddt_registrazione'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_registrazione[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_dttm_walkin'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkin[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_stddt_walkin'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkin[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_dttm_walkout'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkout[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_stddt_walkout'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkout[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_dttm_walkout_closed'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkout_closed[LANGUAGE_NONE][0]['value']);
             $result['rc_dtreg_stddt_walkout_closed'] = DrupalDateTimeToDateTime($elem->field_p_dtreg_walkout_closed[LANGUAGE_NONE][0]['value']);
             $result['rc_stato_parking'] = $elem->field_p_stato_parking[LANGUAGE_NONE][0]['value'];
             $result['rc_rif_barcode'] = $elem->field_p_rif_barcode[LANGUAGE_NONE][0]['value'];
             $result['rc_dt_checkin_checkout_in'] = DrupalDateToDate($elem->field_p_dt_checkin_checkout[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_checkin_checkout_in'] = DrupalTimeToTime($elem->field_p_dt_checkin_checkout[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_dt_checkin_checkout_out'] = DrupalDateToDate($elem->field_p_dt_checkin_checkout[LANGUAGE_NONE][0]['value2']);
             $result['rc_tm_checkin_checkout_out'] = DrupalTimeToTime($elem->field_p_dt_checkin_checkout[LANGUAGE_NONE][0]['value2'], "H:i");
             $rs_data = ListinoBase::get_data_from_nid($elem->field_p_tipo_parcheggio[LANGUAGE_NONE][0]['nid']);
             $result['rc_tipo_parcheggio'] = $rs_data['field_p_tipo_parcheggio'];
             $result['rc_azienda'] = $elem->field_p_azienda[LANGUAGE_NONE][0]['value'];
             $result['rc_azienda_indirizzo'] = $elem->field_p_azienda_indirizzo[LANGUAGE_NONE][0]['value'];
             $result['rc_azienda_city'] = $elem->field_p_azienda_city[LANGUAGE_NONE][0]['value'];
             $result['rc_azienda_piva'] = $elem->field_p_azienda_piva[LANGUAGE_NONE][0]['value'];
             $result['rc_nome_cliente'] = $elem->field_p_nome_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_cognome_cliente'] = $elem->field_p_cognome_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_ritira_auto'] = $elem->field_p_ritira_auto[LANGUAGE_NONE][0]['value'];
             $result['rc_email_cliente'] = $elem->field_p_email_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_nr_telefono_cliente'] = $elem->field_p_nr_telefono_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_targa_auto_cliente'] = $elem->field_p_targa_auto_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_modello_auto_cliente'] = $elem->field_p_modello_auto_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_marca_auto_cliente'] = $elem->field_p_marca_auto_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_nr_passeggeri_cliente'] = $elem->field_p_nr_passeggeri_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_tipo_cliente'] = $elem->field_p_tipo_cliente[LANGUAGE_NONE][0]['nid'];
             $result['rc_tp_veicolo_cliente'] = $elem->field_p_tp_veicolo_cliente[LANGUAGE_NONE][0]['nid'];
             $result['rc_tp_gestione_chiavi'] = $elem->field_p_tp_gestione_chiavi[LANGUAGE_NONE][0]['value'];
             $result['rc_note_interne'] = $elem->field_p_note_interne[LANGUAGE_NONE][0]['value'];
             $result['rc_note_prenotazione'] = $elem->field_p_note_prenotazione[LANGUAGE_NONE][0]['value'];
             $result['rc_zona_parcheggio_auto'] = $elem->field_p_zona_parcheggio_auto[LANGUAGE_NONE][0]['value'];
             $result['rc_cd_volo_cliente'] = $elem->field_p_cd_volo_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_nr_terminal_cliente'] = $elem->field_p_nr_terminal_cliente[LANGUAGE_NONE][0]['value'];
             $result['rc_provenienza_cliente'] = $elem->field_p_provenienza_cliente[LANGUAGE_NONE][0]['value'];
             $pagamentoCliente = new PagamentoCliente();
             $pagamentoCliente->load_data(array('nid_parkauto' => $result['nid']));
             $result['pag_cliente'] = $pagamentoCliente->get_lista();
             $result['rc_dt_walkin'] = DrupalDateToDate($elem->field_p_dt_walkin[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_walkin'] = DrupalTimeToTime($elem->field_p_dt_walkin[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_dt_walkout_prevista'] = DrupalDateToDate($elem->field_p_dt_walkout_prevista[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_walkout_prevista'] = DrupalTimeToTime($elem->field_p_dt_walkout_prevista[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_dt_walkout'] = DrupalDateToDate($elem->field_p_dt_walkout[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_walkout'] = DrupalTimeToTime($elem->field_p_dt_walkout[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_valore_sct_mag'] = $elem->field_p_valore_sct_mag[LANGUAGE_NONE][0]['value'];
             $result['rc_tipo_sct_mag'] = $elem->field_p_tipo_sct_mag[LANGUAGE_NONE][0]['value'];
             $result['rc_tp_sct_mag_v_p'] = $elem->field_p_tp_sct_mag_v_p[LANGUAGE_NONE][0]['value'];
             $result['rc_motivazione_sct_mag'] = $elem->field_p_motivazione_sct_mag[LANGUAGE_NONE][0]['value'];
             $result['rc_tp_doc_fiscale'] = $elem->field_p_tp_doc_fiscale[LANGUAGE_NONE][0]['value'];
             $result['rc_dt_walkout'] = DrupalDateToDate($elem->field_p_dt_walkout[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_walkout'] = DrupalTimeToTime($elem->field_p_dt_walkout[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_imp_totale_pagato'] = $elem->field_p_imp_totale_pagato[LANGUAGE_NONE][0]['value'];
             $result['rc_imp_totale_dovuto'] = $elem->field_p_imp_totale_dovuto[LANGUAGE_NONE][0]['value'];
             $result['rc_totale_nr_giorni'] = $elem->field_p_totale_nr_giorni[LANGUAGE_NONE][0]['value'];
             $result['rc_imp_totale_residuo'] = $elem->field_p_imp_totale_residuo[LANGUAGE_NONE][0]['value'];
             //
             $result['rc_dt_rif_checkin_checkout_in'] = DrupalDateToDate($elem->field_p_dt_rif_checkin_checkout[LANGUAGE_NONE][0]['value']);
             $result['rc_tm_rif_checkin_checkout_in'] = DrupalTimeToTime($elem->field_p_dt_rif_checkin_checkout[LANGUAGE_NONE][0]['value'], "H:i");
             $result['rc_dt_rif_checkin_checkout_out'] = DrupalDateToDate($elem->field_p_dt_rif_checkin_checkout[LANGUAGE_NONE][0]['value2']);
             $result['rc_tm_rif_checkin_checkout_out'] = DrupalTimeToTime($elem->field_p_dt_rif_checkin_checkout[LANGUAGE_NONE][0]['value2'], "H:i");
             $result['rc_is_ricevuta_stampata'] = $elem->field_p_is_ricevuta_stampata[LANGUAGE_NONE][0]['value'];
         }
     }
     $this->rs_parkauto = $result;
 }
Exemple #4
0
 public function set_lista_reg_utenti($node)
 {
     $field_uid = 'rc_uid_' . STATO_REGISTRAZIONE;
     $field_dttm = 'rc_dtreg_dttm_' . STATO_REGISTRAZIONE;
     $field_stddt = 'rc_dtreg_stddt_' . STATO_REGISTRAZIONE;
     $this->rs_parkauto[$field_uid] = $node->field_p_uid_registrazione[LANGUAGE_NONE][0]['uid'];
     $this->rs_parkauto[$field_dttm] = $node->field_p_dtreg_registrazione[LANGUAGE_NONE][0]['value'];
     $this->rs_parkauto[$field_stddt] = DrupalDateTimeToDateTime($node->field_p_dtreg_registrazione[LANGUAGE_NONE][0]['value']);
     if ($this->stato_attuale == STATO_REGISTRAZIONE) {
         $this->rs_parkauto[$field_uid] = $this->user->uid;
         $dt = new DateTime();
         $dt_val = $dt->format('d/m/Y');
         $tm_val = $dt->format('H:i:s');
         $this->rs_parkauto[$field_dttm] = DateTimeToDrupalDateTime($dt_val, $tm_val);
         $dt_val = conv_date_to_iso($dt_val);
         $this->rs_parkauto[$field_stddt] = "{$dt_val} {$tm_val}";
     }
     $field_uid = 'rc_uid_' . STATO_WALKIN;
     $field_dttm = 'rc_dtreg_dttm_' . STATO_WALKIN;
     $field_stddt = 'rc_dtreg_stddt_' . STATO_WALKIN;
     $this->rs_parkauto[$field_uid] = $node->field_p_uid_walkin[LANGUAGE_NONE][0]['uid'];
     $this->rs_parkauto[$field_dttm] = $node->field_p_dtreg_walkin[LANGUAGE_NONE][0]['value'];
     $this->rs_parkauto[$field_stddt] = DrupalDateTimeToDateTime($node->field_p_dtreg_walkin[LANGUAGE_NONE][0]['value']);
     if ($this->stato_attuale == STATO_WALKIN) {
         $this->rs_parkauto[$field_uid] = $this->user->uid;
         $dt = new DateTime();
         $dt_val = $dt->format('d/m/Y');
         $tm_val = $dt->format('H:i:s');
         $this->rs_parkauto[$field_dttm] = DateTimeToDrupalDateTime($dt_val, $tm_val);
         $dt_val = conv_date_to_iso($dt_val);
         $this->rs_parkauto[$field_stddt] = "{$dt_val} {$tm_val}";
     }
     $field_uid = 'rc_uid_' . STATO_WALKOUT;
     $field_dttm = 'rc_dtreg_dttm_' . STATO_WALKOUT;
     $field_stddt = 'rc_dtreg_stddt_' . STATO_WALKOUT;
     $this->rs_parkauto[$field_uid] = $node->field_p_uid_walkout[LANGUAGE_NONE][0]['uid'];
     $this->rs_parkauto[$field_dttm] = $node->field_p_dtreg_walkout[LANGUAGE_NONE][0]['value'];
     $this->rs_parkauto[$field_stddt] = DrupalDateTimeToDateTime($node->field_p_dtreg_walkout[LANGUAGE_NONE][0]['value']);
     if ($this->stato_attuale == STATO_WALKOUT) {
         $this->rs_parkauto[$field_uid] = $this->user->uid;
         $dt = new DateTime();
         $dt_val = $dt->format('d/m/Y');
         $tm_val = $dt->format('H:i:s');
         $this->rs_parkauto[$field_dttm] = DateTimeToDrupalDateTime($dt_val, $tm_val);
         $dt_val = conv_date_to_iso($dt_val);
         $this->rs_parkauto[$field_stddt] = "{$dt_val} {$tm_val}";
     }
     $field_uid = 'rc_uid_' . STATO_WALKOUT_CLOSED;
     $field_dttm = 'rc_dtreg_dttm_' . STATO_WALKOUT_CLOSED;
     $field_stddt = 'rc_dtreg_stddt_' . STATO_WALKOUT_CLOSED;
     $this->rs_parkauto[$field_uid] = $node->field_p_uid_walkout_closed[LANGUAGE_NONE][0]['uid'];
     $this->rs_parkauto[$field_dttm] = $node->field_p_dtreg_walkout_closed[LANGUAGE_NONE][0]['value'];
     $this->rs_parkauto[$field_stddt] = DrupalDateTimeToDateTime($node->field_p_dtreg_walkout_closed[LANGUAGE_NONE][0]['value']);
     if ($this->stato_attuale == STATO_WALKOUT_CLOSED) {
         $this->rs_parkauto[$field_uid] = $this->user->uid;
         $dt = new DateTime();
         $dt_val = $dt->format('d/m/Y');
         $tm_val = $dt->format('H:i:s');
         $this->rs_parkauto[$field_dttm] = DateTimeToDrupalDateTime($dt_val, $tm_val);
         $dt_val = conv_date_to_iso($dt_val);
         $this->rs_parkauto[$field_stddt] = "{$dt_val} {$tm_val}";
     }
 }