cumessage('chooseproduct'); } $cuid = $db->result_one("SELECT c.offer FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}channels c ON c.chid=a.chid WHERE a.aid='{$aid}'"); if (!$cuid || !($commu = read_cache('commu', $cuid))) { message('setcomitem'); } if (empty($commu['ucadd'])) { if (!$memberid) { cumessage('nousernoofferpermis'); } if ($cid = $db->result_one("SELECT cid FROM {$tblprefix}offers WHERE mid='{$memberid}' AND aid='{$aid}'")) { cumessage('offerexist', "adminm.php?action=offers"); } $aedit = new cls_arcedit(); $aedit->set_aid($aid); if ($retmsg = $aedit->newoffer()) { cumessage($retmsg); } cumessage($inajax ? 'succeed' : 'offersubmitsucceed', "adminm.php?action=offers"); } else { include M_ROOT . $commu['ucadd']; } } elseif ($action == 'vote') { $inajax = empty($inajax) ? 0 : 1; $cid = empty($cid) ? 0 : max(0, intval($cid)); if (!$cid) { cumessage('choosevoteobject'); } if (!($row = $db->fetch_one("SELECT * FROM {$tblprefix}offers WHERE cid='{$cid}'"))) { cumessage('choosevoteobject', $forward); }
$updatedatestr = $row['updatedate'] ? date('Y-m-d', $row['updatedate']) : '-'; $viewstr = "<a id=\"{$action}_info_{$row['aid']}\" href=\"?action=arcview&aid={$row['aid']}\" onclick=\"return showInfo(this.id,this.href)\">" . lang('look') . "</a>"; $itemstr .= "<tr><td class=\"item\">{$selectstr}</td><td class=\"item2\">{$subjectstr}</td>\n"; $itemstr .= "<td class=\"item\">{$catalogstr}</td>\n"; $itemstr .= "<td class=\"item\">{$channelstr}</td>\n"; $itemstr .= "<td class=\"item\">{$offersstr}</td>\n"; $itemstr .= "<td class=\"item\">{$propricestr}</td>\n"; $itemstr .= "<td class=\"item\">{$avgpricestr}</td>\n"; $itemstr .= "<td class=\"item\">{$updatedatestr}</td>\n"; $itemstr .= "<td class=\"item\">{$viewstr}</td>\n"; $itemstr .= "</tr>\n"; } $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}"); $multi = multi($counts, $mrowpp, $page, "?action=products{$filterstr}"); echo $itemstr; tabfooter(); echo $multi; echo '<br><br>' . strbutton('barcsedit', 'addtooffer'); } else { if (empty($selectid)) { mcmessage('selectarchive', axaction(2, M_REFERER)); } $aedit = new cls_arcedit(); foreach ($selectid as $aid) { $aedit->init(); $aedit->set_aid($aid); $aedit->newoffer(); } unset($aedit); mcmessage('productadded', axaction(6, "?action=products{$filterstr}&page={$page}")); }