/** * @param $this SLN_Admin_Settings */ function sln_availability_row($prefix, $row) { ?> <div class="col-md-12"> <div class="first-row"> <?php foreach (SLN_Func::getDays() as $k => $day) { ?> <div class="form-group"> <label> <?php SLN_Form::fieldCheckbox($prefix . "[days][{$k}]", isset($row['days'][$k]) ? 1 : null); ?> <?php echo substr($day, 0, 3); ?> </label> </div> <?php } ?> </div> <div class="second-row"> <?php foreach (array(0, 1) as $i) { ?> <?php foreach (array('from' => __('From', 'sln'), 'to' => __('To', 'sln')) as $k => $v) { ?> <div class="form-group"> <label for="<?php echo SLN_Form::makeID($prefix . "[{$k}][{$i}]"); ?> "> <?php echo $v; ?> </label> <?php SLN_Form::fieldTime($prefix . "[{$k}][{$i}]", $row[$k][$i]); ?> </div> <?php } ?> <?php } ?> </div> </div> <?php }
public function __toString() { $days = SLN_Func::getDays(); $ret = array(); foreach ($this->data['days'] as $d => $v) { $ret[] = $days[$d]; } $ret = implode('-', $ret); foreach ($this->times as $t) { $ret .= sprintf(' %s/%s', $t[0], $t[1]); } return $ret; }
public function getNotAvailableString() { foreach (SLN_Func::getDays() as $k => $day) { if ($this->getNotAvailableOn($k)) { $ret[] = $day; } } $ret = $ret ? __('on ', 'sln') . implode(', ', $ret) : ''; $from = $this->getNotAvailableFrom()->format('H:i'); $to = $this->getNotAvailableTo()->format('H:i'); if ($from != '00:00') { $ret .= __(' from ', 'sln') . $from; } if ($to != '00:00') { $ret .= __(' to ', 'sln') . $to; } return $ret; }
SLN_Form::fieldCheckbox($helper->getFieldName($postType, 'secondary'), $service->isSecondary()); ?> <br/><em><?php _e('Select this if you want this service considered as secondary level service', 'sln'); ?> </em> </div> </div> <div class="sln-clear"></div> </div> <h3><?php _e('Not available on', 'sln'); ?> </h3> <?php $days = SLN_Func::getDays(); ?> <div class="row"> <div class="col-md-12 services-notavailable"> <?php foreach ($days as $k => $day) { ?> <label> <?php SLN_Form::fieldCheckbox($helper->getFieldName($postType, 'notav_' . $k), $service->getNotAvailableOn($k)); ?> <?php echo substr($day, 0, 3); ?> </label> <?php