Ejemplo n.º 1
0
/**
 * Выведем список системных таблиц
 */
function SystemTableList()
{
    global $db, $UI_CONFIG, $ADMIN_PATH;
    $nc_core = nc_Core::get_object();
    $nc_core->load('modules');
    $UI_CONFIG = new ui_config_system_classes('systemclass.list');
    // reinit old value from class/function.inc.php
    $UI_CONFIG->headerText = SECTION_SECTIONS_OPTIONS_SYSTEM;
    ?>
    <form method='post' action='index.php'>
        <table border='0' cellpadding='0' cellspacing='0' width='100%'>
        	<tr><td>
	            <table class='nc-table nc--striped nc--hovered' width='100%'>
    	            <tr>
        	    	    <th>ID</th>
            	        <th width='60%'><?php 
    echo CONTROL_SCLASS_TABLE;
    ?>
</th>
                        <th width='30%'><?php 
    echo CONTROL_SCLASS_ACTION;
    ?>
</th>
                        <th width='10%'><?php 
    echo CONTROL_CLASS_FIELDS;
    ?>
</th>
                    </tr>
<?php 
    $select = "SELECT a.System_Table_ID, a.System_Table_Rus_Name,b.Class_ID,IF(b.AddTemplate<>'' OR b.AddCond<>'' OR b.AddActionTemplate<>'',1,0) AS IsAdd, IF(b.EditTemplate<>'' OR b.EditCond<>'' OR b.EditActionTemplate<>'' OR b.CheckActionTemplate<>'' OR b.DeleteActionTemplate<>'',1,0) AS IsEdit, IF(b.SearchTemplate<>'' OR b.FullSearchTemplate<>'',1,0) AS IsSearch, IF(b.SubscribeTemplate<>'' OR b.SubscribeCond<>'',1,0) AS IsSubscribe, COUNT(f.Field_ID) AS `Fields`\n\t\tFROM System_Table AS a\n\t\tLEFT JOIN Class AS b ON a.System_Table_ID=b.System_Table_ID\tAND b.ClassTemplate = 0 AND b.File_Mode =" . +$_REQUEST['fs'] . "\n\t\tLEFT JOIN Field AS f ON f.System_Table_ID = a.System_Table_ID\n\t\tGROUP BY a.System_Table_ID\n\t\tORDER BY a.System_Table_ID";
    $Result = $db->get_results($select, ARRAY_N);
    foreach ($Result as $Array) {
        if ($Array[0] == 3) {
            //$Array[7] = $Array[7] / 2;
        } else {
            if (!+$_REQUEST['fs']) {
                continue;
            }
        }
        print "<tr>";
        print "<td>" . $Array[0] . "</td>";
        print "<td " . (!$Array[2] ? "colspan=2 " : "") . "bgcolor=white>" . ($Array[2] && $nc_core->modules->get_by_keyword('auth', 0) ? "<a href=" . $ADMIN_PATH . "field/system.php?fs=" . +$_REQUEST['fs'] . "&phase=2&SystemTableID=" . $Array[0] . ">" : "<a href=" . $ADMIN_PATH . "field/index.php?fs=" . +$_REQUEST['fs'] . "&isSys=1&amp;SystemTableID=" . $Array[0] . ">") . constant($Array[1]) . "</a></td>";
        if ($Array[2]) {
            print "<td>\n\t\t\t\t\t<a href=" . $ADMIN_PATH . "field/system.php?fs=" . +$_REQUEST['fs'] . "&phase=4&SystemTableID=" . $Array[0] . "&myaction=1>" . (!$Array[3] ? "<font color=gray>" : "") . CONTROL_CLASS_ACTIONS_ADD . "</a>&nbsp;&nbsp;\n\t\t\t\t\t<a href=" . $ADMIN_PATH . "field/system.php?fs=" . +$_REQUEST['fs'] . "&phase=4&SystemTableID=" . $Array[0] . "&myaction=2>" . (!$Array[4] ? "<font color=gray>" : "") . CONTROL_CLASS_ACTIONS_EDIT . "</a>&nbsp;&nbsp;\n\t\t\t\t\t<a href=" . $ADMIN_PATH . "field/system.php?fs=" . +$_REQUEST['fs'] . "&phase=4&SystemTableID=" . $Array[0] . "&myaction=3>" . (!$Array[5] ? "<font color=gray>" : "") . CONTROL_CLASS_ACTIONS_SEARCH . "</a></td>";
        }
        print "<td><a class=\"nc-label nc--blue\" href=\"" . $ADMIN_PATH . "field/index.php?fs=" . +$_REQUEST['fs'] . "&isSys=1&amp;SystemTableID=" . $Array[0] . "&fs=" . +$_REQUEST['fs'] . "\">" . $Array[7] . " " . mb_strtolower(plural_form($Array[7], CONTROL_CLASS_FIELD, CONTROL_CLASS_FIELDS, CONTROL_CLASS_FIELDS_COUNT)) . "</a></td>\n";
        print "</tr>";
    }
    ?>
				</table>
			</td></tr>
		</table>
<?php 
}
Ejemplo n.º 2
0
?>
 на ГК</small>
                                </div>
                            </div><div class="col-xs-4">
                                <div class="">
                                    <span class="h4 font-bold block fs22 TV_color">{{$statistic['products_TV']}}</span>
                                    <small class="text-muted m-b block fs11"><?php 
echo plural_form($statistic['products_TV'], 'товар', false);
?>
 на ТВ</small>
                                </div>
                            </div><div class="col-xs-4">
                                <div class="">
                                    <span class="h4 font-bold block fs22 MK_color">{{$statistic['products_MK']}}</span>
                                    <small class="text-muted m-b block fs11"><?php 
echo plural_form($statistic['products_MK'], 'товар', false);
?>
 на МК</small>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        Последнее изменение: <b><?php 
