コード例 #1
0
ファイル: goods.app.php プロジェクト: 184609680/wcy_O2O_95180
 function notice_stock()
 {
     $email = html_script(trim($_POST['email']));
     $goods_id = intval(trim($_POST['goods_id']));
     $sp_id = intval(trim($_POST['spec_id']));
     if (!is_email($email)) {
         $this->json_error("email格式错误");
         return;
     }
     if (!$goods_id) {
         $this->json_error("商品不存在");
         return;
     }
     if (!$sp_id) {
         $this->json_error("商品不存在");
         return;
     }
     $data = array('email' => $email, 'goods_id' => $goods_id, 'sp_id' => $sp_id, 'add_time' => gmtime());
     $stock =& m("stock");
     $sid = $stock->add($data);
     if ($sid) {
         $this->json_result();
     } else {
         $this->json_error("网络错误");
     }
 }
コード例 #2
0
 /**
  * 提交的数据
  */
 function _get_post_data($id = 0)
 {
     $goods = array('goods_name' => $_POST['goods_name'], 'description' => html_script($_POST['description']), 'keyword' => html_script($_POST['keyword']), 'cate_id' => $_POST['cate_id'], 'cate_name' => $_POST['cate_name'], 'brand' => $_POST['brand'], 'region_id' => $_POST['region_id'], 'region_name' => $_POST['region_name'], 'if_show' => $_POST['if_show'], 'last_update' => gmtime(), 'recommended' => $_POST['recommended'], 'buyer_say' => html_script(trim($_POST['buyer_say'])), 'recommend_image' => $_POST['recommend_image']);
     $spec_name_1 = !empty($_POST['spec_name_1']) ? $_POST['spec_name_1'] : '';
     $spec_name_2 = !empty($_POST['spec_name_2']) ? $_POST['spec_name_2'] : '';
     if ($spec_name_1 && $spec_name_2) {
         $goods['spec_qty'] = 2;
     } elseif ($spec_name_1 || $spec_name_2) {
         $goods['spec_qty'] = 1;
     } else {
         $goods['spec_qty'] = 0;
     }
     $goods_file_id = array();
     $desc_file_id = array();
     if (isset($_POST['goods_file_id'])) {
         $goods_file_id = $_POST['goods_file_id'];
     }
     if (isset($_POST['desc_file_id'])) {
         $desc_file_id = $_POST['desc_file_id'];
     }
     if ($id <= 0) {
         $goods['type'] = 'material';
         $goods['closed'] = 0;
         $goods['add_time'] = gmtime();
     }
     $specs = array();
     // 原始规格
     switch ($goods['spec_qty']) {
         case 0:
             // 没有规格
             $specs[intval($_POST['spec_id'])] = array('price' => $this->_filter_price($_POST['price']), 'stock' => intval($_POST['stock']), 'sku' => trim($_POST['sku']), 'spec_id' => trim($_POST['spec_id']));
             break;
         case 1:
             // 一个规格
             $goods['spec_name_1'] = $spec_name_1 ? $spec_name_1 : $spec_name_2;
             $goods['spec_name_2'] = '';
             $spec_data = $spec_name_1 ? $_POST['spec_1'] : $_POST['spec_2'];
             foreach ($spec_data as $key => $spec_1) {
                 $spec_1 = trim($spec_1);
                 if ($spec_1) {
                     if ($spec_id = intval($_POST['spec_id'][$key])) {
                         $specs[$key] = array('spec_id' => $spec_id, 'spec_1' => $spec_1, 'price' => $this->_filter_price($_POST['price'][$key]), 'stock' => intval($_POST['stock'][$key]), 'sku' => html_script(trim($_POST['sku'][$key])));
                     } else {
                         $specs[$key] = array('spec_1' => $spec_1, 'price' => $this->_filter_price($_POST['price'][$key]), 'stock' => intval($_POST['stock'][$key]), 'sku' => html_script(trim($_POST['sku'][$key])));
                     }
                 }
             }
             break;
         case 2:
             // 二个规格
             $goods['spec_name_1'] = $spec_name_1;
             $goods['spec_name_2'] = $spec_name_2;
             foreach ($_POST['spec_1'] as $key => $spec_1) {
                 $spec_1 = trim($spec_1);
                 $spec_2 = trim($_POST['spec_2'][$key]);
                 if ($spec_1 && $spec_2) {
                     if ($spec_id = intval($_POST['spec_id'][$key])) {
                         $specs[$key] = array('spec_id' => $spec_id, 'spec_1' => $spec_1, 'spec_2' => $spec_2, 'price' => $this->_filter_price($_POST['price'][$key]), 'stock' => intval($_POST['stock'][$key]), 'sku' => html_script(trim($_POST['sku'][$key])));
                     } else {
                         $specs[$key] = array('spec_1' => $spec_1, 'spec_2' => $spec_2, 'price' => $this->_filter_price($_POST['price'][$key]), 'stock' => intval($_POST['stock'][$key]), 'sku' => html_script(trim($_POST['sku'][$key])));
                     }
                 }
             }
             break;
         default:
             break;
     }
     /* 分类 */
     $cates = array();
     foreach ($_POST['sgcate_id'] as $cate_id) {
         if (intval($cate_id) > 0) {
             $cates[$cate_id] = array('cate_id' => $cate_id);
         }
     }
     return array('goods' => $goods, 'specs' => $specs, 'cates' => $cates, 'goods_file_id' => $goods_file_id, 'desc_file_id' => $desc_file_id);
 }
