Example #1
0
$product_image = '';
$product_short_details = '';
if (isset($_GET['products']) && $_GET['products'] != '') {
    $product->find_product($_GET['products']);
    if ($product->product_exists) {
        $product_name = $product->product_name;
        $product_short_details = $product->product_short_details;
        $product_image = $product->product_image;
    }
}
$collection = new Market();
$collection = $collection->getCollection();
if (isset($_POST['assign'])) {
    foreach ($collection as $market) {
        if ($_POST['price_' . $market->market_id] != '' && $_POST['price_' . $market->market_id] != 0) {
            $product->update_market_value($market->market_id, $_POST['price_' . $market->market_id]);
        }
    }
    header('location:index.php?products=' . $product->product_id);
}
?>

<form action="" method="post" enctype="multipart/form-data">
    
    <table>
        <tr>
            <td>Product Name</td><td><input type="text" name="product_name" value="<?php 
echo $product_name;
?>
"></td>
        </tr>