Exemplo n.º 1
0
    $exp_date = '';
} else {
    $exp_date = date('d/m/Y', $rowcontent['exptime']);
    $tdate = date('H|i', $rowcontent['exptime']);
    list($ehour, $emin) = explode('|', $tdate);
}
if ($rowcontent['status'] == 1 and $rowcontent['publtime'] > NV_CURRENTTIME) {
    $array_cat_check_content = $array_cat_pub_content;
} elseif ($rowcontent['status'] == 1) {
    $array_cat_check_content = $array_cat_edit_content;
} else {
    $array_cat_check_content = $array_cat_add_content;
}
if (empty($array_cat_check_content)) {
    $redirect = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=cat';
    $contents = nv_theme_alert($lang_module['note_cat_title'], $lang_module['note_cat_content'], 'warning', $redirect, $lang_module['categories']);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
    die;
}
$contents = '';
$lang_global['title_suggest_max'] = sprintf($lang_global['length_suggest_max'], 65);
$lang_global['description_suggest_max'] = sprintf($lang_global['length_suggest_max'], 160);
$xtpl = new XTemplate('content.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$xtpl->assign('rowcontent', $rowcontent);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
Exemplo n.º 2
0
    $xtpl->parse('main.product_price');
}
// List discount
$sql = 'SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_discounts';
$_result = $db->query($sql);
while ($_discount = $_result->fetch()) {
    $_discount['selected'] = $_discount['did'] == $rowcontent['discount_id'] ? "selected=\"selected\"" : "";
    $xtpl->assign('DISCOUNT', $_discount);
    $xtpl->parse('main.discount');
}
// List pro_unit
$sql = 'SELECT id, ' . NV_LANG_DATA . '_title FROM ' . $db_config['prefix'] . '_' . $module_data . '_units';
$result_unit = $db->query($sql);
if ($result_unit->rowCount() == 0) {
    $url_back = NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=prounit';
    $contents = nv_theme_alert($lang_module['error_punit_empty_title'], $lang_module['error_punit_empty_content'], 'warning', $url_back, $lang_module['continue']);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}
while (list($unitid_i, $title_i) = $result_unit->fetch(3)) {
    $xtpl->assign('utitle', $title_i);
    $xtpl->assign('uid', $unitid_i);
    $uch = $rowcontent['product_unit'] == $unitid_i ? "selected=\"selected\"" : "";
    $xtpl->assign('uch', $uch);
    $xtpl->parse('main.rowunit');
}
// Print tags
if (!empty($rowcontent['keywords'])) {
    $keywords_array = explode(',', $rowcontent['keywords']);
    foreach ($keywords_array as $keywords) {
Exemplo n.º 3
0
    }
}
$is_refresh = false;
$array_cat_admin = nv_array_cat_admin();
$module_admin = explode(',', $module_info['admins']);
// Xoa cac dieu hanh vien khong co quyen tai module
foreach ($array_cat_admin as $userid_i => $value) {
    if (!in_array($userid_i, $module_admin)) {
        $db->query("DELETE FROM " . NV_PREFIXLANG . "_" . $module_data . "_admins WHERE userid = " . $userid_i);
        $is_refresh = true;
    }
}
// Het Xoa cac dieu hanh vien khong co quyen tai module
if (empty($module_info['admins'])) {
    // Thong bao khong co nguoi dieu hanh chung
    $contents = nv_theme_alert($lang_module['admin_no_user_title'], $lang_module['admin_no_user_content']);
}
foreach ($module_admin as $userid_i) {
    $userid_i = intval($userid_i);
    if ($userid_i > 0 && !isset($array_cat_admin[$userid_i])) {
        // Them nguoi dieu hanh chung, voi quyen han Quan ly module
        $sql = "SELECT userid FROM " . NV_PREFIXLANG . "_" . $module_data . "_admins WHERE userid=" . $userid_i . " AND catid=0";
        $numrows = $db->query($sql)->fetchColumn();
        if ($numrows == 0) {
            $db->query("INSERT INTO " . NV_PREFIXLANG . "_" . $module_data . "_admins (userid, catid, admin, add_content, pub_content, edit_content, del_content, app_content) VALUES ('" . $userid_i . "', '0', '1', '1', '1', '1', '1', '1')");
            $is_refresh = true;
        }
    }
}
if ($is_refresh) {
    $array_cat_admin = nv_array_cat_admin();
Exemplo n.º 4
0
                $data_insert['fileupload'] = $fileupload;
                $data_insert['linkdirect'] = $array['linkdirect'];
                $data_insert['version'] = $array['version'];
                $data_insert['fileimage'] = $fileimage;
                $data_insert['copyright'] = $array['copyright'];
                $file_id = $db->insert_id($sql, 'id', $data_insert);
                if (!$file_id) {
                    $is_error = true;
                    $error = $lang_module['upload_error3'];
                } else {
                    $user_post = defined("NV_IS_USER") ? " | " . $user_info['username'] : "";
                    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['upload_files_log'], $array['title'] . " | " . $client_info['ip'] . $user_post, 0);
                    $user_post = defined("NV_IS_USER") ? $user_info['userid'] : 0;
                    nv_insert_notification($module_name, 'upload_new', array('title' => $array['title']), $file_id, 0, $user_post, 1);
                    $url_back = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true);
                    nv_theme_alert($lang_module['file_upload_success_title'], $lang_module['file_upload_success_content'], 'info', $url_back);
                    include NV_ROOTDIR . '/includes/header.php';
                    echo nv_site_theme($contents);
                    include NV_ROOTDIR . '/includes/footer.php';
                    exit;
                }
            }
        }
    }
} else {
    $array['catid'] = sizeof($array_op) == 2 ? (int) $array_op[1] : 0;
    $array['filesize'] = 0;
    $array['title'] = $array['description'] = $array['introtext'] = $array['author_name'] = $array['author_email'] = $array['author_url'] = $array['linkdirect'] = $array['version'] = $array['copyright'] = $array['user_name'] = '';
    if (defined('NV_IS_USER')) {
        $array['user_name'] = $user_info['username'];
        $array['user_id'] = $user_info['userid'];
Exemplo n.º 5
0
                $xtpl->parse('userlist.tools.addUserGroup');
            }
            if ($groupsList[$group_id]['config']['access_addus'] != 0) {
                $xtpl->parse('userlist.tools.add_user');
            }
            if ($groupsList[$group_id]['config']['access_waiting'] != 0) {
                $xtpl->parse('userlist.tools.user_waiting');
            }
            if ($groupsList[$group_id]['config']['access_addus'] != 0 or $groupsList[$group_id]['config']['access_groups_add'] != 0 or $groupsList[$group_id]['config']['access_waiting'] != 0) {
                $xtpl->parse('userlist.tools');
            }
        }
        $xtpl->parse('userlist');
        $contents = $xtpl->text('userlist');
    } else {
        $contents = nv_theme_alert($lang_module['no_premission'], $lang_module['no_premission_leader'], 'danger');
    }
    // Them vao tieu de
    $array_mod_title[] = array('catid' => 0, 'title' => $lang_module['group_manage'], 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
    $array_mod_title[] = array('catid' => 0, 'title' => $groupsList[$group_id]['title'], 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '/' . $group_id);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}
// Danh sach thanh vien (AJAX)
if ($nv_Request->isset_request('listUsers', 'get')) {
    $group_id = $nv_Request->get_int('listUsers', 'get', 0);
    $page = $nv_Request->get_int('page', 'get', 1);
    $type = $nv_Request->get_title('type', 'get', '');
    $per_page = 15;
    $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=groups&listUsers=' . $group_id;