コード例 #3
0
ファイル: whatisthis.php プロジェクト: heiswayi/ishareportal
html_css();
html_favicon();
html_jquery();
html('body');
?>

<div class="container">
<div style="margin:50px auto;">
<a href="index.php" title="Back to Portal"><img id="loginLogo" src="assets/img/logo.png"></a>
<div class="open-sans" style="margin-top:30px;font-size:16px;line-height:24px;">
<p><a href="index.php">IsharePortal</a> is the <em>third generation</em> of Ishare webpages, integrated with forum user account system (<a href="../forum">Forum Ishare</a>). IsharePortal is totally new different experience which is mostly developed and coded with PHP/MySQL and jQuery AJAX from a stratch. IsharePortal represents a bunch of new improvements especially to the shoutbox (core component), sharerlink (core component), sharer's updates section and user's requests section.</p>

<p>So, why third generation? OK, the original purpose of Ishare, which founded by Heiswayi Nrird on February 2010 is <strong>to gather all sharerlinks in one place so that the sharerlinks are easily found by the users and provides a communicating space for community (Komuniti Ishare) interactions</strong>. <em>First generation</em> of Ishare was developed by using WordPress platform with Add Link plugin for sharerlink and using a free external shoutbox service for community interaction medium.</p>

<p>For <em>second generation</em> of Ishare, after Ishare has been transferred from external hosting to internal hosting (within campus network), the big upgrades have been done to the site whereas it was redeveloped based on PHP/MySQL with own PHP/AJAX shoutbox and improved sharerlink indicator system. During this generation, from the last version of its development and improvements, Onion Club and Tuzki Club emoticons have been introduced.</p>

<p>And now, <strong>IsharePortal</strong> - the new generation (3rd generation) of Ishare once again has been upgraded and redeveloped from a stratch based on PHP/MySQL and jQuery AJAX. It's simple and dynamic. The difference between previous generation and this generation is about almost of the components were coded or using jQuery AJAX, apparently the new shoutbox system which is using modern codes (jQuery AJAX) while the previous one used old-fashioned AJAX.</p>

<p>From the first until now, still Ishare has been continuously maintained by Heiswayi Nrird (Founder &amp; Core Developer) and assisted by Pirates_Killer as Ishare Co-Founder &amp; SuperAdmin with a big supports from <strong>Komuniti Ishare</strong>. However, this generation is the last generation of Ishare that has been maintained by Heiswayi Nrird and after this, Pirates_Killer will be take over the Ishare.</p>

<p>For more informations, take a look on <a href="http://mpp.eng.usm.my/sharers/forum/viewforum.php?id=3">Forum Ishare -> Ishare Development Center</a>.</p>
</div>
</div>
</div>

<?php 
html_script();
?>

<?php 
echo html('end');
コード例 #4
0
 /**
  *    修改基本信息
  *
  * @author    Hyber
  * @usage    none
  */
 function profile()
 {
     $user_id = $this->visitor->get('user_id');
     if (!IS_POST) {
         /* 当前位置 */
         $this->_curlocal(LANG::get('member_center'), 'index.php?app=buyer_admin', LANG::get('basic_information'));
         /* 当前用户中心菜单 */
         $this->_curitem('my_profile');
         /* 当前所处子菜单 */
         $this->_curmenu('basic_information');
         $edit_avatar = $this->ms->user->set_avatar($this->visitor->get('user_id'));
         //获取头像设置方式
         $model_user =& m('member');
         $profile = $model_user->get_info(intval($user_id));
         if ($profile['phone_mob']) {
             $profile['phone_mob'] = substr_replace($profile['phone_mob'], '*****', 3, 5);
         }
         $profile['portrait'] = portrait($profile['user_id'], $profile['portrait'], 'middle');
         $this->assign('profile', $profile);
         $this->assign('edit_avatar', $edit_avatar);
         $this->_config_seo('title', Lang::get('member_center') . ' - ' . Lang::get('my_profile'));
         $this->display('member.profile.html');
     } else {
         $data = array('real_name' => str_cut(html_script(trim($_POST['real_name'])), 0, 10), 'gender' => $_POST['gender'], 'birthday' => $_POST['birthday'], 'nick_name' => str_cut(html_script(trim($_POST['nick_name'])), 0, 32));
         $model_user =& m('member');
         $model_user->edit($user_id, $data);
         $_SESSION['user_info'] = $model_user->get("user_id=" . $user_id);
         header("location:/index.php?app=member&act=profile");
     }
 }
