-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetFunctions.php
80 lines (65 loc) · 1.86 KB
/
setFunctions.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
<?php
ini_set('error_reporting', E_ALL);
include('functions.php');
switch( $_GET['function'] ){
case 'SamsungSendKey':
//echo "DeviceIP:" . $_GET['Device'] . " Key:" . $_GET['Key'];
samsung_send_key($_GET['Device'], $_GET['Key']);
break;
case 'OnkyoSendKey':
Onkyo_Send_Key($_GET['Device'], $_GET['Key']);
break;
case 'ChangeTimerState':
//echo "GroupdID:" . $_GET['ID'];
change_timer_state($_GET['ID']);
break;
case 'ChangeGroupState':
//echo "GroupdID:" . $_GET['ID'];
change_group_state($_GET['ID']);
break;
case 'test':
echo "Dies war ein Test!";
break;
}
if ($_POST) {
//var_dump($_POST);
$action = $_POST['action'];
//echo $action;
switch ($action){
case 'updateRecordsListings':
$table = $_POST['table'];
$updateRecordsArray = $_POST['recordsArray'];
$listingCounter = 1;
foreach ($updateRecordsArray as $recordIDValue) {
$sql = query("UPDATE " . $table . " SET sortOrder = '" . $listingCounter . "' WHERE id = '" . $recordIDValue . "'");
$listingCounter = $listingCounter + 1;
}
echo '<h4>die neue Sortierung wurde gespeichert</h4>';
break;
case 'createBackup':
backup_tables($_POST['table'],'backup/');
break;
case 'restoreBackup':
restore_tables($_POST['filename']);
break;
case 'deleteBackup':
delete_tables($_POST['filename']);
break;
case 'clearTable':
$Table = $_POST['table'];
switch ($Table){
case 'config': $ClearTable = 0;break;
case 'configFooter': $ClearTable = 0;break;
case 'deviceTypes': $ClearTable = 0;break;
default: $ClearTable = 1;break;
}
if ($ClearTable == 1) {
$sql = query('TRUNCATE TABLE `' . $_POST['table'] . '`');
echo('Die Tabelle `' . $Table . '` wurde geleert!');
}else{
echo('Die Tabelle `' . $Table . '` kann nicht geleert werden, diese ist eine System Tabelle!');
}
break;
}
}
?>