echo ch_date($statistic['lastUpdate']->created_at);
?>
, {{$statistic['lastUpdate']->showname}}</b>
                    </div>
                </div>
            </div>
        </div>
Ejemplo n.º 3
0
function nc_widgetclass_list($category)
{
    global $nc_core, $db, $ADMIN_PATH, $ADMIN_TEMPLATE, $UI_CONFIG;
    $result = $nc_core->widget->list_widgetclass();
    if ($result) {
        echo "<form method='post' action='index.php'>" . "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>" . "<table class='nc-table nc--striped nc--hovered' width='100%'>" . "<tr>" . "<th>ID</th>" . "<th width='45%'>" . WIDGET_LIST_NAME . "</th>" . "<th width='45%>'" . WIDGET_LIST_CATEGORY . "</th>" . "<th class='nc-text-center'>" . WIDGET_LIST_GO . "</th>" . "<th width='10%'>" . WIDGET_LIST_FIELDS . "</th>" . "<th class='nc-text-center'><i class='nc-icon nc--remove' title='" . WIDGET_LIST_DELETE . "'></i></th>" . "</tr>";
        foreach ($result as $key => $val) {
            if (md5($val['Category']) == $category || !isset($category)) {
                echo "<tr>" . "<td >" . $key . "</td>" . "<td ><a href='index.php?fs=" . get_fs() . "&phase=30&widgetclass_id=" . $key . "'>" . $val['Name'] . "</a></td>" . "<td ><a href='index.php?fs=" . get_fs() . "&phase=10&category=" . md5($val['Category']) . "'>" . $val['Category'] . "</a></td>" . "<td class='nc-text-center'><nobr>" . "<a href='index.php?fs=" . get_fs() . "&phase=30&widgetclass_id=" . $key . "'>" . WIDGET_LIST_EDIT . "</a>&nbsp;&nbsp;" . "<a href='index.php?fs=" . get_fs() . "&phase=50&widgetclass_id=" . $key . "'>" . WIDGET_LIST_AT . "</a></nobr></td>" . "<td><a class='nc-label nc--blue' href='" . $ADMIN_PATH . "field/index.php?fs=" . get_fs() . "&widgetclass_id=" . $key . "&fs=" . get_fs() . "'>" . $val['Fields'] . " " . mb_strtolower(plural_form($val['Fields'], CONTROL_CLASS_FIELD, CONTROL_CLASS_FIELDS, CONTROL_CLASS_FIELDS_COUNT)) . "</a></td>" . "<td class='nc-text-center'>" . nc_admin_checkbox_simple("Delete" . $key, $key) . "</td>" . "</tr>";
            }
        }
        echo "</table></td></tr></table>" . "<input type=hidden name=phase value=60>" . "<input type=hidden name=fs value=" . get_fs() . ">" . "<input type='submit' class='hidden'></form>";
    } else {
        nc_print_status(CONTROL_WIDGET_NONE, "info");
    }
    if ($key) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => WIDGET_LIST_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "red_border" => true);
    }
    $suf = get_fs() ? '_fs' : '';
    $UI_CONFIG->actionButtons[] = array("id" => "addClass", "caption" => WIDGET_LIST_ADDWIDGET, "action" => "urlDispatcher.load('widgetclass{$suf}.add()')", "align" => "left");
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => WIDGETS_LIST_IMPORT, "action" => "urlDispatcher.load('widgetclass{$suf}.import()')", "align" => "left");
}
Ejemplo n.º 4
0
                            <div class="table-responsive">
                                <table class="table table-striped table-hover">
                                    <tbody>
                                    @foreach($labels as $label)
                                        <tr>
                                            <td class="client-avatar">
                                                <?php 
echo icon($label->label, 30);
?>
                                            </td>
                                            <td>
                                                <div class="font-bold">{{$label->label}}</div>
                                            </td>
                                            <td>
                                                <?php 
echo plural_form($label->count_products, 'товар');
?>
                                            </td>
                                            <td class="text-right">
                                                <div class="btn-group btn-group-xs">
                                                    <a class="btn btn-white" href="{{ route('product.label.index', ['id'=>$label->id]) }}">
                                                        <i class="fa fa-cubes"></i> Товары
                                                    </a>
                                                    <a class="btn btn-white" href="{{ route('purchase.label.index', ['id'=>$label->id]) }}">
                                                        <i class="fa fa-bar-chart"></i> Закупки
                                                    </a>
                                                </div>
                                                @if(right('Import'))
                                                    <a class="btn btn-white btn-xs" href="{{ route('label.flag', array('id'=>$label->id)) }}">
                                                        <i class="fa fa-flag-o"></i> Экспорт
                                                    </a>
Ejemplo n.º 5
0
function get_time_type_suffix_plural($time_type, $time)
{
    $forms = array(0 => array('час', 'часа', 'часов'), 1 => array('день', 'дня', 'дней'), 2 => array('месяц', 'месяца', 'месяцев'), 3 => array('минута', 'минуты', 'минут'));
    $form = isset($forms[$time_type]) ? $forms[$time_type] : $forms[0];
    return plural_form($time, $form);
}
Ejemplo n.º 6
0
                                    </ul>
                                </div>

                                <div class="tab-content">

                                    <div id="fileExp" class="tab-pane active">
                                        <div class="clients-list">
                                            <div class="tab-content">
                                                <div class="table-responsive">
                                                    <table class="table table-striped table-hover">
                                                        <tbody>
                                                        @foreach($exportFiles as $expfile)
                                                            <tr>
                                                                <td><i class="fa fa-file-o"></i> <a class="font-bold def" href="{{$expfile->path}}">{{$expfile->filename}}</a></td>
                                                                <td><?php 
echo plural_form($expfile->count, 'товар');
?>
</td>
                                                                <td class="text-right"><a class="h_def" href="{{ route('user.show', ['id' => $expfile->user_id]) }}">{{$expfile->username}}</a> <?php 
