• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中zin函数的典型用法代码示例。如果您正苦于以下问题:PHP zin函数的具体用法?PHP zin怎么用?PHP zin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: run

 public function run()
 {
     $user = $this->order[$this->is_emp ? 'freelancer' : 'employer'];
     //получаем общее кол-во отзывов
     $oplinks = NULL;
     $opcount = opinions::GetCounts($user['uid'], array('total'));
     if (array_sum($opcount['total']) > 0) {
         $oplinks = array('p' => getSortOpinionLinkEx('frl', "total", 1, $user['login'], zin($opcount['total']['p']), null, 0), 'n' => getSortOpinionLinkEx('frl', "total", 2, $user['login'], zin($opcount['total']['n']), null, 0), 'm' => getSortOpinionLinkEx('frl', "total", 3, $user['login'], zin($opcount['total']['m']), null, 0));
     }
     //город юзера
     $city_id = $this->order['is_meet'] == 't' && $this->order['city'] > 0 ? $this->order['city'] : $user['city'];
     $user['place_title'] = '';
     if ($city_id > 0) {
         $user['place_title'] = city::getCountryName($city_id) . ', ' . city::getCityName($city_id);
     }
     //собираем шаблон
     $this->render('t-service-order-user-profile', array('user' => $user, 'oplinks' => $oplinks));
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:18,代码来源:TServiceOrderUserProfile.php


示例2: process_batch

 /**
  * Обработка пачки событий (вызывается демоном).
  *
  * @param int $batch_id
  *
  * @return bool
  */
 public function process_batch($batch_id)
 {
     $events = $this->preprocess_batch($batch_id);
     if ($events === false) {
         $this->log->verbose('PGQDaemonBanners.preprocess_batch got not events (False).');
         return false;
     }
     /*
      * Event processing loop!
      */
     $abort_batch = false;
     $sql = "PREPARE updBanners (int, int, int) AS \n        \t\tUPDATE ban_stats1 set views = views + \$2, clicks = clicks + \$3 WHERE banner_id = \$1;\n";
     foreach ($events as $event) {
         if ($abort_batch) {
             break;
         }
         $id = $event->data['id'];
         $type = $event->type;
         if ($type == 'click') {
             ++$bans[$id]['click'];
         } elseif ($type == 'view') {
             ++$bans[$id]['view'];
         }
         $this->log->verbose('PGQDaemonBanners.process_batch type %s event %d of batch %d ', $type, $event->id, $batch_id);
         $this->log->verbose('PGQDaemonBanners.process_batch processed event %d of batch %d', $event->id, $batch_id);
     }
     if ($bans) {
         foreach ($bans as $ikey => $ban) {
             $sql .= "EXECUTE updBanners({$ikey}, " . zin($ban['view']) . ', ' . zin($ban['click']) . ");\n";
         }
         $sql .= 'DEALLOCATE updBanners;';
         $result = pg_query(DBConnect(), $sql);
         $this->log->debug('UPDATE : %s ', $sql);
         if ($result === false) {
             $this->log->error('Unable to update : %s ', $sql);
             $abort_batch = true;
         }
     } else {
         $this->log->verbose('PGQDaemonBanners.process_batch has no banners');
     }
     return $this->postprocess_batch($batch_id, $abort_batch);
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:49,代码来源:banners_cons.php


示例3: zin

        echo $user->login;
        ?>
#form" method="post"><input type="hidden" name="prjname" value="<?php 
        echo $prj['name'] ? $prj['name'] : 'заголовок отсутствует';
        ?>
"><input type="submit" name="btn" class="btn" value="Оговорить детали"></form><?php 
    }
    ?>
	<div align="right" style="margin-top: 5px;"><b>[<a href="<?/* Апдейт проектов /blogs/view.php?tr=<?php 
    echo $prj['thread_id'];
    ?>
*/?>/projects/?pid=<?php 
    echo $prj['id'];
    ?>
" class="blue"><b>Комментарии (<?php 
    echo zin($prj['comm_count']);
    ?>
)</b></a>]</b></div>
	</td>
	</tr>
