本文整理汇总了PHP中nc_print_status函数的典型用法代码示例。如果您正苦于以下问题:PHP nc_print_status函数的具体用法?PHP nc_print_status怎么用?PHP nc_print_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nc_print_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_environment
/**
* Проверка правильности настроек сервера, выводится на странице «Информация»
* в панели управления модулем.
* @return void
*/
public function check_environment()
{
nc_search_util::check_sites_language();
// multibyte string function overload must be disabled
if (intval(ini_get("mbstring.func_overload")) & 2) {
nc_print_status(NETCAT_MODULE_SEARCH_MB_OVERLOAD_ENABLED_ERROR, 'error');
}
// Lucene index folder must be writable
$index_path = $this->get_index_path();
$path_exists = file_exists($index_path);
if ($path_exists && !is_writeable($index_path) && (!$path_exists && !is_writable("{$index_path}/../"))) {
nc_print_status(NETCAT_MODULE_SEARCH_INDEX_DIRECTORY_NOT_WRITABLE_ERROR, 'error', array($index_path));
}
// try to open the index
try {
$this->open_index();
} catch (Exception $e) {
nc_print_status(NETCAT_MODULE_SEARCH_CANNOT_OPEN_INDEX_ERROR, 'error', array($index_path));
}
}
示例2: confim_delete_sub_class_object
/**
* Show confirm deleting object
*
* @param array post
*/
function confim_delete_sub_class_object($array)
{
global $UI_CONFIG, $db, $nc_core;
$in = array();
reset($array);
while (list($key, $val) = each($array)) {
if (nc_substr($key, 0, 6) == "Delete") {
$in[] = intval($val);
}
}
$in_array = join(',', $in);
$sub_class = $db->get_col("SELECT `Sub_Class_Name` FROM `Sub_Class` WHERE Sub_Class_ID IN(" . $in_array . ")");
if ($db->num_rows) {
print "<form action='index.php' method='post'>\n\n <input type='hidden' name='phase' value='4'>\n\n <input type='hidden' name='sub_class' value='" . $in_array . "'>\n\n " . $nc_core->token->get_input() . "\n </form>\n";
nc_print_status(REPORTS_STAT_CLASS_CONFIRM, 'ok');
print "<ui>";
foreach ($sub_class as $v) {
print "<li>" . $v;
}
$UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => REPORTS_STAT_CLASS_CONFIRM_OK, "action" => "mainView.submitIframeForm()");
} else {
nc_print_status(REPORTS_STAT_CLASS_NOT_CC, 'error');
}
}
示例3: ChangePassword
function ChangePassword($UserID, $Password, $db)
{
global $nc_core;
$UserID = intval($UserID);
$Password = $db->escape($Password);
// новый пароль совпадает с текущим?
if ($db->get_var("SELECT `User_ID` FROM `User` WHERE `User_ID` = '" . $UserID . "' AND `Password` = " . $nc_core->MYSQL_ENCRYPT . "('" . $Password . "')")) {
nc_print_status(CONTROL_USER_ERROR_NEWPASS_IS_CURRENT, 'error');
return;
}
// Есть ли поле RegistrationCode в таблице пользователей?
$RegistrationCodeExists = false;
$res = $db->get_results("EXPLAIN `User`", ARRAY_A);
foreach ($res as $row) {
if ($row['Field'] == 'RegistrationCode') {
$RegistrationCodeExists = true;
break;
}
}
// если нет, то нужно создать
if (!$RegistrationCodeExists) {
$db->query("ALTER TABLE `User` ADD `RegistrationCode` VARCHAR( 255 ) NOT NULL ");
}
$db->last_error = '';
// execute core action
$nc_core->event->execute("updateUserPrep", $UserID);
// сообственно, запро
$db->query("UPDATE `User` SET `Password`=" . $nc_core->MYSQL_ENCRYPT . "('" . $Password . "'), `RegistrationCode` = '' WHERE `User_ID` = '" . $UserID . "'");
if (!$db->last_error) {
nc_print_status(CONTROL_USER_OK_CHANGEDPASS, 'ok');
} else {
nc_print_status(CONTROL_USER_ERROR_NOTCANGEPASS, 'error');
}
// execute core action
$nc_core->event->execute("updateUser", $UserID);
}
示例4: ActionForm_for_modal
function ActionForm_for_modal($SubClassID)
{
global $CatalogueID, $SubdivisionID, $loc, $perm;
global $SUB_FOLDER, $HTTP_ROOT_PATH, $MODULE_FOLDER, $ADMIN_FOLDER, $ADMIN_PATH;
$nc_core = nc_Core::get_object();
$db = $nc_core->db;
$type = 2;
$SubdivisionID = $SubdivisionID ? +$SubdivisionID : $nc_core->sub_class->get_by_id($SubClassID, 'Subdivision_ID');
$CatalogueID = $CatalogueID ? +$CatalogueID : $nc_core->subdivision->get_by_id($SubdivisionID, 'Catalogue_ID');
$SubEnv = $nc_core->sub_class->get_by_id($SubClassID);
$ClassEnv = $db->get_row("SELECT * FROM `Class` WHERE `Class_ID` = '" . intval($SubEnv["Class_ID"]) . "'", ARRAY_A);
if (nc_module_check_by_keyword("cache")) {
$cache_select_fields = "s.`Cache_Access_ID`, s.`Cache_Lifetime`, s.`CacheForUser`,";
} else {
$cache_select_fields = "";
}
$select = "SELECT " . $cache_select_fields . "\n s.`Sub_Class_Name`,\n s.`Subdivision_ID`,\n s.`Priority`,\n s.`Read_Access_ID`,\n s.`Write_Access_ID`,\n s.`Edit_Access_ID`,\n s.`Checked_Access_ID`,\n s.`Delete_Access_ID`,\n s.`Moderation_ID`,\n s.`EnglishName`,\n s.`Checked`,\n s.`Subscribe_Access_ID`,\n s.`DaysToHold`,\n s.`AllowTags`,\n s.`NL2BR`,\n s.`RecordsPerPage`,\n s.`SortBy`,\n s.`Created`,\n s.`LastUpdated`,\n c.`Class_Name`,\n c.`Class_ID`,\n c.`System_Table_ID`,\n s.`DefaultAction`,\n s.`UseCaptcha`,\n c.`CustomSettingsTemplate`,\n s.`CustomSettings`,\n s.`Class_Template_ID`,\n s.`isNaked`,\n s.`SrcMirror`,\n s.`AllowRSS`,\n s.`Edit_Class_Template`\n FROM `Sub_Class` as s,\n `Class` as c\n WHERE `Sub_Class_ID` = " . +$SubClassID . "\n AND c.`Class_ID` = s.`Class_ID`";
$Array = $db->get_row($select, ARRAY_A);
if ($db->is_error) {
throw new nc_Exception_DB_Error($db->last_query, $db->last_error);
}
if (empty($Array)) {
nc_print_status(CONTROL_CONTENT_CATALOUGE_FUNCS_ERROR_NOSUBCLASS, 'info');
return;
}
if ($Array['Class_Template_ID']) {
$Array['CustomSettingsTemplate'] = $db->get_var("SELECT `CustomSettingsTemplate`\n FROM `Class`\n WHERE `Class_ID` = " . $Array['Class_Template_ID']);
}
$mobile = $nc_core->catalogue->get_by_id($CatalogueID, 'ncMobile');
$classTemplatesArr = $db->get_results("SELECT `Class_Name`,\n `Class_ID`\n FROM `Class`\n WHERE `ClassTemplate` = '" . $Array['Class_ID'] . "'\n AND `Type` " . (!$mobile ? "IN ('useful', 'title', 'mobile')" : "= 'mobile'"), ARRAY_A);
$class_array = nc_get_class_template_array_by_id($Array['Class_Template_ID'] ? $Array['Class_Template_ID'] : $Array['Class_ID']);
$edit_class_select = null;
if (count($class_array) > 1) {
$edit_class_select = nc_get_class_template_form_select_by_array($class_array, $Array['Edit_Class_Template']);
}
$classInfo = nc_sub_class_get_classInfo($perm, $Array, $classTemplatesArr, $edit_class_select);
if ($loc->SubdivisionID) {
$wsts = CONTROL_CONTENT_SUBCLASS_ONSECTION;
} else {
$wsts = CONTROL_CONTENT_SUBCLASS_ONSITE;
}
$wsts_msg = nc_sub_class_get_wsts_msg($wsts);
require_once $ADMIN_FOLDER . "related/format.inc.php";
$field = new field_relation_subclass();
$fieldsets = new nc_admin_fieldset_collection();
$fieldsets->set_prefix(nc_sub_class_get_prefix($SubClassID, $Array));
$fieldsets->set_static_prefix(nc_sub_class_get_style_prefix());
$fieldsets->set_suffix("\n </div>\n " . $nc_core->token->get_input() . "\n <input type='hidden' name='phase' value='4' />\n <input type='hidden' name='SubClassID' value='{$SubClassID}' />\n <input type='hidden' name='SubdivisionID' value='{$loc->SubdivisionID}' />\n <input type='hidden' name='CatalogueID' value='{$loc->CatalogueID}' />\n <input type='submit' style='display: none;' />\n ");
$fieldsets->new_fieldset('main_info', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MAININFO)->add(nc_sub_class_get_main_info($Array, $classInfo, $wsts_msg, $field));
$fieldsets->new_fieldset('objlist', CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_HOWSHOW)->add(nc_sub_class_get_objlist($Array));
if ($Array['CustomSettingsTemplate']) {
require_once $ADMIN_FOLDER . 'array_to_form.inc.php';
$values = $CustomSettings ? $CustomSettings : $Array['CustomSettings'];
$a2f = new nc_a2f($Array['CustomSettingsTemplate'], 'CustomSettings');
$a2f->set_value($values);
$fieldsets->new_fieldset('CustomSettings', CONTROL_CONTENT_SUBDIVISION_CUSTOM_SETTINGS_TEMPLATE)->add(nc_sub_class_get_CustomSettings($a2f));
}
$fieldsets->new_fieldset('access', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ACCESS)->add(nc_subdivision_show_access($SubEnv));
#$fieldsets->new_fieldset('rss', 'RSS')->add(nc_subclass_show_export('rss', $SubdivisionID, $SubClassID));
#$fieldsets->new_fieldset('xml', 'XML')->add(nc_subclass_show_export('xml', $SubdivisionID, $SubClassID));
if (nc_module_check_by_keyword('cache')) {
$fieldsets->new_fieldset('cache', CONTROL_CONTENT_SUBCLASS_FUNCS_CACHE)->add(nc_subdivision_show_cache($SubEnv));
}
if (nc_module_check_by_keyword('comments')) {
$fieldsets->new_fieldset('comments', CONTROL_CONTENT_SUBCLASS_FUNCS_COMMENTS)->add(nc_subdivision_show_comments($SubEnv));
}
echo $fieldsets->to_string();
}
示例5: nc_customsettings_show
/**
* Функция выводит список пользовательских настроек
*
* @param int номер компонента
* @param int номер макета дизайн
* @param array массив с настройками
* @return int
*/
function nc_customsettings_show($ClassID = 0, $TemplateID = 0, $custom_settings = array(), $Class_Template = 0)
{
global $UI_CONFIG;
$suffix = +$_REQUEST['fs'] ? '_fs' : '';
if (!$ClassID && !$TemplateID) {
return false;
}
if ($ClassID && !$Class_Template) {
$ac = "urlDispatcher.load('dataclass{$suffix}.custom.new(" . $ClassID . ")')";
$ac1 = "urlDispatcher.load('dataclass{$suffix}.custom.manual(" . $ClassID . ")')";
} else {
if ($ClassID && $Class_Template) {
$ac = "urlDispatcher.load('classtemplate{$suffix}.custom.new(" . $ClassID . ")')";
$ac1 = "urlDispatcher.load('classtemplate{$suffix}.custom.manual(" . $ClassID . ")')";
} else {
$ac = "urlDispatcher.load('template{$suffix}.custom.new(" . $TemplateID . ")')";
$ac1 = "urlDispatcher.load('template{$suffix}.custom.manual(" . $TemplateID . ")')";
}
}
$UI_CONFIG->actionButtons[] = array("id" => "addcs", "caption" => CONTROL_FIELD_LIST_ADD, "action" => $ac, 'align' => 'left');
$UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_MANUAL_EDIT, "action" => $ac1, 'align' => 'left');
if (empty($custom_settings)) {
nc_print_status(NETCAT_CUSTOM_NONE_SETTINGS, 'info');
return false;
}
$a2f = new nc_a2f($custom_settings, '');
$header = " <table class='nc-table nc--striped nc--small nc--hovered' style='width:100%'>\n <tr>\n <th width='30%'>" . NETCAT_CUSTOM_ONCE_FIELD_NAME . "</th>\n <th width='45%'>" . NETCAT_CUSTOM_ONCE_FIELD_DESC . "</th>\n <th width='20%'>" . NETCAT_CUSTOM_TYPE . "</th>\n <td align=center width='5%'>\n " . nc_admin_img('delete', NETCAT_CUSTOM_ONCE_DROP) . "\n </td>\n </tr>";
echo "<form action='index.php' method='post' >";
echo "<input type='hidden' name='phase' value='" . ($ClassID ? $Class_Template ? "2410" : "241" : "81") . "' />";
echo "<input type='hidden' name='ClassID' value='" . $ClassID . "' />";
echo "<input type='hidden' name='TemplateID' value='" . $TemplateID . "' />";
echo "<input type='hidden' name='fs' value='" . +$_REQUEST['fs'] . "' />";
echo $a2f->render_settings($header, '<tr style="background-color: #FFF;"><td><a href="index.php?phase=' . ($ClassID ? $Class_Template ? 250 : 25 : 9) . '&' . ($ClassID ? "ClassID=" . $ClassID : "TemplateID=" . $TemplateID) . '&param=%NAME&fs=' . +$_REQUEST['fs'] . '">%NAME</a></td><td>%CAPTION</td><td>%TYPENAME</td><td align="center">' . nc_admin_checkbox_simple("kill[]", "%NAME") . '</td></tr>', '</table>');
$custom_settings = $a2f->eval_value($custom_settings);
$UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_DROP_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "right", "red_border" => true);
echo "</form>";
return false;
}
示例6: FullTemplateList
function FullTemplateList()
{
global $db;
global $HTTP_DOMAIN;
global $UI_CONFIG;
if ($result = write_template(0)) {
echo $result;
} else {
nc_print_status(CONTROL_TEMPLATE_NONE, "info");
}
$UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_TEMPLATE_TEPL_CREATE, "action" => "urlDispatcher.load('template" . (+$_REQUEST['fs'] ? '_fs' : '') . ".add(0)')", "align" => "left");
$UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_TEMPLATE_TEPL_IMPORT, "action" => "urlDispatcher.load('tools.databackup.import')", "align" => "left");
}
示例7: ExecSQLMultiline
function ExecSQLMultiline($file)
{
global $db, $nc_core;
$fp = fopen($file, "r");
if (!$fp) {
nc_print_status(sprintf(TOOLS_SQL_ERR_OPEN_FILE, $file), 'error');
return false;
}
$i = 0;
while (!feof($fp)) {
$statement = chop(fgets($fp, 65536));
if (strlen($statement)) {
while (substr($statement, strlen($statement) - 1, 1) != ";" && substr($statement, 0, 1) != "#" && substr($statement, 0, 2) != "--") {
$statement .= chop(fgets($fp, 65536));
}
if (substr($statement, 0, 1) != "#" && substr($statement, 0, 2) != "--") {
$statement = str_replace('%%MYSQL_CHARSET%%', $nc_core->MYSQL_CHARSET, $statement);
if (!$nc_core->NC_UNICODE) {
$statement = $nc_core->utf8->utf2win($statement);
}
$db->query($statement);
# если запрос выполнился и нет ошибок
if ($db->last_error) {
nc_print_status(sprintf(TOOLS_SQL_ERR_FILE_QUERY, $file, $db->last_error), 'error');
}
}
}
}
fclose($fp);
return true;
}
示例8: ui_config_system_class
$UI_CONFIG = new ui_config_system_class('edit', $SystemTableID);
ClassForm($SystemTableID, "system.php", 3, 3, 0);
break;
// редактирование завершено
// редактирование завершено
case 3:
BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/settings/systables/");
$perm->ExitIfNotAccess(NC_PERM_SYSTABLE, 0, 0, 0, 1);
ActionClassComleted($type);
if ($System_Table_ID == 3) {
if (+$_REQUEST['isNaked']) {
ob_clean();
echo 'OK';
exit;
}
nc_print_status(CONTROL_CONTENT_CLASS_SUCCESS_EDIT, 'ok');
ClassForm($System_Table_ID, "system.php", 3, 3, 0);
} else {
SystemTableList();
}
break;
// редактирование без UI_CONFIG
// редактирование без UI_CONFIG
case 4:
$AJAX_SAVER = true;
if ($perm->isGuest()) {
$AJAX_SAVER = false;
}
BeginHtml($Title2, $Title3 . $Delimeter . $Title8, "http://" . $DOC_DOMAIN . "/settings/systables/");
$perm->ExitIfNotAccess(NC_PERM_SYSTABLE, 0, 0, 0, 0);
ClassActionForm($SystemTableID, "system.php", 5, 2, $myaction);
示例9: delete
/**
*
* @param string $data_class
*/
public function delete($data_class)
{
$ids = (array) $this->get_input('id', $this->get_input('ids'));
foreach ($ids as $id) {
/** @var nc_search_data_persistent $record */
$record = new $data_class();
$record->set_id($id)->delete();
}
// по-хорошему тут нужно использовать паттерн GET-POST-REDIRECT
nc_print_status(NETCAT_MODULE_SEARCH_ADMIN_STATUS_DELETED, 'info');
}
示例10: listQuery
}
$qry = $field_data->get_list_query($sub);
$cc_list = listQuery($qry, "<a href='#' onclick='top.selectItem(\$data[ItemID])' title='\".NETCAT_MODERATION_SELECT_RELATED.\"'>\n <span class='id'>\$data[ItemID].</span> \$data[ItemCaption]\n <div class='icons icon_related icon_subclass_select'></div></a>");
?>
<html>
<head>
<title>Subclass list</title>
<link type='text/css' rel='Stylesheet' href='<?php
echo $ADMIN_TEMPLATE;
?>
css/admin.css'>
<link type='text/css' rel='Stylesheet' href='<?php
echo $ADMIN_TEMPLATE;
?>
css/main.css'>
<link type='text/css' rel='Stylesheet' href='<?php
echo $ADMIN_TEMPLATE;
?>
css/sprites.css'>
</head>
<body style='margin:6px'>
<?php
if ($cc_list) {
print "<div class='related_list related_list_subclass'>" . $cc_list . "</div>";
} else {
nc_print_status(NETCAT_MODERATION_RELATED_NO_ANY_CLASS_IN_SUB, 'info');
}
?>
</body>
</html>
示例11: action_edit
public function action_edit($template_id, $partial_name)
{
$this->partial = $partial_name;
$this->template_id = (int) $template_id;
$data = array('action' => 'edit');
$this->ui_config('edit', CONTROL_TEMPLATE_PARTIALS . ' <small>' . $partial_name . '</small>');
$this->ui_config->locationHash = "template.partials_edit({$this->template_id}, {$partial_name})";
if (nc_core()->input->fetch_get('addNode')) {
$node_id = $template_id;
$partial = $partial_name;
$fs_suffix = '_fs';
$this->ui_config->treeChanges['addNode'][] = array("parentNodeId" => "template_partials-{$node_id}", "nodeId" => "template_partial-{$node_id}-{$partial}", "name" => $partial, "href" => "#template.partials_edit({$node_id}, {$partial})", "sprite" => 'dev-com-templates', "buttons" => array(nc_get_array_2json_button(CONTROL_TEMPLATE_PARTIALS_REMOVE, "template{$fs_suffix}.partials_remove({$node_id}, {$partial})", "nc-icon nc--remove nc--hovered")));
}
$partial_file = $this->nc_core->template->get_partials_path($this->template_id, $partial_name);
if (file_exists($partial_file)) {
if (isset($_POST['partial_source'])) {
$partial_source = $this->nc_core->input->fetch_post('partial_source');
file_put_contents($partial_file, $partial_source);
}
$partial_source = file_get_contents($partial_file);
$data['partial_name'] = $partial_name;
$data['partial_source'] = $partial_source;
} else {
nc_print_status('Template not found', 'error');
return;
}
$this->ui_config->actionButtons[] = array('caption' => NETCAT_CUSTOM_ONCE_SAVE, 'action' => "nc.view.main('form').submit(); return false");
return $this->view('template_partials/edit', $data);
}
示例12: nc_print_status
?>
css/admin.css'>
<link type='text/css' rel='Stylesheet' href='<?php
echo $ADMIN_TEMPLATE;
?>
css/main.css'>
</head>
<body style='margin:0; overflow: hidden'>
<?php
// 1. Список *подходящих* шаблонов в разделе
$cc_list = $db->get_results("SELECT Sub_Class_ID, Sub_Class_Name\n FROM Sub_Class\n WHERE Subdivision_ID={$sub}\n AND Class_ID={$field_format->class_id}\n ORDER BY Priority", ARRAY_A);
if (!$cc_list) {
$class_name = $db->get_var("SELECT Class_Name FROM Class WHERE Class_ID={$field_format->class_id}");
print "<div class='related_list_container'>";
nc_print_status(sprintf(NETCAT_MODERATION_RELATED_NO_CONCRETE_CLASS_IN_SUB, $class_name), 'info');
print "</div>";
} else {
print "<table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%'>\n";
print "<tr><td class='toolbar'>\n";
if (!$cc) {
$cc = $cc_list[0]["Sub_Class_ID"];
}
foreach ($cc_list as $cc_data) {
if ($cc_data['Sub_Class_ID'] == $cc) {
print "<a class='button button_on' href='#'>" . "<span class='button_caption'>{$cc_data['Sub_Class_Name']}</span>" . "</a>\n";
} else {
print "<a class='button' href='?sub={$sub}&cc={$cc_data[Sub_Class_ID]}&field_id={$field_id}'>" . "<span class='button_caption'>{$cc_data['Sub_Class_Name']}</span>" . "</a>\n";
}
}
print "</td></tr>\n";
示例13: BeginHtml
// Это ошибочная ситуация POST c одним классом , а предросмотр с другим.
BeginHtml(NETCAT_PREVIEW_ERROR_WRONGDATA);
nc_print_status(NETCAT_PREVIEW_ERROR_WRONGDATA, "error");
EndHtml();
die;
}
// В предпросмотре admin_mode=0;
$admin_mode = 0;
// Первый вызов предпросмотра идет без $sub - мы рисуем карту сайта чтобы пользователь выбрал раздел.
if (!isset($sub) || !$sub) {
require_once $INCLUDE_FOLDER . "s_common.inc.php";
require_once $INCLUDE_FOLDER . "s_browse.inc.php";
$sbrowse_mapsub['prefix'] = "<ul style='list-style: disc inside'>";
$sbrowse_mapsub['suffix'] = "</ul>";
$sbrowse_mapsub['unactive'] = "<li><a \".(\$data[\$i][Checked]==0?\"style='color:gray'\":\"\").\"href='%URL?template={$template}&templatePreview={$templatePreview}'>\".\$data[\$i][Subdivision_ID].\". %NAME</a>\".s_browse_sub(\$data[\$i][Subdivision_ID],\$GLOBALS[sbrowse_mapsub]).\"</li>";
$sbrowse_mapsub['active'] = $sbrowse_mapsub['unactive'];
if (!isset($catalogue) || !$catalogue) {
$catalogue = $nc_core->catalogue->get_by_host_name($HTTP_HOST);
$catalogue = $catalogue["Catalogue_ID"];
} else {
$catalogue += 0;
}
BeginHtml(NETCAT_PREVIEW_INFO_CHOOSESUB);
nc_print_status(NETCAT_PREVIEW_INFO_CHOOSESUB, "info");
$current_sub['Subdivision_ID'] = 100000;
$current_sub['Catalogue_ID'] = $catalogue;
$admin_mode = 0;
echo s_browse_sub(0, $sbrowse_mapsub, 1);
EndHtml();
die;
}
示例14: GetFavorites
</head>
<body class='admin_form' style='margin: 0px;'>
<?php
$favorites = GetFavorites();
$nc_settings = $nc_core->get_settings();
if ($nc_settings['InstallationID']) {
echo "<table border='0' width=100% id='main_page_table'><tr><td>";
if ($nc_settings['ProductNumber'] && $nc_settings['Code']) {
$text = sprintf(TOOLS_ACTIVATION_REMIND_UNCOMPLETED, $ADMIN_PATH . '/patch/activation.php');
echo nc_print_status($text, 'info', null, true);
} else {
$text = str_replace("%DAY", intval((strtotime($nc_settings['InstallationDateOut']) - time()) / 86400 + 1), TOOLS_ACTIVATION_DAY);
echo nc_print_status($text, 'error', null, true);
}
echo "</td></tr></table>";
}
echo "<table border='0' width=100% id='main_page_table'>\n";
echo "<tr>\n";
echo "<td width=48%>\n";
//Welcome
echo "<div class='main_page_text'>\n";
echo "\t<div class='block_title'>\n";
//echo "\t\t<img src='".$ADMIN_TEMPLATE."img/i_netcat_big.gif' alt='Netcat'>\n";
echo "\t\t<span>" . SECTION_INDEX_WELCOME . "</span>\n";
echo "\t</div>\n";
echo "\t<div class='block_text'>\n";
printf(SECTION_INDEX_WELCOME_MESSAGE, $perm->getLogin(), $PROJECT_NAME, $perm->GetMaxPerm());
echo "\t</div>\n";
示例15: FROM
$query = "SELECT `latest`.`Timestamp`,\n `latest`.`QueryString`,\n `latest`.`ResultsCount`,\n `latest`.`IP`,\n `latest`.`User_ID`,\n `q`.`QueryCount`,\n `u`.`Login`\n FROM (SELECT MAX(`Query_ID`) AS `Query_ID`,\n COUNT(`Query_ID`) AS `QueryCount`\n FROM `Search_Query`\n WHERE {$where}\n GROUP BY `QueryString`\n ORDER BY {$order_by}\n LIMIT {$per_page} OFFSET {$offset}) AS `q`\n JOIN `Search_Query` AS `latest` ON (`q`.`Query_ID` = `latest`.`Query_ID`)\n LEFT JOIN `User` AS `u` ON (`latest`.`User_ID` = `u`.`User_ID`)";
$res = $this->get_db()->get_results($query, ARRAY_A);
if ($res) {
$found_rows = $this->get_db()->get_var("SELECT COUNT(DISTINCT(`QueryString`))\n FROM `Search_Query`\n WHERE {$where}");
// строка с вариантами сортировки
$sort_link = $this->make_page_query(array('sort_by'));
echo '<div class="query_sort">', $this->link_if($sort_by != '', $sort_link, NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_RESULT_COUNT), " | ", $this->link_if($sort_by != 'time', "{$sort_link}&sort_by=time", NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_TIME), " | ", $this->link_if($sort_by != 'query', "{$sort_link}&sort_by=query", NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_QUERY), "</div>";
// таблица с результатами
echo "<table class='nc-table nc--large nc--hovered nc--striped list'>\n", "<tr>", "<th rowspan='2' width='40%'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_STRING, "</th>", "<th rowspan='2' width='10%' class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_COUNT, "</th>", "<th colspan='3' class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY, "</th>", "</tr>\n", "<tr>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_TIME, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_RESULT_COUNT, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_USER, "</th>", "</tr>\n";
$result_link_title = "title='" . htmlspecialchars(NETCAT_MODULE_SEARCH_ADMIN_QUERY_OPEN_RESULTS_LINK_HINT) . "'";
foreach ($res as $row) {
// ссылка на страницу с результатами поиска
$search_link = nc_search::get_object()->get_search_url($row['Catalogue_ID'], true) . "?nologging=1&search_query=" . rawurlencode($row['QueryString']) . "&area=" . rawurlencode($row['Area']);
echo "<tr class='nc-text-center'>", "<td align='left'><a href='?view=queries_details&query=", rawurlencode($row['QueryString']), "'>", htmlspecialchars($row['QueryString']), "</a></td>", "<td>", $row['QueryCount'], "</td>", "<td>", nc_search_util::format_time($row['Timestamp']), "</td>", "<td><a href='{$search_link}' target='_blank' {$result_link_title}>{$row['ResultsCount']}</a></td>", "<td>", long2ip($row['IP']), $row['User_ID'] ? " (" . $this->hash_link("#user.edit({$row['User_ID']})", $row["Login"]) . ")" : "", "</td>", "</tr>\n";
}
echo "</table>";
echo $this->result_count($offset + 1, $per_page, $found_rows);
// листалка по страницам
$ui = $this->get_ui();
$page_link = $this->make_page_query(array('offset'), true);
if ($offset > 0) {
$prev_page = $page_link . "&offset=" . ($offset - $per_page);
$ui->actionButtons[] = array("id" => "prev_page", "caption" => NETCAT_MODULE_SEARCH_ADMIN_QUERY_PREV_PAGE, "action" => "mainView.loadIframe('{$prev_page}')", "align" => "left");
}
if ($found_rows > $offset + $per_page) {
$next_page = $page_link . "&offset=" . ($offset + $per_page);
$ui->actionButtons[] = array("id" => "next_page", "caption" => NETCAT_MODULE_SEARCH_ADMIN_QUERY_NEXT_PAGE, "action" => "mainView.loadIframe('{$next_page}')");
}
} else {
nc_print_status(NETCAT_MODULE_SEARCH_ADMIN_QUERY_NO_ENTRIES, 'info');
}