Exemple #1
0
 function edit_config()
 {
     $this->isset_cookie();
     $d = date("Y-m-d H:i:s");
     //pr($_POST);die;
     if (!empty($_POST)) {
         foreach ($_POST as $k => $v) {
             $sql = "update " . $this->table_name('config') . " set type='" . $v . "' where con_name='{$k}'";
             $a = mysql_query($sql, $this->conn);
         }
     }
     if ($a) {
         js_redir('index.php?a=admin&m=main_right');
     } else {
         js_alert('修改失败,请联系系统管理员');
     }
 }
Exemple #2
0
 function edit_news()
 {
     $this->isset_cookie();
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
         $d = date("Y-m-d H:i:s");
         $sql = "update " . $this->table_name('article') . " set edit_by='" . $_SESSION[$this->shop_name]['h_id'] . "'  where art_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         require_once MANAGE_MOD . 'uploaded_file.php';
         $path = "/data/news_doc/";
         $doc_src = uploaded_m_file($this->table_name('img'), 'original_src', 'file_url', $path);
         if (!empty($_POST['edit_doc'])) {
             foreach ($_POST['edit_doc'] as $k => $v) {
                 if ($v == 1) {
                     $sql = "select * from " . $this->table_name('img') . " where img_id='" . $_POST['img_id'][$k] . "' ";
                     $img_b = getFetchAll($sql, $this->conn);
                     if (!empty($img_b)) {
                         @unlink('.' . $img_b[0]['original_src']);
                         $sql = "update " . $this->table_name('img') . " set original_src='" . $doc_src[$k] . "',edit_by='" . $_SESSION[$this->shop_name]['h_id'] . "' where img_id='" . $_POST['img_id'][$k] . "' ";
                         $c = mysql_query($sql, $this->conn);
                     } else {
                         $p = explode('-', $k);
                         $sql = "insert into " . $this->table_name('img') . "(type_id,type,original_src,add_by ,add_time,edit_by,i8n) values('" . $id . "','A','" . $doc_src[$k] . "','" . $_SESSION[$this->shop_name]['h_id'] . "','" . $d . "','" . $_SESSION[$this->shop_name]['h_id'] . "','" . $p[1] . "')";
                         $c = mysql_query($sql, $this->conn);
                     }
                 }
             }
         }
         if ($a) {
             if (!empty($_POST['detail'])) {
                 foreach ($_POST['detail'] as $k => $v) {
                     $art_detail = addslashes(implode('":;"', $v));
                     $sql = "update " . $this->table_name('article_i8n') . " set art_detail='" . $art_detail . "'  where art_i8n_id='" . $_POST['iid'][$k] . "'";
                     $b = mysql_query($sql, $this->conn);
                 }
             }
             //$this->index();
             js_redir('index.php?a=admin&m=main_right');
         } else {
             js_alert('修改失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #3
0
 function edit_config()
 {
     $this->isset_cookie();
     $d = date("Y-m-d H:i:s");
     require_once MANAGE_MOD . 'uploaded_file.php';
     $path = "/data/config_doc/";
     $doc_src = uploaded_file($this->table_name('img'), 'original_src', 'file_url', $path);
     if ($_GET['id'] != '') {
         $id = $_GET['id'];
         $sql = "update " . $this->table_name('config') . " set con_name='" . $_POST['con_name'] . "' where con_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         if ($_POST['edit_doc'] == 1) {
             $img_id = $_POST['img_id'];
             $sql = "select * from " . $this->table_name('img') . " where img_id='{$img_id}'";
             $product = getFetchAll($sql, $this->conn);
             if (!empty($product)) {
                 foreach ($product as $k => $v) {
                     @unlink('.' . $v['original_src']);
                 }
             }
             $sql = "delete from " . $this->table_name('img') . " where img_id='{$img_id}'";
             $a = mysql_query($sql, $this->conn);
         }
         if (!empty($doc_src)) {
             $sql = "insert into " . $this->table_name('img') . "(type_id,type,img_title,order_by,original_src,add_by ,add_time,edit_by) values('" . $id . "','CON','" . $_POST['img_name'] . "','" . $_POST['img_by'] . "','{$doc_src}','" . $_SESSION[$this->shop_name]['h_id'] . "','" . $d . "','" . $_SESSION[$this->shop_name]['h_id'] . "')";
             $b = mysql_query($sql, $this->conn);
         }
         if ($a) {
             js_redir('index.php?a=admin&m=main_right');
         } else {
             js_alert('修改失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #4
0
 public function saveedit_area()
 {
     //保存产品
     $id = getgpc("id");
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("joininfo_area") . " where id ='" . $id . "' ");
         if (!$res) {
             alert("错误,没有找到该数据", "");
         }
     }
     $name = getgpc("name");
     $tel = getgpc("tel");
     $email = getgpc("email");
     $join_name = getgpc("join_name");
     $area = getgpc("area");
     $displayorder = intval(getgpc("displayorder"));
     $status = intval(getgpc("status"));
     $indata = array("name" => $name, "join_name" => $join_name, "tel" => $tel, "area" => $area, "email" => $email, "displayorder" => $displayorder, "status" => $status);
     if (!$id) {
         $indata["gtime"] = date("Y-m-d H:i:s");
         dbinsert("joininfo_area", $indata);
     } else {
         $indata["uptime"] = date("Y-m-d H:i:s");
         dbupdate("joininfo_area", $indata, array('id' => $id));
     }
     js_alert("保存成功", "top.location.href='?mod=joininfo&act=area'");
 }
Exemple #5
0
 function saveedit()
 {
     //保存修改
     $id = intval(getgpc("id"));
     $res = fetch_one_array("select * from " . dbtable("news") . " where id='" . $id . "' and status >0");
     if (!$res) {
         js_alert("错误,找不到该新闻");
     }
     $title = trim(getgpc("title"));
     $en_title = trim(getgpc("en_title"));
     $intr = getgpc("intr");
     $content = getgpc("content");
     $showtime = getgpc("showtime");
     $showtime = $showtime ? $showtime : date("Y-m-d H:i:s");
     $content_img1 = getgpc("content_img1");
     $content_img2 = getgpc("content_img2");
     $content_img3 = getgpc("content_img3");
     $content_img4 = getgpc("content_img4");
     $imgurl = trim(getgpc("imgurl"));
     $tags = trim(getgpc("tags"));
     $istop = intval(getgpc("istop"));
     $displayorder = intval(getgpc("displayorder"));
     $status = intval(getgpc("status"));
     $iskv = intval(getgpc("iskv"));
     if (!$title) {
         js_alert("请填写标题");
     }
     if (!$intr) {
         js_alert("请填写简介");
     }
     if (!$content) {
         js_alert("请填写内容");
     }
     if (!$status) {
         js_alert("请选择状态");
     }
     //数据正常,入库
     $data = array('en_title' => $en_title, 'title' => $title, 'imgurl' => $imgurl, 'intr' => $intr, 'content' => $content, 'showtime' => $showtime, 'content_img1' => $content_img1, 'content_img2' => $content_img2, 'content_img3' => $content_img3, 'content_img4' => $content_img4, 'tags' => $tags, 'gtime' => date("Y-m-d H:i:s"), 'iskv' => $iskv, 'istop' => $istop, 'displayorder' => $displayorder, 'status' => $status);
     $this->db->where('id', $id);
     $this->db->update('news', $data);
     js_alert("保存成功", "top.location.href='?mod=news'");
 }
Exemple #6
0
 public function saveedit()
 {
     //保存产品
     $id = getgpc("id");
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("faq") . " where id ='" . $id . "' ");
         if (!$res) {
             alert("错误,没有找到该数据", "");
         }
     }
     $name = getgpc("name");
     $tel = getgpc("tel");
     $email = getgpc("email");
     $question = getgpc("question");
     $displayorder = intval(getgpc("displayorder"));
     $status = intval(getgpc("status"));
     $indata = array("name" => $name, "tel" => $tel, "email" => $email, "question" => $question, "reply_sign" => 1, "displayorder" => $displayorder, "status" => $status);
     if (!$id) {
         $indata["gtime"] = date("Y-m-d H:i:s");
         dbinsert("faq", $indata);
     } else {
         $indata["reply"] = getgpc("reply");
         $indata["reply_sign"] = 2;
         $indata["uptime"] = date("Y-m-d H:i:s");
         dbupdate("faq", $indata, array('id' => $id));
     }
     js_alert("保存成功", "top.location.href='?mod=faq&act=index'");
 }
Exemple #7
0
 /**
  * 保存成员信息
  */
 function actionSave()
 {
     __TRY();
     $this->_modelMembers->saveMember($_POST);
     $ex = __CATCH();
     if (__IS_EXCEPTION($ex)) {
         return $this->_editMember($_POST, $ex->getMessage());
     }
     js_alert(_T('ui_m_member_success'), '', $this->_url('index'));
 }
Exemple #8
0
 function del_user()
 {
     $this->isset_cookie();
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
         $sql = "delete from " . $this->table_name('article') . " where art_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         if ($a) {
             $this->index();
         } else {
             js_alert('删除失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #9
0
 /**
  * 保存帖子
  */
 function actionSave()
 {
     $post = array('post_id' => $_POST['post_id'], 'title' => $_POST['title'], 'body' => strip_tags($_POST['body']));
     __TRY();
     $this->_modelPosts->savePost($post);
     $ex = __CATCH();
     if (__IS_EXCEPTION($ex)) {
         return $this->_editComment($post, $ex->getMessage());
     }
     js_alert(_T('ui_c_success_post'), '', $this->_url('index'));
 }
Exemple #10
0
 /**
  * 保存帖子
  */
 function actionSave()
 {
     __TRY();
     $this->_modelProjects->saveProject($_POST);
     $ex = __CATCH();
     if (__IS_EXCEPTION($ex)) {
         return $this->_editProject($post, $ex->getMessage());
     }
     js_alert(_T('ui_c_success_post'), '', $this->_url('index'));
 }
Exemple #11
0
                        write_html_form("<div class='ecu_preview_file'><a href='{$filelink}'>{$target_name}</a><br />{$filecode}</div>");
                        if ($is_image) {
                            write_html_form("<a href='{$filelink}' rel='lightbox[new]'><img class='ecu_preview_img' src='{$filelink}' /></a><br />");
                        }
                        ecu_user_record_upload_time();
                    } else {
                        $alert = "There was an error uploading the file, please try again!";
                    }
                }
            }
        }
    }
}
// Alert the user of any errors
if (isset($alert)) {
    js_alert($alert);
}
// Check upload against blacklist and return true unless it matches
function filetype_blacklisted()
{
    $blacklist = ecu_get_blacklist();
    return preg_match("/\\.((" . implode('|', $blacklist) . ")|~)(\\.|\$)/i", $_FILES['file']['name']);
}
// Check upload against whitelist and return true if it matches
function filetype_whitelisted()
{
    if (get_option('ecu_file_extension_whitelist') === false) {
        return false;
    }
    $whitelist = get_option('ecu_file_extension_whitelist');
    return preg_match("/^[^\\.]+\\.(" . implode('|', $whitelist) . ")\$/i", $_FILES['file']['name']);
Exemple #12
0
 public function saveedit()
 {
     //保存产品
     $id = getgpc("id");
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("englandstyle") . " where id ='" . $id . "' ");
         if (!$res) {
             alert("错误,没有找到该数据", "");
         }
     }
     $title = getgpc("title");
     $showtime = getgpc("showtime");
     $intr = getgpc("intr");
     $content = getgpc("content");
     $simgurl = getgpc("simgurl");
     $imgurl = getgpc("imgurl");
     $lovenum = getgpc("lovenum");
     $displayorder = intval(getgpc("displayorder"));
     $status = intval(getgpc("status"));
     $indata = array("title" => $title, "showtime" => $showtime, "intr" => $intr, "content" => $content, "simgurl" => $simgurl, "imgurl" => $imgurl, "lovenum" => $lovenum, "displayorder" => $displayorder, "status" => $status);
     if (!$id) {
         //
         $indata["gtime"] = date("Y-m-d H:i:s");
         dbinsert("englandstyle", $indata);
     } else {
         $indata["uptime"] = date("Y-m-d H:i:s");
         dbupdate("englandstyle", $indata, array('id' => $id));
     }
     js_alert("保存成功", "top.location.href='?mod=englandstyle&act=index'");
 }
