first commit
This commit is contained in:
186
templates/client/ranker-summary.php
Normal file
186
templates/client/ranker-summary.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<? global $config, $user;?>
|
||||
<div class="panel panel-info panel-border top">
|
||||
<div class="panel-heading" style="height: auto; padding-bottom: 4px;">
|
||||
<div class="row" style="color: #666666;">
|
||||
<div class="col-xs-12">
|
||||
<select name="month_global" class="form-control ranker-select" id="month_global" onChange="document.location.href='./?p=client_summary&id=<?= $this -> _site['id'];?>&year=' + $( '#year_global' ).val() + '&month=' + $( this ).val();">
|
||||
<option value="01" <? if ( $this -> _month == '01' ) echo 'selected="selected"'; ?>>Styczeń</option>
|
||||
<option value="02" <? if ( $this -> _month == '02' ) echo 'selected="selected"'; ?>>Luty</option>
|
||||
<option value="03" <? if ( $this -> _month == '03' ) echo 'selected="selected"'; ?>>Marzec</option>
|
||||
<option value="04" <? if ( $this -> _month == '04' ) echo 'selected="selected"'; ?>>Kwiecień</option>
|
||||
<option value="05" <? if ( $this -> _month == '05' ) echo 'selected="selected"'; ?>>Maj</option>
|
||||
<option value="06" <? if ( $this -> _month == '06' ) echo 'selected="selected"'; ?>>Czerwiec</option>
|
||||
<option value="07" <? if ( $this -> _month == '07' ) echo 'selected="selected"'; ?>>Lipiec</option>
|
||||
<option value="08" <? if ( $this -> _month == '08' ) echo 'selected="selected"'; ?>>Sierpień</option>
|
||||
<option value="09" <? if ( $this -> _month == '09' ) echo 'selected="selected"'; ?>>Wrzesień</option>
|
||||
<option value="10" <? if ( $this -> _month == '10' ) echo 'selected="selected"'; ?>>Październik</option>
|
||||
<option value="11" <? if ( $this -> _month == '11' ) echo 'selected="selected"'; ?>>Listopad</option>
|
||||
<option value="12" <? if ( $this -> _month == '12' ) echo 'selected="selected"'; ?>>Grudzień</option>
|
||||
</select>
|
||||
<select name="year_global" id="year_global" class="form-control ranker-select" onChange="document.location.href='./?p=client_summary&id=<?= $this -> _site['id'];?>&year=' + $( this ).val() + '&month=' + $( '#month_global' ).val();">
|
||||
<? for ( $i = date( 'Y') - 2; $i <= date( 'Y') + 2; $i++ ):?>
|
||||
<option value="<?= $i;?>" <? if ( $i == $this -> _year ) echo 'selected="selected"'; ?>><?=$i;?></option>
|
||||
<? endfor;?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-5 col-lg-4">
|
||||
<div class="panel panel-info panel-border top">
|
||||
<div class="panel-body p0">
|
||||
<table class="table table-bordered table-condensed table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Strona</th>
|
||||
<th class="text-right">Netto</th>
|
||||
<th class="text-right">Brutto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?
|
||||
$client_sum = 0;
|
||||
if ( is_array( $this -> _sites ) ) foreach ( $this -> _sites as $site )
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $site['name'];?><? if ( $site['subscription'] > 0 ) echo ' (<span class="text-danger">Ab: ' . \S::number_display( $site['subscription'] ) . '</span>)';?></td>
|
||||
<td class="text-right <? if ( $site['subscription'] > 0 ) echo 'text-system';?>">
|
||||
<?
|
||||
$site_sum = 0;
|
||||
|
||||
if ( is_array( $site['phrases'] ) ) foreach ( $site['phrases'] as $phrase )
|
||||
{
|
||||
$discount = '';
|
||||
|
||||
if ( $site['discount'] and !$user['reseller_id'] )
|
||||
$discount = $site['discount'];
|
||||
|
||||
if ( $phrase['discount'] )
|
||||
$discount = $phrase['discount'];
|
||||
|
||||
if ( is_array( $phrase['prices'] ) ) foreach ( $phrase['prices'] as $price )
|
||||
{
|
||||
$price_c = \S::number( $price['price'] - \S::number( $price['price'] * $discount / 100 ) );
|
||||
$site_sum = $site_sum + $price_c * $price['count'];
|
||||
}
|
||||
}
|
||||
$client_sum = $client_sum + $site_sum + $site['subscription'];
|
||||
echo \S::number_display( $site_sum + $site['subscription'] );
|
||||
?>
|
||||
</td>
|
||||
<td class="text-right <? if ( $site['subscription'] > 0 ) echo 'text-system';?>">
|
||||
<?= \S::number_display( ( $site_sum + $site['subscription'] ) * $config['profit']['vat'] );?>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-right">Razem:</td>
|
||||
<td class="alert-dark dark text-right"><?= \S::number_display( $client_sum );?></td>
|
||||
<td class="alert-dark dark text-right"><?= \S::number_display( $client_sum * $config['profit']['vat'] );?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="browse" style="margin: 10px 0; clear: both; background: #FFF; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);">
|
||||
<?
|
||||
if ( is_array( $this -> _phrases ) )
|
||||
{
|
||||
?>
|
||||
<div id="prices" style="margin: 10px 0;">
|
||||
<?
|
||||
$suma = 0;
|
||||
if ( is_array( $this -> _phrases ) ) foreach ( $this -> _phrases as $phrase )
|
||||
{
|
||||
$discount = '';
|
||||
|
||||
if ( $this -> _site['discount'] )
|
||||
$discount = $this -> _site['discount'];
|
||||
|
||||
if ( $phrase['discount'] )
|
||||
$discount = $phrase['discount'];
|
||||
|
||||
if ( is_array( $phrase['prices'] ) )
|
||||
{
|
||||
?>
|
||||
<div class="phrase-cost">
|
||||
<div class="phrase-cost-title"><?= $phrase['phrase'];?> <? if ( $discount ):?><span class="discount">rabat <?= $discount;?>%</span><? endif;?></div>
|
||||
<?
|
||||
if ( is_array( $phrase['prices'] ) )
|
||||
{
|
||||
$sum = 0;
|
||||
?>
|
||||
<table class="price_table no">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Przedział</td>
|
||||
<td>Stawka</td>
|
||||
<td>Ilość dni</td>
|
||||
<td>Należność</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?
|
||||
foreach ( $phrase['prices'] as $price )
|
||||
{
|
||||
$price_c = \S::number( $price['price'] - \S::number( $price['price'] * $discount / 100 ) );
|
||||
?>
|
||||
<tr <? if ( !$price['count'] ):?> style="background: #efefef;"<? endif;?>>
|
||||
<td><?= $price['start'];?> - <?=$price['end'];?></td>
|
||||
<td <? if ( $discount ):?> class="discount" <? endif;?>>
|
||||
<?= $price_c . ' PLN';?>
|
||||
</td>
|
||||
<td><?= $price['count'];?></td>
|
||||
<td>
|
||||
<?= number_format( $price_c * $price['count'], 2, '.', ' ' ) . ' PLN';?>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
$sum = $sum + $price_c * $price['count'];
|
||||
$suma = $suma + $price_c * $price['count'];
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: right;">suma:</td>
|
||||
<td class="header right"><?= number_format( $sum, 2, '.', ' ' );?> PLN</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
}
|
||||
echo '<div class="clearfix"></div>';
|
||||
if ( $suma )
|
||||
{
|
||||
?>
|
||||
<div class="group">
|
||||
<label>Razem netto:</label>
|
||||
<div class="content">
|
||||
<?= number_format( $suma, 2, '.', ' ' ) . ' PLN';?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
<label>Razem brutto:</label>
|
||||
<div class="content">
|
||||
<?= number_format( $suma * 1.23, 2, '.', ' ' ) . ' PLN';?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user