<td><input type="text" name='id' value='<?php echo $product['id']; ?> ' hidden/></td> <td> <input type="submit" value="Save" style="width:100%;height:100%;"></button> </td> </form> <?php echo "</tr>"; } echo " </tbody></table></div></div>"; } elseif ($_GET['y'] == 3) { $array = $product->delete($_GET['z']); } elseif ($_GET['y'] == 2) { $prod = new Products(); $prod->name = $_POST['name']; $prod->price = $_POST['price']; $prod->qty = $_POST['qty']; $prod->sale = $_POST['sale']; $prods = $prod->update($_POST['id']); } } ?> </div> <!-- /. ROW --> </div>
$Product = new Products(); $Product->pname = $name_product; $Product->productPicture = $upimage; $Product->price = $price_prodect; $Product->available = '1'; $Product->cid = $category; ////////////// // $product->updatecolumn('pname',$Product->pname); } else { if ($_GET['code'] == "2") { $product = new Products(); $product->pid = $_GET['pid']; $Op = new orderProducts(); $Op->pid = $_GET['pid']; $Op->deleteByPID(); $product->delete(); } } $limit = isset($_GET['limit']) ? $_GET['limit'] : 0; $res = $product->selectLimit($limit, 4); $productsArray = array(); for ($i = 0; $i < count($res); $i++) { $productsArray[$i]['pid'] = $res[$i][0]; $productsArray[$i]['name'] = $res[$i][1]; $productsArray[$i]['price'] = $res[$i][3]; $productsArray[$i]['image'] = $res[$i][2]; } $replayArr["limit"] = $limit; $replayArr["allRowsNum"] = count($totalRes); $replayArr["productsArray"] = $productsArray; echo json_encode($replayArr);