</table>
<?php 
} else {
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="19">
<tr valign="top">
	<td height="400" valign="top" bgcolor="#FFFFFF">
	<h1>Проект удален</h1>
К сожалению, этот проект был удален.<br> 
<br>
Электронная почта: <a href="mailto:[email protected]">[email protected]</a><br>
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:aboutprj_inner.php


示例4: setlocale

                Сумма к оплате: <span id="quick_pro_sum_pay"></span> руб.<br>
            </div>
    
    
            <div class="b-layout__txt b-layout__txt_padbot_20 b-layout__txt_padleft_20 b-layout__txt_fontsize_11">
                <span id="quick_pro_sum_span_4">
                <span id="quick_pro_sum_span_2">Часть суммы (<span id="quick_pro_sum_span_7"></span> руб.)</span><span id="quick_pro_sum_span_3">Она</span> будет списана с личного счета, на нем 
                <span id="quick_pro_sum_account1" class="b-layout__bold">
                    <?php 
setlocale(LC_NUMERIC, 'en_US');
?>
                    <?php 
if (round($_SESSION['bn_sum'] + $_SESSION['ac_sum'], 2) > 0) {
    ?>
                        <?php 
    echo number_format(round(zin($_SESSION['ac_sum']), 2), 2, ",", " ");
    ?>
                    <?php 
} else {
    ?>
                        0
                    <?php 
}
?>
                </span>
                 руб.<br>
                 <span id="quick_pro_sum_span_5">
                Остаток (<span id="quick_pro_sum_span_6"></span> руб.) вам нужно оплатить одним из способов:
                </span>
                </span>
                <span id="quick_pro_sum_span_1">Ее вы можете оплатить одним из способов:</span>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:quick_buy_pro.php


示例5: url

        $theme = $groups[$i];
        if (in_array($theme['id'], blogs::$copiny_group)) {
            $feedback_copiny[] = $theme;
            continue;
            // Перенесли в архив #0023264
        }
        $love = (int) $theme['id'] == 55;
        if ($love && !$allow_love) {
            continue;
        }
        $tname = $theme['t_name'];
        //if ($theme['id'] == 7 && $theme['t'] == 0) $tname = "<strong>".$theme['t_name']."</strong>";
        if ($theme['id'] == $gr && $base == $theme['t']) {
            $group_line .= $addit . "<li" . ($love ? ' style="background: url(/images/icons/heart.png) no-repeat 2px 7px;" ' : '') . ($i == $size - 1 ? " class=\"last\"" : "") . ">" . ($love ? '<span id="love_time_simple" style="float:right">00:00:00</span>' : '') . $theme['t_name'] . " (" . zin($theme['num']) . ")</li>\n";
        } else {
            $group_line .= $addit . "<li" . ($love ? ' style="background: url(/images/icons/heart.png) no-repeat 2px 7px;" ' : '') . ($i == $size - 1 ? " class=\"last\"" : "") . ">" . ($love ? '<span id="love_time_simple" style="float:right">00:00:00</span>' : '') . "<a href=\"" . getFriendlyUrl('blog_group', $theme['id']) . ($theme['t'] || $ord ? "?" : "") . ($theme['t'] ? "&amp;t=prof" : "") . ($ord != "new" ? "&amp;ord={$ord}" : "") . "\" title=\"" . $theme['t_name'] . "\">" . $tname . " (" . zin($theme['num']) . ")</a></li>\n";
        }
        $sum = $sum + $theme['num'];
    }
    ?>
            <li><?php 
    if ($gr) {
        ?>
<a href="/blogs/viewgroup.php<?php 
        echo $ord ? "?ord={$ord}" : "";
        ?>
" title="Все вместе"><?php 
    }
    ?>
