$params['spend_other'] = input('spend_other'); //Recull tots els dies omplerts $days = input('num_days'); if (!empty($days)) { for ($x = 1; $x <= $days; $x++) { $paramDay[$x]['from'] = input("from-" . $x . ""); $paramDay[$x]['to'] = input("to-" . $x . ""); } } else { $paramDay[0]['from'] = input('from-1'); $paramDay[0]['to'] = input('to-1'); } if ($add->setTrip($params)) { $setDay = true; // if(!empty($paramDay[0]['from'])) { //Si existeix el vector $idTrip = $add->getLastTrip()->id_trip; //Recull id viatge inserit //Inserta itinerari foreach ($paramDay as $dayValues) { $add->setTripDay($idTrip, $dayValues); } // } if ($setDay) { ossn_trigger_message(ossn_print('form:trip:add:created'), 'success'); redirect(REF); } else { ossn_trigger_message(ossn_print('form:trip:create:fail'), 'error'); redirect(REF); } } else { ossn_trigger_message(ossn_print('form:trip:create:fail'), 'error');
<?php /** * Script Widget Profile últim viatge inserit per l'usuari * * @author Dani Marti <*****@*****.**> * @copyright 2016 ABALIT TECHNOLOGIES SL * @license GPL * */ echo '<div class="ossn-profile-module-trips">'; $trips = new OptionTrips(); $lastTrip = $trips->getLastTrip(); if ($lastTrip) { // foreach ($lastTrip as $nombre => $valor) { // echo "$nombre: $valor\n"; // } echo '<label>' . ossn_print('last:trip:place') . '</label>: '; echo $lastTrip->place . '<br>'; echo '<label>' . ossn_print('last:trip:title') . '</label>: '; echo $lastTrip->title . '<br>'; echo '<label>' . ossn_print('last:trip:date') . '</label>: '; echo $lastTrip->date . '<br>'; //var_dump($lastTrip->date); } else { echo '<h3>' . ossn_print('no:last:trip') . '</h3>'; } echo '</div>';