if (!empty($tickets)) {
if (count($tickets)) {
$c_start = strtotime($convetion_details['start']);
$c_end = strtotime($convetion_details['end']);
$i = 0;
while ($c_start <= $c_end) {
if (is_int($i / 4) && $i > 0) $convetion_days_html .= '</tr><tr>';
$convetion_days_html .= '<td>' . date('d.m', $c_start) . ' ' . __t($days_of_week[date('w', $c_start)]) . ' <img src="' . str_replace('https', 'http', TEMPLATE_WWWPATH) . '/images/checkbox.png"/></td>';
$c_start = strtotime('+1 day', $c_start);
$i++;
}
//...
legacy code from 2007 indians
public function getProduct($product_id) {
$query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
/* ... */
Opencart's Product model
$d = explode(".",$request->get("due_date",".."));
foreach ($d as $key => $val) $d[$key]=(int)$val;
if (
!is_numeric($d[0]) || $d[0]<1 ||$d[0]>31 ||
!is_numeric($d[1]) || $d[1]<1 ||$d[1]>12 ||
!is_numeric($d[2]) || $d[2]<2005 ||$d[2]>2100 ) {
$error["due_date"] = "Missing date.";
}
I think this was the last piece of code the developer wrote .... :D
if (isset(self::$proposals[$view])) {
$best_proposals = [];
$all_sources = [];
foreach (self::$proposals[$view] as $proposal_source => $proposal) {
if (!isset($this->backend_branch) || substr($this->backend_branch, 0, 11) != "adjust-for:" || substr($this->backend_branch, 11) == $proposal_source) {
if ($proposal['orig_base'] == $curr_base || $relax_checking) {
$age = time() - $proposal['updated_at'];
if ($age < self::MAX_AGE) {
foreach ($proposal['proposals'] as $proposal_label => $proposal_price) {
if (!in_array($proposal_label, [self::SK_LABEL_AVIASALES, self::SK_LABEL_SKYSCANNER, self::SK_LABEL_YANDEX, self::SK_LABEL_MOMONDO])) {
$proposal_key = $proposal_label;
if (!isset($best_proposals[$proposal_key]) || $best_proposals[$proposal_key]['price'] > $proposal_price) {
$best_proposals[$proposal_key] = [
'price' => $proposal_price,
'name' => $proposal_price . "@" . implode("~", array_map(function ($part) {
return preg_replace('/[~|=#@ ]/', '_', $part);
}, [
'label' => $proposal_label,
'source' => $proposal_source,
])),
'age' => $age,
];
$all_sources[$proposal_source] = null;
}
}
}
}
}
}
}
public function update($oldVersion) {
switch ($oldVersion) {
case '1.0.0':
case '1.0.1':
break;
default:
return false;
}
return true;
}
Found in a Shopware Plugin
$i = 0;
if ($i == 'dupa') {
echo 'dupa';
} else {
echo 'nie dupa';
}
Do you think, that output is "nie dupa"? Just try...
if ( $ordinal_competitors > 0 ) {
foreach( $ordinal_bests as $label => $tuple ) {
unset( $waste[ $tuple['id']->{ '$id' } ] );
$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['updated_at'] = $tuple['updated'];
$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['proposals'][ $label ] = $tuple['price'];
$final_count ++;
}
}
<?php
/**
* SetSelectedPlanet.php
*
* @version 1
* @copyright 2008 By Chlorel for XNova
*/
function SetSelectedPlanet ( &$CurrentUser ) {
global $_GET;
function hour_switvh($hour)
{
$hour=$hour/2;
if($hour==0.0){$hour="00:00";}
if($hour==0.5){$hour="00:30";}
if($hour==1.0){$hour="01:00";}
if($hour==1.5){$hour="01:30";}
if($hour==2.0){$hour="02:00";}
if($hour==2.5){$hour="02:30";}
if($hour==3.0){$hour="03:00";}
if($hour==3.5){$hour="03:30";}
if($hour==4.0){$hour="04:00";}
if($hour==4.5){$hour="04:30";}
if($hour==5.0){$hour="05:00";}
if($hour==5.5){$hour="05:30";}
if($hour==6.0){$hour="06:00";}
if($hour==6.5){$hour="06:30";}
if($hour==7.0){$hour="07:00";}
if($hour==7.5){$hour="07:30";}
if($hour==8.0){$hour="08:00";}
if($hour==8.5){$hour="08:30";}
if($hour==9.0){$hour="09:00";}
if($hour==9.5){$hour="09:30";}
if($hour==10.0){$hour="10:00";}
if($hour==10.5){$hour="10:30";}
if($hour==11.0){$hour="11:00";}
if($hour==11.5){$hour="11:30";}
if($hour==12.0){$hour="12:00";}
if($hour==12.5){$hour="12:30";}
if($hour==13.0){$hour="13:00";}
if($hour==13.5){$hour="13:30";}
if($hour==14.0){$hour="14:00";}
if($hour==14.5){$hour="14:30";}
if($hour==15.0){$hour="15:00";}
if($hour==15.5){$hour="15:30";}
if($hour==16.0){$hour="16:00";}
if($hour==16.5){$hour="16:30";}
if($hour==17.0){$hour="17:00";}
if($hour==17.5){$hour="17:30";}
if($hour==18.0){$hour="18:00";}
if($hour==18.5){$hour="18:30";}
if($hour==19.0){$hour="19:00";}
if($hour==19.5){$hour="19:30";}
if($hour==20.0){$hour="20:00";}
if($hour==20.5){$hour="20:30";}
if($hour==21.0){$hour="21:00";}
if($hour==21.5){$hour="21:30";}
if($hour==22.0){$hour="22:00";}
if($hour==22.5){$hour="22:30";}
if($hour==23.0){$hour="23:00";}
if($hour==23.5){$hour="23:30";}
if($hour==24.0){$hour="24:00";}
return $hour;
}
added by dfj
<?php
function add_points ($resources, $userid) {
return false;
}
function remove_points ($resources, $userid) {
return false;
}
function get_userdata () {
return '';
}
if ($act_number)
{
$act_number = $act_number;
}
else
{
throw new Exception("Документ еще не подготовлен.");
}
// sleep 150s
for ($a = 0; $a < 150 ; $a++ ) {
sleep(1);
}
for ($i=0 ; $i<3 ; $i++) {
switch($i) {
case 1:
// do some stuff
break;
case 2:
// do some stuff
break;;
case 3:
// do some stuff
break;
}
}