public function ruleDeleted($rid = 0) { pdo_delete('vote_reply', array('rid' => $rid)); pdo_delete('vote_fans', array('rid' => $rid)); pdo_delete('vote_option', array('rid' => $rid)); return true; }
public function ruleDeleted($rid) { //删除规则时调用,这里 $rid 为对应的规则 pdo_delete('eso_runman_reply', array('rid' => $rid)); pdo_delete('eso_runman_users', array('rid' => $rid)); pdo_delete('eso_runman_submit', array('rid' => $rid)); }
public function doWebAwardlist() { global $_GPC, $_W; $id = intval($_GPC['id']); if (checksubmit('delete')) { pdo_delete('zzz_user', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } if (!empty($_GPC['wid'])) { $wid = intval($_GPC['wid']); pdo_update('zzz_user', array('status' => intval($_GPC['status'])), array('id' => $wid)); message('标识领奖成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } $pindex = max(1, intval($_GPC['page'])); $psize = 15; $where = ''; $condition = array('mobile' => " AND `b`.`mobile` LIKE '%" . $_GPC['profilevalue'] . "%'", 'realname' => " AND `b`.`realname` LIKE '%" . $_GPC['profilevalue'] . "%'", 'nickname' => " AND `b`.`nickname` LIKE '%" . $_GPC['profilevalue'] . "%'"); if (!empty($_GPC['profile'])) { $where .= $condition[$_GPC['profile']]; } $sql = 'SELECT `a`.`id`, `a`.`friendcount`, `a`.`points`, `a`.`createtime`, `a`.`sharevalue`, `b`.`realname`, `b`.`nickname`, `b`.`mobile` FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` = `a`.`fanid` LEFT JOIN ' . tablename('mc_members') . " AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid\n {$where} ORDER BY `a`.`points` DESC "; $params = array(':rid' => $id); if (empty($_GPC['export'])) { $sql .= ' LIMIT ' . ($pindex - 1) * $psize . ',' . $psize; } else { $list = pdo_fetchall($sql, $params); $tableHeader = array('realname' => '姓名', 'nickname' => '昵称', 'mobile' => '手机', 'points' => '分数'); $tableLength = count($tableHeader) + 1; /* 输入到CSV文件 */ $html = ""; /* 输出表头 */ foreach ($tableHeader as $header) { $html .= $header . "\t ,"; } $html .= "创建时间\t, \n"; /* 输出内容 */ foreach ($list as $value) { foreach ($tableHeader as $key => $header) { $html .= $value[$key] . "\t ,"; } $html .= date('Y-m-d H:i:s', $value['createtime']) . "\t ,"; $html .= "\n"; } /* 输出CSV文件 */ header("Content-type:text/csv"); header("Content-Disposition:attachment; filename=全部数据.csv"); echo $html; exit; } $list = pdo_fetchall($sql, $params); if (!empty($list)) { $sql = 'SELECT COUNT(*) FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` = `a`.`fanid` LEFT JOIN ' . tablename('mc_members') . ' AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid' . $where; $total = pdo_fetchcolumn($sql, $params); $pager = pagination($total, $pindex, $psize); } include $this->template('awardlist'); }
public function doWebList($ischeck = 1) { global $_GPC, $_W; // AJAX if ($_W['isajax']) { $op = $_GPC['op']; $id = intval($_GPC['id']); $result = array('state' => -1, 'message' => ''); if ($op == 'delete') { $item = $this->item_fetch($id); if ($item['id']) { load()->func('file'); file_delete($item['photo']); pdo_delete('qiyue_canvas', array('id' => $item['id'])); $result['state'] = 0; } } elseif ($op == 'check') { if ($this->item_check($id)) { $result['state'] = 0; } } message($result, '', 'ajax'); } $title = '图片管理'; $result = $this->all_list(array('ischeck' => $ischeck)); include $this->template('manage'); }
public function doMobiledelcomment() { global $_W, $_GPC; $cid = $_GPC['cid']; //$comment=$_GPC['cont']; //将ajax写入comment $uniacid = $_W['uniacid']; // $openid=$_W['openid']; // $ulist=$this->auth($uniacid,$openid); //var_dump($ulist); // $data=array( // 'uniacid'=>$uniacid, // 'tid'=>$tid, // 'comment'=>$comment, // 'nickname'=>$ulist['nickname'], // 'cuid'=>$ulist['uid'], // 'createtime'=>TIMESTAMP // ); // pdo_insert('enjoy_circle_comment',$data); $data['tid'] = pdo_fetchcolumn("select tid from " . tablename('enjoy_circle_comment') . " where cid=" . $cid . ""); //删除评论 $res = pdo_delete('enjoy_circle_comment', array('uniacid' => $uniacid, 'cid' => $cid)); if ($res > 0) { echo json_encode($data); } }
public function doWebAwardlist() { global $_GPC, $_W; checklogin(); //$from_user = $_W['fans']['from_user']; $id = $_GPC['id']; if (checksubmit('delete')) { pdo_delete('mgamblemoon_user', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } if (!empty($_GPC['wid'])) { $wid = intval($_GPC['wid']); pdo_update('mgamblemoon_user', array('status' => intval($_GPC['status'])), array('id' => $wid)); message('标识领奖成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } $pindex = max(1, intval($_GPC['page'])); $psize = 50; $where = ''; $condition = array('mobile' => " AND b.mobile ='{$_GPC['profilevalue']}'", 'realname' => " AND b.realname ='{$_GPC['profilevalue']}'"); if (!empty($_GPC['profile'])) { $where .= $condition[$_GPC['profile']]; } $sql = "SELECT a.id, a.award,a.createtime,a.num,a.status, b.nickname, b.mobile FROM " . tablename('mgamblemoon_user') . " AS a\n\t\t\t\tLEFT JOIN " . tablename('fans') . " AS b ON a.from_user = b.from_user WHERE a.rid = {$id} {$where} ORDER BY a.huodeid ASC LIMIT " . ($pindex - 1) * $psize . ",{$psize}"; $list = pdo_fetchall($sql); if (!empty($list)) { $total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('mgamblemoon_user') . " AS a\n\t\t\t\tLEFT JOIN " . tablename('fans') . " AS b ON a.from_user = b.from_user WHERE a.rid = '{$id}' {$where}"); $pager = pagination($total, $pindex, $psize); } include $this->template('awardlist'); }
public function doWebCredit() { // 1. display reservation // 2. add credit // 3. delete credit // 4. update credit global $_W; global $_GPC; // 获取query string中的参数 $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display'; if ($operation == 'delete') { //删除兑换请求 $id = intval($_GPC['id']); $row = pdo_fetch("SELECT id FROM " . tablename('credit_request') . " WHERE id = :id", array(':id' => $id)); if (empty($row)) { message('抱歉,编号为' . $id . '的兑换请求不存在或是已经被删除!'); } pdo_delete('credit_request', array('id' => $id)); message('删除成功!', referer(), 'success'); } else { if ($operation == 'display') { $condition = ''; $sql = "SELECT * FROM " . tablename('award_list') . " as t1," . tablename('credit_request') . "as t2 WHERE t1.award_id=t2.award_id AND t1.weid = '{$_W['weid']}' ORDER BY t2.createtime DESC"; $list = pdo_fetchall($sql); $ar = pdo_fetchall($sql, array(), 'from_user'); $fans = fans_search(array_keys($ar), array('realname', 'mobile', 'credit1', 'residedist')); } } include $this->template('credit_request'); }
public function doWebAwardlist() { global $_GPC, $_W; $id = intval($_GPC['id']); if (checksubmit('delete')) { pdo_delete('zzz_user', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } if (!empty($_GPC['wid'])) { $wid = intval($_GPC['wid']); pdo_update('zzz_user', array('status' => intval($_GPC['status'])), array('id' => $wid)); message('标识领奖成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } $pindex = max(1, intval($_GPC['page'])); $psize = 50; $where = ''; $condition = array('mobile' => " AND `b`.`mobile` LIKE '%" . $_GPC['profilevalue'] . "%'", 'realname' => " AND `b`.`realname` LIKE '%" . $_GPC['profilevalue'] . "%'", 'nickname' => " AND `b`.`nickname` LIKE '%" . $_GPC['profilevalue'] . "%'"); if (!empty($_GPC['profile'])) { $where .= $condition[$_GPC['profile']]; } $sql = 'SELECT `a`.`id`, `a`.`friendcount`, `a`.`points`, `a`.`createtime`, `b`.`realname`, `b`.`nickname`, `b`.`mobile` FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` = `a`.`fanid` LEFT JOIN ' . tablename('mc_members') . " AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid {$where} ORDER BY `a`.`points`\n DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize; $params = array(':rid' => $id); $list = pdo_fetchall($sql, $params); if (!empty($list)) { $sql = 'SELECT COUNT(*) FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` = `a`.`fanid` LEFT JOIN ' . tablename('mc_members') . ' AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid' . $where; $total = pdo_fetchcolumn($sql, $params); $pager = pagination($total, $pindex, $psize); } include $this->template('awardlist'); }
public function doWebList() { global $_GPC, $_W; checklogin(); $weid = $_W['account']['weid']; //当前公众号ID $id = intval($_GPC['id']); $condition = ''; if (!empty($_GPC['name'])) { $condition .= " AND ( grabername LIKE '%{$_GPC['realname']}%' OR fitername LIKE '%{$_GPC['realname']}%' )"; } if (!empty($_GPC['mobile'])) { $condition .= " AND ( grabermobile = '{$_GPC['mobile']}' OR fitermobile = '{$_GPC['mobile']}' )"; } if (checksubmit('delete')) { pdo_delete('grabseat_record', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page']))); } if (!empty($_GPC['wid'])) { $wid = intval($_GPC['wid']); pdo_update('grabseat_record', array('status' => intval($_GPC['status'])), array('id' => $wid)); message('标识领奖成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page']))); } $pindex = max(1, intval($_GPC['page'])); $psize = 25; $list = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize); $listtotal = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} "); $total = count($listtotal); $pager = pagination($total, $pindex, $psize); include $this->template('list'); }
public function receive() { global $_W, $_GPC; load()->func('communication'); $type = $this->message['type']; $uniacid = $GLOBALS['_W']['uniacid']; $acid = $GLOBALS['_W']['acid']; //$uniacid = $_W['acid']; $rid = intval($this->params['rule']); $rid = $this->rule; $openid = $this->message['fromusername']; $cfg = $this->module['config']; //file_put_contents(IA_ROOT.'/receive.txt', iserializer($cfg)); if ($this->message['event'] == 'unsubscribe' && $cfg['isopenjsps']) { $record = array('updatetime' => TIMESTAMP, 'follow' => '0', 'followtime' => TIMESTAMP); pdo_update('mc_mapping_fans', $record, array('openid' => $openid, 'acid' => $acid, 'uniacid' => $uniacid)); $fmvotelog = pdo_fetchall("SELECT * FROM " . tablename('fm_photosvote_votelog') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $openid, ':uniacid' => $uniacid)); foreach ($fmvotelog as $log) { $fmprovevote = pdo_fetch("SELECT * FROM " . tablename('fm_photosvote_provevote') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $log['tfrom_user'], ':uniacid' => $uniacid)); pdo_update('fm_photosvote_provevote', array('lasttime' => TIMESTAMP, 'photosnum' => $fmprovevote['photosnum'] - 1, 'hits' => $fmprovevote['hits'] - 1), array('from_user' => $log['tfrom_user'], 'uniacid' => $uniacid)); } pdo_delete('fm_photosvote_votelog', array('from_user' => $openid)); pdo_delete('fm_photosvote_bbsreply', array('from_user' => $openid)); } }
public function ruleDeleted($rid) { $form = DBUtil::findUnique(DBUtil::$TABLE_ORDER_FORM, array(":rid" => $rid)); pdo_delete(DBUtil::$TABLE_ORDER_ITEM, array("fid" => $form['id'])); pdo_delete(DBUtil::$TABLE_ORDER_ORDER, array("fid" => $form['id'])); pdo_delete(DBUtil::$TABLE_ORDER_FORM, array('id' => $form['id'])); }
public function dolist() { global $_GPC, $_W; checklogin(); $weid = intval($_W['weid']); if (checksubmit('verify') && !empty($_GPC['select'])) { pdo_update('message_list', array('isshow' => 1, 'create_time' => TIMESTAMP), " id IN ('" . implode("','", $_GPC['select']) . "')"); message('审核成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page']))); } if (checksubmit('delete') && !empty($_GPC['select'])) { pdo_delete('message_list', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page']))); } $isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : 0; $pindex = max(1, intval($_GPC['page'])); $psize = 20; $message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('message_reply') . " WHERE weid = '{$weid}' LIMIT 1"); $list = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}' ORDER BY create_time DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}"); if (!empty($list)) { $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}'"); $pager = pagination($total, $pindex, $psize); foreach ($list as &$row) { $row['content'] = emotion($row['content']); $userids[] = $row['from_user']; } unset($row); } include $this->template('list'); }
public function doMobiledelcomment() { global $_W, $_GPC; $cid = $_GPC['cid']; $uniacid = $_W['uniacid']; pdo_delete('enjoy_circle_comment', array('uniacid' => $uniacid, 'cid' => $cid)); }
public function receive() { global $_W; $wedata = pdo_fetch("SELECT * FROM " . tablename('members_status') . " WHERE uid = '{$_W['account']['uid']}' LIMIT 1"); if ($wedata) { if (TIMESTAMP > $wedata['endtime']) { $data = array(); $data['stattime'] = TIMESTAMP; $data['status'] = 1; $data['endtime'] = TIMESTAMP + 3600 * 24 * 365; pdo_update('members_status', $data, array('id' => $wedata['id'])); $nMember = array(); $nMember['uid'] = $_W['account']['uid']; $nMember['groupid'] = 1; member_update($nMember); pdo_delete('members_permission', array('uid' => $_W['account']['uid'])); } } else { $data = array(); $data['endtime'] = TIMESTAMP + 86400 * 3; $data['stattime'] = TIMESTAMP; $data['uid'] = $_W['account']['uid']; pdo_insert('members_status', $data); } }
public function doWebAddInfo() { global $_W, $_GPC; load()->func('tpl'); $infoid = intval($_GPC['infoid']); if ($infoid) { $info = pdo_fetch("SELECT * FROM " . tablename('water_query_info') . " WHERE id= " . $infoid); } if ($_GPC['op'] == 'delete') { $infoid = intval($_GPC['infoid']); $info = pdo_fetch("SELECT id FROM " . tablename('water_query_info') . " WHERE id = " . $infoid); if (empty($info)) { message('抱歉,信息不存在或是已经被删除!'); } pdo_delete('water_query_info', array('id' => $infoid)); message('删除成功!', referer(), 'success'); } if (checksubmit()) { $data = array('keyword' => $_GPC['keyword'], 'info' => htmlspecialchars_decode($_GPC['info']), 'infophoto' => $_GPC['infophoto']); if (!empty($infoid)) { pdo_update('water_query_info', $data, array('id' => $infoid)); } else { $data['uniacid'] = $_W['uniacid']; pdo_insert('water_query_info', $data); $infoid = pdo_insertid(); } message('更新成功!', referer(), 'success'); } include $this->template('addinfo'); }
public function receive() { global $_W, $_GPC; $type = $this->message['type']; $uniacid = $_W['uniacid']; $acid = $_W['acid']; $openid = $this->message['from']; $event = $this->message['event']; $cfg = $this->module['config']; file_put_contents(IA_ROOT . '/addons/fm_photosvote/test/fm_test.txt', iserializer($event)); if ($event == 'unsubscribe') { $record = array('updatetime' => TIMESTAMP, 'follow' => '0', 'unfollowtime' => TIMESTAMP); pdo_update('mc_mapping_fans', $record, array('openid' => $openid, 'acid' => $acid, 'uniacid' => $uniacid)); if ($cfg['isopenjsps']) { $fmvotelog = pdo_fetchall("SELECT tfrom_user FROM " . tablename('fm_photosvote_votelog') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $openid, ':uniacid' => $uniacid)); foreach ($fmvotelog as $log) { $fmprovevote = pdo_fetch("SELECT photosnum,hits FROM " . tablename('fm_photosvote_provevote') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $log['tfrom_user'], ':uniacid' => $uniacid)); pdo_update('fm_photosvote_provevote', array('lasttime' => TIMESTAMP, 'photosnum' => $fmprovevote['photosnum'] - 1, 'hits' => $fmprovevote['hits'] - 1), array('from_user' => $log['tfrom_user'], 'uniacid' => $uniacid)); } pdo_delete('fm_photosvote_votelog', array('from_user' => $openid)); pdo_delete('fm_photosvote_bbsreply', array('from_user' => $openid)); } } elseif ($event == 'subscribe') { if ($cfg['oauthtype'] == 2) { $wechats = pdo_fetch("SELECT * FROM " . tablename('account_wechats') . " WHERE uniacid = :uniacid ", array(':uniacid' => $_W['uniacid'])); $token = iunserializer($wechats['access_token']); $arrlog = pdo_fetch("SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid)); $access_token = $token['token']; $expire = $token['expire']; if (time() >= $expire || empty($access_token)) { $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $wechats['key'] . "&secret=" . $wechats['secret']; $html = file_get_contents($url); $arr = json_decode($html, true); $access_token = $arr['access_token']; $record = array(); $record['token'] = $access_token; $record['expire'] = time() + 3600; $row = array(); $row['access_token'] = iserializer($record); pdo_update('account_wechats', $row, array('uniacid' => $_W['uniacid'])); } $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $openid . "&lang=zh_CN"; $html = file_get_contents($url); $re = @json_decode($html, true); if (!empty($arrlog)) { $data = array('nickname' => $re['nickname'], 'unionid' => $re['unionid']); pdo_update('mc_mapping_fans', $data, array('openid' => $openid)); } else { $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid'])); $nickname = $re['nickname']; $data = array('uniacid' => $_W['uniacid'], 'nickname' => $re['nickname'], 'avatar' => $re['headimgurl'], 'groupid' => $default_groupid, 'createtime' => TIMESTAMP); pdo_insert('mc_members', $data); $id = pdo_insertid(); $data = array('nickname' => $re['nickname'], 'unionid' => $re['unionid'], 'uid' => $id); pdo_update('mc_mapping_fans', $data, array('openid' => $openid)); } } } }
public function ruleDeleted($rid) { //删除规则时调用,这里 $rid 为对应的规则编号 pdo_delete($this->table_reply, array('rid' => $rid)); pdo_delete($this->table_fans, array('rid' => $rid)); pdo_delete($this->table_rank, array('rid' => $rid)); return true; }
public function doWebdatadelete() { global $_W, $_GPC; $uniacid = $_W['uniacid']; $id = $_GPC['id']; pdo_delete("lee_tlvoice_record", array('id' => $id)); message("删除成功", referer(), 'success'); }
public function ruleDeleted($rid) { //删除规则时调用,这里 $rid 为对应的规则编号 pdo_delete($this->modulename . "_rule", array('rid' => $rid)); pdo_delete($this->modulename . "_player", array('rid' => $rid)); pdo_delete($this->modulename . "_share", array('rid' => $rid)); pdo_delete($this->modulename . "_prize", array('rid' => $rid)); }
public function doWebDeleteFans() { global $_GPC, $_W; $rid = intval($_GPC['rid']); $id = intval($_GPC['id']); pdo_delete("ewei_dream_fans", array("id" => $id)); message('规则操作成功!', $this->createWebUrl('fans', array('rid' => $rid)), 'success'); }
public function deleteById($id) { $item = $this->selectById($id); if (empty($item)) { throw new Exception("无法删除,因为这条数据不存在", 402); } pdo_delete($this->table_name, array('id' => $id)); }
public function doWebDelete() { global $_W, $_GPC; $id = $_GPC['id']; if (!empty($id)) { pdo_delete($this->manage, array('weid' => $_W['weid'], 'id' => $id)); message('删除成功', referer(), 'success'); } }
public function ruleDeleted($rid) { //删除规则时调用,这里 $rid 为对应的规则编号 /* * 此处可能需要一些权限及数据方面的判断 * 除了表数据可能还需要删除一些附带的图片等资源 */ pdo_delete($this->table_reply, array('rid' => $rid)); }
public function fieldsFormSubmit($rid) { //规则验证无误保存入库时执行,这里应该进行自定义字段的保存。这里 $rid 为对应的规则编号 global $_W, $_GPC; if (!empty($_GPC['reid'])) { pdo_delete('multisearch_reply', array('rid' => $rid)); pdo_insert('multisearch_reply', array('rid' => $rid, 'reid' => intval($_GPC['reid']))); } }
public function doDelete() { global $_GPC, $_W; $id = intval($_GPC['id']); $rid = intval($_GPC['rid']); if (!empty($id) && !empty($rid)) { pdo_delete('wcha_reply', array('id' => $id, 'rid' => $rid)); } }
public function remove($id) { global $_W; $filter = array(); $filter['uniacid'] = $_W['uniacid']; $filter['id'] = $id; pdo_delete('mbsk_devices', $filter); return true; }
public function doWebAwardlist() { global $_GPC, $_W; $id = intval($_GPC['id']); if (checksubmit('delete')) { if (empty($_GPC['select'])) { message('请选择需要删除的数据', referer(), 'error'); } pdo_delete('bbb_user', ' id IN (' . implode(',', $_GPC['select']) . ')'); message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page']))); } $where = ' WHERE `a`.`rid` = :rid AND `f`.`uniacid` = :uniacid'; $params = array(':rid' => intval($_GPC['id']), ':uniacid' => $_W['uniacid']); $join = ' FROM ' . tablename('bbb_user') . ' AS `a` JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `a`.`from_user` = `f`.`openid`'; if (!empty($_GPC['nickname'])) { $where .= ' AND `f`.`nickname` LIKE :nickname'; $params[':nickname'] = '%' . $_GPC['nickname'] . '%'; } $sql = 'SELECT COUNT(*) ' . $join . $where; $total = pdo_fetchcolumn($sql, $params); if ($total > 0) { $pindex = max(1, intval($_GPC['page'])); $psize = 15; $sql = 'SELECT `a`.`id`, `a`.`points`, `a`.`createtime`, `f`.`nickname` ' . $join . $where . ' ORDER BY `a`.`points` DESC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize; $list = pdo_fetchall($sql, $params); $pager = pagination($total, $pindex, $psize); } if (!empty($_GPC['export'])) { /* 输入到CSV文件 */ $html = ""; /* 输出表头 */ $filter = array('nickname' => '昵称', 'points' => '分数', 'createtime' => '时间'); foreach ($filter as $key => $value) { $html .= $value . "\t,"; } $html .= "\n"; foreach ($list as $key => $value) { foreach ($filter as $index => $title) { if ($index != 'createtime') { $html .= $value[$index] . "\t, "; } else { $html .= date('Y-m-d H:i:s', $value[$index]) . "\t, "; } } $html .= "\n"; } /* 输出CSV文件 */ header("Content-type:text/csv"); header("Content-Disposition:attachment; filename=全部数据.csv"); echo $html; exit; } include $this->template('awardlist'); }
public function doDelete() { global $_GPC, $_W; $id = intval($_GPC['id']); $rid = intval($_GPC['rid']); if (!empty($id) && !empty($rid)) { pdo_delete('xc_article_article_reply', array('id' => $id, 'rid' => $rid)); } message('删除成功!', referer(), 'success'); }
public function ruleDeleted($rid) { //删除规则时调用,这里 $rid 为对应的规则编号 if (pdo_tableexists('dream_wish')) { pdo_delete('dream_wish', array('rid' => $rid)); } if (pdo_tableexists('dream_reply')) { pdo_delete('dream_reply', array('rid' => $rid)); } }
function biz_Print_Delete($data, $module) { $sql = " SELECT * FROM " . tablename('printer') . " where id=:id "; $print = pdo_fetch($sql, array(':id' => $data['index'])); if (!empty($print) && $print['title'] == $data['name'] && $print['moduleid'] == $module['id']) { pdo_delete('printer', array('id' => $print['id'])); return true; } return false; }