echo ch_date($expfile->created_at);
?>
</td>
                                                            </tr>
                                                        @endforeach
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
Ejemplo n.º 7
0
            <td  bgcolor="#ffffff" width="20" height="20" colspan="3"></td>
        </tr>
        <tr>
            <td  bgcolor="#ffffff" width="20"></td>
            <td  >
               <b>
                   <font color="#000000" size="4" face="arial">
                        <a href="<?php 
    echo $more_url;
    ?>
" target="_blank" style="color:#000; font-family:Arial, Helvetica, sans-serif; font-size:18px;">
                            И ещё <?php 
    echo $other_count;
    ?>
 <?php 
    echo plural_form($other_count, array('проект', 'проекта', 'проектов'));
    ?>
 на сайте FL.ru
                        </a>
                   </font>
               </b>
            </td>
            <td  bgcolor="#ffffff" width="20"></td>
        </tr>
        <tr>
            <td  bgcolor="#ffffff" width="20" height="40" colspan="3"></td>
        </tr>
    </tbody>
    </table>
<?php 
}
        the_content();
        ?>
                </div><!-- post_all_information -->
                <div class="row post_bottom_soc">
                    <div class="post_social col-md-8 likes-block">
                        <div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="big" data-yashareQuickServices="vkontakte,facebook,twitter" data-yashareTheme="counter"></div>
                    </div><!-- post_social -->
                    <div class="col-md-4">
                        <?php 
        wpfp_link();
        ?>
                    </div><!-- col-md-4 -->
                </div><!-- row -->
                <div id="comments">
                    <h2>Коментарии<span><?php 
        plural_form(get_comments_number(), array('новый', 'новых', 'новых'));
        ?>
 </span></h2>
                    <?php 
        comments_template();
        ?>
                </div><!-- comments -->
            </div><!-- col-md-offset-2 col-md-8 -->
        <?php 
    }
    ?>
        <?php 
} else {
    ?>
            <p>Ошибка.</p>
        <?php 
Ejemplo n.º 9
0
	<div class="stat-item-container item-test-info">
		<div class="adm-input-wrap adm-input-help-icon-wrap">
			<a class="adm-input-help-icon" href="#math-hint"></a>
		</div>
		<span class="ab-test-info" style="padding: 0px; color: <?php 
    echo $math['pwr'] ? '#729e00' : '#c70000';
    ?>
; font-weight: bold; ">
			&bull; <?php 
    echo getMessage($math['pwr'] ? 'ABTEST_MATH_POWER_YES' : 'ABTEST_MATH_POWER_NO');
    ?>
			<?php 
    if (!$math['pwr'] && $estDays) {
        ?>
			(<?php 
        echo str_replace(array('#NUM#', '#UNIT#'), array($estDays, plural_form($estDays, get_plural_messages('ABTEST_DURATION_DAYS1_'))), getMessage('ABTEST_DURATION_EST'));
        ?>
)
			<?php 
    }
    ?>
		</span> <sup>1</sup><br>
		<span class="ab-test-info" style="padding: 0px; color: <?php 
    echo $math['sgn'] ? '#729e00' : '#c70000';
    ?>
; font-weight: bold; ">
			&bull; <?php 
    echo getMessage($math['sgn'] ? 'ABTEST_MATH_SIGNIFICANCE_YES' : 'ABTEST_MATH_SIGNIFICANCE_NO');
    ?>
		</span> <sup>2</sup>
	</div>
Ejemplo n.º 10
0
 /**
  * @todo: замена NewProj
  * 
  * Рассылка о новых проектах за предыдущий день. Вызывается раз в день из hourly.php
  * 
  * @param array $uids - массив идентификаторов пользователей, которых нужно исключить
  *
  * @return int количество получивших рассылку
  */
 public function NewProj2($uids = array())
 {
     $show_pro_limit = 25;
     $show_limit = 25;
     $projects = projects::GetNewProjectsPreviousDay($error, true);
     $groups = professions::GetAllGroupsLite(true);
     $page = 0;
     $count = 0;
     $projects_count = count($projects);
     if (!$projects_count) {
         return false;
     }
     //Получаем баннеры
     $settings = new settings();
     $banner_file = $settings->GetVariable('newsletter', 'banner_file');
     $banner_link = $settings->GetVariable('newsletter', 'banner_link');
     $this->subject = 'Новые проекты на FL.ru';
     $this->message = Template::render($_SERVER['DOCUMENT_ROOT'] . '/templates/mail/new_projects/project_layout.tpl.php', array('projects' => '%MESSAGE%', 'host' => $GLOBALS['host'], 'title' => '%TITLE%', 'unsubscribe_url' => '%UNSUBSCRIBE_URL%', 'date' => strtotime('- 1 day'), 'track_url' => '%TRACK_URL%'));
     $this->recipient = '';
     $massId = $this->send('text/html');
     $project_ids = array();
     foreach ($projects as $i => $prj) {
         $descr = $prj['descr'];
         $descr = htmlspecialchars($descr, ENT_QUOTES, 'CP1251', false);
         $descr = reformat(LenghtFormatEx($descr, 180), 50, 0, 1);
         $price = $prj['cost'] ? CurToChar($prj['cost'], $prj['currency']) . getPricebyProject($prj['priceby']) : null;
         $projects[$i]['html'] = Template::render($_SERVER['DOCUMENT_ROOT'] . '/templates/mail/new_projects/project.tpl.php', array('url' => $GLOBALS['host'] . getFriendlyURL('project', array('id' => $prj['id'], 'name' => $prj['name'])), 'name' => $prj['name'] ? reformat(htmlspecialchars($prj['name'], ENT_QUOTES, 'CP1251', false), 50, 0, 1) : '', 'descr' => $descr, 'host' => $GLOBALS['host'], 'project_kind' => $prj['kind'], 'project_pro_only' => $prj['pro_only'] == 't', 'project_verify_only' => $prj['verify_only'] == 't', 'project_urgent' => $prj['urgent'] == 't', 'price' => $price, 'end_date' => $prj['end_date'], 'create_date' => $prj['create_date'], 'utm_param' => '%UTM_PARAM%'));
         $project_ids[] = $prj['id'];
     }
     //Собираем юзеров у которых есть ответы на новые проекты
     $offers_exist = array();
     $offers = projects_offers::AllFrlOffersByProjectIDs($project_ids);
     if (count($offers)) {
         foreach ($offers as $offer) {
             if (!isset($offers_exist[$offer['project_id']])) {
                 $offers_exist[$offer['project_id']] = array();
             }
             $offers_exist[$offer['project_id']][$offer['user_id']] = true;
         }
     }
     $strtotime_3y_ago = strtotime('- 3 year');
     $strtotime_1y_ago = strtotime('- 1 year');
     $strtotime_1w_ago = strtotime('- 1 week');
     $current_date = time();
     $current_date_sufix = '_' . date('dmy', $current_date);
     //format:_270314
     $statistics = array();
     while ($users = freelancer::GetPrjRecps($error, ++$page, 200, $uids)) {
         $this->recipient = array();
         foreach ($users as $user) {
             //Если ли у фрилансера уточнение по категориям
             $is_mailer_str = strlen($user['mailer_str']) > 0;
             $subj = array();
             if ($is_mailer_str) {
                 foreach ($groups as $group) {
                     if (freelancer::isSubmited($user['mailer_str'], array(array('category_id' => $group['id'])))) {
                         $subj[$group['id']] = $group['name'];
                     }
                 }
             }
             $message_pro = '';
             $cnt_pro = 0;
             $message = '';
             $cnt = 0;
             $cnt_submited = 0;
             $cnt_user_submited = 0;
             foreach ($projects as $prj) {
                 //Подписан ли фрилансер на специализацию к которой относится проект
                 if ($is_mailer_str && !freelancer::isSubmited($user['mailer_str'], $prj['specs'])) {
                     continue;
                 }
                 //Считаем все проекты по выбранным специализациям
                 ++$cnt_submited;
                 //Условия не попадания в письмо
                 if ($prj['is_blocked'] == 't' || $prj['closed'] == 't' || $prj['state'] == projects::STATE_MOVED_TO_VACANCY || $prj['kind'] == projects::KIND_PERSONAL) {
                     continue;
                 }
                 //Если у фрилансера ответ на проект то не добавляем его в рассылку
                 if (isset($offers_exist[$prj['id']][$user['uid']])) {
                     continue;
                 }
                 if ($prj['pro_only'] == 't') {
                     if ($cnt_pro < $show_pro_limit) {
                         $message_pro .= $prj['html'];
                         ++$cnt_pro;
                     }
                 } else {
                     if ($cnt < $show_limit) {
                         $message .= $prj['html'];
                         ++$cnt;
                     }
                 }
                 ++$cnt_user_submited;
             }
             $message = $message_pro . $message;
             if (empty($message)) {
                 continue;
             }
             if ($cnt_user_submited <= $show_pro_limit + $show_limit) {
                 $cnt_submited = $cnt_user_submited;
             }
             //Формирует UTM метки аналитики
             $reg_date = strtotime($user['reg_date']);
             $reg_year = date('Y', $reg_date);
             $utm_content = $reg_date >= $strtotime_1w_ago ? '_new' : $reg_year;
             //$utm_content = ($user['reg_days_ago'] > 7)?$user['reg_date_year']:'_new';
             $utm_param = $this->_addUtmUrlParams('email', 'free' . $utm_content, 'day_projects' . $current_date_sufix);
             $message = str_replace('%UTM_PARAM%', $utm_param, $message);
             //Собираем шаблон
             $message = Template::render($_SERVER['DOCUMENT_ROOT'] . '/templates/mail/new_projects/project_list.tpl.php', array('projects' => $message, 'spec_list' => implode(' / ', $subj), 'setup_url' => $GLOBALS['host'] . "/users/{$user['login']}/setup/mailer/", 'other_count' => $cnt_submited - $cnt_pro - $cnt, 'more_url' => $GLOBALS['host'] . $utm_param, 'banner_file' => $banner_file, 'banner_link' => $banner_link));
             if (!$user['unsubscribe_key']) {
                 $user['unsubscribe_key'] = users::GetUnsubscribeKey($user['login']);
             }
             /*
             $date = strtotime($projects[0]['post_date']);
             $date = date( 'j', $date ) . ' ' . monthtostr(date('n', $date),true);
             */
             $projects_count_txt = $cnt_submited . ' ' . plural_form($cnt_submited, array('новый', 'новых', 'новых')) . ' ' . plural_form($cnt_submited, array('проект', 'проекта', 'проектов'));
             //$title = "{$projects_count_txt} за {$date}";
             $last_time = strtotime($user['last_time']);
             if ($last_time < $strtotime_3y_ago) {
                 $utm_content = '_3y';
             } elseif ($last_time >= $strtotime_3y_ago && $last_time <= $strtotime_1y_ago) {
                 $utm_content = '_1-3y';
             } elseif ($reg_date < $strtotime_1w_ago) {
                 $utm_content = '_1y';
             }
             /*
              * @todo: EXTRACT медленней
              
             if($user['last_years_ago'] > 0){
                $utm_content = ($user['last_years_ago'] > 3)?'_3y':'_1-3y';
             }else{
                $utm_content = ($user['reg_days_ago'] > 7)?'_1y':'_new';
             }
             */
             //Накапливаем статистику
             $stat_idx = $reg_date >= $strtotime_1w_ago ? 'new' : $reg_year;
             ++$statistics[$stat_idx];
             $this->recipient[] = array('email' => $user['uname'] . ' ' . $user['usurname'] . ' [' . $user['login'] . '] <' . $user['email'] . '>', 'extra' => array('USER_NAME' => $user['uname'], 'USER_SURNAME' => $user['usurname'], 'USER_LOGIN' => $user['login'], 'MESSAGE' => $message, 'UNSUBSCRIBE_URL' => "/unsubscribe/?type=new_projects&ukey={$user['unsubscribe_key']}" . $this->_addUtmUrlParams('email', 'free' . $utm_content, 'unsubscr_day_projects' . $current_date_sufix), 'TITLE' => $projects_count_txt, 'TRACK_URL' => $GLOBALS['host'] . StatisticHelper::track_url(0, $stat_idx, $current_date, $user['login'] . $user['uid'])));
             ++$count;
         }
         $this->bind($massId, true);
     }
     //Собранную статистику отправляем в GA
     $statistics['total'] = $count;
     $ga = StatisticFactory::getInstance('GA');
     $ga->newsletterNewProjectsFrl($statistics, $current_date);
     return $count;
 }
Ejemplo n.º 11
0
                                <i class="fa fa-bell"></i>
                            @else
                                <i class="fa fa-bell c_orange"></i><span class="crcl_label">{{$_glob['_alerts']['alarm']}}</span>
                            @endif
                        </a>
                        <ul class="dropdown-menu dropdown-alerts">
                            @foreach($_glob['_alerts']['absents'] as $absent)
                                <li>
                                    <div class="dropdown-messages-box cd clear">
                                        <div class="pull-left mr5"><?php 
echo gnrtCircleDate($absent->absent);
?>
</div>
                                        <div class="media-body">
                                            <a href="{{ route('product.absent.index', ['absent' => $absent->absent]) }}" class="small pull-right def"><?php 
echo plural_form($absent->count, 'товар');
?>
</a>
                                            <span><?php 
echo cnvSqlDate($absent->absent);
?>
</span> <br>
                                            <small class="text-muted">{{$absent->note}}</small>
                                        </div>
                                    </div>
                                </li>
                                <li class="divider"></li>
                            @endforeach
                            <li>
                                <div class="text-center link-block">
                                    <a href="{{ route('absent.index') }}">
Ejemplo n.º 12
0
        $running_hours = $running_tmp->format('%h');
        $running = '';
        if ($running_days) {
            $running .= '<span>' . $running_days . '</span> ' . plural_form($running_days, get_plural_messages('ABTEST_DURATION_DAYS1_'));
        }
        if ($running_hours) {
            $running .= ' <span>' . $running_hours . '</span> ' . plural_form($running_hours, get_plural_messages('ABTEST_DURATION_HOURS_'));
        } else {
            if (!$running_days) {
                $running .= getMessage('ABTEST_DURATION_HOURS_0');
            }
        }
        if ($abtest['DURATION']) {
            $running .= ' ' . getMessage('ABTEST_DURATION_OF') . ' <span>' . $abtest['DURATION'] . ' </span>';
            if ($running_hours || !$running_days) {
                $running .= ' ' . plural_form($abtest['DURATION'], get_plural_messages('ABTEST_DURATION_DAYS2_'));
            }
        }
        ?>

		<span class="ab-test-info"><?php 
        echo getMessage('ABTEST_DURATION2');
        ?>
: <?php 
        echo $running;
        ?>
</span>
		<?php 
    }
}
?>
Ejemplo n.º 13
0
 public function saveHistory($action, $object = null, $dop = null)
 {
     switch ($action) {
         case 'create_category':
             $message = "Создал категорию [" . $object . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'rename_category':
             $message = "Переименовал категорию [" . $object . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'move_category':
             $categoryModel = new Category();
             $category = $categoryModel->getCategory($object, array('name'));
             $message = "Переименовал категорию [" . $category->name . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'status_category':
             $categoryModel = new Category();
             $category = $categoryModel->getCategory($object, array('name'));
             if ($dop) {
                 $message = "Включил категорию [" . $category->name . "]";
             } else {
                 $message = "Отключил категорию [" . $category->name . "]";
             }
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'create_user':
             $message = "Создал пользователя [" . $object . "]";
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'update_user':
             $message = "Отредактировал пользователя(ей) [" . $object . "]";
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'status_user':
             $userModel = new User();
             $user = $userModel->getUser($object, array('showname'));
             if ($dop) {
                 $message = "Включил пользователя [" . $user->showname . "]";
             } else {
                 $message = "Отключил пользователя [" . $user->showname . "]";
             }
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'create_currency':
             $message = "Создал новую валюту [" . $object . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'delete_currency':
             $currencyModel = new Currency();
             $currency = $currencyModel->getNameCurrencyById($object);
             $message = "Удалил валюту [" . $currency . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'update_rate':
             $currencyModel = new Currency();
             $currency = $currencyModel->getNameCurrencyById($object['currency_id']);
             $message = "Установил курс [" . $currency . " = " . $object['rate'] . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'auto_update_currency':
             $this->insert(array('label' => "Валюты", 'color_label' => 'label label-warning', 'action' => "Обновлены курсы валют по ЦБ", 'user_id' => $object, 'created_at' => date('Y-m-d H:i:s')));
             return true;
             break;
         case 'create_note':
             $message = "Создал публичную заметку";
             $label = 'Заметки';
             $colorLabel = 'label';
             break;
         case 'update_products':
             $product = array();
             foreach ($object as $key => $elem) {
                 $product[] = "<a class='h_def' href='/product/" . $key . "'>" . $key . "</a>";
             }
             $message = "Отредактировал товар(ы) [" . implode(', ', $product) . "]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'import':
             $text = '';
             if (isset($object['update_prod'])) {
                 $text .= "[" . plural_form($object['update_prod'], 'обновлен', false) . ' ' . plural_form($object['update_prod'], 'товар') . "] ";
             }
             if (isset($object['add_prod'])) {
                 $text .= "[" . plural_form($object['add_prod'], 'добавлен', false) . ' ' . plural_form($object['add_prod'], 'товар') . "] ";
             }
             if (isset($object['add_to_GK'])) {
                 $text .= "[на ГК " . plural_form($object['add_to_GK'], 'добавлен', false) . ' ' . plural_form($object['add_to_GK'], 'товар') . "] ";
             }
             if (isset($object['add_to_TV'])) {
                 $text .= "[на ТВ " . plural_form($object['add_to_TV'], 'добавлен', false) . ' ' . plural_form($object['add_to_TV'], 'товар') . "] ";
             }
             if (isset($object['add_to_MK'])) {
                 $text .= "[на МК " . plural_form($object['add_to_MK'], 'добавлен', false) . ' ' . plural_form($object['add_to_MK'], 'товар') . "] ";
             }
             if (isset($object['update_purch'])) {
                 $text .= "[" . plural_form($object['update_purch'], 'обновлен', false) . ' ' . plural_form($object['update_purch'], 'условие') . "] ";
             }
             if (isset($object['add_purch'])) {
                 $text .= "[" . plural_form($object['add_purch'], 'добавлен', false) . ' ' . plural_form($object['add_purch'], 'условие') . "] ";
             }
             $message = "Импорт. " . $text;
             $label = 'Импорт';
             $colorLabel = 'label label-warning';
             break;
         case 'create_product':
             $message = "Добавил товар [<a class='h_def' href='/product/" . $object . "'>" . $object . "</a>]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
             /*case 'create_product_imp':
               $message = "Добавил товар [<a class='h_def' href='/product/" . $object . "'>". $object . "</a>]";
               $label = 'Товары и цены';
               $colorLabel = 'label label-primary';
               break;*/
         /*case 'create_product_imp':
           $message = "Добавил товар [<a class='h_def' href='/product/" . $object . "'>". $object . "</a>]";
           $label = 'Товары и цены';
           $colorLabel = 'label label-primary';
           break;*/
         case 'add_to_site':
             $message = "Добавил товар [<a class='h_def' href='/product/" . $object . "'>" . $object . "</a>] на сайт [" . $dop . "]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'add_to_site_imp':
             $message = "Добавил товар [<a class='h_def' href='/product/" . $object . "'>" . $object . "</a>] на сайт [" . $dop . "] через импорт";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'update_purchase':
             $product = array();
             foreach ($object as $elem) {
                 $product[] = "<a class='h_def' href='/product/" . $elem['product_id'] . "'>" . $elem['product_id'] . "</a>";
             }
             $message = "Отредактировал товар(ы) [" . implode(', ', $product) . "]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'add_purchase':
             $message = "Добавил условия для товара [<a class='h_def' href='/product/" . $object . "'>" . $object . "</a>]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'del_purchase':
             $message = "Удалил условие товара [<a class='h_def' href='/product/" . $object . "'>" . $object . "</a>]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'create_brand':
             $message = "Создал производителя [" . $object . "]";
             $label = 'Производители';
             $colorLabel = 'label label-success';
             break;
         case 'rename_brand':
             $message = "Переименовал производителя [" . $object . "]";
             $label = 'Производители';
             $colorLabel = 'label label-success';
             break;
         case 'status_brand':
             $brandModel = new Brand();
             $brand = $brandModel->getBrand($object, array('name'));
             if ($dop) {
                 $message = "Включил производителя [" . $brand->name . "]";
             } else {
                 $message = "Отключил производителя [" . $brand->name . "]";
             }
             $label = 'Производители';
             $colorLabel = 'label label-success';
             break;
         case 'create_provider':
             $message = "Создал поставщика [" . $object . "]";
             $label = 'Поставщики';
             $colorLabel = 'label label-success';
             break;
         case 'update_provider':
             $message = "Отредактировал поставщика [" . $object . "]";
             $label = 'Поставщики';
             $colorLabel = 'label label-success';
             break;
         case 'status_provider':
             $provoderModel = new Provider();
             $provider = $provoderModel->getProvider($object, array('name'));
             if ($dop) {
                 $message = "Включил поставщика [" . $provider->name . "]";
             } else {
                 $message = "Отключил поставщика [" . $provider->name . "]";
             }
             $label = 'Поставщики';
             $colorLabel = 'label label-success';
             break;
         default:
             $label = 'Что-то пошло не так';
             $colorLabel = 'label label-danger';
             $message = 'Что-то пошло не так';
     }
     $this->insert(array('label' => $label, 'color_label' => $colorLabel, 'action' => $message, 'user_id' => Auth::User()->id, 'created_at' => date('Y-m-d H:i:s')));
 }
