Файл: monst/core/pag/daily.php
Строк: 103
<?
upd_loc('read daily quests');
if ( isset($index[1]) AND $index[1] == 'end' ) {
$daily_id = (int)$index[2];
if ( $daily_id ) {
if ( !isset($daily[$daily_id]) ) {
g('/daily');
}
if ( $daily[$daily_id]['count'] >= $daily[$daily_id]['need'] AND !$daily[$daily_id]['end'] ) {
$gold = $daily[$daily_id]['gold'];
$exp = $daily[$daily_id]['exp'];
if ( $user['vip_time'] > time() ) {
$gold = $gold * 2;
}
$daily[$daily_id]['end'] = 1;
$daily_db[$daily_id]['end'] = 1;
// q
foreach ($quest as $q) {
if ($q['type'] == 'daily') {
$quest_db[$q['id']]['count'] += 1;
}
}
$upd = $_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'daily' => $daily_db,
'gold' => $user['gold'] + $gold,
'exp' => $user['exp'] + $exp,
'quest' => $quest_db
]
]
);
?>
<div class='ok_box'>
<?=$lang['daily.php']['end_text']?><br/>
<img src='<?=$gold_icon?>' alt='' width='20'/><span style='color: <?=$gold_color?>;'><?=num($gold)?></span>
<img src='<?=$exp_icon?>' alt='' width='20'/><span style='color: <?=$exp_color?>;'><?=num($exp)?></span><br/>
</div>
<?
}
}
}
?>
<div style='backgro2und: #000; padding: 20px; text-align: center; fon2t-size: 15px;'>
<a href='/quest'><?=$lang['daily.php']['part_quest']?></a> | <?=$lang['daily.php']['daily']?><br/>
</div>
<?
$all_daily = count($daily);
$ended = 0;
foreach ( $daily as $daily_id => $daily_dat ) {
if ( $daily_dat['end'] ) {
$ended++;
}
}
$progress = floor($ended / $all_daily * 100);
$progress_color = '#fff';
?>
<br/>
<div style='text-align: center;'>
<span style='color: <?=$progress_color?>; font-size: 20px;'><?=$progress?>%</span>
<div style='width: 200px; height: 10px; background: #222; margin: auto;'>
<div style='width: <?=$progress?>%; height: 10px; background: <?=$progress_color?>;'>
</div>
</div>
</div>
<br/>
<?
foreach ( $daily as $daily_id => $daily_dat ) {
?>
<div class='quest_box'>
<?
if ( $daily_dat['count'] >= $daily_dat['need'] AND !$daily_dat['end'] ) {
?>
<img src='/core/i/other/ok.png?1' alt='' width='30'/>
<!-- <span style='font-size: 30px; color: mediumseagreen; font-weight: bold;'>√</span>-->
<?
} elseif ( $daily_dat['end'] ) {
?>
<img src='/core/i/other/ok_gray.png' alt='' width='30'/>
<!-- <span style='font-size: 30px; color: #555; font-weight: bold;'>√</span>-->
<?
} else {
?>
<span style='font-size: 30px; color: <?=$user['theme_color']?>; font-weight: bold;'>?</span>
<?
}
?>
<!-- <img src='--><?//=$quest_dat['icon']?><!--' alt='' width='40' style='float: right; --><?// if ( $quest_dat['end'] ) print '-webkit-filter: grayscale(100%); filter: grayscale(100%); opacity: 0.5;'; ?><!--'/>-->
<span style='fon2t-size: 15px; <? if ( $daily_dat['end'] ) print 'color: #555'; else print 'color: #999;'; ?>'>
<?=$daily_dat['name']?>
<?
// if ( $daily_dat['type'] == 'buy_gold' ) {
// ?>
<!-- <br/>-->
<!-- <span style='color: #777; font-size: 11px;'>--><?//=$lang['daily.php']['dont_needed']?><!--</span>-->
<!-- --><?//
// }
?>
</span><br/>
<?
if ( $daily_dat['end'] ) {
?>
<span style='color: <?=$progress_color?>; color: #333 ;'>
<?=$lang['daily.php']['complete']?>
</span><br/>
<?
} else {
if ( $daily_dat['count'] >= $daily_dat['need'] ) {
if ( $daily_dat['count'] >= $daily_dat['need'] ) {
?>
<span style='color: yellowgreen;'>
<?=$lang['daily.php']['progress']?>: <?=$daily_dat['count']?>/<?=$daily_dat['need']?><br/>
</span>
<?
} else {
?>
<?=$lang['daily.php']['progress']?>: <?=$daily_dat['count']?>/<?=$daily_dat['need']?><br/>
<?
}
?>
<div style='text-align: center;'>
<a href='/daily/end/<?=$daily_id?>'>
<img src='<?=$gold_icon?>' alt='' width='70'/>
</a>
</div>
<?
} else {
?>
<span style='color: <?=$user['theme_color']?>;'>
<?=$lang['daily.php']['progress']?>: <?=$daily_dat['count']?>/<?=$daily_dat['need']?><br/>
</span>
<?
}
}
?>
</div>
<?
}