Ejemplo n.º 1
0
 /**
  * Информация о успешно прошедшей операции
  * 
  * @param array $data - Информация об операции
  * @return array информация
  */
 function getSuccessInfo($data)
 {
     global $DB;
     if (in_array($data['op_code'], array(52, 66, 67, 68))) {
         require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/present.php";
         $present = new present();
         return $present->getSuccessInfo($data);
     }
     $uid = get_uid(false);
     $sql = "SELECT (o.from_date + o.to_date)::date as to_date FROM users u, orders o WHERE u.uid = ?i AND o.from_id = u.uid AND o.billing_id = ?i";
     $pro = $DB->row($sql, $uid, $data['id']);
     $date = date('d.m.Y', strtotime($pro['to_date']));
     $data['ammount'] = abs($data['ammount']);
     $suc = array("date" => $data['op_date'], "name" => "Аккаунт \"ПРО\" (Срок действия — {$date})", "descr" => "", "sum" => "{$data['ammount']} руб.");
     return $suc;
 }
Ejemplo n.º 2
0
 /**
  * Информация о успешно прошедшей операции
  * 
  * @param array $data - Информация об операции
  * @return array информация
  */
 function getSuccessInfo($data)
 {
     global $DB;
     if (in_array($data['op_code'], array(17, 84, 85))) {
         require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/present.php";
         $present = new present();
         return $present->getSuccessInfo($data);
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     $uid = get_uid(false);
     $sql = "SELECT o.*, u.login FROM users u, users_first_page o WHERE u.uid = ?i AND o.user_id = u.uid AND o.billing_id = ?i";
     $asc = $DB->row($sql, $uid, $data['id']);
     $profs[] = $asc['profession'];
     $prof_info = professions::GetProfessions($profs);
     $poss = firstpage::GetPositions($uid, $profs);
     $is_up = $poss[$asc['profession']] > 1;
     $login_pp = "{$asc['login']}_pp";
     $linktopage = "/freelancers/#{$login_pp}";
     if ($prof_info[$profs[0]]["id"] == -1) {
         $linktopage = "/#{$login_pp}";
     } elseif ($prof_info[$profs[0]]["id"]) {
         $linktopage = "/freelancers/{$prof_info[$profs[0]]["link"]}/#{$login_pp}";
     }
     $name = "Платные места в разделах (<a class=\"b-layout__link b-layout__link_bold\" href=\"{$linktopage}\">{$prof_info[$asc['profession']]['name']}</a> — {$poss[$asc['profession']]}-е место" . ($is_up ? " <a class=\"b-layout__link b-layout__link_bold\" href=\"/firstpage/position.php?cur_prof={$asc['profession']}\">подняться выше</a>?)" : ")");
     $data['ammount'] = abs($data['ammount']);
     $suc = array("date" => $data['op_date'], "name" => $name, "descr" => "", "sum" => "{$data['ammount']} руб.");
     return $suc;
 }