/**
  * Returns the seqnum of the next comment added to the wall.
  *
  * Allows to simulate race conditions in unit tests by injecting fake
  * (existing) value via {@link self::fakenextseqnum} property.
  *
  * @return int
  */
 protected function get_next_seqnum()
 {
     if (isset($this->fakenextseqnum)) {
         $fake = $this->fakenextseqnum;
         $this->fakenextseqnum = null;
         return $fake;
     } else {
         return parent::get_next_seqnum();
     }
 }
Exemplo n.º 2
0
         //Вставляем саму запись в БД
         $db->query("INSERT INTO `" . PREFIX . "_communities_wall` SET public_id = '{$id}', text = '{$wall_text}', attach = '{$attach_files}', add_date = '{$server_time}'");
         $dbid = $db->insert_id();
         $db->query("UPDATE `" . PREFIX . "_communities` SET rec_num = rec_num+1 WHERE id = '{$id}'");
         //Вставляем в ленту новотсей
         $db->query("INSERT INTO `" . PREFIX . "_news` SET ac_user_id = '{$id}', action_type = 11, action_text = '{$wall_text}', obj_id = '{$dbid}', action_time = '{$server_time}'");
         //Загружаем все записи
         if (stripos($row['admin'], "u{$user_id}|") !== false) {
             $public_admin = true;
         } else {
             $public_admin = false;
         }
         $limit_select = 10;
         $pid = $id;
         include ENGINE_DIR . '/classes/wall.public.php';
         $wall = new wall();
         $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, text, public_id, add_date, fasts_num, attach, likes_num, likes_users, tell_uid, public, tell_date, tell_comm, tb2.title, photo, comments FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = '{$id}' AND tb1.public_id = tb2.id AND fast_comm_id = 0 ORDER by `add_date` DESC LIMIT 0, {$limit_select}");
         $wall->template('groups/record.tpl');
         $wall->compile('content');
         $wall->select($public_admin, $server_time);
         AjaxTpl();
     }
     die;
     break;
     //################### Добавление комментария к записи ###################//
 //################### Добавление комментария к записи ###################//
 case "wall_send_comm":
     NoAjaxQuery();
     $rec_id = intval($_POST['rec_id']);
     $public_id = intval($_POST['public_id']);
     $wall_text = ajax_utf8(textFilter($_POST['wall_text']));
