| 1 | <?include('../data.php'); ?> |
|---|
| 2 | <?include('../package.php');?> |
|---|
| 3 | |
|---|
| 4 | <? |
|---|
| 5 | if(isset($_GET['action']) && isset($_GET['id'])){ |
|---|
| 6 | |
|---|
| 7 | if($_GET['action']=='del'&& $_GET['id']){ |
|---|
| 8 | $obj=new Package($_GET['id']); |
|---|
| 9 | $obj->delete(); |
|---|
| 10 | echo "<h3>Package has been <span style='color:red'>Deleted</span>.</h3>"; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | if($_GET['action']=='con'&& $_GET['id']){ |
|---|
| 14 | $obj=new Package($_GET['id']); |
|---|
| 15 | $obj->setStatus(TRUE); |
|---|
| 16 | $obj->save(); |
|---|
| 17 | echo "<h3>Package has been <span style='color:green'>Confirmed</span>.</h3>"; |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | if($_GET['action']=='uncon'&& $_GET['id']){ |
|---|
| 21 | $obj=new Package($_GET['id']); |
|---|
| 22 | $obj->setStatus(FALSE); |
|---|
| 23 | $obj->save(); |
|---|
| 24 | echo "<h3>Package has been <span style='color:navy'>Unconfirmed</span>.</h3>"; |
|---|
| 25 | } |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | $t=new packages (); |
|---|
| 29 | $pkgs=$t->getAll(); |
|---|
| 30 | ?> |
|---|
| 31 | <html> |
|---|
| 32 | <head> |
|---|
| 33 | <title>Parsix Build Queue System</title> |
|---|
| 34 | <link rel="icon" href="http://parsix.org/html/themes/parsix/images/icon.png" type="image/png" /> |
|---|
| 35 | <link rel="shortcut icon" href="http://parsix.org/html/themes/parsix/images/favicon.ico" /> |
|---|
| 36 | <link rel="stylesheet" href="http://parsix.org/html/themes/parsix/style/styleNN.css" type="text/css" /> |
|---|
| 37 | <style type="text/css"> |
|---|
| 38 | @import url("themes/parsix/style/style.css"); |
|---|
| 39 | </style> |
|---|
| 40 | </head> |
|---|
| 41 | <a href="add.php">Add New Packages</a><hr /> |
|---|
| 42 | <table border="1"> |
|---|
| 43 | <tr> |
|---|
| 44 | <th style='width:120px'>Package</th> |
|---|
| 45 | <th style='width:130px'>Develoer</th> |
|---|
| 46 | <th style='width:90px' >Distro</th> |
|---|
| 47 | <th style='width:60px'> Status</th> |
|---|
| 48 | <th>action</th> |
|---|
| 49 | </tr> |
|---|
| 50 | <? |
|---|
| 51 | foreach($pkgs as $pkg) : |
|---|
| 52 | echo "\t<tr>\n"; |
|---|
| 53 | echo "\t\t<td>".$pkg->getPkgName()."</td>\n"; |
|---|
| 54 | echo "\t\t<td>".$pkg->getDeveloper()."</td>\n"; |
|---|
| 55 | echo "\t\t<td>".$pkg->getDistro()."</td>\n"; |
|---|
| 56 | echo "\t\t<td>". ( ($pkg->getStatus()==TRUE) ? "Confirmed" : "Not Confirmed") ." </td>\n"; |
|---|
| 57 | echo "\t\t<td>".'<a href="?action=del&id='.$pkg->getId().'">Delete</a> - '. |
|---|
| 58 | |
|---|
| 59 | ( ($pkg->getStatus()==TRUE) ? '<a href="?action=uncon&id='.$pkg->getId().'">Not Confirm</a>' : '<a href="?action=con&id='.$pkg->getId().'">Confirm</a>' ) |
|---|
| 60 | ."</td>\n"; |
|---|
| 61 | echo "\t</tr>\n"; |
|---|
| 62 | endforeach; |
|---|
| 63 | ?> |
|---|