예제 #1
0
파일: list.php 프로젝트: Kmartynov/cms
 $plug_path = getinfo('plugins_url') . 'samborsky_polls/';
 $url_path = getinfo('site_url') . 'admin/samborsky_polls/';
 $id = $row->q_id;
 $qu = stripslashes($row->q_question);
 if (function_exists('mb_strlen') and mb_strlen($qu) > 50) {
     $qu = textTruncate($qu);
 }
 $cell1 = $id;
 $cell2 = "<a href='{$url_path}manage/{$id}'>{$qu}</a>";
 $cell3 = '<div align="right">' . number_format($row->q_totalvotes, 0, ' ', ' ') . '</div>';
 $cell4 = strftime("%m-%d-%Y", $row->q_timestamp);
 if (!$row->q_active) {
     $cell5 = t('Закрыто');
     $cell6 = "<a href='{$url_path}list/open/{$id}'><img src='{$plug_path}img/open.png' title='" . t('Открыть голосование') . "'></a>";
 } else {
     $cell5 = $row->q_expiry ? declination(ceil(($row->q_expiry + -mktime()) / 60 / 60 / 24)) : t('Бессрочное');
     $cell6 = "<a href='{$url_path}list/close/{$id}'><img src='{$plug_path}img/close.png' title='" . t('Закрыть голосование') . "'></a>";
 }
 $link_for_page = '[php]if(function_exists(\\\'samborsky_polls\\\')) echo samborsky_polls(\\\'' . $id . '\\\');[/php]';
 $link_header = t('Код для добавления голосования на страницу') . ' ';
 $link_text = t('(должен быть включен плагин run_php)');
 $cell6 .= " <a href=\"#\"\tonClick = \"jAlert('<textarea cols=60 rows=4>{$link_for_page}</textarea><p>{$link_text}</p>', '{$link_header}'); return false;\"><img src='{$plug_path}img/link.png' title='" . t('Код для добавления голосования на страницу') . "'></a>";
 $cell6 .= " <a href='{$url_path}logs/{$id}'><img src='{$plug_path}img/log.png' title='" . t('Логи') . "'></a>";
 $cell6 .= " <a href='{$url_path}list/delete/{$id}' onclick=\"return confirm('" . t('Удаляем голосование') . "\\r\\n{$qu}\\r\\n\\r\\n " . t('Вы уверены?') . "');\"><img src='{$plug_path}img/del.png' title='" . t('Удалить') . "'></a>";
 $CI->table->add_row($cell1, $cell2, $cell3, $cell4, $cell5, $cell6);
 // Если есть ошибки - добавляем в массив
 if ($row->q_totalvotes != $row->q_totalvoters) {
     $str = "<li>ID: {$row->q_id}, ";
     $str .= t('Вопрос:') . " {$qu}, ";
     $str .= t('сумма голосов') . " - <strong>{$row->q_totalvotes}</strong>, ";
     $str .= t('проголосовавших') . " - <strong>{$row->q_totalvoters}</strong></li>";
예제 #2
0
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div><!-- /.row -->
                </div><!--container-->
            </div><!--popover-content-->

            <!-- Nav dropdown -->
            <ul class="nav navbar-nav navbar-right navbar-link pull-right">
                <?php 
global $user_ntf_unread_cnt, $global_ntf_cnt;
$notifications_count = $user_ntf_unread_cnt + $global_ntf_cnt;
if ($notifications_count > 0) {
    echo '<li>
                            <a class="notification" href="?page=notifications" title="' . declination($notifications_count, array(' сообщение', ' сообщения', ' сообщений')) . '">
                            <i class="cpa cpa-bell-o"></i>
                            <span class="badge badge-danger">' . $notifications_count . '</span>
                            </a>
                            </li>';
}
if (1) {
    // Сделать проверку на многопользовательность
    ?>
                    <li class="text-info">
                        <a class="dropdown-link" href="?page=logout">Выход</a>
                    </li>
<?php 
} else {
    ?>
                    <li class="dropdown">
예제 #3
0
        }
    }
    if (count($arr_timezone_settings) > 1) {
        echo "<li role='presentation' class='divider'></li>";
    }
    ?>
  
                <li><a href="?page=settings&type=timezone"><i class='fa fa-cog'></i>&nbsp;Настроить часовой пояс</a></li>
              </ul>
            </li>            
            <li><a href="?page=logout">Выход</a></li>
          </ul>

            <?php 
    $notifications_count = count($global_notifications);
    if ($notifications_count > 0) {
        echo "<ul class='nav navbar-nav'>";
        echo "<li><a href='?page=notifications'><span class='label label-danger'><i class='fa fa-info-circle'></i> " . declination($notifications_count, array(' сообщение', ' сообщения', ' сообщений')) . "</span></a></li>";
        echo "</ul>";
    }
    ?>


        </div><!--/.nav-collapse -->

    <?php 
}
?>

  </div>
</div>
            $('#ntf_unread_cnt').text(responce.unread_cnt_all);
            $('#ntf_cnt').text(responce.cnt);
        });        
        return false;
    }
</script>
<div class="page-heading">
    <div class="header-content clearfix">
        <h2 class="pull-left">
            У вас
            <strong><?php 
echo $current_ntf_cnt;
?>
</strong>
            <?php 
