Пример #1
0
function showMyAds()
{
    require 'dbase.php';
    $name = $_SESSION['userAccount'];
    //show posted ads
    $stmt = $mysqli->prepare("SELECT * FROM ads WHERE seller=?");
    if (!$stmt) {
        printf("Query Prep Failed: %s\n", $mysqli->error);
        exit;
    }
    $stmt->bind_param('s', $name);
    $stmt->execute();
    $result = $stmt->get_result();
    echo "<table>\n\t\t\t\t<tr>\n\t\t\t\t<th>Title:</th>\n\t\t\t\t<th>Snippet</th>\n\t\t\t\t<th>Price:</th>\n\t\t\t\t<th>Seller:</th>\n\t\t\t\t<th>Category:</th>\n\t\t\t\t<th>Reserve Price:</th>\n\t\t\t\t</tr>";
    while ($row = $result->fetch_assoc()) {
        $_SESSION['Description'] = $row['snippet'];
        echo "<tr>";
        echo "<td>" . htmlentities($row['title']) . "</td>";
        echo "<td>" . htmlentities($row['snippet']) . "</td>";
        echo "<td>" . htmlentities($row['price']) . "</td>";
        echo "<td>" . htmlentities($row['seller']) . "</td>";
        echo "<td>" . htmlentities($row['catagory']) . "</td>";
        echo "<td>" . htmlentities($row['reserve']) . "</td>";
        echo "<td>";
        deleteAd($row['id']);
        editAd($row['id']);
        echo "</td>";
        echo "</tr>";
    }
    $stmt->close();
    echo "</table>";
}
Пример #2
0
require_once 'uploadexception.php';
JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'tables');
define("MAX_SIZE", "1048576");
switch ($task) {
    case 'remove':
        removeAd($option);
        break;
    case 'view':
        viewAds($option);
        break;
    case 'viewad':
        viewAd($option);
        break;
    case 'edit':
    case 'add':
        editAd($option);
        break;
    case 'save':
        save();
        break;
    case 'myads':
        myAds($option);
        break;
    default:
        showPublishedCategories($option);
        break;
}
function showPublishedCategories($option)
{
    $query = "SELECT * FROM #__aard_config WHERE id ='1'";
    $db =& JFactory::getDBO();