Exemplo n.º 1
0
                            $type_payment = __paramInit('int', NULL, 'type_payment');
                            if ($type_payment > 0) {
                                $sbr->setTypePayment($type_payment);
                            }
                            $sbr_stage = $sbr->getStages();
                            foreach ($sbr_stage as $stage) {
                                $sbr->setUserReqvHistory($sbr->uid, intval($stage->data['id']), 0);
                                // Сохраняем для всех этапов, согласие исполнителя
                            }
                            //header_location_exit("/".sbr::NEW_TEMPLATE_SBR."/?id={$id}");
                            header_location_exit("/" . sbr::NEW_TEMPLATE_SBR . "/?site=agreed&sbr_id={$id}");
                        }
                    }
                } else {
                    if ($refuse) {
                        $reason = __paramInit('string', null, 'frl_refuse_reason');
                        //stripslashes($_POST['frl_refuse_reason']); // !!!
                        $reason = substr(pg_escape_string($reason), 0, 512);
                        if ($sbr->refuse($reason)) {
                            header_location_exit("/" . sbr::NEW_TEMPLATE_SBR . "/?id={$id}");
                        }
                    }
                }
            }
        }
        $anchor = __paramInit('int', 'id');
        $anchor = __paramInit('int', 'id');
        $_SESSION['sbr_tip'] = notifications::getSbrTip();
        $sbr->setLastView();
        break;
}
Exemplo n.º 2
0
        if ($action == 'status_action') {
            $resend = __paramInit('bool', NULL, 'resend');
            $del = __paramInit('bool', NULL, 'del');
            $cancel = __paramInit('bool', NULL, 'cancel');
            $id = __paramInit('int', NULL, 'id');
            $ok = true;
            if ($resend) {
                $ok = $sbr->resendCanceled($id);
            } else {
                if ($cancel) {
                    $ok = $sbr->cancel($id);
                } else {
                    if ($del) {
                        $ok = $sbr->delete($id);
                    }
                }
            }
            if ($ok) {
                header_location_exit('/norisk2/' . ($del ? '' : "?id={$id}"));
            }
        }
        $anchor = __paramInit('int', 'id');
        if (!($sbr_currents = $sbr->getCurrents())) {
            header_location_exit('/promo/sbr/');
        } else {
            $sbr->getUserReqvs();
        }
        $_SESSION['sbr_tip_old'] = notifications::getSbrTip('old');
        $sbr->setLastView('old');
        break;
}
Exemplo n.º 3
0
 /**
  * Обьединяем события по старой и новой безопасных сделок
  * 
  * @return string
  */
 public static function getAllSbrTip()
 {
     $default = array('count' => 0, 'tip' => 'Список Безопасных сделок', 'alert' => FALSE);
     $sbrTip = notifications::getSbrTip();
     if (isset($sbrTip['count']) && $sbrTip['count'] > 0) {
         $default['count'] = $sbrTip['count'];
     }
     $sbrOldTip = notifications::getSbrTip('old');
     if (isset($sbrOldTip['count']) && $sbrOldTip['count'] > 0) {
         $default['count'] += $sbrOldTip['count'];
     }
     if ((int) $default['count'] === 1) {
         $default['tip'] = 'Новое событие в «Безопасной Сделке»';
         $default['alert'] = TRUE;
     } elseif ($default['count'] > 1) {
         $default['tip'] = $default['count'] . ' ' . ending($default['count'], 'новое событие', 'новых события', 'новых событий') . ' в ваших «Безопасных Сделках»';
     }
     return $default;
 }