-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmigrate_symbols.php
116 lines (106 loc) · 2.93 KB
/
migrate_symbols.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/*
This file is part of WebDRIP Designer
Copyright (C) 2017 Jasper Vries
WebDRIP Designer is free software: you can redistribute it and/or
modify it under the terms of version 3 of the GNU General Public
License as published by the Free Software Foundation.
WebDRIP Designer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with WebDRIP Designer. If not, see <http://www.gnu.org/licenses/>.
*/
/*
In r43 is de nummering van de regelsymbolen gewijzigd.
Met dit script kan de database worden bijgewerkt zodat opgeslagen
beeldstanden kunnen worden ingeladen met behoud van de oorspronkelijk
geselecteerde regelsymbolen.
Het is belangrijk dit script slechts eenmaal uit te voeren!
Het is aanbevolen eerst een backup te maken van de database.
Verwijder de exit; op regel 30 voor gebruik.
*/
//voorkom per ongeluk uitvoeren
exit;
//create config
include('config.cfg.php');
$db['link'] = mysqli_connect($cfg_db['host'], $cfg_db['user'], $cfg_db['pass'], $cfg_db['db']);
$fromto = array(
'041' => '090',
'042' => '091',
'043' => '092',
'044' => '093',
'045' => '094',
'071' => '020',
'072' => '021',
'073' => '022',
'074' => '023',
'075' => '024',
'111' => '200',
'112' => '210',
'113' => '130',
'114' => '240',
'115' => '230',
'121' => '100',
'122' => '111',
'123' => '110',
'124' => '120',
'125' => '140',
'126' => '141',
'131' => '500',
'132' => '540',
'133' => '511',
'134' => '570',
'135' => '550',
'136' => '551',
'137' => '560',
'138' => '710',
'140' => '300',
'141' => '301',
'142' => '310',
'143' => '320',
'144' => '330',
'145' => '340',
'146' => '510',
'147' => '520',
'148' => '521',
'149' => '522',
'150' => '530',
'151' => '900',
'152' => '901',
'161' => '600',
'162' => '610',
'163' => '620',
'164' => '632',
'165' => '631',
'166' => '630',
'167' => '601',
'168' => '611',
'169' => '910',
'170' => '700',
'171' => '701',
'172' => '541',
'173' => '702',
'174' => '542',
'175' => '703',
'176' => '704',
'177' => '705',
'178' => '706',
'179' => '707',
'180' => '708',
'181' => '709'
);
$qry = "UPDATE `history` SET `timestamp` = `timestamp`, `image_raw` = REPLACE(`image_raw`, '$', '$#')";
mysqli_query($db['link'], $qry);
echo mysqli_error($db['link']) . PHP_EOL;
foreach ($fromto as $from => $to) {
echo $from . ' => ' . $to . PHP_EOL;
$qry = "UPDATE `history` SET `timestamp` = `timestamp`, `image_raw` = REPLACE(`image_raw`, '$#".$from."', '$".$to."')";
mysqli_query($db['link'], $qry);
echo mysqli_error($db['link']) . PHP_EOL;
}
$qry = "UPDATE `history` SET `timestamp` = `timestamp`, `image_raw` = REPLACE(`image_raw`, '$#', '$')";
mysqli_query($db['link'], $qry);
echo mysqli_error($db['link']) . PHP_EOL;
?>