-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.php
87 lines (64 loc) · 2.49 KB
/
action.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
<?php
$language="enus";
include_once("locale/".$language.".php");
include 'content.php';
$content = new content;
$data = array();
switch($_SERVER['REQUEST_METHOD'])
{
case 'GET':
$the_request = &$_GET;
break;
case 'POST':
$the_request = &$_POST;
$the_requestg = &$_GET;
if(stristr($the_requestg['for'], "homepage") !== false)
{
switch ($the_requestg['data']) {
case 'newsfeed':
$data['for'] = 'newsfeed';
$viewdata = array_values($content->viewitems(array('id,newsfeed'), $prefix.'module', "WHERE newsfeed != ''"));
if($viewdata) {
$data['content'] = $the_request['content'];
$data['id'] = $viewdata[0]['id'];
$return = $content->update_content($data);
} else {
$data['content'] = $the_request['content'];
$return = $content->insert_content($data);
}
if($return)
{
echo "<script>alert('Success!'); location.href = './';</script>";
exit;
}
echo "<script>alert('There was an error!')</script>";
break;
case 'copp':
$data['for'] = 'copp';
$viewdata = array_values($content->viewitems(array('id,careeropp'), $prefix.'module', "WHERE careeropp != ''"));
if($viewdata) {
$data['content'] = $the_request['content'];
$data['id'] = $viewdata[0]['id'];
$return = $content->update_content($data);
} else {
$data['content'] = $the_request['content'];
$return = $content->insert_content($data);
}
if($return)
{
echo "<script>alert('Success!');location.href = './'; </script>";
exit;
}
echo "<script>alert('There was an error!')</script>";
break;
default:
die('bloodsuckers! aw');
break;
}
}
break;
default:
break;
}
header("location:javascript://history.go(-1)");
exit;