Ejemplo n.º 14
0
/**
 * Вывод списка шаблонов
 *
 * @param string group name
 */
function ClassList($Class_Group = false)
{
    global $db, $ADMIN_PATH, $ADMIN_TEMPLATE, $UI_CONFIG;
    // get nc_core
    $nc_core = nc_Core::get_object();
    $file_mode = intval($nc_core->input->fetch_get_post('fs'));
    if ($Class_Group) {
        $select = "SELECT c.`Class_ID`,\n\t\tc.`Class_Name`,\n\t\tCOUNT(f.`Field_ID`) AS `Fields`,\n\t\tIF(c.`AddTemplate` <> ''\n\t\t\tOR c.`AddCond` <> ''\n\t\t\tOR c.`AddActionTemplate` <> '', 1, 0) AS IsAdd,\n\t\tIF(c.`EditTemplate` <> ''\n\t\t\tOR c.`EditCond` <> ''\n\t\t\tOR c.`EditActionTemplate` <> ''\n\t\t\tOR c.`CheckActionTemplate` <> '', 1, 0) AS IsEdit,\n\t\tIF(c.`SearchTemplate` <> ''\n\t\t\tOR c.`FullSearchTemplate` <> '', 1, 0) AS IsSearch,\n\t\tIF(c.`SubscribeTemplate` <> ''\n\t\t\tOR c.`SubscribeCond` <> '', 1, 0) AS IsSubscribe,\n\t\tIF(c.`DeleteActionTemplate` <> ''\n\t\t\tOR c.`DeleteTemplate` <> ''\n\t\t\tOR c.`DeleteCond` <> '', 1, 0) as IsDelete\n\t\tFROM `Class` AS c\n\t\tLEFT JOIN `Field` AS f ON c.`Class_ID` = f.`Class_ID`\n\t\tWHERE md5(c.`Class_Group`) = '" . $db->escape($Class_Group) . "'\n\t\t\tAND c.`System_Table_ID` = 0\n\t\t\tAND c.`ClassTemplate` = 0\n\t\t\tAND c.`File_Mode` = '" . $file_mode . "'\n\t\tGROUP BY c.`Class_ID`\n\t\tORDER BY c.`Priority`, c.`Class_ID`";
    } else {
        $select = "SELECT c.`Class_ID`,\n\t\tc.`Class_Name`,\n\t\tCOUNT(f.`Field_ID`) AS `Fields`,\n\t\tIF(c.`AddTemplate` <> ''\n\t\t\tOR c.`AddCond` <> ''\n\t\t\tOR c.`AddActionTemplate` <> '', 1, 0) AS IsAdd,\n\t\tIF(c.`EditTemplate` <> ''\n\t\t\tOR c.`EditCond` <> ''\n\t\t\tOR c.`EditActionTemplate` <> ''\n\t\t\tOR c.`CheckActionTemplate` <> ''\n\t\t\tOR c.`DeleteActionTemplate` <> '', 1, 0) AS IsEdit,\n\t\tIF(c.`SearchTemplate` <> ''\n\t\t\tOR c.`FullSearchTemplate` <> '', 1, 0) AS IsSearch,\n\t\tIF(c.`SubscribeTemplate` <> ''\n\t\t\tOR c.`SubscribeCond` <> '', 1, 0) AS IsSubscribe,\n\t\t\tc.`Class_Group`\n\t\tFROM `Class` AS c\n\t\tLEFT JOIN `Field` AS f ON c.`Class_ID` = f.`Class_ID`\n\t\tWHERE c.`System_Table_ID` = 0\n\t\t\tAND c.`ClassTemplate` = 0\n\t\t\tAND c.`File_Mode` = '" . $file_mode . "'\n\t\tGROUP BY c.`Class_ID`\n\t\tORDER BY c.`Priority`, c.`Class_ID`";
    }
    if ($Result = $db->get_results($select)) {
        ?>
		<form method='post' action='index.php'>
			<table border='0' cellpadding='0' cellspacing='0' width='100%'>
				<tr>
					<td>
<?php 
        $action_map = array(array(1, CONTROL_CLASS_ACTIONS_ADD, 'file-add nc--hovered', 'IsAdd'), array(2, CONTROL_CLASS_ACTIONS_EDIT, 'edit nc--hovered', 'IsEdit'), array(5, CONTROL_CLASS_ACTIONS_DELETE, 'remove nc--hovered', 'IsDelete'), array(3, CONTROL_CLASS_ACTIONS_SEARCH, 'mod-search nc--hovered', 'IsSearch'), array(4, CONTROL_CLASS_ACTIONS_MAIL, 'mod-comments nc--hovered', 'IsSubscribe'));
        ?>
						<table class='nc-table nc--striped nc--hovered nc--wide'>
							<tr>
								<th class='nc-text-center nc--compact'>ID</th>
								<th><?php 
        echo CONTROL_CLASS_CLASS;
        ?>
</th>
                            <?php 
        if (!$Class_Group) {
            ?>
								<th width='20%'><?php 
            echo CONTROL_USER_GROUP;
            ?>
</th>
                            <?php 
        }
        ?>
								<th class='nc-text-center nc--compact' colspan='<?php 
        echo count($action_map);
        ?>
' style='padding: 0;'><?php 
        echo CONTROL_CLASS_ACTIONS;
        ?>
</th>
								<th class='nc-text-center nc--compact' width='10%'><?php 
        echo CONTROL_CLASS_FIELDS;
        ?>
</th>
								<th class='nc-text-center nc--compact'><i class='nc-icon nc--remove nc--hovered' title='<?php 
        echo CONTROL_CLASS_DELETE;
        ?>
'></i></th>
							</tr>
<?php 
        foreach ($Result as $Array) {
            ?>
							<tr>
							<td><?php 
            echo $Array->Class_ID;
            ?>
</td>
							<td><a href="index.php?fs=<?php 
            echo $file_mode;
            ?>
&phase=4&ClassID=<?php 
            echo $Array->Class_ID . ($Class_Group ? '&ClassGroup=' . md5($Class_Group) : '');
            ?>
"><?php 
            echo $Array->Class_Name;
            ?>
</a></td>
<?php 
            if (!$Class_Group) {
                ?>
							<td><a href="index.php?fs=<?php 
                echo $file_mode;
                ?>
&phase=1&ClassGroup=<?php 
                echo md5($Array->Class_Group);
                ?>
"><?php 
                echo $Array->Class_Group;
                ?>
</a></td>
<?php 
            }
            foreach ($action_map as $action_props) {
                $action_href = 'index.php?fs=' . $file_mode . '&phase=8&ClassID=' . $Array->Class_ID . '&myaction=' . $action_props[0];
                if ($Class_Group) {
                    $action_href .= '&ClassGroup=' . urlencode($Class_Group);
                }
                $check_prop = $action_props[3];
                $is_inactive = !$Array->{$check_prop};
                ?>
							<td width="1%" class="button nc-padding-5">
								<a href="<?php 
                echo $action_href;
                ?>
"<?php 
                echo $is_inactive ? ' style="color:#888;"' : '';
                ?>
 title="<?php 
                echo $action_props[1];
                ?>
">
									<i class="nc-icon nc--<?php 
                echo $action_props[2] . ($is_inactive ? ' nc--hovered' : '');
                ?>
"></i>
								</a>
							</td>
	<?php 
            }
            ?>

							<td class='nc-text-center'><a class="nc-label nc--blue" href="<?php 
            echo $ADMIN_PATH;
            ?>
field/?ClassID=<?php 
            echo $Array->Class_ID;
            ?>
&fs=<?php 
            echo $file_mode;
            ?>
" title="<?php 
            echo $Array->Fields;
            ?>
 <?php 
            echo plural_form($Array->Fields, CONTROL_CLASS_FIELD, CONTROL_CLASS_FIELDS, CONTROL_CLASS_FIELDS_COUNT);
            ?>
"><?php 
            echo $Array->Fields;
            ?>
</a></td>
							<td class='nc-text-center'><input type='checkbox' name='Delete<?php 
            echo $Array->Class_ID;
            ?>
' value='<?php 
            echo $Array->Class_ID;
            ?>
'></td>
							</tr>
<?php 
        }
        ?>
						</table>
					</td>
				</tr>
			</table>
			<br />
<?php 
    } else {
        nc_print_status(CONTROL_CLASS_NONE, 'error');
    }
    $UI_CONFIG->actionButtons[] = array("id" => "addClass", "caption" => CONTROL_CLASS_FUNCS_SHOWCLASSLIST_ADDCLASS, "action" => "urlDispatcher.load('dataclass" . ($file_mode ? '_fs' : '') . ".add({$Class_Group})')", "align" => "left");
    $UI_CONFIG->actionButtons[] = array("id" => "importClass", "caption" => CONTROL_CLASS_FUNCS_SHOWCLASSLIST_IMPORTCLASS, "action" => "urlDispatcher.load('#tools.databackup.import')", "align" => "left");
    if ($Array) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => NETCAT_ADMIN_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "red_border" => true);
        if ($Class_Group) {
            ?>
		<input type='hidden' name='ClassGroup' value='<?php 
            echo $Class_Group;
            ?>
'>
	<?php 
        }
        ?>
		<input type='hidden' name='fs' value="<?php 
        echo $file_mode;
        ?>