Exemple #13
0
 function del_img()
 {
     isset_cookie();
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
         $sql = "delete from aich_img where i_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         if ($a) {
             $this->index();
         } else {
             js_alert('删除失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #14
0
 public function saveedit_city()
 {
     //保存门店
     $id = getgpc("id");
     $pid = getgpc("pid");
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("district") . " where id ='" . $id . "' ");
         if (!$res) {
             alert("错误,没有找到该数据", "");
         }
     }
     $name = getgpc("name");
     $status = getgpc("status");
     if (empty($name)) {
         js_alert("请输入城市名称");
     }
     $indata = array("name" => $name, "level" => 2, "usetype" => 0, "upid" => $pid, "status" => $status);
     if (!$id) {
         dbinsert("district", $indata);
     } else {
         dbupdate("district", $indata, array('id' => $id));
     }
     alert("保存成功", "admin.php?mod=product&act=citylist&pid=" . $pid);
 }
Exemple #15
0
 public function saveedit()
 {
     $id = intval(getgpc("id"));
     $tid = intval(getgpc("tid"));
     $title = getgpc("title");
     $stitle = getgpc("stitle");
     $imgurl = getgpc("imgurl");
     $intr = getgpc("intr");
     $type = getgpc("type");
     $url = getgpc("url");
     //        if(!empty($url))
     //        {
     //        	if(!strstr($url,"http://") and !strstr($url,"www") and !strstr($url,"index.php"))
     //        	{
     //				$url="index.php".$url;
     //        	}
     //        }
     //		if(!is_numeric(substr($url, -1)) and $tid=='1')
     //		{
     //			js_alert("请输入相对应产品的ID号");
     //		}
     if (empty($imgurl) and $tid != '11' and $tid != 9) {
         js_alert("上传相应的图片");
     }
     $con = getgpc("con");
     $istop = getgpc("istop");
     $displayorder = getgpc("displayorder");
     $status = getgpc("status");
     $indata = array('tid' => $tid, 'type' => $type, 'title' => $title, 'stitle' => $stitle, 'imgurl' => $imgurl, 'intr' => $intr, 'url' => $url, 'con' => $con, 'gtime' => date("Y-m-d H:i:s"), 'postip' => json_encode(convertip()), "istop" => $istop, "displayorder" => $displayorder, "status" => $status);
     if (!$id) {
         //更新
         dbinsert("indexpush", $indata);
     } else {
         //dbupdate("indexpush",$indata,"id='".$id."'");
         dbupdate("indexpush", $indata, array('id' => $id));
     }
     js_alert("保存成功", "top.location.href='?mod=indexpush&tid=" . $tid . "'");
 }
