Passed
Push — master ( 077fbd...836ec9 )
by Michael
04:09
created

Extcal_2_28::addTable_etablissement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 31
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * extcal module.
4
 *
5
 * You may not change or alter any portion of this comment or credits
6
 * of supporting developers from this source code or any supporting source code
7
 * which is considered copyrighted (c) material of the original comment or credit authors.
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * @copyright           XOOPS Project (https://xoops.org)
13
 * @license             http://www.fsf.org/copyleft/gpl.html GNU public license
14
 *
15
 * @since               2.2
16
 *
17
 * @author              JJDai <http://xoops.kiolo.com>
18
 **/
19
20
//----------------------------------------------------
21
class Extcal_2_28
22
{
23
    //----------------------------------------------------
24
25
    /**
26
     * @param \XoopsModule $module
27
     * @param             $options
28
     */
29
    public function __construct(\XoopsModule $module, $options)
0 ignored issues
show
Unused Code introduced by
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function __construct(/** @scrutinizer ignore-unused */ \XoopsModule $module, $options)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $options is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function __construct(\XoopsModule $module, /** @scrutinizer ignore-unused */ $options)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
    {
31
        global $xoopsDB;
32
33
        $this->addTable_etablissement();
34
        $this->alterTable_event();
35
    }
36
37
    //----------------------------------------------------
38
    public function alterTable_event()
39
    {
40
        global $xoopsDB;
41
42
        $tbl = $xoopsDB->prefix('extcal_event');
43
44
        $sql = <<<__sql__
45
ALTER TABLE `{$tbl}`
46
  add  `event_organisateur` varchar(255) NOT NULL default '',
47
  add  `event_picture1` varchar(255) NOT NULL,
48
  add  `event_picture2` varchar(255) NOT NULL,
49
  add  `event_price` varchar(255) NOT NULL default '',
50
  add  `event_etablissement` int(5) NOT NULL DEFAULT '1';
51
__sql__;
52
53
        $xoopsDB->queryF($sql);
54
    }
55
56
    //----------------------------------------------------
57
    public function addTable_etablissement()
58
    {
59
        global $xoopsDB;
60
61
        $tbl = $xoopsDB->prefix('extcal_etablissement');
62
63
        $sql = <<<__sql__
64
CREATE TABLE `{$tbl}` (
65
  `id` int(5) NOT NULL auto_increment,
66
  `nom` varchar(255) NOT NULL,
67
  `desc` text NOT NULL,
68
  `logo` varchar(255) NOT NULL,
69
  `categorie` varchar(255) NOT NULL,
70
  `adresse` varchar(255) NOT NULL,
71
  `adresse2` varchar(255) NOT NULL,
72
  `cp` varchar(10) NOT NULL,
73
  `ville` varchar(50) NOT NULL,
74
  `tel_fixe` varchar(20) NOT NULL,
75
  `tel_portable` varchar(20) NOT NULL,
76
  `mail` varchar(255) NOT NULL,
77
  `site` varchar(255) NOT NULL,
78
  `horaires` text NOT NULL,
79
  `divers` text NOT NULL,
80
  `tarifs` text NOT NULL,
81
  `map` text NOT NULL,
82
83
  PRIMARY KEY  (`id`)
84
) ENGINE = MYISAM ;
85
__sql__;
86
87
        $xoopsDB->queryF($sql);
88
        //---------------------------------------------------
89
    }
90
91
    //-----------------------------------------------------------------
92
}   // fin de la classe
93