Beispiel #1
0
 //для пользователя
 $account_sum = $account->sum;
 $account_bonus_sum = $account->bonus_sum;
 //для модератора
 $view_user_login = '';
 if (hasPermissions("projects")) {
     $uid = $tmpPrj->getAuthorId();
     $view_account = new account();
     $view_account->GetInfo($uid);
     $account_sum = $view_account->sum;
     $account_bonus_sum = $view_account->bonus_sum;
     $view_user_login = $tmpPrj->getAuthorLogin();
 }
 if ($action == 'save') {
     $_POST['logo_id'] = $_POST['logo_file_id'];
     if ($PDA && !$tmpPrj->getCategories()) {
         $cats = array();
         $cats[] = array('category_id' => $project['category'], 'subcategory_id' => $project['subcategory']);
         $tmpPrj->setCategories($cats);
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/drafts.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/billing.php";
     $bill = new billing($uid);
     $bill->clearOrders();
     $tmpProject = $tmpPrj->getProject();
     if ($tmpPrj->isVacancy()) {
         $initedState = $tmpProject['state'];
         $tmpPrj->setProjectField('old_state', $initedState);
         $tmpPrj->setProjectField('state', projects::STATE_PUBLIC);
     }
     if ($tmpPrj->getAmmount() && $account_bonus_sum < $tmpPrj->getAmmount()) {
Beispiel #2
0
 //для пользователя
 $price = $tmpPrj->getPrice($payedItems);
 $account_sum = $account->sum;
 $account_bonus_sum = $account->bonus_sum;
 //для модератора
 $view_user_login = '';
 if (hasPermissions("projects")) {
     $uid = $tmpPrj->getAuthorId();
     $view_account = new account();
     $view_account->GetInfo($uid);
     $account_sum = $view_account->sum;
     $account_bonus_sum = $view_account->bonus_sum;
     $view_user_login = $tmpPrj->getAuthorLogin();
 }
 if ($action == 'save' && ($account_sum >= $price || $account_bonus_sum >= $price)) {
     if ($PDA && !$tmpPrj->getCategories()) {
         $cats = array();
         $cats[] = array('category_id' => $project['category'], 'subcategory_id' => $project['subcategory']);
         $tmpPrj->setCategories($cats);
     }
     if (!($error['buy'] = $tmpPrj->saveProject(hasPermissions('projects') ? $uid : NULL, $proj))) {
         if (hasPermissions("projects")) {
             $inspect_user_session = new session();
             $inspect_user_session->UpdateProEndingDate($view_user_login);
         }
         $back = $backLink ? $backLink : '/';
         $drafts->DeleteDraft($draft_id, $uid, 1);
         if ($price) {
             // в PDA без страниц-прокладок
             if ($PDA) {
                 if ($back == '/') {