· 10 years ago · Sep 11, 2016, 12:10 PM
1<?php
2
3
4$servername = "localhost";
5$username = "deniiynz_host";
6$password = "test";
7$dbname = "deniiynz_manual";
8$conn = new mysqli($servername, $username, $password, $dbname);
9
10if ($conn->connect_error) {
11 die("Connection failed: " . $conn->connect_error);
12}
13
14$sql = "SELECT id, title, value, shlink, vlink FROM manualsurf_links";
15$result = $conn->query($sql);
16
17$sql5="SELECT * FROM manualsurf_links ORDER BY `credits`";
18$records=mysql_query($sql5);
19
20$res=mysql_query("SELECT * FROM manualsurf_setup");
21$setupRow=mysql_fetch_array($res);
22
23$title = $_POST['title'];
24$value = $_POST['value'];
25$shlink = $_POST['shlink'];
26$vlink = $_POST['vlink'];
27$show = '<h2>he</h2>';
28$bow1 = '<form method="post">
29<div class="info_box">Manual Surf is installed in your website, if you do not want continue using this addon, you can uninstall it by.
30<input type="submit" name="ungo" value="Uninstall">
31</div>
32<tr><td><input type="submit" value="Add Links" name="setgo1" ></td> <input type="submit" value="Manage Links" name="setgo" ></td> <input type="submit" value="Settings" name="addgo" ></td> <input type="submit"
33
34value="About" name="addgo" ></td></tr>
35</form>
36<center>
37<br>
38<h3><b>Add Links</b></h3>
39<br>
40</center>
41<center>
42<form method="post" >
43<p>Title : <input type="text" name="title" ></p>
44<p>Value : <input type="text" name="value" ></p>
45<p>Short link : <input type="text" name="shlink" ></p>
46<p>Valid Link : <input type="text" name="vlink" ></p>
47<br>
48</center>
49<center>
50<input type="submit" value="Add Link" name="addgo" >
51</center>
52</form>
53<br>
54</form>
55
56
57';
58$bow2 = '<center>
59<br>
60<br>
61<h3>Click on "Install" button to process the installation.</h3>
62<br>
63<br>
64<img src="../images/IA7uX.png">
65<br>
66<p>Monetize your ptc site with shorten links without problems.</p>
67<br>
68<form method="post" >
69<input type="submit" value="Install" name="installgo" >
70</form>
71<br>
72<br>
73</center>';
74while($mansurf=mysql_fetch_Assoc($records)){
75$bow3 = '<form method="post">
76<div class="info_box">Manual Surf is installed in your website, if you do not want continue using this addon, you can uninstall it by.
77<input type="submit" name="ungo" value="Uninstall">
78</div>
79<tr><td><input type="submit" value="Add Links" name="setgo1" ></td> <input type="submit" value="Manage Links" name="setgo" ></td> <input type="submit" value="Settings" name="addgo" ></td> <input type="submit"
80
81value="About" name="addgo" ></td></tr><p></form>
82<center>
83<br>
84<h3><b>Manage Links</b></h3>
85<br>
86</center>
87<tr>
88<style type="text/css">
89.tg {border-collapse:collapse;border-spacing:0;}
90.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
91.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
92.tg .tg-lnt9{background-color:#4c4c4c;color:#ffffff;vertical-align:top}
93.tg .tg-cxkv{background-color:#ffffff}
94.tg .tg-fx22{background-color:#4c4c4c;color:#ffffff}
95.tg .tg-yw4l{vertical-align:top}
96</style>
97<table class="tg" style="undefined;table-layout: fixed; width: 940px">
98<colgroup>
99<col style="width: 10px">
100<col style="width: 20px">
101<col style="width: 20px">
102<col style="width: 20px">
103<col style="width: 20px">
104<col style="width: 20px">
105</colgroup>
106
107 <tr>
108 <th class="tg-fx22">ID</th>
109 <th class="tg-fx22">Title</th>
110 <th class="tg-fx22">Value</th>
111 <th class="tg-fx22">Short Link</th>
112 <th class="tg-lnt9">Valid Link</th>
113 <th class="tg-lnt9">Credits</th>
114 </tr>
115 <tr>
116 <td class="tg-z2zr">'.$mansurf[id].'</td>
117
118 <td class="tg-z2zr">'.$mansurf['title'].'</td>
119
120 <td class="tg-z2zr">'.$mansurf['value'].'$</td>
121
122 <td class="tg-z2zr">'.$mansurf['shlink'].'</td>
123
124 <td class="tg-z2zr">'.$mansurf['vlink'].'</td>
125
126 <td class="tg-z2zr">'.$mansurf['credits'].'</td>
127
128 </tr>
129</table>
130<br>
131<br>
132 ';
133}
134
135
136
137if(isset($_POST['ungo'])) {
138$ungo = "DROP TABLE manualsurf_links;";
139if($conn->query($ungo) === TRUE) {
140$ungo1 = "DROP TABLE manualsurf_setup;";
141if($conn->query($ungo1) === TRUE) {
142 echo '<script>location.href="./?view=addon_modules&module=manualsurf";</script>';
143 } else {
144 echo "Error";
145
146}
147}
148}
149
150
151if(isset($_POST['setgo'])) {
152$bow1 = $bow3;
153
154}
155
156if(isset($_POST['setgo1'])) {
157$bow3 = $bow1;
158
159}
160
161if(isset($_POST['addgo'])){
162if($title == "" || $value == "" || $shlink == "" || $vlink == "") {
163echo '<div class="info_box">Please make sure to fill all textboxs.</div>';
164} else {
165$ago = "INSERT INTO `deniiynz_manual`.`manualsurf_links` (`id`, `title`, `value`, `shlink`, `vlink`) VALUES (NULL, '$title', '$value', '$shlink', '$vlink');";
166if($conn->query($ago) === TRUE) {
167echo '<div class="l2successptcform success_box"><span class="icon"></span>New link was successfully added.</div>';
168
169}
170}
171}
172
173if($setupRow['status'] == "Installed") {
174echo $bow1;
175} else {
176echo $bow2;
177
178}
179
180if(isset($_POST['installgo'])) {
181
182$updo1 = "CREATE TABLE IF NOT EXISTS `manualsurf_links` (
183 `id` int(11) NOT NULL AUTO_INCREMENT,
184 `title` varchar(10) NOT NULL,
185 `value` double NOT NULL DEFAULT '0.0001',
186 `shlink` varchar(255) NOT NULL,
187 `vlink` varchar(255) NOT NULL,
188 `credits` int(200) NOT NULL,
189 PRIMARY KEY (`id`)
190) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;";
191if($conn->query($updo1) === TRUE) {
192$upto2 = "CREATE TABLE IF NOT EXISTS `manualsurf_setup` (
193 `id` int(11) NOT NULL AUTO_INCREMENT,
194 `status` varchar(255) NOT NULL DEFAULT 'uninstalled',
195 PRIMARY KEY (`id`)
196) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;";
197if($conn->query($upto2) === TRUE) {
198$upto4 = "INSERT INTO `manualsurf_setup` (`id`, `status`) VALUES
199(1, 'Installed');";
200if($conn->query($upto4) === TRUE) {
201echo '<script>location.href="./?view=addon_modules&module=manualsurf";</script>';
202 } else {
203 echo "Error";
204
205}
206}
207}
208}
209
210?>