<strong>Все вместе</strong> (<?php 
    echo $sum;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:favlist_cnt.php


示例6: view_account_format

/**
 * Форматтер состояния счета в шапке
 * 
 * @return string
 */
function view_account_format($tip = FALSE)
{
    $ac_sum = round(zin($_SESSION['ac_sum']), 2);
    $bn_sum = round(zin($_SESSION['bn_sum']), 2);
    $ac_sum_txt = number_format($ac_sum, 2, ",", " ");
    $bn_sum_txt = number_format($bn_sum, 2, ",", " ");
    $ret = $tip ? "У вас на счету {$ac_sum_txt} " . ending($ac_sum, 'рубль', 'рубля', 'рублей') : $ac_sum_txt . ((int) $_SESSION['bn_sum'] ? ' + ' . $bn_sum_txt : '') . ' руб.';
    $ret = str_replace(',00', '', $ret);
    return $ret;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:15,代码来源:stdf.php


示例7: Auth


//.........这里部分代码省略.........
                 $res = array();
                 //переходим ко 2ой стадии
                 return self::AUTH_STATUS_2FA;
             }
         }
     }
     //Более нам параметр этапов авторизации не нужен
     unset($params['2fa_provider']);
     /**
      * Успешная авторизация.
      */
     if (count($res)) {
         list($email, $trole, $tname, $tsurname, $tid, $is_banned, $ban_where, $active, $sum, $bonus_sum, $log, $anti_uid, $is_pro_test, $is_pro_new, $is_chuck, $sex, $settings, $splash_show, $is_verify, $reg_date, $activate_code, $photo, $is_profi, $birthday) = array_values($res);
         if ($activate_code != '' && $active == 't') {
             $this->checkRegDate($tid, $reg_date);
         }
         if ($is_banned) {
             return -1;
         }
         //if ($active=='f') return -2; //##0027983
         if (!$this->CheckUserAllowIP($ip, $tid)) {
             return -3;
         }
         $params['birthday'] = $birthday ? strtotime($birthday) : null;
         $params['age'] = $params['birthday'] ? intval(ElapsedYears($params['birthday'])) : null;
         require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/permissions.php';
         $params['permissions'] = permissions::getUserPermissions($tid);
         $params['email'] = $email;
         $params['role'] = $trole;
         $params['name'] = $tname;
         $params['surname'] = $tsurname;
         $params['uid'] = $tid;
         $params['user_ip'] = $ip;
         $params['ac_sum'] = zin($sum);
         $params['bn_sum'] = zin($bonus_sum);
         $params['login'] = $log;
         $params['is_pro_new'] = $is_pro_new;
         $params['pro_test'] = $is_pro_test;
         $params['is_chuck'] = $is_chuck;
         $params['is_verify'] = $is_verify;
         $params['sex'] = $sex;
         $params['reg_date'] = $reg_date;
         $params['photo'] = $photo;
         if (!is_emp($trole)) {
             $params['is_profi'] = $is_profi === 't';
         }
         if ($anti_uid) {
             $anti_class = is_emp($trole) ? 'freelancer' : 'employer';
             require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/{$anti_class}.php";
             $anti = new $anti_class();
             $anti->GetUserByUID($anti_uid);
             $params['anti_uid'] = $anti->uid;
             $params['anti_login'] = $anti->login;
             $params['anti_surname'] = $anti->usurname;
             $params['anti_name'] = $anti->uname;
         }
         if (!is_emp($params['role'])) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_offers.php';
             if ($po_summary = projects_offers::GetFrlOffersSummary($params['uid'])) {
                 $params['po_count'] = $po_summary['total'];
             }
         }
         $sql = 'UPDATE users SET last_time = now(), last_ip = ?, is_active = true WHERE uid = ?i';
         $res = $DB->query($sql, $ip, $tid);
         $this->SaveLoginIPLog($tid, $ip);
         $this->increaseLoginsCnt($tid);
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:67,代码来源:users.php


示例8: zin

                echo $prj['thread_id'];
                ?>
" class="blue">
	  <?php 
                echo $prj['comm_count'] ? '<b>Комментарии (' . zin($prj['comm_count']) . ')</b>' : 'Комментарии (' . zin($prj['comm_count']) . ')';
                ?>