コード例 #5
0
 function rss()
 {
     $email = isset($_GET["email"]) ? html_script(trim($_GET['email'])) : 0;
     if (!is_email($email)) {
         $this->json_error("邮箱格式错误");
         return;
     }
     $rss =& m("rss");
     $info = $rss->get("email='{$email}'");
     if ($info) {
         $this->json_result();
         return;
     }
     $data = array("email" => $email, "send_time" => gmtime());
     $rid = $rss->add($data);
     if ($rid) {
         $this->json_result();
     } else {
         $this->json_error("未知错误");
     }
 }
コード例 #6
0
 /**
  * 检查提交的数据
  */
 function _handle_post_data($post, $id = 0)
 {
     if ($post['if_publish'] == 1 || gmstr2time($post['start_time']) <= gmtime()) {
         $post['start_time'] = gmtime();
         //立即发布
         $post['state'] = GROUP_ON;
     } else {
         $post['start_time'] = gmstr2time($post['start_time']);
         $post['state'] = GROUP_PENDING;
     }
     if (intval($post['end_time'])) {
         $post['end_time'] = gmstr2time_end($post['end_time']);
     } else {
         $this->_error('fill_end_time');
         return false;
     }
     if ($post['end_time'] < $post['start_time']) {
         $this->_error('start_not_gt_end');
         return false;
     }
     if (($post['goods_id'] = intval($post['goods_id'])) == 0) {
         $this->_error('fill_goods');
         return false;
     }
     if (empty($post['spec_id']) || !is_array($post['spec_id'])) {
         $this->_error('fill_spec');
         return false;
     }
     foreach ($post['spec_id'] as $key => $val) {
         if (empty($post['group_price'][$key])) {
             $this->_error('invalid_group_price');
             return false;
         }
         $spec_price[$val] = array('price' => number_format($post['group_price'][$key], 2, '.', ''));
     }
     $data = array('group_name' => $post['group_name'], 'group_desc' => html_script($post['group_desc']), 'start_time' => $post['start_time'], 'end_time' => $post['end_time'] - 1, 'goods_id' => $post['goods_id'], 'spec_price' => serialize($spec_price), 'min_quantity' => $post['min_quantity'], 'max_per_user' => $post['max_per_user'], 'state' => $post['state'], 'store_id' => $this->_store_id);
     if ($id > 0) {
         $this->_groupbuy_mod->edit($id, $data);
         if ($this->_groupbuy_mod->has_error()) {
             $this->_error($this->_groupbuy_mod->get_error());
             return false;
         }
     } else {
         if (!($id = $this->_groupbuy_mod->add($data))) {
             $this->_error($this->_groupbuy_mod->get_error());
             return false;
         }
     }
     $this->_last_update_id = $id;
     return true;
 }
コード例 #7
0
 /**
  * Define el formato de la cabecera
  * @access private
  */
 function getNavBar()
 {
     $table = html_table(Session::getContextValue("mainInterfaceWidth"), 0, 0, 0);
     $table->set_class('fecha');
     $row = html_tr();
     //$row->set_tag_attribute('valign', 'bottom');
     $msg = html_td('', "", $this->str_message);
     $msg->set_tag_attribute('align', 'left');
     $fecha = html_script();
     $fecha->add('damefecha();');
     $row->add($msg);
     $row->add(html_td('', '', $fecha));
     $table->add_row($row);
     return $table;
 }