Exemple #16
0
 public function save_employment_content()
 {
     //保存产品
     $id = getgpc("id");
     $pid = getgpc("pid");
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("employment_content") . " where id ='" . $id . "' ");
         if (!$res) {
             alert("错误,没有找到该数据", "");
         }
     }
     $content = getgpc("content");
     $istop = intval(getgpc("istop"));
     $displayorder = intval(getgpc("displayorder"));
     $status = intval(getgpc("status"));
     $indata = array('pid' => $pid, "content" => $content, "istop" => $istop, "displayorder" => $displayorder, "status" => $status);
     if (!$id) {
         //
         $indata["gtime"] = date("Y-m-d H:i:s");
         dbinsert("employment_content", $indata);
     } else {
         dbupdate("employment_content", $indata, array('id' => $id));
     }
     js_alert("保存成功", "top.location.href='?mod=employment&act=content&pid=" . $pid . "'");
 }
 public function vxBlogLinkSave()
 {
     $return = $_SERVER['HTTP_REFERER'];
     header('Content-type: text/plain;charset=UTF-8');
     if ($this->User->vxIsLogin()) {
         if (isset($_GET['weblog_id'])) {
             $weblog_id = intval($_GET['weblog_id']);
             $sql = "SELECT blg_id, blg_uid, blg_title, blg_links FROM babel_weblog WHERE blg_id = {$weblog_id}";
             $rs = mysql_query($sql);
             if ($_weblog = mysql_fetch_array($rs)) {
                 mysql_free_result($rs);
                 if ($_weblog['blg_uid'] == $this->User->usr_id) {
                     if (isset($_POST['blg_links'])) {
                         $blg_links = fetch_multi($_POST['blg_links']);
                         if (strlen($blg_links) > 2048) {
                             $_SESSION['babel_message_weblog'] = '链接描述文本过长';
                         } else {
                             $blg_links = str_replace('\\|', '{$pipeline}', $blg_links);
                             $blg_links_md5 = md5($blg_links);
                             $_links = explode("\n", $blg_links);
                             $links = array();
                             $category_current = '';
                             foreach ($_links as $entry) {
                                 $entry = trim($entry);
                                 if ($entry != '') {
                                     if (strpos($entry, '|') === false) {
                                         // This is a link category:
                                         $category_md5 = md5($entry);
                                         if (!in_array($category_md5, $links)) {
                                             $category_current = $category_md5;
                                             $links[$category_md5] = array();
                                             $links[$category_md5]['category'] = str_replace('{$pipeline}', '\\|', $entry);
                                             $links[$category_md5]['links'] = array();
                                         }
                                     } else {
                                         // This is a link:
                                         if ($category_current == '') {
                                             $category_current = md5('Blogroll');
                                             $links[$category_current] = array();
                                             $links[$category_current]['category'] = 'Blogroll';
                                             $links[$category_current]['links'] = array();
                                         }
                                         $_link_info = explode('|', $entry);
                                         $_link_info[0] = str_replace('{$pipeline}', '\\|', trim($_link_info[0]));
                                         $_link_info[1] = str_replace('{$pipeline}', '\\|', trim($_link_info[1]));
                                         if (mb_strlen($_link_info[1], 'UTF-8') > 7) {
                                             if (strtolower(mb_substr($_link_info[1], 0, 7, 'UTF-8')) != 'http://') {
                                                 $_link_info[1] = 'http://' . $_link_info['1'];
                                             }
                                         } else {
                                             $_link_info[1] = 'http://' . $_link_info['1'];
                                         }
                                         $link_md5 = md5($_link_info[1]);
                                         $links[$category_current]['links'][$link_md5] = array();
                                         $links[$category_current]['links'][$link_md5]['title'] = $_link_info[0];
                                         $links[$category_current]['links'][$link_md5]['url'] = $_link_info[1];
                                     }
                                 }
                             }
                             $links_sql = mysql_real_escape_string(serialize($links));
                             $sql = "UPDATE babel_weblog SET blg_links = '{$links_sql}' WHERE blg_id = {$weblog_id}";
                             mysql_unbuffered_query($sql);
                         }
                         return URL::vxToRedirect(URL::vxGetBlogLink($_weblog['blg_id']));
                     } else {
                         return URL::vxToRedirect(URL::vxGetBlogLink($_weblog['blg_id']));
                     }
                 } else {
                     return js_alert('你没有权力对这个博客网站进行操作', '/blog/admin.vx');
                 }
             } else {
                 mysql_free_result($rs);
                 return js_alert('指定的博客网站没有找到', '/blog/admin.vx');
             }
         } else {
             return js_alert('指定的博客网站没有找到', '/blog/admin.vx');
         }
     } else {
         return js_alert('你还没有登录,请登录之后再进行操作', URL::vxGetLogin(URL::vxGetBlogAdmin()));
     }
 }
