-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreated.php
More file actions
executable file
·132 lines (110 loc) · 3.95 KB
/
created.php
File metadata and controls
executable file
·132 lines (110 loc) · 3.95 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
<title>The New Bottol Creation System</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, print" />
<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function removeBottol(id) {
$('#'+id).remove();
$.post("remove.php", { id: id});
}
</script>
</head>
<body>
<?php
include('db_config.php');
// scrivo nel db tutti i dati della bottiglia e al sua struttura
if(isset($_POST['submit_bottol'])) {
$topic_title=$_POST['topic_title'];
$topic_subtitle=$_POST['topic_subtitle'];
$conn=mysql_connect($db_host,$db_user,$db_psw) or die ("db_connect error");
$var="INSERT INTO sharabelcom.wp_bb_topics (topic_title,topic_subtitle) VALUES ('$topic_title','$topic_subtitle')";
$query= mysql_query($var, $conn) or die ("db_query error 1");
$var="SELECT topic_id FROM sharabelcom.wp_bb_topics ORDER BY topic_id DESC LIMIT 1";
$query= mysql_query($var, $conn) or die ("db_query error 2");
while ($values=mysql_fetch_array($query)) {
$topic_id=$values['topic_id'];
}
for ($i=1; $i<=30 ; $i++) {
if(!$_POST['element'.$i.'_component_position']) {
break;
}
$component_position=$_POST['element'.$i.'_component_position'];
$template_id=$_POST['element'.$i.'_template_id'];
$resource_position=$_POST['element'.$i.'_resource_position'];
$resource_type=$_POST['element'.$i.'_resource_type'];
$resource=$_POST['element'.$i.'_resource'];
$conn=mysql_connect($db_host,$db_user,$db_psw) or die ("db_connect error");
$var="INSERT INTO sharabelcom.topic_component_resources (topic_id,component_position,template_id,resource_position,resource_type,resource) VALUES ('$topic_id','$component_position','$template_id','$resource_position','$resource_type','$resource')";
$query= mysql_query($var, $conn) or die ("db_query error 3-".$i);
}
}
// fine scrittura sul db
?>
<div id="giveusfeedback-side">
<span><a href="#"></a></span>
</div>
<div id="header">
<img src="img/fakeadminbar.png" alt="">
<a id="adminbar_new" href="<?php echo 'http://'.$db_domain; ?>" title="Created A New Bottol"></a>
<a id="adminbar_created" href="<?php echo 'http://'.$db_domain.'/created.php'; ?>" title="Createed Bottols"></a>
</div>
<div id="container">
<div id="content">
<h2 class="pagetitle">Created Bottols</h2>
<!-- tabella con tutte le bottiglie create -->
<table id="createdbottols">
<thead>
<tr>
<th id="bottolid">ID</th>
<th id="bottoltitle">Title</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$conn=mysql_connect($db_host,$db_user,$db_psw) or die ("db_connect error");
$var="SELECT * FROM sharabelcom.wp_bb_topics";
$query= mysql_query($var, $conn) or die ("db_query error 4");
while ($values=mysql_fetch_array($query)) {
$id=$values["topic_id"];
$titolo=$values["topic_title"];
?>
<tr id="<?php echo $id; ?>">
<td><?php echo $id; ?></td>
<td><a href="http://<?php echo $db_domain; ?>/show.php?id=<?php echo $id; ?>"><?php echo $titolo; ?></a></td>
<td><input type="button" class="remove_button" value="Remove" onclick="removeBottol(<?php echo $id; ?>);"/></td>
</tr>
<?php } ?>
</tbody>
</table>
<!-- fine tabella -->
</div>
<div id="sidebar">
<div id="box1" class="sidebox">
<p>You have created</p>
<p class="sidemetrics">1</p>
<p>Bottols so far</p>
</div>
<div id="box2" class="sidebox">
<p>You have</p>
<p class="sidemetrics">49</p>
<p>new Bottols remaining</p>
</div>
</div>
</div>
<div id="footer">
<p id="footlinks">
<a href="#">How It Works</a> <span>•</span>
<a href="#">Blog</a> <span>•</span>
<a href="#">FAQ</a> <span>•</span>
<a href="#">Contact Us</a> <span>•</span>
<a href="#">About</a> <span>•</span>
<a href="#">Terms</a> <span>•</span>
<a href="#">Privacy</a>
</p>
<p id="copyright">© 2012 bottol.com - All Rights Reserved.</p>
</div>
</body>
</html>