コード例 #8
0
 function body_content()
 {
     if ($this->bol_normal) {
         //add the header area
         $this->add($this->header_block());
     }
     //add the header area
     if (MIGUELBASE_USR_BROWSER_AGENT == 'IE') {
         $params = array('leftmargin' => '0', 'topmargin' => '0', 'marginwidth' => '0', 'marginheight' => '0');
         $this->set_body_attributes($params);
     }
     if ($this->bol_normal) {
         //add the navigation bar
         $this->add($this->navigationBar());
     }
     //if($this->issetViewVariable('wm')){
     /*
     $iframe_div = html_div('fondopagina');
     $div_style = 'position:relative;z-index:1;visibility: hidden';
     $iframe_div->set_tag_attribute('id', 'div_i');
     $iframe_div->set_tag_attribute('style', $div_style);
     			
     if($this->issetViewVariable('wm')){
     	$link = Util::format_URLPath('calendar/index.php');
     } else {
     	$link = '';
     }
     
     $iframe = html_iframe($link, '100%', '100%', 'no');
     //$iframe = html_iframe();
     $iframe->set_tag_attribute('name', 'myFrame');
     //$iframe->set_tag_attribute('style', 'width:0px; height:0px; border: 0px');
     //$iframe->set_tag_attribute('AllowTransparency');
     
     $iframe_div->add($iframe);
     
     $this->add($iframe_div);
     */
     //$params = array('onUnLoad'=>'window.close();');
     //$this->set_body_attributes($params);
     //}
     /*
     $params = array('onLoad'=>'winpopup.close();');
     $this->set_body_attributes($params);
     */
     //add it to the page
     $main = html_div();
     $main->set_id('content');
     $table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 1, 0);
     $table->set_class('simple');
     //Barra Herramientas
     if ($this->str_type == 'toolbar') {
         $elem1 = html_td('color3-bg', '', $this->left_block());
         //$elem1->set_id("anonymous");
         $elem1->set_tag_attribute('width', 40);
         $elem1->set_tag_attribute('valign', 'top');
     }
     //Principal
     $elem2 = html_td('color1-bg', '', $this->right_block());
     $elem2->set_tag_attribute('valign', 'top');
     //$elem2->set_id("identification");
     $row = html_tr();
     $row->add($elem1);
     $row->add($elem2);
     $table->add_row($row);
     $main->add($table);
     $this->add($main);
     //add the footer area.
     if ($this->bol_normal) {
         //if ($this->str_type == 'menu') {
         $this->add($this->footer_block());
         //}
     }
     if ($this->bol_normal) {
         $this->add(html_script(Theme::getThemeJSPath('menu_exec.js'), 'text/javascript'));
     }
 }
コード例 #9
0
ファイル: story.app.php プロジェクト: 184609680/wcy_O2O_95180
 function tag()
 {
     $cate_id = !empty($_GET['cate_id']) ? intval($_GET['cate_id']) : 15;
     //如果cate_id为空则默认显示商城快讯
     $this->assign("cid", $cate_id);
     $acategories = $this->_get_acategory($cate_id);
     foreach ($acategories as $k => &$cate) {
         $sql = "SELECT COUNT(*) FROM {$this->_article_mod->table} WHERE cate_id = " . $cate['cate_id'];
         $cate['count'] = $this->_article_mod->getone($sql);
     }
     $q = isset($_GET['q']) ? html_script(trim($_GET['q'])) : 0;
     $curlocal[] = array('text' => $q);
     $this->_curlocal($curlocal);
     $page = $this->_get_page();
     $tag =& m("tag");
     $tagid = $tag->getOne("select tagid from ecm_tag where tag_name='{$q}'");
     //搜索tagid
     $tag->edit($tagid, 'num=num+1');
     //num++
     $articles = $this->_article_mod->find(array("join" => "tag_to", "conditions" => "tagmap.tagid=" . $tagid));
     $user_mod =& m('member');
     foreach ($articles as $k => $article) {
         $articles[$k]['add_time'] = date("Y.m.d", $articles[$k]['add_time']);
         $articles[$k]['content'] = str_replace('&nbsp;', '', $articles[$k]['content']);
         $articles[$k]['wx'] = $this->generateQRfromGoogle($articles[$k]['article_id']);
         $articles[$k]['tag'] = unserialize($articles[$k]['tag']);
         $info = $user_mod->get_info($articles[$k]['uid']);
         $articles[$k]['author'] = $info['user_name'];
         $articles[$k]['portrait'] = portrait($info['user_id'], $info['portrait'], 'middle');
     }
     $this->assign("q", $q);
     $page['item_count'] = count($articles);
     $this->_format_page($page);
     $this->assign('page_info', $page);
     // 页面标题
     $category = $this->_acategory_mod->get_info($cate_id);
     $this->assign("hottags", $this->hot_tag());
     $this->_config_seo('title', $category['cate_name'] . ' - ' . Conf::get('site_title'));
     $this->assign('stories', $articles);
     $this->_format_page($page);
     $this->assign('page_info', $page);
     $this->assign('acategories', $acategories);
     if (is_wap()) {
         $this->assign("title", "食材故事");
     }
     $this->display('story.index.html');
 }