public function notice_f() { $id = $this->get('id', 'int'); if (!$id) { error(P_Lang("无法获取订单信息"), $this->url, 'error'); } $rs = $this->model('order')->get_one($id); if (!$rs) { error(P_Lang('订单信息为空'), $this->url, 'error'); } $burl = $this->url("order", 'info', 'id=' . $rs['id']); if (!$_SESSION['user_id']) { $burl = $this->url("order", "info", "sn=" . $rs['sn'] . "&passwd=" . $rs['passwd']); } $burl = $this->config['www_file'] . substr($burl, strlen($this->config['api_file'])); if ($rs['pay_end']) { error(P_Lang('您的订单付款成功,请稍候,系统将引导您查看订单信息'), $burl, 'ok'); } $payment_rs = $this->model('payment')->get_one($rs['pay_id']); if (!$payment_rs) { error(P_Lang('付款方案不存在'), $this->url, 'error'); } $file = $this->dir_root . 'payment/' . $payment_rs['code'] . '/notice.php'; if (!is_file($file)) { error(P_Lang('支付接口异常,请检查'), $this->url, 'error'); } include_once $file; $name = $payment_rs['code'] . '_notice'; $cls = new $name($rs, $payment_rs); $cls->submit(); error(P_Lang('您的订单付款成功,请稍候,系统将引导您查看订单信息'), $burl, 'ok'); }
public function index_f() { $email = $this->get('email'); if (!$email) { $this->json(P_Lang('Email不能为空')); } $title = $this->get('title'); $content = $this->get('content', 'html'); if (!$content) { $this->json(P_Lang('邮件内容不能为空')); } if (!$title) { $title = phpok_cut($content, 50, '…'); } if (!$this->site['email_server'] || !$this->site['email_account'] || !$this->site['email_pass'] || !$this->site['email']) { $this->json(P_Lang('SMTP未配置好')); } $list = explode(',', $email); foreach ($list as $key => $value) { $value = trim($value); if ($value && phpok_check_email($value)) { $value_name = str_replace(strstr($value, '@'), '', $value); $info = $this->lib('email')->send_mail($value, $title, $content, $value_name); if (!$info) { $this->json($this->lib('email')->error()); } } } $this->json(true); }
public function config_f() { $id = $this->get("id"); if (!$id) { exit(P_Lang('未指定ID')); } $eid = $this->get("eid", "int"); $etype = $this->get("etype"); if (!$etype) { $etype = "ext"; } if ($eid) { if ($etype == "fields") { $rs = $this->model('fields')->get_one($eid); } elseif ($etype == "module") { $rs = $this->model('module')->field_one($eid); } elseif ($etype == "user") { $rs = $this->model('user')->field_one($eid); } else { $rs = $this->model('ext')->get_one($eid); } if ($rs["ext"]) { $ext = unserialize($rs["ext"]); foreach ($ext as $key => $value) { $rs[$key] = $value; } } $this->assign("rs", $rs); } $this->lib('form')->config($id); }
function debug_time($memory_ctrl = 1, $sql_ctrl = 1, $file_ctrl = 0, $cache_ctrl = 0) { $time = run_time(true); $memory = run_memory(true); $sql_db_count = $GLOBALS['app']->db->sql_count(); $sql_db_time = $GLOBALS['app']->db->sql_time(); $sql_cache_count = $GLOBALS['app']->cache->count(); $sql_cache_time = $GLOBALS['app']->cache->time(); $string = P_Lang('运行{seconds_total}秒', array('seconds_total' => $time)); //$string = "运行 ".$time." 秒"; if ($memory_ctrl && $memory_ctrl != 'false') { $string .= P_Lang(',内存使用{memory_total}', array('memory_total' => $memory)); } if ($sql_ctrl && $sql_ctrl != 'false') { $string .= P_Lang(',数据库执行{sql_count}次,耗时{sql_time}秒', array('sql_count' => $sql_db_count, 'sql_time' => $sql_db_time)); //$string .= ",数据库执行 ".$sql_db_count." 次,耗时 ".$sql_db_time." 秒"; } if ($file_ctrl && $count > 0 && $file_ctrl != 'false') { $string .= P_Lang(',文件执行{file_count}次', array('file_count' => $count)); } if ($cache_ctrl && $cache_ctrl != 'false') { $string .= P_Lang(',缓存执行{cache_count}次,耗时{cache_time}秒', array('cache_count' => $sql_cache_count, 'cache_time' => $sql_cache_time)); } $db_debug = $GLOBALS['app']->db->debug(); if ($db_debug && is_string($db_debug)) { $string .= $db_debug; } $cache_debug = $GLOBALS['app']->cache->debug(); if ($cache_debug) { $string .= $cache_debug; } return $string; }
public function phpok_format($rs, $appid = "admin") { if (!$rs["optlist_id"]) { return P_Lang('未指定选项组'); } $idlist = $rs["optlist_id"]; if (!$idlist || !is_array($idlist)) { return P_Lang('未指定项目,请配置'); } $project_id = implode(",", $idlist); $project_list = $this->model("project")->title_list($project_id); if ($project_list) { $open_title = implode(" / ", $project_list) . " - 主题列表"; } else { $open_title = "主题资源"; } $condition = " l.project_id IN(" . $project_id . ") "; $total = $this->model("list")->get_all_total($condition); if ($rs["is_multiple"]) { $content = $rs["content"] ? explode(",", $rs["content"]) : array(); $rs["content"] = $content; } $this->assign("_project_id_btn", $project_id); $this->assign("_rs", $rs); $this->assign("_open_title", $open_title); return $this->fetch($this->dir_phpok . 'form/html/title_admin_tpl.html', 'abs-file'); }
public function exec_f() { $id = $this->get('id', 'system'); if (!$id) { error(P_Lang('未指定ID'), '', 'error'); } $rs = $this->model('plugin')->get_one($id); if (!$rs || !$rs['status']) { error('插件不存在或未启用'); } if (!file_exists($this->dir_root . 'plugins/' . $id . '/' . $this->app_id . '.php')) { error(P_Lang('插件应用{appid}.php不存在', array('appid' => $this->app_id)), '', 'error'); } include_once $this->dir_root . 'plugins/' . $id . '/' . $this->app_id . '.php'; $name = $this->app_id . '_' . $id; $cls = new $name(); $mlist = get_class_methods($cls); $exec = $this->get('exec', 'system'); if (!$exec) { $exec = 'index'; } if (!$mlist || !in_array($exec, $mlist)) { error(P_Lang('插件方法{method}不存在', array('method' => $exec))); } $cls->{$exec}(); }
private function load_search($keywords) { if (!$keywords) { return false; } //取得符合搜索的项目 $condition = "status=1 AND hidden=0 AND is_search !=0 AND module>0"; $list = $this->model('project')->project_all($this->site['id'], 'id', $condition); if (!$list) { error(P_Lang('您的网站没有允许可以搜索的信息'), $this->url, "error", 10); } $pids = $mids = array(); foreach ($list as $key => $value) { $pids[] = $value["id"]; $mids[] = $value['module']; } $mids = array_unique($mids); $condition = "l.project_id IN(" . implode(",", $pids) . ") AND l.module_id IN(" . implode(",", $mids) . ") "; $klist = explode(" ", $keywords); $kc = array(); $kwlist = array(); foreach ($klist as $key => $value) { $kwlist[] = '<i>' . $value . '</i>'; $kc[] = " l.seo_title LIKE '%" . $value . "%'"; $kc[] = " l.seo_keywords LIKE '%" . $value . "%'"; $kc[] = " l.seo_desc LIKE '%" . $value . "%'"; $kc[] = " l.title LIKE '%" . $value . "%'"; $kc[] = " l.tag LIKE '%" . $value . "%'"; } $condition .= "AND (" . implode(" OR ", $kc) . ") "; $total = $this->model('search')->get_total($condition); $pageid = $this->get($this->config['pageid'], 'int'); if (!$pageid) { $pageid = 1; } $psize = $this->config['psize'] ? $this->config['psize'] : 30; $offset = ($pageid - 1) * $psize; $idlist = $this->model('search')->id_list($condition, $offset, $psize); if ($idlist) { $rslist = array(); foreach ($idlist as $key => $value) { $info = $this->call->phpok('_arc', array('title_id' => $value['id'], 'site' => $this->site['id'])); if ($info) { $info['_title'] = str_replace($klist, $kwlist, $info['title']); $rslist[] = $info; } } $this->assign("rslist", $rslist); } $pageurl = $this->url('search', '', 'keywords=' . rawurlencode($keywords)); $this->assign("pageurl", $pageurl); $this->assign("total", $total); $this->assign("pageid", $pageid); $this->assign("psize", $psize); $this->assign("keywords", $keywords); $this->view("search_list"); exit; }
public function editor_f() { $id = $this->get('id', 'int'); if (!$id) { $this->json(P_Lang('未指定ID')); } $this->model('gd')->update_editor($id); $this->json(true); }
public function delete_f() { $id = $this->get('id', 'int'); if (!$id) { $this->json(P_Lang('未指定ID')); } $this->model('tag')->delete($id); $this->json(true); }
function index_f() { $admin_name = $_SESSION["admin_account"]; foreach ($_SESSION as $key => $value) { if (substr($key, 0, 5) == 'admin' && $key != 'admin_lang_id') { unset($_SESSION[$key]); } } error(P_Lang('管理员{admin_name}成功退出', array('admin_name' => '<span class="red">' . $admin_name . '</span>')), $this->url('login'), 'ok'); }
public function submit() { $paypal = new paypal_payment($this->param['param']["payid"], $this->param['param']["at"]); $paypal->set_value("action_url", $this->param['param']["action"]); $price = $GLOBALS['app']->get('mc_gross'); $sn = $GLOBALS['app']->get('invoice'); $checkcode = $GLOBALS['app']->get('custom'); if (!$checkcode) { phpok_log(P_Lang('异步传输:没有自定义验证串')); exit('error'); } if (!$price || !$sn) { phpok_log(P_Lang('数据异步')); exit('error'); } $chk = $paypal->check($price, $sn, $checkcode); if (!$chk) { phpok_log(P_Lang('异步传输:验证不能过')); exit('error'); } $payment_status = $GLOBALS['app']->get('payment_status'); if ($payment_status != 'Completed') { phpok_log(P_Lang('异步传输:支付状态是' . $payment_status)); exit('error'); } $pay_date = $GLOBALS['app']->get('payment_date'); if ($pay_date) { $pay_date = strtotime($pay_date); if (!$pay_date) { $pay_date = $GLOBALS['app']->time; } } else { $pay_date = $GLOBALS['app']->time; } $price = $GLOBALS['app']->get('mc_gross'); $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1); $array['status'] = '付款完成'; $exchange_rate = $GLOBALS['app']->get('exchange_rate'); if ($exchange_rate) { $array['pay_currency_rate'] = $exchange_rate; } $p_array = array(); $p_array['txn_id'] = $GLOBALS['app']->get('txn_id'); $p_array['txn_type'] = $GLOBALS['app']->get('txn_type'); $p_array['mc_fee'] = $GLOBALS['app']->get('mc_fee'); $p_array['mc_currency'] = $GLOBALS['app']->get('mc_currency'); $p_array['payer_email'] = $GLOBALS['app']->get('payer_email'); $p_array['first_name'] = $GLOBALS['app']->get('first_name'); $p_array['last_name'] = $GLOBALS['app']->get('last_name'); $p_array['payer_business_name'] = $GLOBALS['app']->get('payer_business_name'); $p_array['payer_status'] = $GLOBALS['app']->get('payer_status'); $array['ext'] = serialize($p_array); $GLOBALS['app']->model('order')->save($array, $this->order['id']); exit('SUCCESS'); }
function submit() { if ($_SESSION['user_id']) { $url = $GLOBALS['app']->url('order', 'info', 'id=' . $_GET['id']); unset($_GET['id']); } else { $url = $GLOBALS['app']->url('order', 'info', 'sn=' . $_GET['sn'] . '&passwd=' . $_GET['passwd']); unset($_GET['sn'], $_GET['passwd']); } $paypal = new paypal_payment($this->param['param']["payid"], $this->param['param']["at"]); $paypal->set_value("action_url", $this->param['param']["action"]); $price = $GLOBALS['app']->get('mc_gross'); $sn = $GLOBALS['app']->get('invoice'); $checkcode = $GLOBALS['app']->get('custom'); if (!$checkcode || !$price || !$sn) { error(P_Lang('支付返回异常,请检查'), $url, 'notice'); } $chk = $paypal->check($price, $sn, $checkcode); if (!$chk) { error(P_Lang('数据验证不通过,请检查'), $url, 'notice'); } $ext = $this->order['ext']; if ($ext && is_string($ext)) { $ext = unserialize($this->order['ext']); } if ($ext && is_array($ext)) { if ($ext['txn_id'] && $ext['txn_id'] == $GLOBALS['app']->get('txn_id')) { error(P_Lang('订单支付成功'), $url, 'ok'); } } $payment_status = $GLOBALS['app']->get('payment_status'); if ($payment_status != 'Completed') { error(P_Lang('支付不确定是否完成,请联系商家确认'), $url, 'notice'); } $price = $GLOBALS['app']->get('mc_gross'); $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1); $array['status'] = '付款完成'; $exchange_rate = $GLOBALS['app']->get('exchange_rate'); if ($exchange_rate) { $array['pay_currency_rate'] = $exchange_rate; } $p_array = array(); $p_array['txn_id'] = $GLOBALS['app']->get('txn_id'); $p_array['txn_type'] = $GLOBALS['app']->get('txn_type'); $p_array['mc_fee'] = $GLOBALS['app']->get('mc_fee'); $p_array['mc_currency'] = $GLOBALS['app']->get('mc_currency'); $p_array['payer_email'] = $GLOBALS['app']->get('payer_email'); $p_array['first_name'] = $GLOBALS['app']->get('first_name'); $p_array['last_name'] = $GLOBALS['app']->get('last_name'); $p_array['payer_business_name'] = $GLOBALS['app']->get('payer_business_name'); $p_array['payer_status'] = $GLOBALS['app']->get('payer_status'); $array['ext'] = serialize($p_array); $GLOBALS['app']->model('order')->save($array, $this->order['id']); return true; }
public function checkout_f() { $rslist = $this->model('cart')->get_all($this->cart_id); if (!$rslist) { error(P_Lang('您的购物车里没有任何产品'), $this->url, "notice", 5); } //生成随机码,以确定客户通过正确途径下单 $_SESSION['order_spam'] = str_rand(10); $totalprice = 0; foreach ($rslist as $key => $value) { $totalprice += price_format_val($value['price'] * $value['qty'], $value['currency_id'], $this->site['currency_id']); } $price = price_format($totalprice, $this->site['currency_id']); $this->assign('price', $price); $this->assign("rslist", $rslist); $shipping = $billing = array(); if ($_SESSION['user_id']) { $shipping_list = $this->model('address')->address_list($_SESSION['user_id'], 'shipping'); if ($shipping_list) { foreach ($shipping_list as $key => $value) { if ($value['is_default']) { $shipping = $value; } } if (!$shipping) { reset($shipping_list); $shipping = current($shipping_list); } } if ($this->site['biz_billing']) { $billing_list = $this->model('address')->address_list($_SESSION['user_id'], 'billing'); if ($billing_list) { foreach ($billing_list as $key => $value) { if ($value['is_default']) { $billing = $value; } } if (!$billing) { reset($billing_list); $billing = current($billing_list); } } } } else { if ($_SESSION['address']['shipping']) { $shipping = $_SESSION['address']['shipping']; } if ($_SESSION['address']['billing']) { $billing = $_SESSION['address']['billing']; } } $this->assign('shipping', $shipping); $this->assign('billing', $billing); $this->view("cart_checkout"); }
public function xml_f() { $file = $this->get('file', "system"); if (!$file) { $this->json(P_Lang('未指定XML文件')); } if (!file_exists($this->dir_root . 'data/xml/' . $file . '.xml')) { $this->json(P_Lang('XML文件不存在')); } $info = $this->lib('xml')->read($this->dir_root . 'data/xml/' . $file . '.xml'); $this->json($info, true); }
public function alias_f() { $id = $this->get('id', 'int'); if (!$id) { $this->json(P_Lang('未指定站点ID')); } $alias = $this->get('alias'); if (!$alias) { $this->json(P_Lang('未指定别名')); } $this->model('site')->alias_save($alias, $id); $this->json(true); }
private function download($rs, $back = '', $title = '') { if (!$back) { $back = $this->url; } if (!$rs || !$rs["filename"] || !is_file($this->dir_root . $rs["filename"])) { error(P_Lang('附件不存在'), $back, "error"); } $filesize = filesize($this->dir_root . $rs["filename"]); if (!$title) { $title = $rs["title"] ? $rs['title'] : basename($rs['filename']); } $title = str_replace("." . $rs["ext"], "", $title); ob_end_clean(); header("Date: " . gmdate("D, d M Y H:i:s", $this->time) . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s", $this->time) . " GMT"); header("Content-Encoding: none"); if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/Firefox/", $_SERVER["HTTP_USER_AGENT"])) { $dname = "utf8''" . $dname; header("Content-Disposition: attachment; filename*=\"utf8''" . rawurlencode($title . '.' . $rs['ext']) . "\""); } else { header("Content-Disposition: attachment; filename=" . rawurlencode($title . '.' . $rs['ext'])); } header("Accept-Ranges: bytes"); $range = 0; $size2 = $filesize - 1; if (isset($_SERVER['HTTP_RANGE'])) { list($a, $range) = explode("=", $_SERVER['HTTP_RANGE']); $new_length = $size2 - $range; header("HTTP/1.1 206 Partial Content"); header("Content-Length: " . $new_length); //输入总长 header("Content-Range: bytes " . $range . "-" . $size2 . "/" . $filesize); } else { header("Content-Range: bytes 0-" . $size2 . "/" . $filesize); //Content-Range: bytes 0-4988927/4988928 header("Content-Length: " . $filesize); } $handle = fopen($this->dir_root . $rs['filename'], "rb"); fseek($handle, $range); set_time_limit(0); while (!feof($handle)) { print fread($handle, 1024 * 8); flush(); ob_flush(); } fclose($handle); }
function index_f() { $uid = $this->get("uid"); if (!$uid) { error(P_Lang('未指定会员信息')); } /*if($uid == $_SESSION["user_id"]){ header("Location:".$this->url('usercp')); exit; }*/ $user_rs = $this->model('user')->get_one($uid); $this->assign("user_rs", $user_rs); //$is_atten = $this->check_atten($_SESSION["user_id"],$user_rs['user']); //$this->assign("atten",$is_atten); $this->view("user_info"); }
public function config($id) { $obj = $this->cls($id); if (!$obj) { return false; } $mlist = get_class_methods($obj); if (in_array('phpok_config', $mlist)) { $obj->phpok_config(); exit; } if (in_array('config', $mlist)) { $obj->config(); exit; } exit(P_Lang('文件异常')); }
function submit_f() { $oldpass = $this->get("oldpass"); if (!$oldpass) { error(P_Lang('管理员密码验证不能为空'), $this->url("me", "setting"), "error"); } $rs = $this->model('admin')->get_one($_SESSION["admin_id"]); if (!password_check($oldpass, $rs["pass"])) { error(P_Lang("管理员密码不正确"), $this->url("me", "setting"), "error"); } $name = $this->get('name'); $array = array('email' => $this->get('email')); $update_login = false; $admin = $this->model('admin')->get_one($_SESSION['admin_id'], 'id'); $tip = P_Lang('信息修改成功'); if ($name && $name != $admin['account']) { //修改管理员账号 $check = $this->model('admin')->check_account($name, $_SESSION['admin_id']); if ($check) { error(P_Lang('管理员账号已经存在,请重新设置'), $this->url('me', 'setting'), 'error'); } $array['account'] = $name; $update_login = true; $tip = P_Lang('管理员账号信息变更成功,请重新登录'); } $newpass = $this->get("newpass"); if ($newpass) { $chkpass = $this->get("chkpass"); if ($newpass != $chkpass) { error(P_Lang("两次输入的新密码不一致"), $this->url("me", "setting"), "error"); } $array['pass'] = password_create($newpass); $tip = P_Lang('密码修改成功,请下次登录后使用新密码登录!'); } $array['fullname'] = $this->get('fullname'); $array['close_tip'] = $this->get('close_tip'); $this->model('admin')->save($array, $_SESSION['admin_id']); if ($update_login) { error($tip, $this->url('logout'), 'ok'); } else { $info = $this->model('admin')->get_one($_SESSION['admin_id'], 'id'); $_SESSION['admin_rs'] = $info; $html = '<input type="button" value=" ' . P_Lang('确定') . ' " class="submit" onclick="$.dialog.close();" />'; error_open($tip, "ok", $html); } }
public function submit() { unset($_GET[$GLOBALS['app']->config['ctrl_id']], $_GET[$GLOBALS['app']->config['func_id']]); if ($_SESSION['user_id']) { unset($_GET['id']); } else { unset($_GET['sn'], $_GET['passwd']); } //合作身份者id,以2088开头的16位纯数字 $alipay_config = array('partner' => $this->param['param']['pid'], 'key' => $this->param['param']['key']); $alipay_config['sign_type'] = 'MD5'; $alipay_config['input_charset'] = 'utf-8'; $alipay_config['cacert'] = $this->paydir . 'cacert.pem'; $alipay_config['transport'] = 'http'; $alipayNotify = new AlipayNotify($alipay_config); $verify_result = $alipayNotify->verify($_GET); if (!$verify_result) { error(P_Lang('订单验证不通过,请联系管理员确认'), $GLOBALS['app']->url, 'error'); } //附款日期 $pay_date = $GLOBALS['app']->get('notify_time'); if ($pay_date) { $pay_date = strtotime($pay_date); } //附款金额,支付宝接口仅支持人民币 $price = $GLOBALS['app']->get('total_fee', 'float'); //更新订单信息 $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1); $array['status'] = '付款完成'; //更新扩展数据 $alipay = array(); $alipay['buyer_email'] = $GLOBALS['app']->get('buyer_email'); $alipay['buyer_id'] = $GLOBALS['app']->get('buyer_id'); $alipay['time'] = $GLOBALS['app']->get('notify_time'); $alipay['seller_email'] = $GLOBALS['app']->get('seller_email'); $alipay['seller_id'] = $GLOBALS['app']->get('seller_id'); $alipay['total_fee'] = $GLOBALS['app']->get('total_fee'); $alipay['trade_no'] = $GLOBALS['app']->get('trade_no'); $alipay['trade_status'] = $GLOBALS['app']->get('trade_status'); $array['ext'] = serialize($alipay); $GLOBALS['app']->model('order')->save($array, $this->order['id']); return true; }
function default_f() { if (!$this->popedom['default']) { $this->json(P_Lang('您没有权限执行此操作')); } $id = $this->get("id", "int"); if (!$id) { $this->json(P_Lang('未指定站点信息')); } $rs = $this->model('site')->get_one($id); if (!$rs) { $this->json(P_Lang('站点信息不存在')); } if ($rs['is_default']) { $this->json(P_Lang('默认站点不支持此操作')); } $this->model('site')->set_default($id); $this->json(P_Lang('默认站点设置成功'), true); }
function submit() { $notify_url = $this->baseurl . "payment/chinpay/notify_url.php"; if ($_SESSION['user_id']) { $return_url = $GLOBALS['app']->url('payment', 'notice', 'id=' . $this->order['id'], 'www', true); $show_url = $GLOBALS['app']->url('order', 'info', 'id=' . $this->order['id'], 'www', true); } else { $return_url = $GLOBALS['app']->url('payment', 'notice', 'sn=' . $this->order['sn'] . '&passwd=' . $this->order['passwd'], 'www', true); $show_url = $GLOBALS['app']->url('order', 'info', 'sn=' . $this->order['sn'] . '&passwd=' . $this->order['passwd']); } $return_url = api_url('payment', 'notice', 'id=' . $this->order['id'], true); $currency_id = $this->param['currency'] ? $this->param['currency']['id'] : $this->order['currency_id']; $total_fee = price_format_val($this->order['price'], $this->order['currency_id'], $currency_id); $debug = $this->param['param']['env'] == 'start' ? false : true; $chinapay = new chinapay_lib($this->dir_root); $chinapay->set_debug($debug); $chinapay->set_pid($this->param['param']['pid']); $chinapay->set_pri_key($this->param['param']['prikey']); $chinapay->set_pub_key($this->param['param']['pubkey']); $chinapay->set_orderid($this->order['id']); $options = array('notify_url' => $notify_url, 'return_url' => $return_url, 'bankid' => $bankid, 'price' => $total_fee); $options['show_url'] = $show_url; $options['currency'] = $this->param['currency']['code']; $options['date'] = date("Ymd", $GLOBALS['app']->time); $options['passwd'] = $this->order['sn']; $chinapay->set_options($options); $info = $chinapay->action_form('paymentsubmit'); if (!$info) { error(P_Lang('银行支付接口异常,数据未正常配置'), '', 'error'); } //建立请求 echo '<!DOCTYPE html>' . "\n"; echo '<html>' . "\n"; echo '<head>' . "\n\t"; echo '<meta charset="utf-8" />' . "\n\t"; echo '<title>付款中</title>' . "\n"; echo '</head>' . "\n<body>\n"; echo $info; echo '<script type="text/javascript">document.getElementById("paymentsubmit").submit()</script>'; echo "\n" . '</body>' . "\n</html>"; exit; }
public function submit() { unset($_GET[$GLOBALS['app']->config['ctrl_id']], $_GET[$GLOBALS['app']->config['func_id']], $_GET['sn']); $alipay_config = array('partner' => $this->param['param']['pid'], 'key' => $this->param['param']['key']); $alipay_config['sign_type'] = 'MD5'; $alipay_config['input_charset'] = 'utf-8'; $alipay_config['cacert'] = $this->paydir . 'cacert.pem'; $alipay_config['transport'] = 'http'; $alipayNotify = new AlipayNotify($alipay_config); $verify_result = $alipayNotify->verify($_GET); if (!$verify_result) { phpok_log(P_Lang('异步通知:支付宝验证不通过')); exit('fail'); } //附款日期 $pay_date = $GLOBALS['app']->get('notify_time'); if ($pay_date) { $pay_date = strtotime($pay_date); } //附款金额,支付宝接口仅支持人民币 $price = $GLOBALS['app']->get('total_fee', 'float'); $trade_status = $GLOBALS['app']->get('trade_status'); $tmp = array('WAIT_SELLER_SEND_GOODS', 'WAIT_BUYER_CONFIRM_GOODS', 'TRADE_FINISHED', 'TRADE_SUCCESS'); if (in_array($trade_status, $tmp)) { $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1); $array['status'] = '付款完成'; //更新扩展数据 $alipay = array(); $alipay['buyer_email'] = $GLOBALS['app']->get('buyer_email'); $alipay['buyer_id'] = $GLOBALS['app']->get('buyer_id'); $alipay['time'] = $GLOBALS['app']->get('notify_time'); $alipay['seller_email'] = $GLOBALS['app']->get('seller_email'); $alipay['seller_id'] = $GLOBALS['app']->get('seller_id'); $alipay['total_fee'] = $GLOBALS['app']->get('total_fee'); $alipay['trade_no'] = $GLOBALS['app']->get('trade_no'); $alipay['trade_status'] = $GLOBALS['app']->get('trade_status'); $array['ext'] = serialize($alipay); $GLOBALS['app']->model('order')->save($array, $rs['id']); } exit('success'); }
public function phpok_f() { if (!$this->site['api_code']) { $this->json(P_Lang("系统未启用接口功能")); } $token = $this->get("token"); if (!$token) { $this->json(P_Lang("接口数据异常")); } $this->lib('token')->keyid($this->site['api_code']); $info = $this->lib('token')->decode($token); if (!$info) { $this->json(P_Lang('信息为空')); } $id = $info['id']; if (!$id) { $this->json(P_Lang('未指定数据调用中心ID')); } $param = $info['param']; if ($param) { if (is_string($param)) { $pm = array(); parse_str($param, $pm); $param = $pm; unset($pm); } } $list = $this->call->phpok($id, $param); if (!$list) { $this->json(P_Lang("没有获取到数据")); } $tpl = $this->get("tpl"); if ($tpl && $this->tpl->check_exists($tpl)) { $this->assign("rslist", $list); $info = $this->fetch($tpl); $this->json($info, true); } $this->json($list, true); }
public function index_f() { $type = $this->get("__type"); if (!$type) { $type = "list"; } $str = $_POST ? serialize($_POST) : ""; if (!$str) { $this->json(P_Lang('没有自动存储的表单数据'), true); } $rs = $this->model('temp')->chk($type, $_SESSION["admin_id"]); if ($rs) { $id = $rs["id"]; unset($rs["id"]); $rs["content"] = $str; } else { $rs["content"] = $str; $rs["tbl"] = $type; $rs["admin_id"] = $_SESSION["admin_id"]; } $this->model('temp')->save($rs, $id); $this->json(P_Lang('数据存储成功'), true); }
P_Lang('会员'); P_Lang('工具'); P_Lang('设置'); P_Lang('全局内容'); P_Lang('分类管理'); P_Lang('数据调用'); P_Lang('评论管理'); P_Lang('资源管理'); P_Lang('Tag标签管理'); P_Lang('订单管理'); P_Lang('付款方案'); P_Lang('货币及汇率'); P_Lang('会员列表'); P_Lang('会员组'); P_Lang('会员字段'); P_Lang('程序升级'); P_Lang('字段维护'); P_Lang('插件'); P_Lang('项目管理'); P_Lang('模块管理'); P_Lang('表单选项'); P_Lang('邮件通知模板'); P_Lang('核心配置'); P_Lang('风格管理'); P_Lang('伪静态页规则'); P_Lang('站点管理'); P_Lang('数据库管理'); P_Lang('生成静态页'); P_Lang('附件分类管理'); P_Lang('GD图片方案');
public function delete_f() { $id = $this->get('id', 'int'); if (!$id) { $this->json(P_Lang('未指定产品ID')); } $rs = $this->model('cart')->get_one($id); if (!$rs) { $this->json(P_Lang('产品不存在')); } if ($rs['cart_id'] != $this->cart_id) { $this->json(P_Lang('您没有权限执行此操作')); } $this->model('cart')->delete_product($id); $this->json(true); }
public function save_f() { $id = $this->get('id', 'int'); if (!$id) { $this->json(P_Lang('未指定ID')); } $wf = $this->model('workflow')->get_one($id); if (!$wf) { $this->json(P_Lang('工作任务不存在')); } $rs = $this->model('list')->get_one($wf['tid']); $pid = $rs["project_id"]; $parent_id = $rs["parent_id"]; $p_rs = $this->model('project')->get_one($pid); if (!$p_rs) { $this->json(P_Lang('操作异常,无法取得项目信息')); } $array = array(); //更新标识串 $array['identifier'] = $this->get("identifier"); if ($array['identifier']) { $check = $this->check_identifier($array['identifier'], $wf['tid'], $p_rs["site_id"]); if ($check != 'ok') { $this->json($check); } } $array["project_id"] = $p_rs['id']; $array["module_id"] = $p_rs["module"]; $array["site_id"] = $p_rs["site_id"]; $this->model('list')->save($array, $wf['tid']); if ($p_rs["module"]) { $ext_list = $this->model('module')->fields_all($p_rs["module"]); $tmplist = array(); $tmplist["id"] = $wf['tid']; $tmplist["site_id"] = $p_rs["site_id"]; $tmplist["project_id"] = $pid; if (!$ext_list) { $ext_list = array(); } foreach ($ext_list as $key => $value) { if ($rs[$value['identifier']]) { $value['content'] = $rs[$value['identifier']]; } $tmplist[$value["identifier"]] = $this->lib('form')->get($value); } $this->model('list')->save_ext($tmplist, $p_rs["module"]); } $is_end = $this->get('is_end', 'int'); $array = array('is_end' => $is_end); if ($is_end) { $array['endtime'] = $this->time; } $this->model('workflow')->update($array, $id); $this->json(true); }
public function mfields_f() { $id = $this->get("id"); if (!$id) { $this->json(P_Lang('未指定项目ID')); } $rs = $this->model('project')->get_one($id); if (!$rs || !$rs["module"]) { $this->json(P_Lang('无数据或未设置模块')); } $mid = $rs["module"]; $rslist = $this->model('module')->fields_all($mid); if (!$rslist) { $this->json(P_Lang('没有自定义字段')); } $list = array(); foreach ($rslist as $key => $value) { if ($value["field_type"] != "longtext" && $value["field_type"] != "longblob" && $value["field_type"] != "text") { $list[] = array("id" => $value["id"], "identifier" => $value["identifier"], "title" => $value["title"]); } } $this->json($list, true); }
public function code_f() { if ($_SESSION['user_id']) { $this->json(P_Lang('您已是本站会员,不能执行这个操作')); } if ($this->config['is_vcode'] && function_exists('imagecreate')) { $code = $this->get('_chkcode'); if (!$code) { $this->json(P_Lang('验证码不能为空')); } $code = md5(strtolower($code)); if ($code != $_SESSION['vcode']) { $this->json(P_Lang('验证码填写不正确')); } unset($_SESSION['vcode']); } $code = $this->get('_code'); if (!$code) { $this->json(P_Lang('邀请码不能为空')); } $group_id = $this->get('group_id', 'int'); if ($group_id) { $group_rs = $this->model('usergroup')->get_one($group_id); if (!$group_rs || !$group_rs['status']) { $group_id = 0; } } if (!$group_id) { $group_rs = $this->model('usergroup')->get_default(1); if (!$group_rs) { $this->json(P_Lang('注册失败,网站未开放注册权限')); } $group_id = $group_rs['id']; } if (!$group_rs['register_status'] || $group_rs['register_status'] == '1') { $this->json(P_Lang('该组不需要启用邀请码功能')); } if (!$group_rs['tbl_id']) { $this->json(P_Lang('未分配相应的验证组功能')); } $project = $this->model("project")->get_one($group_rs["tbl_id"], false); if (!$project['module']) { $this->json(P_Lang('验证库未绑定相应的模块')); } $chk_rs = $this->model("list")->get_one_condition("l.title='" . $code . "'", $project['module']); if (!$chk_rs) { $this->json(P_Lang('邀请码不存在')); } if ($chk_rs && $chk_rs["account"]) { $this->json(P_Lang('邀请码已被使用')); } if (!$chk_rs["status"]) { $this->json(P_Lang('邀请码未启用,您可以联系管理员启用')); } $url = $this->url('register', '', '_code=' . rawurlencode($code) . '&group_id=' . $group_id, 'www'); $this->json($url, true); }