rows; $lim0 = $this->lim0; $navbut = $this->navbut; $orderby = $this->orderby; $ordersort = $this->ordersort; $vbo_app = VikBooking::getVboApplication(); $vbo_app->loadSelect2(); $vbo_app->loadDatePicker(); $nowdf = VikBooking::getDateFormat(true); if ($nowdf == "%d/%m/%Y") { $df = 'd/m/Y'; } elseif ($nowdf == "%m/%d/%Y") { $df = 'm/d/Y'; } else { $df = 'Y/m/d'; } $datesep = VikBooking::getDateSeparator(true); $juidf = $nowdf == "%d/%m/%Y" ? 'dd/mm/yy' : ($nowdf == "%m/%d/%Y" ? 'mm/dd/yy' : 'yy/mm/dd'); $dates_filter = ''; $pdatefilt = $this->datefilt; $pdatefiltfrom = $this->datefiltfrom; $pdatefiltto = $this->datefiltto; if ((!empty($pdatefiltfrom) || !empty($pdatefiltto))) { $dates_filter = '&datefilt='.$pdatefilt.(!empty($pdatefiltfrom) ? '&datefiltfrom='.$pdatefiltfrom : '').(!empty($pdatefiltto) ? '&datefiltto='.$pdatefiltto : ''); } $pactive_tab = VikRequest::getString('vbo_active_tab', 'vbo-trackings-tabcont-list', 'request'); ?>
'; $datesel .= ''; $datesel .= ''; $datesel .= ''; $datesel .= ''; $datesel .= ''; echo $datesel; ?>
 
 
 

