/** * Добавляет жалобу на предложение фрилансера * * @param int $nOfferId Идентификатор предложения на которое жалуются * @param int $nUserId Идентификатор пользователя который жалуется * @param int $nType Тип нарушения * @param string $sMsg Суть жалобы * @return object xajaxResponse */ function sendOfferComplain($nOfferId = 0, $nUserId = 0, $nType = 1, $sMsg = '') { session_start(); if (isset($_SESSION['uid'])) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer_offers.php'; $objResponse = new xajaxResponse(); $offers = new freelancer_offers(); if ($offers->getOfferById($nOfferId, false)) { if ($offers->AddComplain($nOfferId, $nUserId, intval($nType), $sMsg)) { $objResponse->script("\$('offer_complain_{$nOfferId}').set('html','Ваша жалоба на рассмотрении');"); $objResponse->script("\$('offer_complain_{$nOfferId}').set('onclick','');"); } } $objResponse->script('complainBusy=false;'); $objResponse->script("\$\$('.b-popup').setStyle('display', 'none');"); return $objResponse; } }