$merchant->setName($_POST['name']);
    $merchant->insertMerchant();
    $lastmerchant = $merchant->getIDMerchant();
    $filter->setIdMerchant($lastmerchant);
    $filter->insertFilter();
}
if (isset($_GET['edit'])) {
    $merchant->Merchant($_GET['edit']);
    $id_merchant = $merchant->getIDMerchant();
    $lead = $merchant->getLead();
    $name = $merchant->getName();
}
if (isset($_POST['id_merchant']) && is_numeric($_POST['id_merchant'])) {
    $merchant->setLead($_POST['lead']);
    $merchant->setName($_POST['name']);
    $merchant->updateMerchant();
    header('Location: index.php');
}
if (isset($_GET['delete'])) {
    $merchant->Merchant($_GET['delete']);
    $merchant->deleteMerchant();
}
?>

<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Lenders email system</title>
    <link rel="stylesheet" href="css/foundation.css" />