Exemple #18
0
 function saveedit()
 {
     $id = getgpc("id");
     // $username=getgpc("username");
     $tel = getgpc("tel");
     $password = getgpc("password");
     $tname = getgpc("tname");
     $nicename = getgpc("nicename");
     $sex = getgpc("sex");
     $intr = getgpc("intr");
     $pic = getgpc("pic");
     $birthday = getgpc("birthday");
     $weixun = getgpc("weixun");
     $status = getgpc("status");
     //if(!$tele){js_alert("请填写用户账号");}
     if (!$tel) {
         js_alert("请填写用户手机号码");
     }
     if ($id) {
         $res = fetch_one_array("select * from " . dbtable("user") . " where id='" . $id . "'");
         if (!$res) {
             alert("错误,找不到该用户", "");
         }
     } else {
         $res = fetch_one_array("select * from " . dbtable("user") . " where tel='" . $tel . "'");
         if ($res) {
             alert("错误,该手机已存在", "");
         }
         if (!$password) {
             js_alert("请填写用户密码");
         }
     }
     //处理用户密码
     $md5salt = $this->config->item("md5salt");
     if ($password) {
         $password = md5($md5salt . $password);
     }
     if ($id) {
         $updata = array('tel' => $tel, 'status' => $status);
         if ($password) {
             $updata['password'] = $password;
         }
         $this->db->where('id', $id);
         $this->db->update('user', $updata);
         //更新信息表
         $updata_info = array('tname' => $tname, 'nicename' => $nicename, 'sex' => $sex, 'intr' => $intr, 'pic' => $pic, 'birthday' => $birthday, 'weixun' => $weixun);
         $this->db->where('uid', $id);
         $this->db->update('user_info', $updata_info);
     } else {
         $salt = rand(100000, 999999);
         $user_token = "t" . md5($md5salt . $salt . "_" . $tel . time());
         $indata = array('tel' => $tel, 'password' => $password, 'status' => $status, 'user_token' => $user_token);
         $this->db->insert('user', $indata);
         $uid = $this->db->insert_id();
         $indata_info = array('uid' => $uid, 'tname' => $tname, 'nicename' => $nicename, 'sex' => $sex, 'intr' => $intr, 'pic' => $pic, 'birthday' => $birthday, 'weixun' => $weixun);
         $this->db->insert('user_info', $indata_info);
         $this->db->insert('user_set', array('uid' => $uid));
         //初始化一个小孩的数据
         /*
                     if($sex=='男'){
                         $cdata=array('pid'=>$uid);
                     }else{//默认是妈妈
                         $cdata=array('mid'=>$uid);
                     }
                     $this->db->insert('child_info', $cdata);
                     //*/
         //需要插入用户mongodb的用户信息数据
         $mongo = getMyMongodb();
         $mongo->insert("userMessages", array("userid" => $uid, "user_token" => $user_token));
     }
     js_alert("保存成功", "top.location.href='?mod=user'");
 }
