コード例 #1
0
ファイル: parkauto.php プロジェクト: remo-candeli/remoc-test
 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}";
     }
 }
コード例 #2
0
 private function set_CT_data($node, $elem)
 {
     $node->field_pag_ref_parkauto[LANGUAGE_NONE][0]['nid'] = $elem['nid_parkauto'];
     $node->field_pag_tp_pagamento[LANGUAGE_NONE][0]['value'] = $elem['tp_pag'];
     $node->field_pag_importo[LANGUAGE_NONE][0]['value'] = number_format($elem['imp_pag'], 2, '.', '');
     $dt = new DateTime();
     $dt_val = $dt->format('d/m/Y');
     $tm_val = $dt->format('H:i:s');
     $node->field_pag_dt_registrazione[LANGUAGE_NONE][0]['value'] = DateTimeToDrupalDateTime($dt_val, $tm_val);
     $node->field_pag_dt_registrazione[LANGUAGE_NONE][0]['timezone'] = 'Europe/Rome';
     $node->field_pag_dt_registrazione[LANGUAGE_NONE][0]['timezone_db'] = 'UTC';
     $node->field_pag_dt_registrazione[LANGUAGE_NONE][0]['date_type'] = 'date';
     $node->field_pag_uid_registrazione[LANGUAGE_NONE][0]['uid'] = $elem['uid'];
     return $node;
 }