示例#1
0
 function add()
 {
     //ajax_echo( print_r( $_REQUEST , 1 ) );
     $name = z(t(v('name')));
     // remove spaces in name
     $name = str_replace(' ', '', $name);
     if (strlen($name) < 1) {
         return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
     }
     $email = z(t(v('email')));
     if (strlen($email) < 1) {
         return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
     }
     $password = z(t(v('password')));
     if (strlen($password) < 1) {
         return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
     }
     $params = array();
     $params['name'] = $name;
     $params['email'] = $email;
     $params['password'] = $password;
     if ($content = send_request('user_sign_up', $params, token())) {
         $data = json_decode($content, 1);
         if ($data['err_code'] != 0) {
             return render(array('code' => $data['err_code'], 'message' => $data['err_msg']), 'rest');
         }
         return render(array('code' => 0, 'data' => array('html' => render_html(array('item' => $data['data']), AROOT . 'view' . DS . 'layout' . DS . 'ajax' . DS . 'widget' . DS . 'buddy.tpl.html'))), 'rest');
     }
     return render(array('code' => 100001, 'message' => __('API_CONNECT_ERROR_NOTICE')), 'rest');
 }
示例#2
0
文件: t1.php 项目: Halfnhav4/pfff
function f($a, $b)
{
    static $c, $d;
    global $e, $f;
    $g = $h = x();
    list($i, list($j, $k)) = y();
    foreach (q() as $l => $m) {
    }
    $a++;
    $b++;
    $c++;
    $d++;
    $e++;
    $f++;
    $g++;
    $h++;
    $i++;
    $j++;
    $k++;
    $l++;
    $m++;
    $this++;
    $n++;
    // Only one that isn't declared.
    extract(z());
    $o++;
}
示例#3
0
 function modify($id)
 {
     $data = array();
     $data['title'] = z(v('title'));
     $data['subtitle'] = z(v('subtitle'));
     $data['state'] = z(v('state'));
     $this->db->where('id', $id)->limit(1);
     $this->db->update('w2_form', $data);
 }
