Ejemplo n.º 1
0
 /**
  * Get compositions & print
  */
 public function printCompositions($compositions)
 {
     echo '<ul>';
     $db = JFactory::getDbo();
     $compositions = json_decode($compositions, true);
     foreach ($compositions as $key => $comp) {
         $query = "\n\t\t\t\tSELECT\n\t\t\t\t  c.title,\n\t\t\t\t  c.compositions,\n\t\t\t\t  c.print_title\n\t\t\t\tFROM\n\t\t\t\t  #__sibdiet_compositions c\n\t\t\t\tWHERE\n\t\t\t\t  c.id = " . $key;
         $db->setQuery($query);
         $composition = $db->loadObject();
         if ($composition) {
             $print_title = SibdietHelper::getLanguagePrint($composition->print_title);
             $title = $print_title ? $print_title : $composition->title;
             echo '<li>' . $title . ' (' . $comp . ')';
             if ($composition->compositions) {
                 $this->printCompositions($composition->compositions);
             }
             echo '</li>';
         }
     }
     echo '</ul>';
 }
Ejemplo n.º 2
0
            ?>
								<div class="workphone"><?php 
            echo $item->workphone;
            ?>
</div>
							<?php 
        }
        ?>
						</td>
						<td class="nowrap hidden-phone">
							<?php 
        echo $this->escape($item->city);
        ?>
							<div class="small">
								<?php 
        $country_printtitle = SibdietHelper::getLanguagePrint($item->country_printtitle);
        echo $country_printtitle ? $country_printtitle : $this->escape($item->country_title);
        ?>
							</div>
							<div class="small">
								<?php 
        if ($item->homeaddress) {
            ?>
									<i title="<?php 
            echo $this->escape($item->homeaddress);
            ?>
" class="hasTooltip icon-home"></i>
								<?php 
        }
        ?>
								<?php 
Ejemplo n.º 3
0
 public static function Countries($value)
 {
     if (empty($value)) {
         return JHtml::_('users.value', $value);
     } else {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select($db->quoteName(array('title', 'print_title')))->from($db->quoteName('#__sibdiet_countries'))->where($db->quoteName('code') . ' = ' . $db->quote($value));
         $db->setQuery($query);
         $result = $db->loadObject();
         $print_title = SibdietHelper::getLanguagePrint($result->print_title);
         return $print_title ? $print_title : $result->title;
     }
 }
Ejemplo n.º 4
0
					<br /><br />
					<?php 
if ($item->evening_snack_id && !empty($foods[$item->evening_snack_id])) {
    echo JText::sprintf('COM_SIBDIET_PRINT_EVENING_SNACK', $foods[$item->evening_snack_id]->title);
    if ($foods[$item->evening_snack_id]->supplement == 'bread') {
        if ($lunchs['bread']) {
            echo JText::sprintf('COM_SIBDIET_PRINT_BREAD', $lunchs['bread']);
        }
    } elseif ($lunchs['rice'] && !empty($foods[$item->evening_snack_id]->supplement)) {
        $supplementAmount = $foods[$lunchs[$day]]->supplement == 'macaroni' ? $lunchs['rice'] * 20 : $lunchs['rice'];
        echo JText::sprintf('COM_SIBDIET_PRINT_' . $foods[$lunchs[$day]]->supplement, $supplementAmount);
    }
    $compositions = $foods[$item->evening_snack_id]->compositions;
    if (count($compositions)) {
        foreach ($compositions as $comp) {
            $print_title = SibdietHelper::getLanguagePrint($comp->print_title);
            $title = $print_title ? $print_title : $comp->title;
            echo ' - ' . $title . ' (' . $comp->uamount . ' ' . $comp->unit . ') ';
        }
    }
}
?>
				</div>
			</div>
			<div class="footer row-fluid text-center">
				<?php 
echo JText::_('COM_SIBDIET_PRINT_PAGE3_FOOTER');
?>
			</div>
		</div>
	</div>
Ejemplo n.º 5
0
        // Convert the payment field to an array.
        $registry = new JRegistry();
        $registry->loadString($request->payment);
        $request->payment = $registry->toArray();
        echo $this->requestStatus($request);
        ?>
				</td>
				<td headers="requestslist_header_setdiet_status" class="list-setdiet-status text-center">
					<?php 
        echo $this->setdietStatus($request);
        ?>
				</td>
				<td headers="requestslist_header_prescriptive_diet" class="list-prescriptive-diet">
					<?php 
        if ($request->diets_id) {
            if ($print_title = SibdietHelper::getLanguagePrint($request->diet_print_title)) {
                echo $print_title;
            } else {
                echo $this->escape($request->diet_title);
            }
        }
        ?>
				</td>
				<td headers="requestslist_header_diet_period" class="list-diet-period text-center">
					<?php 
        if ($request->period) {
            echo $request->period;
        }
        ?>
				</td>
				<td headers="requestslist_header_request_id" class="list-request-id text-center">