">
		<input type='hidden' name='phase' value='6'>
		<input type='submit' class='hidden'>
	</form>
<?php 
    }
}
Ejemplo n.º 15
0
     }
     $user_name = CUser::formatName(CSite::getNameFormat(), array('TITLE' => $abtest['USER_TITLE'], 'NAME' => $abtest['USER_NAME'], 'SECOND_NAME' => $abtest['USER_SECOND_NAME'], 'LAST_NAME' => $abtest['USER_LAST_NAME'], 'LOGIN' => $abtest['USER_LOGIN']), true, true);
     $status = '<table style="width: 100%; border-spacing: 0px; "><tr>';
     $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><img src="/bitrix/images/abtest/ab-test-on.gif"></td>';
     $status .= '<td style="padding: 0px 10px; vertical-align: top; ">';
     $status .= '<span style="white-space: nowrap; color: #729e00; font-weight: bold; ">' . getMessage('ABTEST_STATE_STARTED') . '</span><br>';
     $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_START_DATE') . ': ' . $start_date . ' / ' . getMessage('ABTEST_DURATION') . ': ' . $running . '</span><br>';
     $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STARTED_BY') . ': <a href="/bitrix/admin/user_edit.php?ID=' . $abtest['USER_ID'] . '&lang=' . LANG . '">' . $user_name . '</a></span>';
     $status .= '</td>';
     if ($isAdmin) {
         $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><span class="adm-btn" onclick="if (confirm(\'' . CUtil::JSEscape(getMessage('ABTEST_STOP_CONFIRM')) . '\')) ' . $lAdmin->actionDoGroup($abtest['ID'], 'stop') . '">' . getMessage('ABTEST_BTN_STOP') . '</span></td>';
     }
     $status .= '</tr></table>';
 } else {
     $stop_date = $abtest['STOP_DATE'] ? $abtest['STOP_DATE']->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE'])) : false;
     $duration = $abtest['DURATION'] ? $abtest['DURATION'] . ' ' . plural_form($abtest['DURATION'], get_plural_messages('ABTEST_DURATION_DAYS1_')) : false;
     $user_name = $abtest['USER_ID'] ? CUser::formatName(CSite::getNameFormat(), array('TITLE' => $abtest['USER_TITLE'], 'NAME' => $abtest['USER_NAME'], 'SECOND_NAME' => $abtest['USER_SECOND_NAME'], 'LAST_NAME' => $abtest['USER_LAST_NAME'], 'LOGIN' => $abtest['USER_LOGIN']), true, true) : false;
     $status = '<table style="width: 100%; border-spacing: 0px; "><tr>';
     $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><img src="/bitrix/images/abtest/ab-test-off.gif"></td>';
     $status .= '<td style="padding: 0px 10px; vertical-align: top; ">';
     $status .= '<span style="white-space: nowrap; font-weight: bold; ">' . getMessage('ABTEST_STATE_STOPPED') . '</span><br>';
     if ($stop_date || $duration) {
         $status .= '<span style="white-space: nowrap; ">' . ($stop_date ? getMessage('ABTEST_STOP_DATE') . ': ' . $stop_date : '') . ($stop_date && $duration ? ' / ' : '') . ($duration ? getMessage('ABTEST_DURATION') . ': ' . $duration : '') . '</span><br>';
     }
     if ($user_name) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOPPED_BY') . ': <a href="/bitrix/admin/user_edit.php?ID=' . $abtest['USER_ID'] . '&lang=' . LANG . '">' . $user_name . '</a></span>';
     }
     $status .= '</td>';
     if ($isAdmin) {
         if ($abtest['ENABLED'] == 'T') {
             $action = $lAdmin->actionRedirect('abtest_edit.php?ID=' . $abtest['ID'] . '&lang=' . LANG);