</a>]</b>
	</div><?php 
            } else {
                ?>
	<div align="right" style="margin-top: 5px;"><b>[<a href="/projects/?pid=<?php 
                echo $prj['id'];
                ?>
" class="blue">
	  <?php 
                echo $prj['offers_count'] ? '<b>Комментарии (' . zin($prj['offers_count']) . ')</b>' : 'Комментарии (' . zin($prj['offers_count']) . ')';
                ?>
</a>]</b>
	</div><?php 
            }
            ?>
	</td>
	<td width="67" align="center" class="qp"><?if ($prj['cost']>0) {?><strong><?php 
            echo CurToChar($prj['cost'], $prj['currency']);
            ?>
</strong><?} else{?>&nbsp;<?}?></td>
	<td width="30"><?php 
            if ($prj['closed'] == 't') {
                ?>
Проект закрыт<?php 
            } else {
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:projects_inner.old.php


示例9: getHeaderData

 /**
  * Возвращает html заголовка страницы с отзывами в массиве
  * 
  * @param string $from (frl|my|emp|norisk) параметр from
  * @param users $user пользователь, на странице которого мы в данный момент находимся
  * @param integer $to_id пользователь, для которго мы готовим вывод
  * @return array html заголовка страницы с отзывами в массиве
  */
 public static function getHeaderData($from, $user, $to_id)
 {
     $opcount = opinions::GetCounts($to_id, array('emp', 'norisk', 'frl', 'all', 'total'));
     $out = array();
     /*
      * @todo: неиспользуется?
      * 
      * 
     $out['all'] = getSortOpinionLinkEx($from, "users", 1, $user->login, zin($opcount['all']['p']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "users", 2, $user->login, zin($opcount['all']['n']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "users", 3, $user->login, zin($opcount['all']['m']));
     
     $out['emp'] = getSortOpinionLinkEx($from, "emp", 1, $user->login, zin($opcount['emp']['p']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "emp", 2, $user->login, zin($opcount['emp']['n']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "emp", 3, $user->login, zin($opcount['emp']['m']));
     
     $out['frl'] = getSortOpinionLinkEx($from, "frl", 1, $user->login, zin($opcount['frl']['p']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "frl", 2, $user->login, zin($opcount['frl']['n']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "frl", 3, $user->login, zin($opcount['frl']['m']));
     
     $out['norisk'] = getSortOpinionLinkEx($from, "norisk", 1, $user->login, zin($opcount['norisk']['p']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "norisk", 2, $user->login, zin($opcount['norisk']['n']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "norisk", 3, $user->login, zin($opcount['norisk']['m']));
     
     $out['total'] = getSortOpinionLinkEx($from, "total", 1, $user->login, zin($opcount['total']['p']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "total", 2, $user->login, zin($opcount['total']['n']))
             . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "total", 3, $user->login, zin($opcount['total']['m']));
     */
     $out['total_no_author'] = getSortOpinionLinkEx($from, "total", 1, $user->login, zin($opcount['total']['p']), null, 0) . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "total", 2, $user->login, zin($opcount['total']['n']), null, 0) . '&nbsp;&nbsp;' . getSortOpinionLinkEx($from, "total", 3, $user->login, zin($opcount['total']['m']), null, 0);
     return $out;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:39,代码来源:opinions.php


示例10: zin

            ?>
                     </td>
                     <td class="b-layout__td b-layout__td_padtb_15 b-layout__td_valign_mid b-page__desktop">
                        <div class="b-layout__txt b-layout__txt_color_64 b-layout__txt_fontsize_15 b-layout__txt_bold b-layout__txt_center">
                            <a class="b-layout__link b-layout__link_color_6db335 b-layout__link_bold b-layout_hover_link_decorated" href="/users/<?php 
            echo $frl['login'];
            ?>
/opinions/?sort=1&author=0">+ <?php 
            echo zin($frl['total_opi_plus']);
            ?>
</a>  |  
                            <a class="b-layout__link b-layout__link_bold b-layout__link_color_c10600 b-layout_hover_link_decorated" href="/users/<?php 
            echo $frl['login'];
            ?>
/opinions/?sort=3&author=0">- <?php 
            echo zin($frl['total_opi_minus']);
            ?>
</a>
                        </div>
                     </td>
                     <td class="b-layout__td b-layout__td_padleft_20 b-layout__td_padright_20 b-layout__td_padtb_15 b-layout__td_valign_mid">
                        <div class="b-layout__txt b-layout__txt_color_64 b-layout__txt_fontsize_11">
                            <?php 
            echo br2br(LenghtFormatEx(reformat($frl['status_text'], 40, 0, 1, 25), 150));
            ?>
                        </div>
                     </td>
                  </tr>
                  <?php 
            if ($i < $cntCatalogList - 1) {
                ?>
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:content.php


示例11: zin

% (<a href="/siteadmin/users/?action=selacop&fdate=<?php 
        echo $fdate;
        ?>
&tdate=<?php 
        echo $tdate;
        ?>
&akop=45" class="blue">операций: <?php 
        echo zin($mass_sending_a[$i]['cnt']);
        ?>
</a>)
        <br>
        Отказанные: <?php 
        echo zin(abs($mass_sending_r[$i]['sum']));
        ?>
 руб. (операций: <?php 
        echo zin(abs($mass_sending_r[$i]['cnt']));
        ?>
)
    </td>
</tr>


</table>
<?php 
    }
    ?>

<br><br>

<div style="margin-bottom: 50px"></div>
<?php 
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:inner_index.php


示例12: getOpinionLinks

function getOpinionLinks($login, $value)
{
    return getSortOpinionLinkEx(0, 1, 1, $login, zin($value['total_opi_plus']), null, 0) . '&nbsp;' . getSortOpinionLinkEx(0, 1, 2, $login, zin($value['total_opi_null']), null, 0) . '&nbsp;' . getSortOpinionLinkEx(0, 1, 3, $login, zin($value['total_opi_minus']), null, 0);
}
开发者ID:amage,项目名称:fl-ru-damp,代码行数:4,代码来源:stdf5.php


示例13: round

 <?php 
echo $user->usurname;
?>
 [<?php 
echo $user->login;
?>
]</a><br>
Номер счета: <?php 
echo $account->id;
?>
<h3 style="margin-bottom:0px;">На счету <?php 
echo round($account->sum, 2);
?>
 руб.</h3>
<strong>на бонусном счету - <?php 
echo zin(round($account->bonus_sum, 2));
?>
 руб.</strong><br /><br />

<?php 
if (!is_release() || in_array($_SESSION['login'], $GLOBALS['balanceCanChangeAdmins'])) {
    ?>
<form action="." method="post">
Изменить счет пользователя
<table cellspacing="2" cellpadding="2" border="0">
<tr>
	<td>на сумму(руб):</td>
	<td><input type="text" name="val"></td>
</tr>
<tr>
	<td>комментарий (для пользователя)</td>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:inner_index.php


示例14: zin

                echo $prj['thread_id'];
                ?>
" class="blue">
	  <?php 
                echo $prj['comm_count'] ? "<b>Комментарии (" . zin($prj['comm_count']) . ")</b>" : "Комментарии (" . zin($prj['comm_count']) . ")";
                ?>
</a>]</b>
	</div><?php 
            } else {
                ?>
	<div align="right" style="margin-top: 5px;"><b>[<a href="/projects/?pid=<?php 
                echo $prj['id'];
                ?>
" class="blue">
	  <?php 
                echo $prj['offers_count'] ? "<b>Комментарии (" . zin($prj['offers_count']) . ")</b>" : "Комментарии (" . zin($prj['offers_count']) . ")";
                ?>
</a>]</b>
	</div><?php 
            }
            ?>
	</td>
	<td width="67" align="center" class="qp"><?php 
            if ($prj['cost'] > 0) {
                ?>
<strong><?php 
                echo CurToChar($prj['cost'], $prj['currency']);
                ?>
</strong><?php 
            } else {
                ?>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:projects_inner.old.php


示例15: zin

"><?php 
        echo zin($frl['se']);
        ?>
</a></span><br />
                                        <span class="review-type">-</span><span class="review-minus"><a href="/users/<?php 
        echo $frl['login'];
        ?>
/opinions/?from=users&sort=3&f=<?php 
        echo stat_collector::REFID_CATALOG;
        ?>
&stamp=<?php 
        echo $_SESSION['stamp'];
        echo $kw_param;
        ?>
"><?php 
        echo zin($frl['sl']);
        ?>
</a></span>
                                        <?php 
        echo seo_end();
        ?>
                                    </td>
                                    <td style="width:65px;"><?php 
        echo view_cost2($frl['frl_cost_hour'], '', '', true, $frl['frl_cost_type_hour']);
        ?>
</td>
                                    <td class="price_prj" style="width:70px;"><?php 
        if ($prof_type) {
            echo view_cost2($frl['cost_1000'], '', '', true, $frl['cost_type']);
        } else {
            echo view_cost2($frl['cost_from'], 'от', '', true, $frl['cost_type']);
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:content.php


示例16: GetStatSbrCommission

 /**
  * Возвращает статистику по комиссиям СБР
  *
  * @param string $from_date     фильтр: начальная дата
  * @param string $to_date       фильтр: конечная дата
  * @return array                массив или NULL
  */
 function GetStatSbrCommission($from_date = '2000-01-01', $to_date = 'now()')
 {
     global $DB;
     $sql = "SELECT SUM(act_lcomm) as summ, COALESCE(ao.payment_sys, cost_sys) as ps\n                FROM sbr_stages_users s\n                    INNER JOIN sbr_stages st ON st.id = s.stage_id\n                    INNER JOIN sbr ON sbr.id = st.sbr_id\n                    LEFT JOIN sbr_stages_payouts po ON po.stage_id = st.id\n                    LEFT JOIN account_operations ao ON ao.id = po.credit_id\n                WHERE st.closed_time::date >= ?::date\n                AND st.closed_time::date < ?::date+'1 day'::interval\n                GROUP BY ps\n        ";
     $ret = null;
     if (($res = $DB->query($sql, $from_date, $to_date)) && pg_num_rows($res)) {
         while ($row = pg_fetch_assoc($res)) {
             $row['summ'] = zin(round($row['summ'], 2));
             $ret[$row['ps']] = $row;
         }
     }
     return $ret;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:20,代码来源:account.php


示例17: tservicesOrdersNewFeedback


//.........这里部分代码省略.........
    if ($uid <= 0 || $hash !== $test_hash) {
        return $objResponse;
    }
    $memebuff = new memBuff();
    if ($memebuff->get('feedback_process_' . $order_id)) {
        return $objResponse;
    }
    $memebuff->set('feedback_process_' . $order_id, true);
    $is_emp = is_emp();
    $prefix = $is_emp ? 'emp' : 'frl';
    $sufix = $is_emp ? 'frl' : 'emp';
    $allow_status = array(TServiceOrderModel::STATUS_ACCEPT, TServiceOrderModel::STATUS_FIX, TServiceOrderModel::STATUS_EMPCLOSE, TServiceOrderModel::STATUS_FRLCLOSE);
    $feedback = @$params['feedback'];
    $is_feedback = !empty($feedback);
    $fbtype = @$params['fbtype'];
    $orderData = $orderModel->getCard($order_id, $uid);
    //Если не существует или статус не подходящий
    if (!$orderData || !in_array($orderData['status'], $allow_status)) {
        $memebuff->delete('feedback_process_' . $order_id);
        return $objResponse;
    }
    //Если есть отзыв и он не удален
    if (!empty($orderData[$prefix . '_feedback'])) {
        $memebuff->delete('feedback_process_' . $order_id);
        return $objResponse;
    }
    $order_id = $orderData['id'];
    $status = $orderData['status'];
    if ($orderModel->isDisallowFeedback()) {
        $memebuff->delete('feedback_process_' . $order_id);
        return $objResponse;
    }
    //Меняем статус при необходимости и тем самым закрываем заказ
    if ($status != TServiceOrderModel::STATUS_EMPCLOSE) {
        try {
            $new_status = $orderModel->changeStatus($order_id, 'close', $is_emp, $fbtype);
        } catch (Exception $e) {
            $sHtml = tservices_helper::getMessage($e->getMessage(), 'error');
            $objResponse->call('TServices_Order.showBeforeStatus', $order_id, $sHtml);
            $memebuff->delete('feedback_process_' . $order_id);
            return $objResponse;
        }
        $orderData['status'] = $new_status;
    }
    //Сохраняем отзыв если он есть
    if ($is_feedback) {
        $orderFeedbackModel = new TServiceOrderFeedbackModel();
        $is_valid = $orderFeedbackModel->attributes(array('feedback' => $feedback, 'rating' => $fbtype, 'is_emp' => $is_emp, 'user_id' => $uid));
        //Тут обрабатывать ошибки при валидации
        if (!$is_valid || !$orderFeedbackModel->addFeedback($order_id)) {
            $memebuff->delete('feedback_process_' . $order_id);
            return $objResponse;
        }
        $attributes = $orderFeedbackModel->attributes();
        $orderData[$prefix . '_feedback'] = $attributes['feedback'];
        $orderData[$prefix . '_rating'] = $attributes['rating'];
        //Сохранить действие в историю
        $history = new tservices_order_history($order_id);
        $history->saveFeedback($is_emp, $fbtype);
        //Чистим кеш кол-во новых сообщений юзера после написания комментария
        $orderModel->clearCountEvent($orderData["{$sufix}_id"]);
        /*
                if ($status == TServiceOrderModel::STATUS_EMPCLOSE && $is_emp && $fbtype < 0) 
                {
           $orderModel->cancelTax($order_id);
                }
        */
    }
    //Уведомление на почту
    $tservices_smail = new tservices_smail();
    $tservices_smail->attributes(array('order' => $orderData, 'is_emp' => $is_emp));
    $tservices_smail->closeOrderAndFeedback($status);
    $tserviceOrderStatusWidget = new TServiceOrderStatus();
    $tserviceOrderStatusWidget->setIsEmp($is_emp);
    $tserviceOrderStatusWidget->setOrder($orderData);
    $tserviceOrderStatusWidget->init();
    ob_start();
    $tserviceOrderStatusWidget->run();
    $sHtml = ob_get_contents();
    ob_end_clean();
    $objResponse->assign('tservices_order_status_' . $order_id, 'innerHTML', $sHtml);
    //если фрилансер закрывает заказ или оставляет отзыв
    //то обновляем ему информацию о состоянии счета
    if (!$is_emp) {
        //не показываем отрицательную сумму
        //$balance = ($_SESSION['ac_sum'] > 0)?number_format(round(zin($_SESSION['ac_sum']),2), 2, ",", " ").' руб.':'Мои услуги';
        //$balance = '<span class="b-bar__icon b-bar__icon_fm"></span>' . $balance;
        //для новой шапки
        $balance = number_format(round(zin($_SESSION['ac_sum']), 2), 2, ",", " ") . ' Р';
        $objResponse->script("\$\$('.b-user-menu-wallet-clause a').set('html', '" . $balance . "');");
    }
    //Обновляем события так как у mootools нет Live
    //а Delegation не работает.
    $objResponse->script('
        Bar_Ext.popuper();
        window.order_feedback_factory = new OrderFeedbackFactory();
    ');
    $memebuff->delete('feedback_process_' . $order_id);
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:tservices_orders.server.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zip函数代码示例发布时间:2022-05-23
下一篇:
PHP zilla_likes函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap