摘要: //php后台返回JSON数据 $pageIndex = intval($this->input->get('pageIndex')); $test = $this->homepage_model->getPrizeLogLists($pageIndex, 10); $test = eval('return ' . iconv('gbk', 'UTF-8', var_export($test, true) . ';')); exit(j... 阅读全文
posted @ 2014-01-03 13:51 耐得住寂寞 阅读(7101) 评论(0) 推荐(0) 编辑
摘要: //参数初始化 $filePath = ''; if ($_FILES["file"]["error"] > 0) { returnJSON(ERROR_INVALID, $_FILES["file"]["error"]); } $filePath = $_FILES["file"]["tmp_name"]; //建立reader对象 $this->load->library('PHPExcel'); $PHPReader = 阅读全文
posted @ 2013-12-19 17:39 耐得住寂寞 阅读(1072) 评论(0) 推荐(0) 编辑
摘要: //浏览器输出excel header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="dzg_card_info.xlsx"'); header('Cache-Control: max-age=0'); $this->load->library('PHPExcel'); //加载类 阅读全文
posted @ 2013-12-19 14:35 耐得住寂寞 阅读(14620) 评论(1) 推荐(1) 编辑
摘要: /** * 可变长字符串,相比较加号更节省内存空间,对于大量字符串拼接时建议使用。 * 示:{@code * var html = new StringBuilder(); * html.append(''); html.toString(); } * */function StringBuilder() { this._strings = [];}StringBuilder.prototype.append = function(val) { this._strings.push(val);}StringBuilder.prototype.clear = function(. 阅读全文
posted @ 2013-11-11 15:17 耐得住寂寞 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 问题描述:公司的登录接口使用的是jquery1.4.2,因为我要使用一个jquery.pagination的分页控件(jquery1.7.2).如果我使用了1.7.2,登录接口会有问题.<script src="../js/jquery-1.10.0.js"></script> <script> var jq110 = jQuery.noConflict(true); </script> <script src="../js/jquery-1.4.2.min.js"></script> 阅读全文
posted @ 2013-06-18 10:57 耐得住寂寞 阅读(4695) 评论(0) 推荐(1) 编辑
摘要: <form id="formBug" name="formBug" method="post" action="http://events.tiancity.com/cp/collect/api/collect_bug.php" enctype="multipart/form-data" target="app_iframe" onsubmit="return validateForm(this);"> <table width=&quo 阅读全文
posted @ 2013-05-28 10:40 耐得住寂寞 阅读(204) 评论(0) 推荐(0) 编辑
摘要: <?php/* 大致思想就是:将剩余展示数目累加比如:A:5,B:8,C:10累加后:A:5,B:13,C:23然后随即一个数,范围0~23判断 随机数是否小于A或B或C,小于则成功 效果:谁的剩余展示数目越多,被随机到的几率越高*/function pc_rand_weighted($numbers) { $total = 0; foreach ( $numbers as $number => $weight ) { $total += $weight; $distribution [$number] = $total; } $rand =... 阅读全文
posted @ 2013-04-27 17:50 耐得住寂寞 阅读(356) 评论(0) 推荐(0) 编辑