</div> </body> </html> <?php if (isset($_POST['btnSave'])) { $path = constant("IMG_PATH"); $name = date('YmdHis') . floor(microtime() * 10000); $name .= rand(100, 999); $pathinfo = pathinfo($_FILES["txtEditUrl"]["name"]); $name .= "." . $pathinfo['extension']; move_uploaded_file($_FILES["txtEditUrl"]["tmp_name"], "../" . $path . "/" . $name); $path .= "/" . $name; $service = new HatService(); $sql = ' insert into hat '; $url = $path; $title = $_POST["txtEditTitle"]; $price = $_POST["txtEditPrice"]; $category = $_POST["txtEditCatetoryId"]; $suppliers = $_POST["txtEditSupplierId"]; $keyword = $_POST["txtEditKeyword"]; $hot = $_POST["ishotsale"]; $descr = $_POST["txtEditDesc"]; $dataArray = array("hat_title" => "'" . $title . "'", "hat_category_id" => "'" . $category . "'", "hat_price" => "'" . $price . "'", "hat_description" => "'" . $descr . "'", "hat_search_keyword" => "'" . $keyword . "'", "is_hot_sale" => "'" . $hot . "'", "hat_path" => "'" . $url . "'"); $sql .= $service->GetInsertSQL($dataArray); $id = $service->SaveHat($sql, $suppliers); if ($id != 0) { alertRedirect(true, 'DisplayHat.php'); } else { alertRedirect(false, 'DisplayHat.php'); } }
</table> </td> </tr> </table> <input id="supplier_id" type="hidden" value="" /> </form> </div> </body> </html> <?php if (isset($_POST['btnSave'])) { $service = new SupplierService(); $sql = ' insert into supplier '; $name = $_POST["txtEditName"]; $home = $_POST["txtEditHomePhone"]; $work = $_POST["txtEditWorkPhone"]; $mobile = $_POST["txtEditMobilePhone"]; $fax = $_POST["txtEditFaxNumber"]; $address = $_POST["txtEditSupplierAddress"]; $dataArray = array("supplier_name" => "'" . $name . "'", "supplier_home_phone" => "'" . $home . "'", "supplier_work_phone" => "'" . $work . "'", "supplier_mobile_phone" => "'" . $mobile . "'", "supplier_fax_number" => "'" . $fax . "'", "supplier_address" => "'" . $address . "'"); $sql .= $service->GetInsertSQL($dataArray); $id = $service->save($sql); if ($id != 0) { alertRedirect(true, 'DisplaySupplier.php'); } else { alertRedirect(false, 'DisplaySupplier.php'); } }
<tr> <td style="height:26px" > <input type="submit" id="btnSave" name="btnSave" class="submit_btn" onsubmit="return save()" value="Save"/> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </form> </div> </body> </html> <?php if (isset($_POST['btnSave'])) { $service = new CategoryService(); $sql = ' insert into category '; $title = $_POST["txtEditTitle"]; $dataArray = array("category_title" => "'" . $title . "'"); $sql .= $service->GetInsertSQL($dataArray); $id = $service->save($sql); if ($id != 0) { alertRedirect(true, 'DisplayCategory.php'); } else { alertRedirect(false, 'DisplayCategory.php'); } }
<td width="5" valign="bottom" class="navigation"> </td> <td valign="bottom" class="navigation"> Customer Management--Display Customer </td> </tr> </table> </td> </tr> </table> <form id="pageForm" name="pageForm" method="post" action="DisplayCustomer.php"> <?php include_once 'DataGrid.php'; ?> </form> </body> </html> <?php if (isset($_GET["customer_id"])) { $custId = $_GET['customer_id']; $service = new CustomerService(); $id = $service->UpdateStatus($custId); if ($id != 0) { alertRedirect(true, 'DisplayCustomer.php'); } else { alertRedirect(false, 'DisplayCustomer.php'); } }