Ejemplo n.º 1
0
 }
 if ($action != "create" && $action != "update" && $fid) {
     $offer = $frl_offers->getOfferById($fid);
     if (!$offer) {
         include $error_page;
         exit;
     }
 }
 switch ($action) {
     case "create":
         if (isset($error)) {
             $categories_specs = professions::GetAllProfessions($_POST['categories']);
             break;
         }
         $create = array("user_id" => (int) $_SESSION['uid'], "title" => $_POST['title'], "descr" => $_POST['descr'], "category_id" => (int) $_POST['categories'], "subcategory_id" => (int) $_POST['subcategories']);
         $id_offer = $frl_offers->Create($create);
         if ($id_offer > 0) {
             //$_SESSION['bill.GET']['addinfo'] = "<a href='/?kind=8#o_{$id_offer}'>Перейти к оплаченному предложению</a>";
             header("Location: /public/offer/offer_published.php?offer_id={$id_offer}");
         }
         break;
     case "update":
         if (!$fid) {
             $fid = intval($_POST['fid']);
         }
         $is_edit = true;
         if (isset($error)) {
             $categories_specs = professions::GetAllProfessions($_POST['categories']);
             break;
         }
         $update = array("title" => $_POST['title'], "descr" => $_POST['descr'], "category_id" => (int) $_POST['categories'], "subcategory_id" => (int) $_POST['subcategories']);