Exemple #19
0
 function del_product()
 {
     $this->isset_cookie();
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
         $sql = "delete from " . $this->table_name('goods') . " where goods_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         $sql = "delete from " . $this->table_name('goods_i8n') . " where goods_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         $sql = "select * from " . $this->table_name('img') . " where type_id='{$id}' and type='P'";
         $product = getFetchAll($sql, $this->conn);
         if (!empty($product)) {
             foreach ($product as $k => $v) {
                 @unlink('.' . $v['original_src']);
             }
         }
         $sql = "delete from " . $this->table_name('img') . " where type_id='{$id}' and type='P'";
         $a = mysql_query($sql, $this->conn);
         if ($a) {
             $this->index();
         } else {
             js_alert('删除失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #20
0
 function edit_order_type()
 {
     $this->isset_cookie();
     if (isset($_GET['id'])) {
         //order
         $orderid = $_GET['id'];
         $type = $_GET['type'];
         $sql_o = "update " . $this->table_name('order') . " \n\t\t\t\t\t\tset type='{$type}'\n\t\t\t\t\t\twhere orderid='{$orderid}'";
         $o = mysql_query($sql_o, $this->conn);
         //	echo $sql_o;die;
         if ($o) {
             $this->index();
         } else {
             js_alert('订单修改失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #21
0
 function actionlogout()
 {
     session_destroy();
     js_alert('退出成功!', 'history.back()');
 }
Exemple #22
0
 function faq_save()
 {
     $name = getgpc("name");
     $tel = getgpc("tel");
     $email = getgpc("email");
     $question = getgpc("question");
     if (empty($name)) {
         js_alert("请输入姓名");
     }
     if (empty($tel)) {
         js_alert("请输入联系电话");
     }
     if (empty($email)) {
         js_alert("请输入Email");
     }
     if (empty($question)) {
         js_alert("请输入问题描述");
     }
     $indata = array("name" => $name, "tel" => $tel, "email" => $email, "question" => $question, "reply_sign" => 1, "displayorder" => 0, "status" => 1);
     $indata["gtime"] = date("Y-m-d H:i:s");
     dbinsert("faq", $indata);
     js_alert("提交成功", "top.location.href='?c=home&m=faq'");
 }
Exemple #23
0
 function edit_category()
 {
     $this->isset_cookie();
     if (isset($_GET['id'])) {
         $id = addslashes($_GET['id']);
         $sql = "update " . $this->table_name('category') . " set edit_by='" . $_SESSION[$this->shop_name]['h_id'] . "'  where cat_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         require_once MANAGE_MOD . 'uploaded_file.php';
         $path = "/data/category_doc/";
         $doc_src = uploaded_m_file($this->table_name('img'), 'original_src', 'file_url', $path);
         if (!empty($_POST['edit_doc'])) {
             foreach ($_POST['edit_doc'] as $k => $v) {
                 $sql = "select * from " . $this->table_name('img') . " where img_id='" . $_POST['img_id'][$k] . "' ";
                 $img_b = getFetchAll($sql, $this->conn);
                 if (!empty($img_b)) {
                     if ($v == 1) {
                         $img_sql = " , original_src='" . $doc_src[$k] . "' ";
                         @unlink('.' . $img_b[0]['original_src']);
                     } else {
                         $img_sql = "";
                     }
                     // order_by='".$_POST['order_by'][$k]."',
                     $sql = "update " . $this->table_name('img') . " set original_link='" . $_POST['original_link'][$k] . "',is_show='" . $_POST['is_showi'][$k] . "',edit_by='" . $_SESSION[$this->shop_name]['h_id'] . "' " . $img_sql . " where img_id='" . $_POST['img_id'][$k] . "' ";
                 } else {
                     if ($v == 1) {
                         $img_sql = ",original_link";
                         $img_sql1 = ",'" . $doc_src[$k] . "'";
                     } else {
                         $img_sql = "";
                         $img_sql1 = "";
                     }
                     $sql = "insert into " . $this->table_name('img') . "(type_id,type,original_link" . $img_sql . ",is_show,add_by ,add_time,edit_by) values('" . $id . "','C','" . $_POST['original_link'][$k] . "'" . $img_sql1 . ",'" . $_POST['is_showi'][$k] . "','" . $_SESSION[$this->shop_name]['h_id'] . "','" . $d . "','" . $_SESSION[$this->shop_name]['h_id'] . "')";
                 }
                 $c = mysql_query($sql, $this->conn);
             }
         }
         if ($a) {
             if (!empty($_POST['detail'])) {
                 foreach ($_POST['detail'] as $k => $v) {
                     $art_detail = addslashes(implode('":;"', $v));
                     $sql = "update " . $this->table_name('category_i8n') . " set cat_detail='" . $art_detail . "'  where cat_i8n_id='" . $_POST['iid'][$k] . "'";
                     $b = mysql_query($sql, $this->conn);
                 }
             }
             js_redir('index.php?a=admin&m=main_right');
         } else {
             js_alert('修改失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemple #24
0
  
  if (!$_POST['username'] || !$_POST['password']){
    $js_alert.=js_alert('Полетата \\\'Потребител\\\' и \\\'Парола\\\' са задължителни за попълване!');
  } 
  else {
    $username=trim($_POST['username']);
    $result = ConfirmUser($username, md5($_POST['password']));
    if($result == 1) {
      logit("bad user name: $username");
      $js_alert.=js_alert('Потребителят не съществува в базата!');
    } elseif($result == 2) {
      logit("unactive user: $username");
      $js_alert.=js_alert('Потребителят е с неактивно състояние.\\n Обърнете се към системния администратор!');
    } elseif($result == 3) {
      logit("bad password! username=$username");
      $js_alert.=js_alert('Невалидна парола!');
    }
    $_SESSION['username'] = $username;
    $user_id=mysql_fetch_assoc(sql_q("select id, placement from users where username='******'"));
    $_SESSION['user_id'] = $user_id['id'];
    $_SESSION['placement'] = $user_id['placement'];
    $_SESSION['password'] = md5($_POST['password']);
  }
  if(empty($js_alert)){
    logit("loged in");
    Header ("Location: Modules.php");
    //////////////////////////////////////////////////////////////
    ip_info($_SESSION['username']);
	///////////////////////////////////////////////////////////////	
    
    exit;