/** * AJAX: the api to recive the file posted through ajax. * * @param string $uid * @access public * @return array */ public function ajaxUpload($uid) { if (RUN_MODE == 'front' and !commonModel::isAvailable('forum')) { exit; } if (!$this->loadModel('file')->canUpload()) { $this->send(array('error' => 1, 'message' => $this->lang->file->uploadForbidden)); } $file = $this->file->getUpload('imgFile'); $file = $file[0]; if ($file) { if (!$this->file->checkSavePath()) { $this->send(array('error' => 1, 'message' => $this->lang->file->errorUnwritable)); } if (!in_array(strtolower($file['extension']), $this->config->file->imageExtensions)) { $this->send(array('error' => 1, 'message' => $this->lang->fail)); } move_uploaded_file($file['tmpname'], $this->file->savePath . $file['pathname']); if (in_array(strtolower($file['extension']), $this->config->file->imageExtensions) !== false) { $this->file->compressImage($this->file->savePath . $file['pathname']); $imageSize = $this->file->getImageSize($this->file->savePath . $file['pathname']); $file['width'] = $imageSize['width']; $file['height'] = $imageSize['height']; } $url = $this->file->webPath . $file['pathname']; $file['addedBy'] = $this->app->user->account; $file['addedDate'] = helper::now(); $file['editor'] = 1; unset($file['tmpname']); $this->dao->insert(TABLE_FILE)->data($file)->exec(); $_SESSION['album'][$uid][] = $this->dao->lastInsertID(); die(json_encode(array('error' => 0, 'url' => $url))); } }
/** * The index page of admin panel, print the sites. * * @access public * @return void */ public function index() { $this->app->loadConfig('product'); $messages = new stdclass(); if (commonModel::isAvailable('forum')) { $this->view->threads = $this->loadModel('thread')->getThreads(); $this->view->threadReply = $this->loadModel('reply')->getReplies(); } if (commonModel::isAvailable('message')) { $messages->comment = $this->loadModel('message')->getMessages('comment'); $messages->message = $this->loadModel('message')->getMessages('message'); $messages->reply = $this->loadModel('message')->getMessages('reply'); } if (commonModel::isAvailable('order')) { $this->view->orders = $this->loadModel('order')->getOrders(); } if (commonModel::isAvailable('contribution')) { $this->view->contributions = $this->loadModel('article')->getContributions(); } $this->view->articleCategories = $this->loadModel('tree')->getOptionMenu('article', 0, $removeRoot = true); $this->view->todayReport = $this->loadModel('stat')->getTodayReport(); $this->view->yestodayReport = $this->loadModel('stat')->getYestodayReport(); $this->view->ignoreUpgrade = isset($this->config->global->ignoreUpgrade) and $this->config->global->ignoreUpgrade; $this->view->checkLocation = $this->loadModel('user')->checkAllowedLocation(); $this->view->currencySymbol = $this->config->product->currencySymbol; $this->view->messages = $messages; $this->display(); }
public function createModuleMenu($method) { if (!isset($this->lang->my->{$method}->menu)) { return false; } $string = "<nav id='menu'><ul class='nav'>\n"; /* Get menus of current module and current method. */ $moduleMenus = $this->lang->my->{$method}->menu; $currentMethod = $this->app->getMethodName(); /* Cycling to print every menus of current module. */ foreach ($moduleMenus as $methodName => $methodMenu) { /* Split the methodMenu to label, module, method, vars. */ list($label, $module, $method, $vars) = explode('|', $methodMenu); $class = ''; if ($method == $currentMethod) { $class = "class='active'"; } $hasPriv = commonModel::hasPriv($module, $method); if ($module == 'my' and $method == 'order') { $hasPriv = commonModel::hasPriv('order', 'browse'); } if ($module == 'my' and $method == 'contract') { $hasPriv = commonModel::hasPriv('contract', 'browse'); } if ($hasPriv) { $string .= "<li {$class}>" . html::a(helper::createLink($module, $method, $vars), $label) . "</li>\n"; } } $string .= "</ul></nav>\n"; return $string; }
/** * Output sitemap.xml. * * @access public * @return void */ public function sitemapXML() { $this->loadModel('tree'); $this->loadModel('article'); $this->loadModel('product'); $this->loadModel('forum'); $this->loadModel('thread'); $bookAlias = $this->dao->select('id, alias')->from(TABLE_BOOK)->where('type')->eq('book')->fetchPairs('id', 'alias'); $nodes = $this->dao->select('id, title, type, path, alias, editedDate, addedDate')->from(TABLE_BOOK)->fetchAll(); $this->loadModel('book'); foreach ($nodes as $node) { $bookID = $this->book->extractBookID($node->path); $node->book = $bookAlias[$bookID]; } $articles = $this->article->getList('article', $this->tree->getFamily(0, 'article'), 'id_desc'); $pages = $this->dao->select('id, title, alias')->from(TABLE_ARTICLE)->where('type')->eq('page')->andWhere('status')->eq('normal')->fetchAll('id'); $blogs = $this->article->getList('blog', $this->tree->getFamily(0, 'blog'), 'id_desc'); $products = $this->product->getList($this->tree->getFamily(0), 'id_desc'); $board = $this->tree->getFamily(0); $threads = $this->dao->select('id, editedDate')->from(TABLE_THREAD)->beginIf($board)->where('board')->in($board)->orderBy('id desc')->fetchPairs(); $this->view->systemURL = commonModel::getSysURL(); $this->view->books = $nodes; $this->view->articles = $articles; $this->view->blogs = $blogs; $this->view->products = $products; $this->view->threads = $threads; $this->view->pages = $pages; $this->display(); }
/** * Admin all blocks. * * @param int $index * @access public * @return void */ public function admin($index = 0) { $title = $index == 0 ? $this->lang->block->createBlock : $this->lang->block->editBlock; $entries = $this->dao->select('*')->from(TABLE_ENTRY)->where('block')->ne('')->orWhere('buildin')->eq(1)->fetchAll('id'); if (!$index) { $index = $this->block->getLastKey('sys') + 1; } $allEntries[''] = ''; foreach ($entries as $id => $entry) { if (!commonModel::hasAppPriv($entry->code)) { continue; } $allEntries[$entry->code] = $entry->name; } //$allEntries['rss'] = 'RSS'; $allEntries['html'] = 'HTML'; $allEntries['allEntries'] = $this->lang->block->allEntries; $allEntries['dynamic'] = $this->lang->block->dynamic; $hiddenBlocks = $this->block->getHiddenBlocks(); foreach ($hiddenBlocks as $block) { $allEntries['hiddenBlock' . $block->id] = $block->title; } $this->view->block = $this->block->getBlock($index); $this->view->entries = $entries; $this->view->allEntries = $allEntries; $this->view->index = $index; $this->view->title = $title; $this->display(); }
/** * Get block list. * * @access public * @return string */ public function getAvailableBlocks() { foreach ($this->lang->block->availableBlocks as $key => $block) { if (!commonModel::hasPriv($key, 'browse')) { unset($this->lang->block->availableBlocks->{$key}); } } return json_encode($this->lang->block->availableBlocks); }
/** * Update a product. * * @param int $productID * @access public * @return void */ public function update($productID) { $oldProduct = $this->getByID($productID); $product = fixer::input('post')->add('editedBy', $this->app->user->account)->add('editedDate', helper::now())->get(); $this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()->batchCheck($this->config->product->require->edit, 'notempty')->where('id')->eq($productID)->exec(); if (dao::isError()) { return false; } return commonModel::createChanges($oldProduct, $product); }
/** * Get block list. * * @access public * @return string */ public function getAvailableBlocks() { foreach ($this->lang->block->availableBlocks as $key => $block) { $module = $key == 'thread' ? 'forum' : $key; $method = $key == 'thread' ? 'board' : 'index'; if (!commonModel::hasPriv($module, $method)) { unset($this->lang->block->availableBlocks->{$key}); } } return json_encode($this->lang->block->availableBlocks); }
/** * Get block list. * * @access public * @return string */ public function getAvailableBlocks() { foreach ($this->lang->block->availableBlocks as $key => $block) { $method = $key == 'project' ? 'index' : 'browse'; if ($key == 'attend') { $method = 'personal'; } if (!commonModel::hasPriv($key, $method)) { unset($this->lang->block->availableBlocks->{$key}); } } return json_encode($this->lang->block->availableBlocks); }
/** * Get order list. * * @param string $mode * @param mix $value * @param string $orderBy * @param object $pager * @access public * @return array */ public function getList($mode, $value, $orderBy = 'id_desc', $pager = null) { $days = $this->config->shop->confirmLimit; if ($days) { $deliveryDate = date('Y-m-d H:i:s', time() - 24 * 60 * 60 * $days); $this->dao->update(TABLE_ORDER)->set('deliveryStatus')->eq('confirmed')->where('deliveryStatus')->eq('send')->andWhere('deliveriedDate')->le($deliveryDate)->exec(); } $orders = $this->dao->select('*')->from(TABLE_ORDER)->beginIf($mode == 'account')->where('account')->eq($value)->fi()->beginIf($mode == 'status')->where('status')->eq($value)->fi()->beginIf(!commonModel::isAvailable('score'))->andWhere('type')->ne('score')->fi()->beginIf(!commonModel::isAvailable('shop'))->andWhere('type')->ne('shop')->fi()->orderBy($orderBy)->page($pager)->fetchAll('id'); $products = $this->dao->select('*')->from(TABLE_ORDER_PRODUCT)->where('orderID')->in(array_keys($orders))->fetchGroup('orderID'); foreach ($orders as $order) { $order->products = isset($products[$order->id]) ? $products[$order->id] : array(); } return $orders; }
/** * Nav admin function * * @param string $top * @access public * @return void */ public function admin($type = '') { if ($type == '' and $this->config->site->type == 'portal') { $type = $this->device . '_top'; } if ($type == '' and $this->config->site->type == 'blog') { $type = $this->device . '_blog'; } foreach ($this->lang->nav->system as $module => $name) { if (!commonModel::isAvailable($module)) { unset($this->lang->nav->system->{$module}); } } if ($_POST) { $navs = $this->post->nav; foreach ($navs as $key => $nav) { $navs[$key] = $this->nav->organizeNav($nav); } if (isset($navs[2])) { $navs[2] = $this->nav->group($navs[2]); if (isset($navs[3])) { $navs[3] = $this->nav->group($navs[3]); } foreach ($navs[2] as &$navList) { foreach ($navList as &$nav) { $nav['children'] = isset($navs[3][$nav['key']]) ? $navs[3][$nav['key']] : array(); } } } foreach ($navs[1] as &$nav) { $nav['children'] = isset($navs[2][$nav['key']]) ? $navs[2][$nav['key']] : array(); } $settings = array($type => helper::jsonEncode($navs[1])); $result = $this->loadModel('setting')->setItems('system.common.nav', $settings); if ($result) { $this->send(array('result' => 'success', 'message' => $this->lang->setSuccess)); } $this->send(array('result' => 'fail', 'message' => $this->lang->failed)); } $this->view->title = $this->lang->nav->setNav; $this->view->navs = $this->nav->getNavs($type); $this->view->type = $type; $this->view->types = $this->lang->nav->types; $this->view->articleTree = $this->loadModel('tree')->getOptionMenu('article'); $this->display(); }
/** * Output the rss. * * @access public * @return void */ public function index() { $type = $this->get->type != false ? $this->get->type : 'blog'; $this->loadModel('tree'); $this->loadModel('article'); $this->app->loadClass('pager', $static = true); $pager = new pager(0, isset($this->config->rss->items) ? $this->config->rss->items : 10, 1); $articles = $this->article->getList($type, $this->tree->getFamily(0, $type), 'id_desc', $pager); $latestArticle = current((array) $articles); $this->view->title = $this->config->site->name; $this->view->desc = $this->config->site->desc; $this->view->siteLink = $this->inlink('browse', "type={$type}"); $this->view->siteLink = commonModel::getSysURL(); $this->view->articles = $articles; $this->view->lastDate = $latestArticle ? $latestArticle->addedDate : date('Y-m-d H:i:s') . ' +0800'; $this->display(); }
</td> <td><?php echo $public->appID; ?> </td> <td> <?php commonModel::printLink('wechat', 'edit', "publicID={$public->id}", $lang->edit); if (!$public->certified and $public->type == 'subscribe') { echo html::a('javascript:;', $lang->wechat->setMenu, "class='text-muted' data-container='body' data-toggle='popover' data-placement='right' data-content='{$lang->wechat->needCertified}'"); } else { commonModel::printLink('tree', 'browse', "type=wechat_{$public->id}", $lang->wechat->setMenu); } commonModel::printLink('wechat', 'adminResponse', "publicID={$public->id}", $lang->wechat->response->keywords); commonModel::printLink('wechat', 'setResponse', "publicID={$public->id}&group=default&key=default", $lang->wechat->response->default, "data-toggle='modal'"); commonModel::printLink('wechat', 'setResponse', "publicID={$public->id}&group=subscribe&key=subscribe", $lang->wechat->response->subscribe, "data-toggle='modal'"); commonModel::printLink('wechat', 'delete', "publicID={$public->id}", $lang->delete, "class='deleter'"); commonModel::printLink('wechat', 'integrate', "publicID={$public->id}", $lang->wechat->integrate); commonModel::printLink('wechat', 'qrcode', "publicID={$public->id}", $lang->wechat->qrcode, "data-toggle=modal"); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } include '../../common/view/footer.admin.html.php';
?> </td> <td><?php echo $log->desc; ?> </td> <td><?php echo $log->browser; ?> </td> <td><?php commonModel::printLink('user', 'adminlog', "ip={$log->ip}", $log->ip); ?> </td> <td><?php commonModel::printLink('user', 'adminlog', "location={$log->location}", $log->location); ?> </td> <td><?php echo $log->date; ?> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td colspan='8'> <?php
</div> </div> <div class='form-group'> <label class='col-md-2 control-label'><?php echo $lang->category->desc; ?> </label> <div class='col-md-9'><?php echo html::textarea('desc', htmlspecialchars($category->desc), "class='form-control' rows=3'"); ?> </div> </div> <div class='form-group'> <label class='col-md-2 control-label'>图片</label> <div class='col-md-9' style="padding-top:6px;"><?php commonModel::printLink('file', 'browse', "objectType=category&objectID={$category->id}&isImage=1", '上传图片', "data-toggle='modal'"); ?> </div> </div> </div> <div class='categoryInfo'> <?php if ($category->type == 'forum') { ?> <div class='form-group'> <label class='col-md-2 control-label'><?php echo $lang->category->moderators; ?> </label> <div class='col-md-9'><?php echo html::input('moderators', $category->moderators, "class='form-control' placeholder='{$lang->board->placeholder->moderators}'");
<td><?php echo $order->id; ?> </td> <td class='text-left'><?php echo $order->account; ?> </td> <td> <dl> <?php foreach ($order->products as $product) { ?> <dd class='text-left'> <span><?php echo html::a(commonModel::createFrontLink('product', 'view', "id={$product->productID}"), $product->productName, "target='_blank'"); ?> </span> <span><?php echo $lang->order->price . $lang->colon . $product->price . ' ' . $lang->order->count . $lang->colon . $product->count; ?> </span> </dd> <?php } ?> </dl> </td> <td class='text-center'><?php echo $order->amount; ?>
* @license ZPL (http://zpl.pub/page/zplv12.html) * @author Chu Jilu <*****@*****.**> * @package order * @version $Id: sendmail.html.php 867 2010-06-17 09:32:58Z yuren_@126.com $ * @link http://www.ranzhico.com */ $onlybody = isonlybody() ? true : false; if ($onlybody) { $_GET['onlybody'] = 'no'; } ?> <table width='98%' align='center'> <tr class='header'> <td> ORDER #<?php echo $order->id . "=>{$order->assignedTo} " . html::a(commonModel::getSysURL() . $this->createLink('crm.order', 'view', "orderID={$order->id}"), $order->title); ?> </td> </tr> <tr> <td> <fieldset> <legend><?php echo $lang->order->view; ?> </legend> <div class='content'> <?php $productName = count($order->products) > 1 ? current($order->products) . $lang->etc : current($order->products); ?> <p><?php
/** * browse todos. * * @param string $mode * @param string $orderBy * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ public function browse($mode = 'assignedTo', $orderBy = 'date_asc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); $this->session->set('todoList', $this->app->getURI(true)); if ($mode == 'future') { $todos = $this->todo->getList('self', $this->app->user->account, 'future', 'unclosed', $orderBy, $pager); } else { if ($mode == 'all') { $todos = $this->todo->getList('self', $this->app->user->account, 'all', 'all', $orderBy, $pager); } else { if ($mode == 'undone') { $todos = $this->todo->getList('self', $this->app->user->account, 'before', 'undone', $orderBy, $pager); } else { $todos = $this->todo->getList($mode, $this->app->user->account, 'all', 'unclosed', $orderBy, $pager); } } } $this->view->title = $this->lang->todo->browse; $this->view->todos = $todos; $this->view->users = $this->loadModel('user')->getPairs(); $this->view->mode = $mode; $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->moduleMenu = commonModel::createModuleMenu($this->moduleName); $this->display(); }
public function __construct() { parent::__construct(); }
?> <?php if (!empty($treeModuleMenu)) { ?> <div class='col-md-2'> <div class="leftmenu affix hiddden-xs hidden-sm"> <div class='panel category-nav'> <div class='panel-body'> <?php echo $treeModuleMenu; ?> <?php if (!empty($treeManageLink)) { ?> <div class='text-right'><?php if (commonModel::hasPriv('tree', 'browse')) { echo $treeManageLink; } ?> </div> <?php } ?> </div> </div> </div> </div> <div class='col-md-10'> <?php } ?>
<?php /** * The browse view file of company module of chanzhiEPS. * * @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPLV12 (http://zpl.pub/page/zplv12.html) * @author Xiying Guan <*****@*****.**> * @package company * @version $Id$ * @link http://www.chanzhi.org */ include '../../common/view/header.admin.html.php'; include '../../common/view/kindeditor.html.php'; js::set('score', commonModel::isAvailable('score')); js::set('setCounts', $lang->site->setCounts); $displayAll = $display === 'all'; ?> <div class='panel display-<?php echo $display; ?> '> <div class='panel-heading'><strong><i class='icon-building'></i> <?php echo $lang->company->setBasic; ?> </strong></div> <div class='panel-body'> <form method='post' id='ajaxForm' class='ve-form'> <table class='table table-form'> <tr data-row='name'> <th class='w-100px'><?php
/** * Get the link of the object of one message. * * @param string $message * @access public * @return sting */ public function getObjectLink($message) { $link = ''; if ($message->objectType == 'article') { $link = $this->loadModel('article')->createPreviewLink($message->objectID); } elseif ($message->objectType == 'product') { $link = commonModel::createFrontLink('product', 'view', "prodcutID={$message->objectID}"); } elseif ($message->objectType == 'book') { $node = $this->loadModel('book')->getNodeByID($message->objectID); $link = commonModel::createFrontLink('book', 'read', "articleID={$message->objectID}", "book={$node->book->alias}&node={$node->alias}"); } elseif ($message->objectType == 'message') { $link = commonModel::createFrontLink('message', 'index') . "#comment{$message->objectID}"; } elseif ($message->objectType == 'comment') { $object = $this->getByID($message->objectID); $link = $this->getObjectLink($object); } return $link; }
?> <div class='col-md-2'> <ul class='nav nav-primary nav-stacked user-control-nav'> <li class='nav-heading'><?php echo $lang->user->control->common; ?> </li> <?php ksort($lang->user->control->menus); foreach ($lang->user->control->menus as $menu) { $class = ''; list($label, $module, $method) = explode('|', $menu); if (in_array($method, array('thread', 'reply')) && !commonModel::isAvailable('forum')) { continue; } if ($method == 'message' && !commonModel::isAvailable('message')) { continue; } if ($module == $this->app->getModuleName() && $method == $this->app->getMethodName()) { $class .= 'active'; } echo '<li class="' . $class . '">' . html::a($this->createLink($module, $method), $label) . '</li>'; } ?> <li> <a href="<?php echo $siteRoot . 'user-logout.html'; ?> "> <i class="icon-mail-reply"></i> 退出 <i class="icon-chevron-right"></i> </a>
?> </th> </tr> </thead> <tbody> <?php foreach ($replies as $reply) { ?> <tr class='text-center'> <td><?php echo $reply->id; ?> </td> <td class='text-left'> <?php echo html::a(commonModel::createFrontLink('thread', 'locate', "threadID={$reply->thread}&replyID={$reply->id}"), $reply->content, "target=_blank"); ?> </td> <td><?php echo $reply->authorRealname; ?> </td> <td><?php echo substr($reply->createdDate, 5, -3); ?> </td> <td> <?php echo html::a($this->createLink('reply', 'delete', "replyID={$reply->id}"), $lang->delete, "class='reloadDeleter'"); ?> </td>
$vars = "mode={$mode}&orderBy=%s&begin={$begin}&end={$end}"; ?> <th class='text-center'><?php echo $lang->stat->page->url; ?> </th> <th class='w-100px'> <?php commonModel::printOrderLink('pv', $orderBy, $vars, $lang->stat->pv); ?> </th> <th class='w-100px'> <?php commonModel::printOrderLink('uv', $orderBy, $vars, $lang->stat->uv); ?> </th> <th class='w-100px'> <?php commonModel::printOrderLink('ip', $orderBy, $vars, $lang->stat->ipCount); ?> </th> </tr> </thead> <?php $i = 0; ?> <?php foreach ($pages as $page) { ?> <?php $i++; ?> <tr> <td>
</p> <div class='text-center'> <div class='btn-group text-center'> <?php echo html::a($theme->viewLink, $lang->package->view, 'class="btn theme" target="_blank"'); if ($currentRelease->public) { if ($theme->type != 'computer' and $theme->type != 'mobile') { if (isset($installeds[$theme->code])) { if ($installeds[$theme->code]->version != $theme->latestRelease->releaseVersion and $this->theme->checkVersion($theme->latestRelease->chanzhiCompatible)) { commonModel::printLink('theme', 'upgrade', "theme={$theme->code}&downLink=" . helper::safe64Encode($currentRelease->downLink) . "&md5={$currentRelease->md5}&type={$theme->type}", $lang->theme->upgrade, "class='btn' data-toggle='modal'"); } else { echo html::a('javascript:;', $lang->theme->installed, "class='btn disabled'"); } } else { $label = $currentRelease->compatible ? $lang->package->installAuto : $lang->package->installForce; commonModel::printLink('package', 'install', "theme={$theme->code}&downLink=" . helper::safe64Encode($currentRelease->downLink) . "&md5={$currentRelease->md5}&type={$theme->type}&overridePackage=no&ignoreCompitable=yes", $label, "data-toggle='modal' class='btn'"); } } } echo html::a($currentRelease->downLink, $lang->package->downloadAB, 'class="manual btn"'); echo html::a($theme->site, $lang->package->site, "class='btn' target='_blank'"); ?> </div> </div> </div> </div> </div> </div> </div> <?php }
<?php if ($this->config->forum->postReview == 'open' and $thread->status == 'wait') { commonmodel::printlink('thread', 'approve', "threadid={$thread->id}&boardid={$thread->board}", $lang->thread->approve, "class='reload'"); } else { echo html::a('javascript:;', $lang->thread->approve, "class='disabled'"); } $text = $thread->hidden ? $lang->thread->show : $lang->thread->hide; if ($thread->status != 'wait') { commonModel::printLink('thread', 'switchStatus', "threadID={$thread->id}", $text, "class='reload'"); commonModel::printLink('thread', 'transfer', "threadID={$thread->id}", $lang->thread->transfer, "data-toggle='modal'"); } else { echo html::a('javascript:;', $text, "class='disabled'"); echo html::a('javascript:;', $lang->thread->transfer, "class='disabled'"); } commonModel::printLink('thread', 'delete', "threadID={$thread->id}", $lang->delete, "class='deleter'"); commonModel::printLink('guarder', 'addToBlacklist', "type=thread&id={$thread->id}", $lang->addToBlacklist, "data-toggle='modal'"); ?> </td> </tr> <?php } ?> </tbody> <tfoot><tr><td colspan='12'><?php $pager->show(); ?> </td></tr></tfoot> </table> </div> <?php include '../../common/view/footer.admin.html.php';
echo $article->editedDate; ?> </td> <td class='text-center'><?php echo $lang->contribution->status[$article->contribution]; ?> </td> <td class='text-center'><?php echo $article->views; ?> </td> <td class='text-center'> <?php if ($article->contribution != 2) { commonModel::printLink('article', 'modify', "articleID={$article->id}", $lang->edit); commonModel::printLink('article', 'delete', "articleID={$article->id}", $lang->delete, 'class="deleter"'); } else { echo html::a('javascript:;', $lang->edit, "class='disabled'") . html::a('javascript:;', $lang->delete, "class='disabled'"); } ?> </td> </tr> <?php } ?> </tbody> <tfoot><tr><td colspan='7'><?php $pager->show(); ?> </td></tr></tfoot> </table>
function act_sureAddOrder() { $order_data = array(); $detail_data = array(); $exten_data = array(); $userinfo_data = array(); $buyer_data = array(); $time = time(); $platform_id = trim($_POST['platform']); $username = trim($_POST['fullname']); $account_id = trim($_POST['account']); $street1 = trim($_POST['street1']); $platformUsername = trim($_POST['userid']); $email = trim($_POST['ebay_usermail1']); $street2 = trim($_POST['street2']); $recordNumber = trim($_POST['orderid']); $city = trim($_POST['city']); $ordersTime = strtotime(trim($_POST['ebay_createdtime'])); $state = trim($_POST['state']); $paymentTime = strtotime(trim($_POST['ebay_paidtime'])); $countryname = trim($_POST['country']); $ebay_itemprice = trim($_POST['ebay_itemprice']); $zipCode = trim($_POST['zip']); $shippingFee = trim($_POST['ebay_shipfee']); $ebay_tel1 = trim($_POST['tel1']); $actualTotal = trim($_POST['ebay_total']); $ebay_tel2 = trim($_POST['tel2']); $ebay_tel3 = trim($_POST['tel3']); $currency = trim($_POST['ebay_currency']); $other_currency = trim($_POST['other_currency']); $isCheckOrder = self::act_checkOrder(); $returnArr = array(); //返回的数组信息 if (!$isCheckOrder) { $returnArr['errCode'] = self::$errCode; $returnArr['errMsg'] = self::$errMsg; return $returnArr; } if ($currency == '其他') { $currency = $other_currency; } $phone = trim($_POST['tel1']); $transId = trim($_POST['ebay_ptid']); $other_ptid = trim($_POST['other_ptid']); if ($transId == 'paypal' || $transId == 'Escrow' || $transId == '其他') { $transId = $other_ptid; } $PayPalPaymentId = $transId; $orderweight = trim($_POST['orderweight']); $ebay_usermail2 = trim($_POST['ebay_usermail2']); $ebay_carrier = trim($_POST['ebay_carrier']); $ebay_usermail3 = trim($_POST['ebay_usermail3']); $ebay_tracknumber = trim($_POST['ebay_tracknumber']); $ebay_noteb = trim($_POST['ebay_noteb']); $orderStatus = 100; $orderType = 101; $tracknumber = trim($_POST['ebay_tracknumber']); //order信息 $orderData[$recordNumber]['orderData']['recordNumber'] = $recordNumber; $orderData[$recordNumber]['orderData']['ordersTime'] = $ordersTime; $orderData[$recordNumber]['orderData']['paymentTime'] = $paymentTime; $orderData[$recordNumber]['orderData']['actualTotal'] = $actualTotal; $orderData[$recordNumber]['orderData']['onlineTotal'] = $actualTotal; //默认线上总价和实际总价一样 $orderData[$recordNumber]['orderData']['orderAddTime'] = time(); //$orderData[$recordNumber]['orderData']['calcWeight'] = $orderweight;//估算重量 $orderData[$recordNumber]['orderData']['accountId'] = $account_id; $orderData[$recordNumber]['orderData']['platformId'] = $platform_id; //添加状态信息 $orderData[$recordNumber]['orderData']['orderStatus'] = 100; $orderData[$recordNumber]['orderData']['orderType'] = 101; $SYS_ACCOUNTS = OmAvailableModel::getPlatformAccount(); foreach ($SYS_ACCOUNTS as $platform => $accounts) { foreach ($accounts as $accountId => $accountname) { if ($account_id == $accountId) { if ($platform == 'ebay') { //为ebay平台 $orderData[$recordNumber]['orderData']['isFixed'] = 2; } else { $orderData[$recordNumber]['orderData']['isFixed'] = 1; } } } } $transportation = CommonModel::getCarrierList(); //所有的 foreach ($transportation as $tranValue) { if ($tranValue['id'] == $ebay_carrier) { $orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id']; break; } } //order扩展信息 $orderData[$recordNumber]['orderExtenData']['currency'] = $currency; $orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS"; //$orderData[$recordNumber]['orderExtenData']['transId'] = $transId; $orderData[$recordNumber]['orderExtenData']['PayPalPaymentId'] = $PayPalPaymentId; $orderData[$recordNumber]['orderExtenData']['platformUsername'] = $platformUsername; //user信息 $orderData[$recordNumber]['orderUserInfoData']['platformUsername'] = $platformUsername; $orderData[$recordNumber]['orderUserInfoData']['username'] = $username; $orderData[$recordNumber]['orderUserInfoData']['email'] = $email; $orderData[$recordNumber]['orderUserInfoData']['street'] = $street1; $orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency; $orderData[$recordNumber]['orderUserInfoData']['address2'] = $street2; $orderData[$recordNumber]['orderUserInfoData']['city'] = $city; $orderData[$recordNumber]['orderUserInfoData']['state'] = $state; $orderData[$recordNumber]['orderUserInfoData']['zipCode'] = $zipCode; $orderData[$recordNumber]['orderUserInfoData']['countryName'] = $countryname; $orderData[$recordNumber]['orderUserInfoData']['landline'] = !empty($ebay_tel2) ? $ebay_tel2 : $ebay_tel3; $orderData[$recordNumber]['orderUserInfoData']['phone'] = $phone; //note信息 if (!empty($ebay_noteb)) { $orderData[$recordNumber]['orderNote']['content'] = $ebay_noteb; $orderData[$recordNumber]['orderNote']['userId'] = $_SESSION['sysUserId']; $orderData[$recordNumber]['orderNote']['createdTime'] = time(); } //tracknumer信息 $orderData[$recordNumber]['orderTrack']['tracknumber'] = $tracknumber; $sku_list = $_POST['sku']; $sku_count = $_POST['qty']; $ebay_itemtitle = $_POST['name']; $count = count($sku_list); for ($i = 0; $i < $count; $i++) { //detail信息 $sku = $sku_list[$i]; $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku_list[$i]; $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] += $sku_count[$i]; //累加 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber; $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time(); $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $ebay_itemtitle[$i]; } foreach ($orderData as $id => $order) { //$orderData 中第一维只有一个元素,方便起见这里用foreach,虽然只循环一次 $ret = commonModel::checkOrder($recordNumber); if ($ret) { $returnArr['errCode'] = 101; $returnArr['errMsg'] = "订单{$recordNumber}已存在!"; return $returnArr; } //计算订单属性 if (count($order['orderDetail']) == 1) { $detail = current($order['orderDetail']); if ($detail['orderDetailData']['amount'] == 1) { $orderData[$id]['orderData']['orderAttribute'] = 1; } else { $orderData[$id]['orderData']['orderAttribute'] = 2; } } else { $orderData[$id]['orderData']['orderAttribute'] = 3; } //计算订单重量及包材 $obj_order_detail_data = array(); foreach ($order['orderDetail'] as $sku => $detail) { $obj_order_detail_data[] = $detail['orderDetailData']; } $weightfee = commonModel::calcOrderWeight($obj_order_detail_data); $orderData[$id]['orderData']['calcWeight'] = $weightfee[0]; $orderData[$id]['orderData']['pmId'] = $weightfee[1]; $calcShippingInfo = CommonModel::calcAddOrderShippingFee($orderData[$id], $orderData[$id]['orderData']['isFixed']); //计算运费 $orderData[$id]['orderData']['channelId'] = $calcShippingInfo['channelId']; $orderData[$id]['orderData']['calcShipping'] = $calcShippingInfo['fee']; //调用旧系统接口,先插入数据到旧系统 $rtn = OldsystemModel::orderErpInsertorder($orderData[$id]); $insertData = array(); if (empty($rtn)) { $returnArr['errCode'] = 102; $returnArr['errMsg'] = "接口返回异常,请重试!"; return $returnArr; } if ($rtn['errcode'] == 200) { $rtn_data = $rtn['data']; $orderId = $rtn_data['orderId']; //echo "插入老系统成功,订单编号 [$orderId] \n"; $pmId = $rtn_data['pmId']; $totalweight = $rtn_data['totalweight']; $shipfee = $rtn_data['shipfee']; $carrier = $rtn_data['carrier']; $carrierId = $rtn_data['carrierId']; $status = $rtn_data['status']; $orderData[$id]['orderData']['id'] = $orderId; //赋予新系统订单编号 if ($orderData['orderData']['calcWeight'] != $totalweight) { $insertData['old_totalweight'] = $totalweight; $insertData['new_totalweight'] = $orderData[$id]['orderData']['calcWeight']; $orderData[$id]['orderData']['calcWeight'] = $totalweight; } if ($orderData['orderData']['pmId'] != $pmId) { $insertData['old_pmId'] = $pmId; $insertData['new_pmId'] = $orderData[$id]['orderData']['pmId']; $orderData[$id]['orderData']['pmId'] = $pmId; } if ($orderData['orderData']['calcShipping'] != $shipfee) { $insertData['old_shippfee'] = $shipfee; $insertData['new_shippfee'] = $orderData[$id]['orderData']['calcShipping']; $orderData[$id]['orderData']['calcShipping'] = $shipfee; } if ($orderData['orderData']['transportId'] != $carrierId) { $insertData['old_carrierId'] = $carrierId; $insertData['new_carrierId'] = $orderData[$id]['orderData']['transportId']; $orderData[$id]['orderData']['transportId'] = $carrierId; } if (!empty($insertData)) { $insertData['ebay_id'] = $orderId; $insertData['addtime'] = time(); //var_dump($insertData); OldsystemModel::insertTempSyncRecords($insertData); // 插入临时对比记录表 } //缺货拦截 $orderData[$id] = AutoModel::auto_contrast_intercept($orderData[$id]); //插入订单 $info = OrderAddModel::insertAllOrderRowNoEvent($orderData[$id]); if ($info) { $returnArr['errCode'] = 200; $returnArr['errMsg'] = "订单{$id}上传成功!"; } else { $returnArr['errCode'] = 404; $returnArr['errMsg'] = "订单{$id}上传失败!"; } } else { $returnArr['errCode'] = 400; $returnArr['errMsg'] = "添加失败,原因为:{$rtn['msg']}!"; } } return $returnArr; }
include '../../common/view/header.admin.html.php'; js::set('setCounts', $lang->site->setCounts); js::set('score', commonModel::isAvailable('score')); ?> <div class='panel'> <div class='panel-heading'><strong><i class='icon-envelope'></i> <?php echo $lang->mail->common; ?> <i class='icon-arrow-right'></i> <?php echo $lang->mail->save; ?> </strong></div> <div class='panel-body'> <div class='alert alert-success'> <i class='icon-ok-sign'></i> <div class='content'><?php echo $lang->mail->successSaved; ?> </div> </div> <div><?php if ($this->post->turnon and commonModel::hasPriv('mail', 'test')) { echo html::linkButton($lang->mail->test, inlink('test')); } ?> </div> </div> </div> <?php include '../../common/view/footer.admin.html.php';