'; } } } $dt_info = getdate(strtotime($row['dt'])); $lastdt_info = getdate(strtotime($row['lastdt'])); ?>
ID
$info) { $trkdata = json_decode($info['trkdata']); $trkdata = !is_object($trkdata) ? (new stdClass) : $trkdata; $is_subidentifier = false; $is_opening = false; if (!isset($row['infos'][($k - 1)]) || $info['identifier'] != $row['infos'][($k - 1)]['identifier']) { // open identifier because previous is different or not set (this is the first record) $is_opening = true; echo '
'."\n"; } elseif (isset($row['infos'][($k - 1)]) && $info['identifier'] == $row['infos'][($k - 1)]['identifier']) { $is_subidentifier = true; } ?>
'; } elseif ($info['device'] == 'S') { // smartphone $device = ''; } elseif ($info['device'] == 'T') { // tablet $device = ''; } } if (!empty($device)) { ?>
">+
checkin); $time_info = getdate($tsdt); echo JText::translate('VB'.strtoupper(substr($time_info['weekday'], 0, 3))) . ', ' . date(str_replace("/", $datesep, $df), $tsdt); ?>
checkout); $time_info = getdate($tsdt); echo JText::translate('VB'.strtoupper(substr($time_info['weekday'], 0, 3))) . ', ' . date(str_replace("/", $datesep, $df), $tsdt); ?>
nights)) { ?>
nights; ?>
party)) { ?>
party as $numroom => $guests) { ?>
adults." ".($guests->adults > 1 ? JText::translate('VBMAILADULTS') : JText::translate('VBMAILADULT')).($guests->children > 0 ? ", ".$guests->children." ".($guests->children > 1 ? JText::translate('VBMAILCHILDREN') : JText::translate('VBMAILCHILD')) : "");; ?>
rooms) || isset($trkdata->rplans)) { ?>
rooms)) { ?>
rindex) && is_array($trkdata->rindex)) { $rindexes = array_filter($trkdata->rindex); if (count($rindexes)) { // display all indexes booked, even the empty ones ?>
rindex); ?>
rooms as $idroom => $units) { ?>
rooms[$idroom]) ? $this->rooms[$idroom] : '?').($units > 1 ? ' (x'.$units.')' : ''); ?>
rplans)) { ?>
rplans as $idprice => $units) { ?>
prices[$idprice]) ? $this->prices[$idprice] : '?').($units > 1 ? ' (x'.$units.')' : ''); ?>
'.JText::translate('VBCONFIRMED').''; } elseif ($info['status'] == "standby") { $saystaus = ''.JText::translate('VBSTANDBY').''; } else { $saystaus = ''.JText::translate('VBCANCELLED').''; } ?> $trk_val) { if (!is_string($trk_prop) || !is_scalar($trk_val) || in_array($trk_prop, $common_props)) { continue; } $say_trk_prop = ucwords(str_replace('_', ' ', $trk_prop)); $extra_trk_props[$say_trk_prop] = $trk_val; } if (count($extra_trk_props)) { // display the extra tracking properties ?>
$trk_val) { ?>
' . $say_referrer . ''; } else { $referrer_logo = ''; } ?>
msg)) { ?>
msg as $msg) { $msg_type = strtolower($msg->type); $msg_icon = ''; if ($msg_type == 'success') { $msg_icon = ''; } elseif ($msg_type == 'warning') { $msg_icon = ''; } elseif ($msg_type == 'error') { $msg_icon = ''; } ?>

text; ?>

'."\n"; } } ?>
stats_data as $stat) { if (!empty($stat['referrer'])) { if (!isset($referrer_count[$stat['referrer']])) { $referrer_count[$stat['referrer']] = 0; } $referrer_count[$stat['referrer']]++; } if (!isset($totidentifiers[$stat['identifier']])) { // total identifiers $totidentifiers[$stat['identifier']] = 1; } if (!empty($stat['idorder']) && !isset($totbookings[$stat['identifier']])) { // one conversion per tracking identifier $totbookings[$stat['identifier']] = $stat['idorder']; } // loop through the nights of this tracking info record $in_ts = strtotime($stat['checkin']); $in_info = getdate($in_ts); $out_ts = strtotime($stat['checkout']); $out_dt = date('Y-m-d', $out_ts); $in_dt = date('Y-m-d', $in_info[0]); $now_los = 0; while ($in_dt != $out_dt) { if (!($in_ts < $out_ts)) { // prevent any possible loop in case of records with invalid data break; } $now_los++; if (!isset($demands_nights[$in_dt])) { $demands_nights[$in_dt] = 0; } // increase the requests for this night $demands_nights[$in_dt]++; if (!isset($demands_count[$in_dt])) { $demands_count[$in_dt] = array(); } if (!in_array($stat['idtracking'], $demands_count[$in_dt])) { // push this visitor (tracking) ID to the counter for this night array_push($demands_count[$in_dt], $stat['idtracking']); } // update next loop $in_info = getdate(mktime(0, 0, 0, $in_info['mon'], ($in_info['mday'] + 1), $in_info['year'])); $in_dt = date('Y-m-d', $in_info[0]); } array_push($los_pool, $now_los); } // sort most demanded nights and best referrers arsort($demands_nights); arsort($referrer_count); // count values that could be 0 $cnt_tot_idfs = count($totidentifiers); $cnt_tot_idfs = $cnt_tot_idfs > 0 ? $cnt_tot_idfs : 1; $cnt_los_pool = count($los_pool); $cnt_los_pool = $cnt_los_pool > 0 ? $cnt_los_pool : 1; // average conversion rate: 100 : totidentifiers = x : totbookings $avg_conv_rate = 100 * count($totbookings) / $cnt_tot_idfs; $avg_conv_rate = round($avg_conv_rate, 2); $avg_conv_colr = '#550000'; //black-red if ($avg_conv_rate > 33 && $avg_conv_rate <= 66) { $avg_conv_colr = '#ff4d4d'; //red } elseif ($avg_conv_rate > 66 && $avg_conv_rate < 100) { $avg_conv_colr = '#ffa64d'; //orange } elseif ($avg_conv_rate >= 100) { $avg_conv_colr = '#2a762c'; //green } // average length of stay $avg_los = array_sum($los_pool) / $cnt_los_pool; $avg_los = round($avg_los, 1); ?>