global $user;
$datetime1 = date( 'Y-m-', strtotime( $this -> _date_from ) ) . '01';
$datetime2 = date( 'Y-m-', strtotime( $this -> _date_to ) ) . date( 't', strtotime( $this -> _date_to ) );
$x = floor( ( strtotime( $datetime2 ) - strtotime( $datetime1 ) ) / 2628000 );
$months = \S::getMonthNames();
?>
Raport pozycji od = $this -> _date_from;?> do = $this -> _date_to;?>
if ( is_array( $this -> _pages ) ):
foreach ( $this -> _pages as $page ):?>
Raport dla strony = $page['url'];?>
for ( $i = 0; $i <= $x; $i++ ):?>
= $months[ date( 'n', strtotime( '+' . $i . ' months', strtotime( $this -> _date_from ) ) )];?> = date( 'Y', strtotime( '+' . $i . ' months', strtotime( $this -> _date_from ) ) );?>
if ( is_array( $page['phrases'] ) ):?>
| Fraza |
for ( $z = 1; $z <= date( 't', strtotime( '+' . $i . ' months', strtotime( $this -> _date_from ) ) ); $z++ ):?>
= $z;?> |
endfor;?>
foreach( $page['phrases'] as $phrase ):?>
| = $phrase['phrase'];?> |
for ( $z = 1; $z <= date( 't', strtotime( '+' . $i . ' months', strtotime( $this -> _date_from ) ) ); $z++ )
{
$date = date( 'Y-m-', strtotime( '+' . $i . ' months', strtotime( $this -> _date_from ) ) );
$z < 10 ? $date .= '0' . $z : $date .= $z;
$phrase['positions'][ $date ] ? $pos = $phrase['positions'][ $date ] : $pos = '-';
if ( $pos == 1 )
$style = 'background: #6a8da7 !important; color: #fff !important;';
if ( $pos == 2 || $pos == 3 )
$style = 'background: #56bc76 !important; color: #fff !important;';
if ( $pos >= 4 && $pos <= 6 )
$style = 'background: #cb60b3 !important; color: #fff !important;';
if ( $pos >= 7 && $pos <= 10 )
$style = 'background: #e5603b !important; color: #fff !important;';
if ( $pos >= 11 && $pos <= 20 )
$style = 'background: #666666 !important; color: #fff !important;';
if ( $pos == 0 || $pos >= 21 )
$style = '';
?>
= $pos;?> |
};?>
endforeach;?>
endif;?>
endfor;?>
if ( $this -> _report_form == 2 ):?>
$page['subscription'] ? $suma_all = $page['subscription'] : $suma_all = 0;?>
if ( is_array( $page['phrases'] ) ): foreach( $page['phrases'] as $phrase ):?>
$discount = '';
if ( $page['discount'] and !$user['reseller_id'] )
$discount = $page['discount'];
if ( $phrase['discount'] )
$discount = $phrase['discount'];
$suma = 0;
$price_tmp = 0;
?>
if ( is_array( $phrase['prices'] ) ): foreach ( $phrase['prices'] as $price ):?>
if ( $discount > 0 )
$price_tmp += number_format( number_format( $price['price'] - ( $price['price'] * $discount / 100 ), 2 ) * $price['count'], 2, '.', ' ' );
else
$price_tmp += number_format( $price['price'] * $price['count'], 2, '.', ' ' );
?>
endforeach; endif;?>
if ( $price_tmp > 0 ):?>
| = $phrase['phrase'];?> if ( $discount > 0 and !$user['reseller_id'] ):?>rabat = $discount;?>% endif;?> |
if ( is_array( $phrase['prices'] ) ): foreach ( $phrase['prices'] as $price ):?>
| Pozycja = $price['start'];?> - = $price['end'];?>: |
if ( $discount > 0 )
echo number_format( number_format( $price['price'] - ( $price['price'] * $discount / 100 ), 2 ), 2, '.', ' ' );
else
echo number_format( $price['price'], 2, '.', ' ' ) . ' PLN';
?>
|
= (int)$price['count'];?> |
if ( $discount > 0 )
echo number_format( number_format( $price['price'] - ( $price['price'] * $discount / 100 ), 2 ) * $price['count'], 2, '.', ' ' );
else
echo number_format( $price['price'] * $price['count'], 2, '.', ' ' ) . ' PLN';
?>
|
$suma += number_format( number_format( $price['price'] - ( $price['price'] * $discount / 100 ), 2 ) * $price['count'], 2 );
$suma_all += number_format( number_format( $price['price'] - ( $price['price'] * $discount / 100 ), 2 ) * $price['count'], 2 );
?>
endforeach; endif;?>
endif;?>
if ( $suma > 0 ):?>
|
Razem netto: |
= number_format( $suma, 2, '.', ' ' );?> PLN |
|
Razem brutto: |
= number_format( $suma * 1.23, 2, '.', ' ' );?> PLN |
endif;?>
endforeach; endif;?>
if ( $page['subscription'] ):?>
Abonament: = number_format( $page['subscription'], 2, '.', ' ' );?> PLN
endif;?>
if ( $suma_all > 0 ):?>
Razem netto: = number_format( $suma_all, 2, '.', ' ' );?> PLN
Razem brutto: = number_format( $suma_all * 1.23, 2, '.', ' ' );?> PLN
endif;?>
endif;?>
endforeach;?>
endif;?>