source: extensions/delete_hit_rate/admin/admin.php @ 12402

Revision 12402, 1.7 KB checked in by ddtddt, 8 years ago (diff)

[extensions] - delete_hit_rate - update 2.3.0

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3global $template, $conf, $user;
4include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
5load_language('plugin.lang', PDHR_PATH);
6$my_base_url = get_admin_plugin_menu_link(__FILE__);
7
8// +-----------------------------------------------------------------------+
9// | Check Access and exit when user status is not ok                      |
10// +-----------------------------------------------------------------------+
11check_status(ACCESS_ADMINISTRATOR);
12
13//-------------------------------------------------------- sections definitions
14
15
16
17// Gestion des onglets
18if (!isset($_GET['tab']))
19    $page['tab'] = 'pdhr';
20else
21    $page['tab'] = $_GET['tab'];
22
23$tabsheet = new tabsheet();
24$tabsheet->add('pdhr',
25               l10n('pdhr_onglet_all'),
26               $my_base_url.'&amp;tab=pdhr');
27
28$tabsheet->select($page['tab']);
29$tabsheet->assign();
30
31// Onglet gestion par photo
32switch ($page['tab'])
33{
34 case 'pdhr':
35
36  $template->assign(
37    'gestion',
38    array(
39
40      ));
41
42//purge photo
43if (isset($_POST['pdhr_all_h']))
44        {
45        $query = '
46UPDATE ' . IMAGES_TABLE . '
47  SET hit= \'0\'
48    ;';
49$result = pwg_query($query);
50
51        array_push( $page['infos'], l10n('pdhr_all_hok') );
52       
53        }
54       
55if (isset($_POST['pdhr_all_r']))
56        {
57        $query = '
58UPDATE ' . IMAGES_TABLE . '
59  SET rating_score= \'NULL\'
60    ;';
61$result = pwg_query($query);
62
63        $query = '
64TRUNCATE ' . RATE_TABLE . '
65    ;';
66$result = pwg_query($query);
67
68        array_push( $page['infos'], l10n('pdhr_all_rok') );
69       
70        }
71         
72    break;
73
74} 
75
76$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
77$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
78?>
Note: See TracBrowser for help on using the repository browser.