-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary.php
More file actions
executable file
·52 lines (48 loc) · 1.24 KB
/
Copy pathlibrary.php
File metadata and controls
executable file
·52 lines (48 loc) · 1.24 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
<?php
global $wpdb;
/*Delete the model*/
if ( isset( $_POST['submit'] ) )
{
$tablename = $wpdb->prefix.'threed';
$wpdb->delete( $tablename,array('FILE_NAME' => $_POST['file_name']));
}
/*Display the list of models*/
$results = $wpdb->get_results ("SELECT * FROM wp_threed;");
if(count($results)==0)
{
echo "<center><h1>PLEASE ADD A NEW MODEL USING THE ADD NEW MODEL SUBMENU</h1>";
}
else
{
echo '<center><table class="box" width="700" id="cssTable"><tr>
<th> MODEL NAME </th>
<th> DELETE </th></tr>
';
foreach ( $results as $result )
{
echo '<tr height="30"><td width="800">'.$result->FILE_NAME.'</td><td width="800"><form action="" method="post"><input type="text" class="hidden" value="'.$result->FILE_NAME.'" name="file_name"><input type="submit" name="submit" class="deletes" value="DELETE"></form></td></tr>';
}
echo '</table>';
}
/*Styling for the table*/
echo "
<style>
table, th, td {
border: 1px solid black;
}
.box {
height:100px;
background-color:#ADD8E6;
position:fixed;
margin-left:-250px; /* half of width */
margin-top:-200px; /* half of height */
top:50%;
left:50%;
}
#cssTable td
{
text-align:center;
vertical-align:middle;
}
</style>
";