示例#4
0
文件: app.php 项目: xianliflc/teamirr
function plugin_mycss_save()
{
    $css = z(t(v('css')));
    $sql = "REPLACE INTO `css` ( `uid` , `css` ) VALUES ( '" . intval(uid()) . "' , '" . s($css) . "' )";
    run_sql($sql);
    $location = '?c=plugin&a=mycss';
    if (db_errno() != 0) {
        return info_page(__('PL_CSS_MODIFIER_DATE_UPDATE_ERROR', $location));
    } else {
        header("Location:" . $location);
    }
}
示例#5
0
文件: app.php 项目: ramo01/1kapp
function plugin_mycss_save()
{
    $css = z(t(v('css')));
    $sql = "REPLACE INTO `css` ( `uid` , `css` ) VALUES ( '" . intval(uid()) . "' , '" . s($css) . "' )";
    run_sql($sql);
    $location = '?c=plugin&a=mycss';
    if (db_errno() != 0) {
        return info_page('数据保存失败,请稍后重试。<a href="' . $location . '">点击返回</a>');
    } else {
        header("Location:" . $location);
    }
}
示例#6
0
function plugin_basic_auth_save()
{
    if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
        return ajax_echo(__('PL_BASIC_AUTH_PASSWORD_NOT_SAME'));
    }
    $bauth_username = z(t(v('bauth_username')));
    $bauth_password = z(t(v('bauth_password')));
    $bauth_on = intval(t(v('bauth_on')));
    kset('bauth_username', $bauth_username);
    kset('bauth_password', $bauth_password);
    kset('bauth_on', $bauth_on);
    return ajax_echo(__('PL_BASIC_AUTH_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例#7
0
文件: editSong.php 项目: hlag/svs
 private function organizePost($command)
 {
     switch ($command) {
         case 'deleteSong':
             $this->song->delete();
             break;
         case 'updateSong':
             $this->song->updateSong(Request::getInstance()->getPostRequests());
             break;
         default:
             z(Request::getInstance()->getPostRequests());
     }
 }
示例#8
0
文件: app.php 项目: ramo01/1kapp
function plugin_basic_auth_save()
{
    if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
        return ajax_echo('两次输入的密码不一致,请重新输入');
    }
    $bauth_username = z(t(v('bauth_username')));
    $bauth_password = z(t(v('bauth_password')));
    $bauth_on = intval(t(v('bauth_on')));
    kset('bauth_username', $bauth_username);
    kset('bauth_password', $bauth_password);
    kset('bauth_on', $bauth_on);
    return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例#9
0
文件: z.php 项目: keyzf/z.js
function z($d, $p = false, $m = false)
{
    /*RC4 implementation*/
    if (!function_exists('rc4')) {
        function rc4($d, $p)
        {
            if (!$p) {
                return $d;
            }
            $a = array();
            $j = 0;
            for ($i = 0; $i < 256; $i++) {
                $a[$i] = $i;
            }
            for ($i = 0; $i < 256; $i++) {
                $j = ($j + $a[$i] + ord($p[$i % strlen($p)])) % 256;
                $z = $a[$i];
                $a[$i] = $a[$j];
                $a[$j] = $z;
            }
            $i = $j = 0;
            for ($y = 0; $y < strlen($d); $y++) {
                $i = ($i + 1) % 256;
                $j = ($j + $a[$i]) % 256;
                $z = $a[$i];
                $a[$i] = $a[$j];
                $a[$j] = 0 + $z;
                @($R .= $d[$y] ^ chr($a[($a[$i] + $a[$j]) % 256]));
            }
            return $R;
        }
    }
    $a = array(json_decode('"\\u200c"'), json_decode('"\\u200d"'), !is_bool($m) ? $m[0] : json_decode('"\\u2589"'));
    $A = str_repeat($a[0], 32) . str_repeat($a[1], 32);
    if (@$m[1] && mb_substr_count($d, $m[1]) % 2 == 0) {
        //parts-mode
        return preg_replace_callback("#\\{$m[1]}([\\x{0000}-\\x{ffff}]+?)\\{$m[1]}#ums", function ($_) use($A, $p, $m) {
            return $A . z($_[1], $p ? $p : !1, $m[0]);
        }, preg_replace("#\\{$m[1]}{2}#ums", '', $d));
    }
    if ($m) {
        $m = preg_replace('# {2,}#ms', ' ', preg_replace('#[^ \\t\\n]#ums', $a[2], html_entity_decode('' . strip_tags($d), !1, 'UTF-8')));
    }
    $d = rc4("ÿÿÿÿ" . preg_replace_callback('#[\\x{0100}-\\x{ffff}]#u', function ($_) {
        return '&#' . hexdec(json_encode($_[0])) . ';';
    }, $d), $p);
    for ($j = 0; $j < strlen($d); $j++) {
        @($z .= str_replace(array(0, 1), $a, str_pad(decbin(ord($d[$j])), 8, '0', STR_PAD_LEFT)));
    }
    return ($m ? $a[2] : '') . $z . @mb_substr($m, 1);
}
示例#10
0
 function __construct()
 {
     // 检测语言
     if (isset($_COOKIE['tt2_lang'])) {
         $GLOBALS['i18n'] = z(t(basename($_COOKIE['tt2_lang'])));
     } else {
         $GLOBALS['i18n'] = c('default_language');
     }
     __('TEST');
     // force to load langua array before plugin
     // 安装时不启用插件
     if (g('c') != 'install') {
         // 载入插件
         $plugins = c('plugins');
         if (my_sql("SHOW COLUMNS FROM `plugin`")) {
             if ($pinfos = get_data("SELECT * FROM `plugin`")) {
                 foreach ($pinfos as $pinfo) {
                     if (intval($pinfo['on']) == 0) {
                         $plugins = array_remove($pinfo['folder_name'], $plugins);
                     } elseif (!in_array($pinfo['folder_name'], $plugins)) {
                         $plugins[] = $pinfo['folder_name'];
                     }
                 }
             }
         }
         if (is_array($plugins)) {
             $plugins = array_unique($plugins);
         }
         if (isset($plugins) && is_array($plugins)) {
             foreach ($plugins as $plugin) {
                 $plugin_file = c('plugin_path') . DS . basename($plugin) . DS . 'app.php';
                 if (file_exists($plugin_file)) {
                     require_once $plugin_file;
                 }
             }
         }
         $GLOBALS['config']['plugins'] = $plugins;
     }
     // update config for this time
     // 载入默认的
     parent::__construct();
     do_action('CTRL_ALL');
     apply_filter('CTRL_' . g('c') . '_' . g('a') . '_INPUT_FILTER');
     if (g('c') != 'api') {
         // set session time
         session_set_cookie_params(c('session_time'));
         @session_start();
     }
     do_action('CTRL_SESSION_STARTED');
 }
示例#11
0
 function modify_save($fid = NULL)
 {
     check_admin();
     $fid = intval($fid);
     if ($fid < 1) {
         info_page('Form参数错误');
     }
     $title = z(v('title'));
     if (!$title) {
         info_page('标题不能为空');
     }
     $this->form->modify($fid);
     info_page('修改组件信息成功', '/design', '返回组件列表');
 }
示例#12
0
 function index()
 {
     if (c("wxValid")) {
         $signature = $_GET["signature"];
         $timestamp = $_GET["timestamp"];
         $nonce = $_GET["nonce"];
         $echoStr = $_GET["echostr"];
         $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
         die($this->valid($echoStr, $signature, $timestamp, $nonce));
     }
     $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
     $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
     $GLOBALS['fromUsername'] = $postObj->FromUserName;
     $GLOBALS['toUsername'] = $postObj->ToUserName;
     $event = $postObj->Event;
     $eventKey = $postObj->EventKey;
     $keyword = z(t($postObj->Content));
     //订阅事件,发送欢迎词
     if ($event == "subscribe") {
         $text = c("subscribe");
         die($this->creat_xml_response($text));
     }
     //自定义菜单的点击事件
     if ($event == "CLICK") {
         switch ($eventKey) {
             case 'V1001_RANK_LUCKY':
                 $votecount = 10 - get_user_count(g("fromUsername"));
                 $msg = "您还剩余{$votecount}票";
                 die($this->creat_xml_response($msg));
                 break;
             case 'V1001_INREODUCE':
                 $title = "";
                 $description = "";
                 $picUrl = "";
                 $url = "";
                 die($this->creat_pic_response($title, $description, $picUrl, $url));
                 break;
             default:
                 break;
         }
     }
     //进行投票操作
     $openId = g("fromUsername");
     if ($keyword != "") {
         $workId = strtoupper($keyword);
         $text = send_vote($openId, $workId);
     }
 }
示例#13
0
function x($b)
{
    $a = unpack("C*", $b);
    $c = sizeof($a);
    $d = $c / 2;
    $e = array();
    for ($h = 0; $h < $c; ++$h) {
        array_push($e, ~$a[($h + $d) % $c + 1]);
    }
    $f = array_reverse($e);
    $g = array();
    for ($h = 0; $h < $c; ++$h) {
        $g[$h] = $f[$h] + 96;
    }
    return z($g);
}
示例#14
0
文件: app.php 项目: ramo01/1kapp
function plugin_mail_queue_save()
{
    $mqueue_on = intval(t(v('mqueue_on')));
    $mqueue_server = z(t(v('mqueue_server')));
    $mqueue_port = z(t(v('mqueue_port')));
    $mqueue_username = z(t(v('mqueue_username')));
    $mqueue_password = z(t(v('mqueue_password')));
    if (strlen($mqueue_server) < 1 || strlen($mqueue_port) < 1 || strlen($mqueue_username) < 1 || strlen($mqueue_password) < 1) {
        return ajax_echo('设置内容不能为空');
    }
    kset('mqueue_on', $mqueue_on);
    kset('mqueue_server', $mqueue_server);
    kset('mqueue_port', $mqueue_port);
    kset('mqueue_username', $mqueue_username);
    kset('mqueue_password', $mqueue_password);
    return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例#15
0
function plugin_sendcloud_update()
{
    $sendcloud_on = intval(t(v('sendcloud_on')));
    $sendcloud_user = z(t(v('sendcloud_user')));
    $sendcloud_key = z(t(v('sendcloud_key')));
    $sendcloud_from = z(t(v('sendcloud_from')));
    $sendcloud_url = z(t(v('sendcloud_url')));
    if (strlen($sendcloud_user) < 1 || strlen($sendcloud_key) < 1 || strlen($sendcloud_from) < 1 || strlen($sendcloud_url) < 1) {
        return ajax_echo(__('PL_SENDCLOUD_SETTINGS_CANNOT_EMPTY'));
    }
    kset('sendcloud_on', $sendcloud_on);
    kset('sendcloud_user', $sendcloud_user);
    kset('sendcloud_key', $sendcloud_key);
    kset('sendcloud_from', $sendcloud_from);
    kset('sendcloud_url', $sendcloud_url);
    return ajax_echo(__('PL_SENDCLOUD_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例#16
0
 function turn()
 {
     if (!is_admin()) {
         return render(array('code' => LR_API_FORBIDDEN, 'message' => __('API_MESSAGE_ONLY_ADMIN')), 'rest');
     }
     $on = intval(v('on'));
     $folder_name = z(t(v('folder_name')));
     if (strlen($folder_name) < 1) {
         return render(array('code' => LR_API_ARGS_ERROR, 'message' => 'FOLDER NAME CANNOT BE EMPTY'), 'rest');
     }
     $sql = "REPLACE `plugin` (`folder_name` , `on`) VALUES ( '" . s($folder_name) . "' , '" . intval($on) . "' )";
     run_sql($sql);
     if (db_errno() == 0) {
         return render(array('code' => 0, 'message' => 'ok'), 'rest');
     } else {
         return render(array('code' => LR_API_DB_ERROR, 'message' => db_error()), 'rest');
     }
 }
示例#17
0
 public function getContent()
 {
     //$id3 = new getid3_mp3(new getID3());
     $liste = new Liste();
     $liste->getSongs('all');
     foreach ($liste->songs as $song) {
         if ($song->mp3 != '') {
             $f = PATH . 'files/' . $song->mp3;
             if (file_exists($f)) {
                 z($f);
                 $datum = date("Y-m-d", filemtime($f));
                 z($datum);
                 $song->__set('angefangen', $datum);
                 $song->saveSong();
             }
             // if(0 < ($seconds = $this->getLenght($song->mp3)))
         }
     }
 }
示例#18
0
 function i18n()
 {
     @session_write_close();
     $c = z(t(v('lang')));
     if (strlen($c) < 1) {
         $c = c('default_language');
         if (strlen($c) < 1) {
             $c = 'zh_cn';
         }
     }
     if (!isset($GLOBALS['language'][$c])) {
         $lang_file = AROOT . 'local' . DS . basename($c) . '.lang.php';
         if (file_exists($lang_file)) {
             include_once $lang_file;
         }
     }
     $data['js_items'] = js_i18n($GLOBALS['language'][$c]);
     return render($data, 'ajax', 'js');
 }
示例#19
0
文件: extra.php 项目: yunsite/easysns
 function save()
 {
     check_login();
     $mail = z(v('email'));
     if (strpos(_sess('u2_email'), '@') !== false) {
         info_page('你使用是正确的email');
     }
     if (strpos($mail, '@') === false) {
         info_page('请填写正确的email');
     }
     $sql = "select count(*) from u2_user where LCASE(u2_email) = '" . strtolower($mail) . "' ";
     if (lazy_get_var($sql)) {
         info_page('该email已经有人使用了,请重新填写');
     }
     $this->load->database();
     $data['u2_email'] = $mail;
     $uid = format_uid();
     $this->db->where('id', $uid);
     $this->db->update('u2_user', $data);
     $this->load->library('session');
     $this->session->set_userdata('u2_email', $mail);
     info_page('补充E-mail信息成功,以后请用email登陆.', '/', '返回首页');
 }
示例#20
0
 function update()
 {
     $iid = intval(v('iid'));
     if ($iid < 1) {
         return false;
     }
     $data = array();
     $data['label'] = z(v('label'));
     $data['type'] = z(v('type'));
     $data['size'] = z(v('size'));
     $data['is_required'] = intval(v('is_required'));
     $data['is_unique'] = intval(v('is_unique'));
     $data['is_searchable'] = z(v('is_searchable'));
     $data['view_level'] = z(v('view_level'));
     $type_values = v('type_values');
     $new_values = array();
     if ($type_values && is_array($type_values)) {
         $i = 1;
         foreach ($type_values['name'] as $key => $value) {
             if ($value || $type_values['value'][$key]) {
                 $new_values['name'][$i] = $value;
                 $new_values['value'][$i] = $type_values['value'][$key];
                 $i++;
             }
         }
     }
     $data['type_values'] = serialize($new_values);
     $is_adv = intval(v('is_adv'));
     if ($is_adv > 0) {
         $data['default_value'] = z(v('default_value'));
         $data['instruction'] = z(v('instruction'));
         $data['custom_css'] = z(v('custom_css'));
     }
     $this->db->where('id', $iid);
     $this->db->update('w2_item', $data);
     echo 'done';
 }
示例#21
0
文件: app.php 项目: xianliflc/teamirr
function plugin_system_setting_save()
{
    $new_lang = z(t(v('new_lang')));
    $sql = "UPDATE `user` SET `language`='" . $new_lang . "' WHERE `id`='" . intval(uid()) . "'";
    run_sql($sql);
    $sql = "UPDATE ip_br_os_lang SET language='" . $new_lang . "' WHERE ip = '" . $GLOBALS['sys']['ip'] . "' AND browser = '" . $GLOBALS['sys']['browser'] . "' AND browser_ver='" . $GLOBALS['sys']['browser_version'] . "' AND platform= '" . $GLOBALS['sys']['platform'] . "' AND uid='" . intval(uid()) . "'";
    run_sql($sql);
    plugin_system_setting();
    $script = '
	<script type="text/javascript" src="static/script/jquery.tablesorter.js"></script>
	<script type="text/javascript">
	$(function(){
	  $("#sys_confirm").tablesorter();

	toastr.options = {
						"closeButton": true,
						"debug": false,
						"newestOnTop": true,
						"progressBar": false,
						"positionClass": "toast-top-full-width",
						"preventDuplicates": false,
						"showDuration": "300",
						"hideDuration": "1000",
						"timeOut": "5000",
						"extendedTimeOut": "1000",
						"showEasing": "swing",
						"hideEasing": "linear",
						"showMethod": "fadeIn",
						"hideMethod": "fadeOut",
						
	}
	toastr.options.onHidden = function() { location.reload(); }
	toastr["success"]("' . __('PL_SYS_SUCCESS') . '", "' . __('PL_SYS_RELOADING') . '");
});</script>';
    return ajax_echo($script);
}
示例#22
0
文件: app.php 项目: ramo01/1kapp
function todo_flow_item()
{
    $uid = intval(z(v(t('uid'))));
    if ($uid < 0) {
        return ajax_echo('BAD UID');
    }
    $params = array();
    $params['uid'] = $uid;
    $params['ord'] = 'desc';
    $params['by'] = 'last_action_at';
    $params['count'] = '20';
    if ($content = send_request('todo_list', $params, token())) {
        $data = json_decode($content, 1);
        $data['user'] = get_user_info_by_id($uid);
        if (isset($data['data'])) {
            foreach ($data['data'] as $k => $v) {
                if ($v['is_follow'] == 1) {
                    unset($data['data'][$k]);
                }
            }
        }
        return render($data, 'ajax', 'plugin', 'todo_flow');
    }
}
示例#23
0
文件: app.php 项目: ramo01/1kapp
function stoken_jsonp($data)
{
    $jsonp = z(t(v('jsonp')));
    if (strlen($jsonp) > 0) {
        $str = $jsonp . '(' . json_encode($data) . ');';
        ajax_echo($str);
        exit;
    }
    return $data;
}
示例#24
0
    case "create":
        create($_REQUEST['nfname'], $_REQUEST['isfolder'], $_REQUEST['ndir']);
        break;
    case "ren":
        ren($_REQUEST['file']);
        break;
    case "rename":
        renam($_REQUEST['rename'], $_REQUEST['nrename'], $folder);
        break;
    case "movall":
        movall(@$_REQUEST['file'], @$_REQUEST['ndir'], $folder);
        break;
    case "copy":
        tocopy(@$_REQUEST['file'], @$_REQUEST['ndir'], $folder);
        break;
    case "printerror":
        printerror($error);
        break;
    case "logout":
        logout();
        break;
    case "z":
        z($_REQUEST['dename'], $_REQUEST['folder']);
        break;
    case "zip":
        zip($_REQUEST['dename'], $_REQUEST['folder']);
        break;
    default:
        home();
        break;
}
示例#25
0
 function zz($data)
 {
     z($data);
     die;
 }
示例#26
0
 private function check_token()
 {
     $token = z(t(v('token')));
     if (strlen($token) < 2) {
         return self::send_error(LR_API_TOKEN_ERROR, 'NO TOKEN');
     }
     session_id($token);
     session_set_cookie_params(c('session_time'));
     @session_start();
     if ($_SESSION['token'] != $token) {
         return self::send_error(LR_API_TOKEN_ERROR, 'BAD TOKEN');
     }
 }
示例#27
0
function api_checklist_add()
{
    $content = z(t(v('text')));
    if (!not_empty($content)) {
        return apiController::send_error(LR_API_ARGS_ERROR, 'TEXT CAN\'T EMPTY');
    }
    $tid = intval(v('tid'));
    if (intval($tid) < 1) {
        return apiController::send_error(LR_API_ARGS_ERROR, 'TID NOT EXISTS');
    }
    // check user
    $tinfo = get_todo_info_by_id($tid);
    if (intval($tinfo['details']['is_public']) == 0 && uid() != $tinfo['owner_uid']) {
        return apiController::send_error(LR_API_FORBIDDEN, 'ONLY PUBLIC TODO CAN ADD CHECKLIST BY OTHERS');
    }
    $sql = "INSERT INTO `checklist` ( `tid` , `title` , `content` , `timeline` , `uid` ) VALUES ( '" . intval($tid) . "' , '" . s($content) . "' , '" . s($content) . "'  , NOW() , '" . intval(uid()) . "' ) ";
    run_sql($sql);
    if (db_errno() != 0) {
        return apiController::send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . mysql_error());
    } else {
        return apiController::send_result(get_line("SELECT * FROM `checklist` WHERE `id` = '" . intval(last_id()) . "' LIMIT 1", db()));
    }
}
示例#28
0
<?php

include_once dirname(__FILE__) . '/function.php';
if (!is_login()) {
    info_page('请登录后查看');
}
$uid = format_uid();
$folder = z(array_shift($args));
$cid = intval(array_shift($args));
$mid = app_config('mid', $folder);
$bind = app_config('bind', $folder);
if (!isset($mid)) {
    info_page('没有此表!');
}
if ($bind['price'] == '' || $bind['price'] <= '0') {
    info_page('价格错误!');
}
foreach ($bind as $k => $v) {
    $selected[] = " `{$v}` as {$k} ";
}
$com = lazy_get_line("SELECT  " . join(',', $selected) . " FROM `app_content_{$mid}` WHERE `id` = '" . intval($cid) . "'");
$cnum = get_count();
if ($cnum == '0') {
    info_page('没有此件物品!');
}
$num = lazy_get_var("SELECT COUNT(*) FROM `app_shopcart` WHERE `cid` = '" . intval($cid) . "' AND `uid` = '" . intval($uid) . "'");
if ($num != '0') {
    lazy_run_sql("UPDATE `app_shopcart` SET `num` = `num`+1 WHERE `cid` = '" . intval($cid) . "' AND `uid` = '" . intval($uid) . "'");
} else {
    lazy_run_sql("INSERT INTO `app_shopcart` ( `uid`, `cid`, `name`, `desp`, `num`, `money`, `date`, `folder` ) VALUES ( '" . intval($uid) . "' , '" . intval($cid) . "' , " . s($com['title']) . " , " . s($com['desp']) . " , '1' , " . s($com['price']) . " , '" . date('Y-m-d H:i:s') . "' , " . s($folder) . " )");
}
示例#29
0
 function save_shop_item($id)
 {
     $time = date("Y-m-d H:i:s");
     $extra = v('extra');
     $data['name'] = z(v('name'));
     $data['number'] = z(v('number'));
     $data['brands'] = intval(v('brands'));
     $data['unit'] = z(v('unit'));
     $data['weight'] = intval(v('weight'));
     $data['price'] = floatval(v('price'));
     $data['market_price'] = floatval(v('market_price'));
     $data['pro_price'] = floatval(v('pro_price'));
     $data['is_pro'] = intval(v('is_pro'));
     $data['`leave`'] = intval(v('leave'));
     $data['alarm'] = intval(v('alarm'));
     $data['new'] = intval(v('new'));
     $data['good'] = intval(v('good'));
     $data['hot'] = intval(v('hot'));
     $data['cate'] = intval(v('cate'));
     $data['type'] = intval(v('type'));
     $data['pic'] = z(v('pic'));
     $data['desp'] = x(v('desp'));
     $data['is_active'] = intval(v('is_active')) == 1 ? 1 : 0;
     $data['time'] = $time;
     $this->db->where('id', $id);
     $this->db->update('u2_shop_items', $data);
     $is_active = $data['is_active'];
     $type = $data['type'];
     if ($extra && $type) {
         $data = array();
         foreach ($extra as $k => $v) {
             $k = intval($k);
             if ($k > 0) {
                 if (is_array($v)) {
                     $data['extra_' . $k] = serialize($v);
                 } else {
                     $data['extra_' . $k] = z($v);
                 }
             }
         }
         if ($data) {
             $this->db->select('count(*)')->from('shop_extra_' . $type)->where('cid', $id);
             if (lazy_get_var()) {
                 $this->db->where('cid', $id);
                 $this->db->update('shop_extra_' . $type, $data);
             } else {
                 $data['cid'] = $id;
                 $this->db->insert('shop_extra_' . $type, $data);
             }
         }
     }
     $data = array();
     $data['is_active'] = $is_active;
     $this->db->where('cid', $id);
     $this->db->update('u2_shop_relate_tags', $data);
     return $time;
 }
示例#30
0
<?php

'a' . ($b['c'] == 'd' ? "e{$f}g{$h['i']}" . j('k') . "l" . m('n') . "o" : "p{$q}r{$s['t']}u" . ($v['w'] != X ? "y" . z('aa') . "'ab" : "ac" . ad('ae') . "af") . "ag" . ah('ai') . "aj") . "ak";