Exemplo n.º 3
0
                 $row = array();
                 $row['id'] = $m_internal_counter;
                 $row['s3 date'] = improvement::getImprovementStatus($status);
                 $row['desc'] = '<a href="?open=improvement&amp;id=' . $mid . '&amp;hidemenu=true" class="view_webpage">' . $m['name'] . '</a>';
                 $row['s4 date'] = $m['pic'];
                 $kpi_table[] = $row;
             }
         }
         //echo "<pre>";var_dump($mims_internal[1]);
         $result .= '<h3 style="margin-top:20px;">Internal MIMS</h3>';
         $result .= tep_draw_table('', $kpi_table);
     }
     $result .= '</div>';
     //#kpi-mims
 } elseif ($_GET['week-sum'] == 'MWALL') {
     $wall = new wall('0');
     $result .= '<div style="float:left;padding:20px 0;">';
     $result .= $wall->draw(5, 'width:650px;');
     $result .= '</div>';
     //RIGHT PART - Begin
     $result .= '<div style="margin-left:680px;padding:20px;">';
     //DISPLAY RED ALERT MESSAGE WHEN STOCK CHECKING CRON IS DISABLED
     if (!is_file('cron/process-open-orders.php')) {
         $result .= '<div id="mw-scs" class="box ui-corner-all" style="width:480px;margin-bottom:25px;border:1px solid #fff;background:#f00;color:#fff;">';
         $result .= '<h3 class="tac" style="margin:0;">!!! STOCK CHECKING CRON IS CURRENTLY DISABLED !!!</h3>';
         $result .= '</div>';
         //#mw-scs
     }
     $result .= '<div id="mw-nots" style="width:500px;margin-left:2px;">';
     $result .= '<div id="mw-nots-nfb" class="box ui-corner-all red pointer" style="height:87px;border-color:#c00;background:#fff top right url(images/need-feedback-level-1.jpg) no-repeat;font-weight:bold;font-size:1.7em;display:none;">';
     $result .= '<div class="tac" style="width:310px;margin:3px 0 0 15px;">You have <span style="font-size:2em;"></span> Notifications<br />waiting for your feedback!</div>';
Exemplo n.º 4
0
     msgbox('', '<br /><br />' . $lang['lang_710'] . '<br /><br /><br />', 'info_2');
 } elseif ($row) {
     $metatags['title'] = stripslashes($row['title']);
     $user_speedbar = $lang['public_spbar'];
     if (stripos($row['admin'], "u{$user_id}|") !== false) {
         $public_admin = true;
     } else {
         $public_admin = false;
     }
     //Стена
     //Если страница вывзана через "к предыдущим записям"
     if ($page_cnt) {
         NoAjaxQuery();
     }
     include ENGINE_DIR . '/classes/wall.public.php';
     $wall = new wall();
     $wall->query("SELECT tb1.id, text, public_id, add_date, fasts_num, attach, likes_num, likes_users, tell_uid, public, tell_date, tell_comm, fixed, tb2.title, photo, comments, adres FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = '{$row['id']}' AND tb1.public_id = tb2.id AND fast_comm_id = 0 ORDER by `fixed` DESC, `add_date` DESC LIMIT {$page_cnt}, {$limit_select}");
     $wall->template('groups/record.tpl');
     //Если страница вывзана через "к предыдущим записям"
     if ($page_cnt) {
         $wall->compile('content');
     } else {
         $wall->compile('wall');
     }
     $wall->select($public_admin, $server_time);
     //Если страница вывзана через "к предыдущим записям"
     if ($page_cnt) {
         AjaxTpl();
         exit;
     }
     $tpl->load_template('public/main.tpl');
Exemplo n.º 5
0
             $tpl->set("{activetab-{$_GET['type']}}", 'activetab');
             $tpl->compile('info');
             if ($cnt_rec['cnt'] < 1) {
                 msgbox('', $lang['wall_no_rec'], 'info_2');
             }
         } else {
             $user_speedbar = $lang['error'];
             msgbox('', $lang['no_notes'], 'info');
         }
     } else {
         msgbox('', $lang['wall_no_rec'], 'info_2');
     }
 }
 if (!$CheckBlackList) {
     include ENGINE_DIR . '/classes/wall.php';
     $wall = new wall();
     if ($user_privacy['val_wall1'] == 1 or $user_privacy['val_wall1'] == 2 and $check_friend or $user_id == $id) {
         $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
     } elseif ($wallAuthorId['author_user_id'] == $id) {
         $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
     } else {
         $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 AND tb1.author_user_id = '{$id}' ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
         if ($wallAuthorId['author_user_id']) {
             $Hacking = true;
         }
     }
     //Если вызвана страница стены, не со страницы юзера
     if (!$Hacking) {
         if ($rid or $walluid) {
             $wall->template('wall/one_record.tpl');
             $wall->compile('content');
Exemplo n.º 6
0
$daily_data = ReportCOGS::retrieveSummary($jng_sp_id, $date_start, $date_end);
$sales_lw = displayCurrency(CURRENCY_DEFAULT, $daily_data['total_price'], false);
$grossprofit_lw = number_format($daily_data['average_gross_profit_percent'] * 100, 1) . ' %';
//last month
$date_start = date('Y-m-01', strtotime('last month'));
$date_end = date('Y-m-t', strtotime('last month'));
$daily_data = ReportCOGS::retrieveSummary($jng_sp_id, $date_start, $date_end);
$sales_lm = displayCurrency(CURRENCY_DEFAULT, $daily_data['total_price'], false);
$grossprofit_lm = number_format($daily_data['average_gross_profit_percent'] * 100, 1) . ' %';
//bestseller
$q = "SELECT COUNT(products_id) AS total FROM products WHERE active_status=1 AND stars=3";
$r = tep_db_query($q);
$row = tep_db_fetch_array($r);
$total_bestseller = $row['total'];
//Draw content
$wall = new wall('0');
$content .= '<div id="dashboard">' . '<div id="db-block-left" style="position:absolute;">' . '<div id="db-block-sales" style="margin-bottom:40px">' . '<h2>Sales Summary (' . CURRENCY_DEFAULT . ')</h2>' . '<ul class="table-list">' . '<li><span class="label">Yesterday</span><span class="value">' . $sales_ld . '</span></li>' . '<li><span class="label">Last Week</span><span class="value">' . $sales_lw . '</span></li>' . '<li><span class="label">Last Month</span><span class="value">' . $sales_lm . '</span></li>' . '</ul>' . '</div>' . '<div id="db-block-grossprofit" style="margin-bottom:40px">' . '<h2>Gross Profit Margin</h2>' . '<ul class="table-list">' . '<li><span class="label">Yesterday</span><span class="value">' . $grossprofit_ld . '</span></li>' . '<li><span class="label">Last Week</span><span class="value">' . $grossprofit_lw . '</span></li>' . '<li><span class="label">Last Month</span><span class="value">' . $grossprofit_lm . '</span></li>' . '</ul>' . '</div>' . '<div id="db-block-bestseller" style="margin-bottom:40px">' . '<h2>Bestseller Management</h2>' . '<ul class="table-list">' . '<li><span class="value" style="">' . $total_bestseller . '</span><span class="label">Total 3 stars products</span></li>' . '<li><span class="value" title="coming soon!">NA</span><span class="label">Bestseller not on stock</span></li>' . '</ul>' . '</div>' . '</div>' . '<div id="db-block-middle" style="position:absolute;left:320px;margin-bottom:20px;">' . '<h1>News</h1>' . $wall->draw(2, 'width:500px;margin-bottom:20px;', true, 'Share something new...') . '</div>' . '<div id="db-block-right" class="w500" style="position:absolute;left:870px;">' . '<h2>Recent Orders</h2>' . '<div id="recent-bought"></div>' . '</div>' . '</div>';
#dashboard
$javascript = wall::drawWallJSaction() . '
            var recent_bought_firstload = true;
            function compareProduct(xmlResult, txtStatus) {
                if(txtStatus=="success") {
                    recent_bought_firstload = false;
                    var container_is_empty = ($("#recent-bought").find("div:eq(0)").attr("id")==undefined);
                    var products_id = $("products_id", xmlResult).text();
                    if(products_id=="none") {
                        if(container_is_empty) $("#recent-bought").html("<div id=\'rb-empty\' class=\'notice\'>No Recent Orders found</div>");
                    } else {
                        products_id = products_id.split(",");
                        $("#rb-empty").remove();
                        if(container_is_empty) {