echo declination($current_ntf_cnt, $declination, false);
?>
        </h2>
        <?php 
if ($var['cnt_unread'] - $var['cnt_system'] > 0) {
    ?>
            <a class="btn btn-default pull-right" href="?page=notifications&act=read_all" id="real_all_button">
                <i class="cpa cpa-check-o"></i>
                <span>Отметить все как прочитанное</span>
            </a>
        <?php 
}
?>
    </div>
</div>
<div class="link-list-box">
예제 #5
0
             }
             // Add item to conditions section
             $arr['rules'][$i]['conditions'][] = array('textinput' => inputtype($cur_item_val['root']['type']), 'getinput' => $cur_item_val['root']['type'] == 'get', 'type' => $condition_types[$cur_item_val['root']['type']], 'select_type' => $cur_item_val['root']['type'], 'value' => $cur_item_val['root']['value'], 'destination_id' => $cur_item_val['inner'][0]['value']);
         }
         $arr_destinations = array_keys($arr_destinations);
         $destinations_count = count($arr_destinations);
         switch ($destinations_count) {
             case 0:
                 break;
             case 1:
                 $str = current($arr_destinations);
                 $arr['rules'][$i]['destination'] = $arr_offers[$str]['offer_name'];
                 $arr['rules'][$i]['destination_id'] = $arr_offers[$str]['id'];
                 break;
             default:
                 $arr['rules'][$i]['destination_multi'] = declination($destinations_count, array(' оффер', ' оффера', ' офферов'));
                 break;
         }
         $arr['rules'][$i]['default_destination_id'] = $default_destination_id;
         $arr['rules'][$i]['other_users'] = count($cur['items']) > 1 ? 'Остальные посетители' : 'Все посетители';
         $i++;
     }
     echo json_encode($arr);
     exit;
     break;
 case 'excel_export':
     include _TRACK_SHOW_COMMON_PATH . '/lib/excel_writer/ExcelWriterXML.php';
     $xml = new ExcelWriterXML('report.xls');
     $sheet = $xml->addSheet('Report');
     // Get data for report
     $arr_data = get_excel_report($_REQUEST['date']);
예제 #6
0
    foreach ($val as $sk => $ssql) {
        $res = $DB->Query($ssql);
        while ($ar = $res->Fetch()) {
            $arResult[$key][$sk][] = $ar;
        }
    }
}
$ru = array('fresh' => GetMessage('STATE1'), 'achtung' => GetMessage('STATE2'), 'inprogress' => GetMessage('STATE3'), 'fixed' => GetMessage('STATE4'), 'prosecutor' => GetMessage('STATE5'), 'gibddre' => GetMessage('STATE6'));
foreach ($arResult['state'][0] as $k => $ar) {
    $arResult['state'][0][$k]['state'] = strtr($ar['state_to_filter'], $ru);
}
$num = date('Y', $arResult['state'][1][0]['time']) - 1970;
$tmp = $num != 0 ? $num . declination($num, 'Y') . ', ' : '';
$num = gmdate('m', $arResult['state'][1][0]['time']) - 1;
$tmp .= $num != 0 ? $num . declination($num, 'm') . ', ' : '';
$num = gmdate('d', $arResult['state'][1][0]['time']) - 1;
$tmp .= $num != 0 ? $num . declination($num, 'd') . ', ' : '';
$num = gmdate('H', $arResult['state'][1][0]['time']);
$tmp .= $num != 0 ? $num . declination($num, 'H') . ', ' : '';
$num = gmdate('i', $arResult['state'][1][0]['time']);
$tmp .= $num != 0 ? $num . declination($num, 'i') . ', ' : '';
$num = gmdate('s', $arResult['state'][1][0]['time']) - 1;
$tmp .= $num != 0 ? $num . declination($num, 's') . ', ' : '';
$tmp = substr($tmp, 0, strlen($tmp) - 2);
$arResult['state'][1][0]['time'] = $tmp;
for ($i = 0; $i < 2; $i++) {
    foreach ($arResult['user'][$i] as $k => $v) {
        $arResult['user'][$i][$k]['user'] = !empty($v['name']) && !empty($v['last_name']) ? $v['last_name'] . ' ' . $v['name'] : $v['login'];
    }
}
$this->IncludeComponentTemplate();
예제 #7
0
 function getSunTimes()
 {
     $lw = rad * -$this->lng;
     $phi = rad * $this->lat;
     $d = toDays($this->date);
     $n = julianCycle($d, $lw);
     $ds = approxTransit(0, $lw, $n);
     $M = solarMeanAnomaly($ds);
     $L = eclipticLongitude($M);
     $dec = declination($L, 0);
     $Jnoon = solarTransitJ($ds, $M, $L);
     $result = ['solarNoon' => fromJulian($Jnoon), 'nadir' => fromJulian($Jnoon - 0.5)];
     for ($i = 0, $len = count($this->times); $i < $len; $i += 1) {
         $time = $this->times[$i];
         $Jset = getSetJ($time[0] * rad, $lw, $phi, $dec, $n, $M, $L);
         $Jrise = $Jnoon - ($Jset - $Jnoon);
         $result[$time[1]] = fromJulian($Jrise);
         $result[$time[2]] = fromJulian($Jset);
     }
     return $result;
 }