当前位置: 首页>>代码示例>>PHP>>正文


PHP account::GetInfo方法代码示例

本文整理汇总了PHP中account::GetInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP account::GetInfo方法的具体用法?PHP account::GetInfo怎么用?PHP account::GetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account的用法示例。


在下文中一共展示了account::GetInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Конструктор класса.
  *
  * @param int $uid ИД Пользователя
  */
 public function __construct($uid = null)
 {
     global $DB;
     if ($uid === null) {
         $uid = get_uid(false);
     }
     $this->uid = $uid;
     $account = new account();
     $account->GetInfo($uid, true);
     $this->account = $account;
     $this->_db = $DB;
     $this->initWallet();
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:18,代码来源:wallet.php

示例2: income

 /**
  * Основная функция для пополнения. В нее нужно передать POST данны, которые пришли от веб-кошелька.
  * 
  * @param  array    массив с данным от webpay
  *
  * @return успех
  */
 public function income($data)
 {
     global $DB;
     $this->_fields = array();
     $id = $DB->insert('webpay_log', array('request' => serialize($data)), 'id');
     if (empty($data['amount']) || empty($data['userid']) || empty($data['userid_extra']) || empty($data['paymentid']) || empty($data['key']) || empty($data['paymode'])) {
         $this->_error($id, self::ERR_DATA);
         return false;
     }
     $amount = floatval($data['amount']);
     $login = (string) $data['userid_extra'];
     $this->_fields['payment_id'] = $paymentid = (string) $data['paymentid'];
     if ($amount <= 0) {
         $this->_error($id, self::ERR_AMOUNT);
         return false;
     }
     $this->_fields['amount'] = $amount;
     if ($data['key'] != md5($data['amount'] . $data['userid'] . $data['paymentid'] . onlinedengi_cards::SECRET)) {
         $this->_error($id, self::ERR_SECRET);
         return false;
     }
     $user = new users();
     $user->GetUser($login);
     if (empty($user->uid)) {
         $this->_error($id, self::ERR_USER);
         return false;
     }
     $this->_fields['user_id'] = $user->uid;
     if ($DB->val('SELECT COUNT(*) FROM webpay_log WHERE payment_id = ?', $paymentid)) {
         $this->_success($id, true);
     } else {
         $account = new account();
         $account->GetInfo($user->uid);
         $comment = 'Пополнение через Веб-кошелек';
         if ($account->deposit($op_id, $account->id, $amount, $comment, self::PAYMENT_SYS_CODE, $amount)) {
             $this->_error($id, self::ERR_DEPOSIT);
             return false;
         }
         $this->_fields['billing_id'] = $op_id;
         $this->_success($id);
     }
     return true;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:50,代码来源:webpay.php

示例3: delAttach

function delAttach($id, $login)
{
    $objResponse = new xajaxResponse();
    if (!hasPermissions('users')) {
        $login = $_SESSION['login'];
    }
    $user = new users();
    $user->GetUser($login);
    if ($user->uid) {
        $account = new account();
        $account->GetInfo($user->uid);
    }
    if (!$account->id) {
        $err = 'Ошибка';
    }
    //if(!sbr::isFileInReqvHistory($user->uid,$id)) {
    if (!$account->delAttach($id)) {
        $err = 'Ошибка';
    }
    //}
    $objResponse->call('delFinAttach', $id, $login, 1, $err);
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:23,代码来源:account.server.php

示例4: __construct

 /**
  * Конструктор класса, инициализируем аккаунт пользователя и так же данные необходимые для работы страницы.
  */
 public function __construct()
 {
     session_start();
     $uid = get_uid();
     // закрываем доступ на страницу для теста, доступ только админам
     if (!hasPermissions('users')) {
         //header("Location: /bill/"); // Если пользователь не админ
         //exit;
     }
     if (!$uid && $_GET['pg'] != '/bill/alphabank/') {
         header('Location: /fbd.php');
         // Если пользователь не авторизован, то посылаем на данную страницу
         exit;
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
     if (is_emp()) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr.php';
         $sbr = sbr_meta::getInstance();
         front::og('tpl')->sbr_reserved = $sbr->getReserved();
     }
     $account = new account();
     $account->GetInfo(get_uid());
     $this->account = $account;
     $_SESSION['ac_sum'] = $account->sum;
     $_SESSION['bn_sum'] = $account->bonus_sum;
     $this->uid = $uid;
     front::og('tpl')->footer_bill = true;
     front::og('tpl')->main_css = '/css/bill.css';
     front::og('tpl')->uid = $uid;
     // ИД пользователя
     front::og('tpl')->account = $account;
     // Аккаунт для биллинга
     front::og('tpl')->month_name = array(1 => 'Январь', 2 => 'Февраль', 3 => 'Март', 4 => 'Апрель', 5 => 'Май', 6 => 'Июнь', 7 => 'Июль', 8 => 'Август', 9 => 'Сентябрь', 10 => 'Октябрь', 11 => 'Ноябрь', 12 => 'Декабрь');
     front::og('tpl')->name_page = $this->name_page;
     front::og('tpl')->no_banner = !!is_pro();
     front::og('tpl')->g_page_id = '0|27';
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:40,代码来源:page_bill.class.php

示例5: exrates

$exrates = new exrates();
if ($action == 'add') {
    $sLogin = $_POST['login'];
    $nSummR = floatval($_POST['summ']);
    $nStamp = strtotime($_POST['date'] . ' ' . $_POST['time']);
    $oUser = new users();
    $oUser->GetUser($sLogin);
    if ($oUser->uid) {
        if ($nSummR > 0) {
            if (intval($nStamp)) {
                $nRate = $exrates->GetField(51, $err, 'val');
                $nSummFM = round($nSummR, 2);
                $sAdmin = 'Запись добавил: ' . $_SESSION['login'];
                $comments = "Безналичный перевод для физ.лиц, логин {$oUser->login}, Альфа-банк";
                $sDate = date('c', $nStamp);
                if ($account->GetInfo($oUser->uid, true) && !($err = $account->depositEx($account->id, $nSummFM, $sAdmin, $comments, 12, $nSummR, 11, $sDate))) {
                    // ВРЕМЕННАЯ АКЦИЯ! -------------
                    // ВРЕМЕННАЯ ЗАКОМЕНТЕНО! :) -------------
                    // $account->alphaBankGift( $nSummR, $sDate, $oUser->uid, $oUser->login );
                    //-------------------------------
                    // обновляем сессию юзера
                    $session = new session();
                    $session->UpdateProEndingDate($oUser->login);
                    $_SESSION['success'] = 'ok';
                    $sReferer = $_SERVER['HTTP_REFERER'];
                    $sReferer = preg_match('~siteadmin/alpha~i', $sReferer) ? $sReferer : '/siteadmin/alpha/';
                    header('Location: ' . $sReferer);
                    exit;
                }
            } else {
                $sError = 'Дата указана не верно';
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例6: saveProject

 /**
  * Сохраняет временный проект в базу.
  *
  * @param integer $buyer_id     ид. юзера-покупателя проекта. Если указан, то проект будет куплен за его счет (например, для админов).
  * @param mixed &$proj     сюда сохранится информация о проекте после его сохранения
  * @return integer|string   0 в случае успешной покупки или текст ошибки.
  */
 function saveProject($buyer_id = NULL, &$proj, $promo_codes = array())
 {
     $price = 0;
     // Если проект новый добаляется, то надо отослать уведомление
     if (!$this->isEdit()) {
         $need_send_email = true;
     } else {
         $need_send_email = false;
     }
     $operations = array();
     if ($ammount = $this->getAmmount()) {
         $buyer_id = $buyer_id ? $buyer_id : $this->_uid;
         $account = new account();
         if (!$account->GetInfo($buyer_id, true)) {
             return 'Ошибка в получении информации по счету.';
         }
         $is_pro = is_pro(true, $this->_project["user_id"]);
         $price = $this->getPrice($items);
         if ($this->isKonkurs()) {
             if ($items['contest']) {
                 $operations['contest'] = array('op_code' => $is_pro ? self::OPCODE_KON : self::OPCODE_KON_NOPRO, 'op_code_bns' => $is_pro ? self::OPCODE_KON_BNS : self::OPCODE_KON_BNS_NOPRO, 'ammount' => 1, 'comment' => $this->getOperationComment('contest'));
             }
         }
         if ($this->isVacancy()) {
             if ($items['office']) {
                 $operations['office'] = array('op_code' => $this->getVacancyOpCode(), 'op_code_bns' => self::OPCODE_PAYED_BNS, 'ammount' => 1, 'comment' => $this->getOperationComment('office'));
             }
         }
         $services = array('top', 'logo', 'urgent', 'hide');
         foreach ($services as $service) {
             if ($items[$service]) {
                 $operations[$service] = array('op_code' => self::getOpCodeByService($service), 'ammount' => $items[$service], 'comment' => $this->getOperationComment($service));
             }
         }
         foreach ($operations as $service => $operation) {
             $bill_id = 0;
             $this->_transactionId = $account->start_transaction($buyer_id, $this->_transactionId);
             if (!isset($operation['op_code_bns'])) {
                 $operation['op_code_bns'] = $operation['op_code'];
             }
             $descr = trim($operation['comment'], '&');
             if ($this->_project['billing_id']) {
                 $descr .= ' - дополнение к операции #' . $this->_project['billing_id'];
             }
             if ($account->bonus_sum >= $price) {
                 $error = $account->BuyFromBonus($bill_id, $this->_transactionId, $operation['op_code_bns'], $buyer_id, "{$descr} за счет подарка", "{$operation['comment']} за счет подарка", $operation['ammount'], true);
                 if ($error) {
                     return $error;
                 }
             } else {
                 $error = $account->Buy($bill_id, $this->_transactionId, $operation['op_code'], $buyer_id, $descr, $operation['comment'], $operation['ammount'], 0, isset($promo_codes[$service]) ? $promo_codes[$service] : 0);
                 if ($error) {
                     return $error;
                 }
             }
             if (!$bill_id) {
                 return 'Не хватает денег. ' . $account->sum . ' из ' . $price;
             }
             $this->account_operation_id = $bill_id;
             $operations[$service]['bill_id'] = $bill_id;
         }
     }
     $prePrj = $this->_preDb($price, $bill_id);
     $success = $this->isEdit() ? $this->editPrj($this->_project, $this->_attach, array_reverse($this->getCategories())) : $this->addPrj($this->_project, $this->_attach, array_reverse($this->_categories));
     if (!$this->isEdit()) {
         foreach ($operations as $service => $operation) {
             $account->updateComment($this->getOperationComment($service), $operation['bill_id'], array($operation['op_code'], $operation['op_code_bns']));
         }
     }
     $proj = $this->_project;
     if (!$success) {
         $this->_postDbFailed($prePrj, $bill_id, $buyer_id);
         return $error ? $error : 'Error';
     }
     $this->SavePayedInfo($items, $this->_project['id'], $bill_id, $topDays ? $topDays : 1);
     $this->_postDbSuccess();
     if (!$_SESSION['quickprjbuy_ok_id']) {
         $_SESSION['quickprjbuy_ok_id'] = $this->_project['id'];
     }
     return 0;
 }
开发者ID:amage,项目名称:fl-ru-damp,代码行数:88,代码来源:projects.php

示例7: getDocsFlow


//.........这里部分代码省略.........
     // документы, после загрузки которых выводим работодателя в док-те.
     $frl_upload_docs_cond = sbr::DOCS_TYPE_ACT;
     if ($scheme) {
         if ($scheme != -1) {
             $where[] = "ss.arch_closed_time > NOW()::date - interval '6 months'";
             $scheme_cond = "AND s.scheme_type = {$scheme}";
             if ($scheme == sbr::SCHEME_PDRD || $scheme == sbr::SCHEME_PDRD2) {
                 $scheme_cond = "AND ( s.scheme_type = {$scheme} OR s.scheme_type = " . sbr::SCHEME_PDRD2 . ')';
             }
         }
         $docs_cond = 'AND su.docs_received = false AND su.is_removed = false';
     } else {
         if ($filter['archive'] == 't') {
             $where[] = "ss.arch_closed_time < NOW()::date - interval '6 months'";
         }
         if ($filter['archive'] == 'f') {
             $where[] = "ss.arch_closed_time >= NOW()::date - interval '6 months'";
         }
     }
     if ($fv = pg_escape_string(trim($filter['contract_num']))) {
         $where[] = "'СБР-'||ss.sbr_id||'-'||ss.num ILIKE '%{$fv}%'";
     }
     if ($fv = pg_escape_string(trim($filter['user']))) {
         $where[] = "(u.login ILIKE '%{$fv}%' OR u.uname ILIKE '%{$fv}%' OR u.usurname ILIKE '%{$fv}%')";
     }
     if ($fv = pg_escape_string(trim($filter['name']))) {
         $where[] = "ss.name ILIKE '%{$fv}%'";
     }
     if ($fv = round((double) str_replace(array(' ', ','), array('', '.'), $filter['act_sum']), 2)) {
         $where[] = "round(su.act_lcomm+su.act_lintr, 2) = {$fv}";
     }
     if ($fv = (int) $filter['act_sys']) {
         $where[] = "ss.act_sys = {$fv}";
     }
     if ($fv = $filter['has_docs']) {
         $where[] = "su.docs_received = '{$fv}'";
     }
     if ($fv = $filter['has_act']) {
         $where[] = '((su.uploaded_docs & ' . sbr::DOCS_TYPE_COPY_ACT . ") <> 0) = '{$fv}'";
     }
     if ($fv = $filter['has_fct']) {
         $where[] = '((su.uploaded_docs & ' . sbr::DOCS_TYPE_COPY_FACTURA . ") <> 0) = '{$fv}'";
     }
     if ($fv = $filter['has_reqv']) {
         $where[] = "COALESCE(sr.is_filled[sr.form_type], false) = '{$fv}'";
     }
     if ($fv = $filter['is_removed']) {
         $where[] = "su.is_removed = '{$fv}'";
     }
     if ($scheme == 0) {
         $where[] = ' ( ss.scheme_type <> ' . sbr::SCHEME_LC . ' ) ';
         // исключаем Аккредитив
     }
     if ($where) {
         $where = 'WHERE ' . implode(' AND ', $where);
     }
     $leftPdrd = 'WHERE sp.completed IS NOT NULL OR su.user_id IS NOT NULL';
     if ($scheme == SBR::SCHEME_PDRD || $scheme == sbr::SCHEME_PDRD2) {
         $leftPdrd = "LEFT JOIN \n                 sbr_stages_users su1 \n                   ON su1.stage_id = wss.id \n                  AND su1.user_id = wss.frl_id \n                  AND (su1.uploaded_docs & {$frl_upload_docs_cond}) <> 0 \n                  WHERE su1.user_id IS NOT NULL OR su.user_id IS NOT NULL\n                  ";
     }
     $from = "\n            FROM (\n              WITH w_sbr_stages AS (\n                SELECT ss.*, s.emp_id, s.frl_id, s.scheme_id, s.scheme_type, s.cost_sys, \n                        arb.resolved, arb.frl_percent\n                  FROM sbr s\n                INNER JOIN\n                  sbr_stages ss\n                    ON ss.sbr_id = s.id\n                LEFT JOIN sbr_stages_arbitrage arb\n                    ON arb.stage_id = ss.id\n                 WHERE s.reserved_id IS NOT NULL\n                   AND s.norisk_id IS NULL\n                       {$scheme_cond}\n              )\n              SELECT wss.*, wss.emp_id as user_id, wss.cost_sys as act_sys,\n                    wss.closed_time as arch_closed_time\n                FROM w_sbr_stages wss \n              LEFT JOIN\n                sbr_stages_payouts sp\n                  ON sp.stage_id = wss.id\n                 AND sp.user_id = wss.frl_id\n              LEFT JOIN\n                sbr_stages_users su\n                  ON su.stage_id = wss.id\n                 AND su.user_id = wss.emp_id\n                 AND (su.uploaded_docs & {$emp_upload_docs_cond}) <> 0\n              {$leftPdrd}  \n              UNION ALL\n              SELECT wss.*, wss.frl_id, sp.credit_sys,\n                    sp.requested as arch_closed_time\n                FROM w_sbr_stages wss\n              INNER JOIN\n                sbr_stages_payouts sp\n                  ON sp.stage_id = wss.id\n                 AND sp.user_id = wss.frl_id\n            ) as ss\n          INNER JOIN\n            sbr_stages_users su\n              ON su.stage_id = ss.id\n             AND su.user_id = ss.user_id\n             {$docs_cond}\n          INNER JOIN\n            users u\n              ON u.uid = ss.user_id\n          LEFT JOIN\n            sbr_reqv sr\n              ON sr.user_id = ss.user_id\n        ";
     $sql = "\n          SELECT ss.*, sr.*, ss.id as stage_id,\n                 su.uploaded_docs, su.docs_received, su.act_lcomm, su.act_lintr, su.act_lndfl, su.act_lnp, su.act_lcomm + su.act_lintr as act_sum, su.act_notnp, su.is_removed,\n                 sp.credit_sys, sp.credit_sum,\n                 u.login, u.uname, u.usurname, u.role,\n                 COALESCE(docs.publ_time, ss.arch_closed_time) as act_upload_time\n          {$from}\n          LEFT JOIN\n            sbr_stages_payouts sp\n\n              ON sp.stage_id = ss.id\n             AND sp.user_id = ss.user_id\n             \n          --LEFT JOIN sbr_docs docs ON docs.stage_id = ss.id AND docs.access_role IN (1,2) AND docs.type IN (1,8) AND docs.is_deleted = false AND docs.owner_role = 0\n          LEFT JOIN (\n                SELECT DISTINCT ON (stage_id, access_role) stage_id, d.publ_time, f.modified, d.access_role FROM sbr_docs d\n                INNER JOIN file_sbr f ON f.id = d.file_id\n                WHERE \n                is_deleted = false AND access_role IN (1,2)\n                AND owner_role = 0\n                ORDER BY stage_id, access_role, publ_time DESC\n          ) docs ON docs.stage_id = ss.id AND (docs.access_role = substring(u.role, 1, 1)::integer + 1)\n          \n          {$where}\n           ORDER BY {$this->form_cols['docsflow'][$dir_col][1][$dir]}\n           LIMIT {$limit} OFFSET {$offset}\n        ";
     /*
               LEFT JOIN (
         SELECT DISTINCT ON (stage_id) stage_id, d.publ_time, f.modified FROM sbr_docs d
         INNER JOIN sbr s ON s.id = d.sbr_id
         INNER JOIN file_sbr f ON f.id = d.file_id
         WHERE type IN (1,8) 
         --AND status = 4 
         AND is_deleted = false AND access_role IN (1,2)
         AND owner_role = 0
         ORDER BY stage_id, publ_time DESC
               ) docs ON docs.stage_id = ss.id
     */
     if ($res = pg_query(self::connect(), $sql)) {
         if ($ret = pg_fetch_all($res)) {
             $account = new account();
             foreach ($ret as &$row) {
                 if ($row['uploaded_docs']) {
                     $access_role = is_emp($row['role']) ? self::DOCS_ACCESS_EMP : self::DOCS_ACCESS_FRL;
                     if ($docs = sbr_meta::getDocs("WHERE sd.stage_id = '{$row['id']}' AND (sd.access_role & {$access_role}) = {$access_role} AND sd.is_deleted = false", null, true)) {
                         $row['uploaded_docs_a'] = array();
                         foreach ($docs as $doc) {
                             $row['uploaded_docs_a'][$doc['type']] = $doc;
                         }
                     }
                 }
                 // это потом переделать
                 $account->GetInfo($row['user_id']);
                 $row['attaches'] = $account->getAllAttach();
             }
             $sql = "SELECT COUNT(1) as cnt {$from} {$where}";
             $mem = new memBuff();
             if ($rows = $mem->getSql($err, $sql, 60)) {
                 $page_count = $rows[0]['cnt'];
             }
         }
     }
     return $ret;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:sbr_adm.php

示例8: _admEditPrjOfferParseForm

/**
 * Отдает HTML для Редактирование предложения по проектам
 * 
 * @param  object $objResponse xajaxResponse
 * @param  string $rec_id идентификатор записи
 * @param  string $rec_type тип записи
 * @param  array $aParams дополнительные параметры с UID отправителя. остальные - опционально
 * @return string
 */
function _admEditPrjOfferParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array())
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/portfolio.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers_answers.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers_dialogue.php';
    $offer = projects_offers::GetPrjOfferById($rec_id);
    $dialogue = new projects_offers_dialogue();
    $user = new users();
    $account = new account();
    $portfolio = new portfolio();
    $professions = professions::GetSelFilProf($offer['user_id']);
    $professions = $professions ? $professions : array();
    $cur_prof = $professions ? $professions[0]['id'] : 0;
    $op_sum = projects_offers_answers::COLOR_FM_COST;
    if (!($portf_works = $portfolio->GetPortfProf($offer['user_id'], $cur_prof))) {
        $portf_works = array();
    }
    $user->GetUserByUID($offer['user_id']);
    $account->GetInfo($offer['user_id']);
    $offer['dialogue'] = $dialogue->GetDialogueForOffer($offer['id']);
    ob_start();
    include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/projects_offers.php';
    $sHtml = ob_get_contents();
    ob_end_clean();
    // текст
    $sOnReady = "if(document.getElementById('adm_edit_descr')) document.getElementById('adm_edit_descr').value = (\$('adm_edit_descr_source')? \$('adm_edit_descr_source').value : null);";
    // работы -----------------------------------
    $offer['portfolio_work_1_id'] = $offer['portf_id1'];
    $offer['portfolio_work_2_id'] = $offer['portf_id2'];
    $offer['portfolio_work_3_id'] = $offer['portf_id3'];
    $offer['portfolio_work_1'] = $offer['pict1'];
    $offer['portfolio_work_2'] = $offer['pict2'];
    $offer['portfolio_work_3'] = $offer['pict3'];
    $offer['portfolio_work_1_prev_pict'] = $offer['prev_pict1'];
    $offer['portfolio_work_2_prev_pict'] = $offer['prev_pict2'];
    $offer['portfolio_work_3_prev_pict'] = $offer['prev_pict3'];
    $offer['cost_from'] = round($offer['cost_from'], 2);
    $offer['cost_to'] = round($offer['cost_to'], 2);
    $use = array();
    $sWorks = 'adm_edit_content.works_ids   = new Array();
        adm_edit_content.works_names = new Array();
        adm_edit_content.works_prevs = new Array();
        adm_edit_content.works_picts = new Array();
        adm_edit_content.works_links = new Array();';
    if ($portf_works) {
        foreach ($portf_works as $key => $value) {
            $use[$value['id']] = 1;
            $sWorks .= "adm_edit_content.works_ids[{$value['id']}] = '{$value['id']}';\n                adm_edit_content.works_names[{$value['id']}] = '" . htmlspecialchars(addslashes(trim($value['name']))) . "';\n                adm_edit_content.works_prevs[{$value['id']}] = '" . trim($value['prev_pict']) . "';\n                adm_edit_content.works_picts[{$value['id']}] = '" . trim($value['pict']) . "';\n                adm_edit_content.works_links[{$value['id']}] = '" . trim($value['link']) . "';";
        }
    }
    for ($i = 1; $i < 4; $i++) {
        if ($user_offer['portf_id' . $i] > 0 && !isset($use[$user_offer['portf_id' . $i]])) {
            $sId = $user_offer['portf_id' . $i];
            $sWorks .= "adm_edit_content.works_ids[{$sId}] = '{$sId}';\n                adm_edit_content.works_prevs[{$sId}] = '" . trim($user_offer['prev_pict' . $i]) . "';\n                adm_edit_content.works_picts[{$sId}] = '" . trim($user_offer['pict' . $i]) . "';";
        }
    }
    if ($offer['portfolio_work_1'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_1_id']}, '{$offer['portfolio_work_1']}', '{$offer['portfolio_work_1_prev_pict']}');";
    }
    if ($offer['portfolio_work_2'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_2_id']}, '{$offer['portfolio_work_2']}', '{$offer['portfolio_work_2_prev_pict']}');";
    }
    if ($offer['portfolio_work_3'] != '') {
        $sWorks .= "adm_edit_content.prjOfferAddWork({$offer['portfolio_work_3_id']}, '{$offer['portfolio_work_3']}', '{$offer['portfolio_work_3_prev_pict']}');";
    }
    //-------------------------------------------
    $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать предложения по проекту');
    $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml);
    $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');");
    $objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное', 'Файлы'];");
    $objResponse->script('adm_edit_content.edit();');
    $objResponse->script("adm_edit_content.userLogin = '{$user->login}';");
    $objResponse->script($sOnReady);
    $objResponse->script($sWorks);
    $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_PRJ_OFFERS . ');');
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:89,代码来源:adm_edit_content.server.php

示例9: account

 if (!$error_type && $error['attach']) {
     $error_type = 'attach';
 }
 if (!$error_type && ($error['win_date'] || $error['end_date'])) {
     $error_type = 'date';
 }
 if (!$error) {
     //для пользователя
     $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();
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例10: TransferReserved

 /**
  * Зачислить деньги после списания с резерва (или арбитража) (СБР)
  *
  * @param integer $fid				uid кому зачисляем
  * @param float   $sum				сумма
  * @param integer $money_type		тип денег
  * @param string  $descr            комменты к операции
  * @param string  $errors			возвращает массив ошибок
  * @param integer $op_code			код операции
  * @param string  $comments         комменты к операции для юзера.
  * @return integer					id операции в account_operations
  */
 function TransferReserved($fid, $sum, $money_type, $descr, &$errors, $op_code = 38, $comments = NULL)
 {
     global $DB;
     $user_account = new account();
     $user_account->GetInfo($fid);
     //Если в ФМ, то надо пополнять сразу
     $ammount = $money_type == 0 ? $sum : 0;
     $frl_accept_id = $DB->insert('account_operations', array('billing_id' => $user_account->id, 'op_code' => $op_code, 'ammount' => $ammount, 'descr' => $descr, 'comments' => $comments ? $comments : NULL, 'payment_sys' => $money_type, 'trs_sum' => $sum), 'id');
     // количество операций
     $_SESSION['account_operations'] = intval($_SESSION['account_operations']) + 1;
     return $frl_accept_id;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:24,代码来源:account.php

示例11: freelancer

require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/stdf.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/rating.php";
$stretch_page = true;
$showMainDiv = true;
$footer_payed = true;
$no_banner = true;
$freelancer = new freelancer();
$is_allow = isAllowProfi();
if ($is_allow) {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/account.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/payed.php";
    $uid = get_uid();
    $account = new account();
    $account->GetInfo($uid, true);
    if (__paramInit('bool', 'quickprofi_ok', NULL, false)) {
        //Обновляем сессию
        $freelancer->GetUserByUID($uid);
        $_SESSION['is_profi'] = $freelancer->isProfi();
        $pro_last = payed::ProLast($_SESSION['login']);
        $_SESSION['pro_last'] = $pro_last['is_freezed'] ? false : $pro_last['cnt'];
    }
}
$catalogList = $freelancer->getProfiCatalog(80);
$maxFirstCLBlock = 90;
$cntCatalogList = count($catalogList);
$isMoreCatalogList = $cntCatalogList > $maxFirstCLBlock;
$cntFirstCLBlock = $isMoreCatalogList ? $maxFirstCLBlock : $cntCatalogList;
$page_title = "PROFI аккаунт - фриланс, удаленная работа на FL.ru";
$css_file = array('/css/block/b-icon/__cont/b-icon__cont.css');
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:30,代码来源:index.php

示例12: getMaxPrice

 /**
  * Возвращает максимальную сумму покупки, проверив, покупал ли юзер 
  * что-нибудь через Плати потом ранее.
  *
  * @param type $bill_id ИД счета
  *
  * @return int
  */
 public function getMaxPrice($bill_id = 0)
 {
     $maxPrice = self::PRICE_MAX;
     if ($this->is_pro) {
         $maxPrice = self::PRICE_MAX_PRO;
     } else {
         $uid = get_uid(false);
         if ($uid > 0) {
             $memBuff = new memBuff();
             if ($maxPriceSaved = $memBuff->get('platipotom_max_price_' . $uid)) {
                 return $maxPriceSaved;
             } else {
                 if (!$bill_id) {
                     $account = new account();
                     $account->GetInfo($uid, true);
                     $bill_id = $account->id;
                 }
                 $sql = 'SELECT id FROM account_operations WHERE op_code = 12 AND payment_sys = ?i AND billing_id = ?i';
                 $operation_id = $this->db()->val($sql, self::PAYMENT_CODE, $bill_id);
                 if ($operation_id) {
                     $maxPrice = self::PRICE_MAX_MORE;
                 }
                 $memBuff->set('platipotom_max_price_' . $uid, $maxPrice);
             }
         }
     }
     return $maxPrice;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:36,代码来源:platipotom.php

示例13: actionIndex

 public function actionIndex()
 {
     $limit = 20;
     $do = __paramInit('string', 'do', 'do', '');
     $page = __paramInit('int', 'page', 'page', 1);
     $filter = array();
     $filter_default = array('date' => date('d.m.Y', strtotime('-1 month')) . ' - ' . date('d.m.Y'));
     switch ($do) {
         case 'factura_delete':
             $nums = __paramInit('array', NULL, 'num', null);
             $this->billInvoicesAdminModel->deleteFactura($nums);
             break;
         case 'factura_update':
             $invoice_id = __paramInit('int', NULL, 'invoice_id', null);
             $file = $_FILES['new_file'];
             $this->billInvoicesAdminModel->updateFactura($invoice_id, $file);
             break;
         case 'factura':
             $nums = __paramInit('array', NULL, 'num', null);
             $dates = __paramInit('array', NULL, 'date', null);
             $this->billInvoicesAdminModel->addFactura($nums, $dates);
             break;
         case 'filter':
             $filter['do'] = $do;
             $filter['login'] = __paramInit('string', 'login', 'login', '');
             $filter['date'] = __paramInit('string', 'date', 'date', null);
             break;
             //Операция зачисления средств по счету
         //Операция зачисления средств по счету
         case 'pay':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/billing.php';
             $sums = __paramInit('array', NULL, 'sum', null);
             //@todo: слишком толстый контроллер
             //все ниже нужно было определить в модель
             $account = new account();
             $user = new users();
             if ($sums) {
                 $sAdmin = 'Запись добавил: ' . @$_SESSION['login'];
                 $sDate = date('c');
                 foreach ($sums as $user_id => $invoices) {
                     $user->GetUserByUID($user_id);
                     if (!$user->uid || !$account->GetInfo($user->uid, true) || empty($invoices)) {
                         continue;
                     }
                     $bill = new billing($user->uid);
                     foreach ($invoices as $invoice_id => $sum) {
                         $account_sum = $account->sum;
                         if (!is_numeric($sum) || $sum <= 0 || $account->sum + $sum < 0) {
                             continue;
                         }
                         $comments = sprintf("Безналичный перевод по счету Б-%06d", $invoice_id);
                         if (!$account->depositEx2($acc_op_id, $account->id, $sum, $sAdmin, $comments, 12, $sum, 4, $sDate)) {
                             $this->billInvoicesAdminModel->update($invoice_id, array('acc_op_id' => $acc_op_id));
                             //Автоматическая покупка услуги погашения задолженности
                             if ($account_sum < 0) {
                                 $payed_sum = abs($account_sum);
                                 $option = array('acc_sum' => $payed_sum);
                                 $billReserveId = $bill->addServiceAndCheckout(135, $option);
                                 if ($billReserveId) {
                                     $bill->buyOrder($billReserveId);
                                 }
                             }
                         }
                     }
                 }
                 $this->redirect('.');
             }
             break;
     }
     $this->billInvoicesAdminModel->setPage($limit, $page);
     $list = $this->billInvoicesAdminModel->setFilter($filter)->getInvoices();
     $count = $this->billInvoicesAdminModel->getInvoicesCnt();
     $filter_query = '';
     if (empty($filter)) {
         $filter = $filter_default;
     } else {
         $filter_query = http_build_query($filter) . '&';
     }
     $this->render('index', array('list' => $list, 'limit' => $limit, 'page' => $page, 'page_count' => $count, 'filter_query' => $filter_query, 'filter' => $filter));
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:82,代码来源:BillInvoicesAdminController.php

示例14: payoutAgnt

 /**
  * Совершает выплату юзеру по данному этапу СБР.
  * Выплата -- это отметка, что деньги реально выплачены.
  *
  * @param integer $user_id   ид. юзера, которому предназначается выплата.
  * @return boolean   успешно?
  */
 function payoutAgnt($user_id, pskb $pskb, pskb_lc $pskb_lc)
 {
     setlocale(LC_ALL, 'en_US.UTF-8');
     if (!$this->getPayouts($user_id)) {
         return false;
     }
     if ($this->payouts[$user_id]['completed']) {
         return false;
     }
     $account = new account();
     $account->GetInfo($user_id);
     $credit_sys = $this->payouts[$user_id]['credit_sys'];
     $lc = $pskb->getLC(true);
     $acc = $user_id == $this->sbr->emp_id ? $lc['accCust'] : $lc['accPerf'];
     switch ($credit_sys) {
         case exrates::BANK:
             $descr = "Безнал на счет: {$acc}";
             break;
         case exrates::YM:
             $descr = "Яндекс.Деньги на кошелек: {$acc}";
             break;
         case exrates::WMR:
             $descr = "WMR на кошелек: {$acc}";
             break;
         case exrates::WEBM:
             $descr = "Вывод на Веб-кошелек";
             break;
         case exrates::CARD:
             $descr = "Безнал на счет пластиковой карты";
             break;
         default:
             return !($this->error = 'Неверная валюта');
     }
     $this->sbr->getScheme();
     $percent = 1;
     if ($this->payouts[$user_id]['is_arbitrage'] == 't') {
         $this->getArbitrage();
         $percent = abs((int) ($user_id == $this->sbr->emp_id) - $this->arbitrage['frl_percent']);
     }
     $iex = $credit_sys . $this->sbr->cost_sys;
     if (!$this->exrates) {
         $this->sbr->getExrates();
     }
     $credit_sum = $this->payouts[$user_id]['credit_sum'];
     $debit_sum = round($credit_sum * $this->sbr->exrates[$iex], 2);
     $d_descr = 'Списание ' . ($percent == 1 ? '' : 100 * $percent . '% (арбитраж) ') . "резерва «Безопасной Сделки» (этап #{$this->id})";
     $sbr = sbr_meta::getInstanceLocal($user_id);
     $sbr->initFromId($this->data['sbr_id'], false, false);
     $comments = sbr_meta::view_cost($credit_sum, $credit_sys) . ', ' . $sbr->getContractNum();
     $d_comments = sbr_meta::view_cost($debit_sum, $this->sbr->cost_sys) . ', ' . $sbr->getContractNum();
     if (($debit_id = $account->CommitReserved($sbr->emp_id, $this->sbr->reserved_id, $d_descr, sbr::OP_DEBIT, $debit_sum, $d_comments)) && ($credit_id = $account->TransferReserved($user_id, $credit_sum, $credit_sys - 1, $descr, $errors, sbr::OP_CREDIT, $comments))) {
         $sql = "\n              UPDATE sbr_stages_payouts\n                 SET debit_id = {$debit_id},\n                     credit_id = {$credit_id},\n                     completed = now(),\n                     state = '{$pskb_lc->state}',\n                     \"stateReason\" = '{$pskb_lc->stateReason}',\n                     bank_completed = '{$pskb_lc->date}'\n               WHERE stage_id = {$this->id}\n                 AND user_id = {$user_id}\n\n                 AND completed IS NULL\n              RETURNING *\n            ";
         if ($res = pg_query(self::connect(), $sql)) {
             $this->payoutUpdateState($pskb_lc);
             $docs = array();
             $is_emp_arb = $this->status == sbr_stages::STATUS_ARBITRAGED && $this->arbitrage['resolved'] && floatval($this->arbitrage['frl_percent']) == 0;
             if ($this->sbr->scheme_type == sbr::SCHEME_LC && !$is_emp_arb) {
                 if ($doc_file = $this->generateEmpAgentReport($doc_err, $rep_num)) {
                     // отчет агента.
                     $docs[] = array('stage_id' => $this->id, 'file_id' => $doc_file->id, 'num' => $rep_num, 'status' => sbr::DOCS_STATUS_PUBL, 'access_role' => sbr::DOCS_ACCESS_EMP, 'owner_role' => 0, 'type' => sbr::DOCS_TYPE_AGENT_REP);
                     if ($doc_file = $this->generateEmpAct($doc_err, $doc_num, $rep_num)) {
                         // акт работодателя по агентской схеме (он же отчет об арбитраже, если был арбитраж).
                         $docs[] = array('stage_id' => $this->id, 'file_id' => $doc_file->id, 'num' => $doc_num, 'status' => sbr::DOCS_STATUS_PUBL, 'access_role' => sbr::DOCS_ACCESS_EMP, 'owner_role' => 0, 'type' => sbr::DOCS_TYPE_ACT);
                     }
                 }
             } elseif (($this->sbr->scheme_type == sbr::SCHEME_PDRD || $this->sbr->scheme_type == sbr::SCHEME_PDRD2) && !$is_emp_arb) {
                 if ($doc_file = $this->generateArbReportPdrdEmp($doc_err)) {
                     // отчет арбитража по договору подряда для работодателя.
                     $docs[] = array('stage_id' => $this->id, 'file_id' => $doc_file->id, 'status' => sbr::DOCS_STATUS_PUBL, 'access_role' => sbr::DOCS_ACCESS_EMP, 'owner_role' => 0, 'type' => sbr::DOCS_TYPE_ARB_REP);
                 }
             }
             if (count($docs)) {
                 foreach ($docs as $doc) {
                     $ok = $this->sbr->addDocR($doc);
                 }
             }
             $this->payouts[$user_id] = pg_fetch_assoc($res);
             return true;
         }
     }
     if ($debit_id && !$credit_id) {
         $account->Del($user_id, $debit_id);
     }
     return false;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:92,代码来源:sbr_stages.php

示例15: qiwipay

require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/stdf.php";
if (is_release()) {
    exit;
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/qiwipay.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/billing.php";
$qiwipay = new qiwipay(get_uid(false));
if (isset($_POST['cancel'])) {
    $back_url = $_SESSION['referer'];
    unset($_SESSION['referer']);
    header("Location: {$back_url}");
    exit;
} elseif (isset($_POST['success'])) {
    $sum = $_SESSION['post_payment']['sum'];
    $account = new account();
    $account->GetInfo($qiwipay->uid, true);
    $bill = $DB->row("SELECT * FROM qiwi_account WHERE account_id = ? order by id desc LIMIT 1", $account->id);
    $error = $qiwipay->completeBill($error, $bill, $sum);
    var_dump($error);
    var_dump($DB->sql);
    exit;
    header("Location: /bill/");
    exit;
}
$bill = new billing(get_uid(false));
$bill->test = true;
$bill->setPaymentMethod('qiwipurse');
$created = $bill->error;
$_SESSION['post_payment'] = $_POST;
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
?>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:qiwipurse.php


注:本文中的account::GetInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。