本文整理汇总了PHP中FileUtil::copyFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtil::copyFile方法的具体用法?PHP FileUtil::copyFile怎么用?PHP FileUtil::copyFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtil
的用法示例。
在下文中一共展示了FileUtil::copyFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reading_root_init
public static function reading_root_init()
{
if (is_dir(I3GEEK_READING_ROOT . "css/") && file_exists(I3GEEK_READING_ROOT . "qrcode")) {
//完成,没问题
} else {
FileUtil::copyDir(I3GEEK_READING_PLUGIN_ROOT . "reading/css", I3GEEK_READING_ROOT . "css", true);
FileUtil::copyFile(I3GEEK_READING_PLUGIN_ROOT . "reading/qrcode", I3GEEK_READING_ROOT . "qrcode", true);
}
}
示例2: update
function update()
{
header("Content-Type:text/html; charset=utf-8");
//获取经办人的信息
$usr = M('usr');
$usross = $usr->where('usrid=' . session('usridss'))->find();
$stdid = $_POST['stdid'];
$xqid = $_POST['f_stdxqcls_xqid'];
if ($stdid == 0) {
$f_mj_bxxsid = $_POST['f_mj_bxxsid'];
$f_std_grdid = $_POST['f_std_grdid'];
$grd = M('grd');
$grdo = $grd->where('grdid=' . $f_std_grdid)->find();
$std = M($grdo['grdnm'] . '_std');
$bxxs = M('bxxs');
$bxxso = $bxxs->where('bxxsid=' . $f_mj_bxxsid)->find();
if (preg_match('/技能/', $bxxso['bxxsnm']) || preg_match('/自考/', $bxxso['bxxsnm'])) {
if ($_POST['stdaplno'] != '') {
$stdaplno = $_POST['stdaplno'];
} else {
$bxxs = M('bxxs');
$bxxso = $bxxs->where('bxxsid=' . $f_mj_bxxsid)->find();
$stdaplno = '';
if (preg_match('/技能/', $bxxso['bxxsnm']) || preg_match('/自考/', $bxxso['bxxsnm'])) {
if (preg_match('/技能/', $bxxso['bxxsnm'])) {
$stdaplno = 'J' . $grdo['grdnm'];
} else {
if (preg_match('/自考/', $bxxso['bxxsnm'])) {
$stdaplno = 'Z' . $grdo['grdnm'];
}
}
$stdls = $std->field('stdaplno')->where("stdaplno LIKE '%" . $stdaplno . "%'")->order('stdaplno DESC')->select();
if (count($stdls) > 0) {
$stdo = $stdls[0];
$hou = substr($stdo['stdaplno'], 5);
$hounew = intval($hou) + 1;
if (intval($hounew / 1000) > 0) {
$k = 0;
} else {
if (intval($hounew / 100) > 0) {
$k = 1;
} else {
if (intval($hounew / 10) > 0) {
$k = 2;
} else {
$k = 3;
}
}
}
} else {
$k = 3;
$hounew = 1;
}
$ling = '';
for ($i = 0; $i < $k; $i++) {
$ling = $ling . '0';
}
$stdaplno = $stdaplno . $ling . $hounew;
}
}
} else {
$stdaplno = '';
//一般都是空的,这里保留就是为了留个后门
}
//如果有学号就把文件名称改掉并从std/tmp/迁徙回来
if ($_POST['stdpt'] && $_POST['stdpt'] != C('PUBLIC') . '/IMG/default.jpg' && $_POST['stdno'] && !preg_match($_POST['stdno'], $_POST['stdpt'])) {
$sys = M('sys');
$syso = $sys->find();
$stdpt = str_replace('/' . $syso['sysnm'] . '/', './', $_POST['stdpt']);
import('@.FileUtil.FileUtilAction');
$fu = new FileUtil();
$fu->copyFile($stdpt, './Uploads/std/' . $grdo['grdnm'] . '/' . $_POST['f_std_sttid'] . '/' . $_POST['stdno'] . '.jpg');
$stdpt = '/' . $syso['sysnm'] . '/Uploads/std/' . $grdo['grdnm'] . '/' . $_POST['f_std_sttid'] . '/' . $_POST['stdno'] . '.jpg';
} else {
$stdpt = $_POST['stdpt'];
}
//先截获数据//学生基本部分
$data = array('f_std_sttid' => $_POST['f_std_sttid'], 'f_std_grdid' => $_POST['f_std_grdid'], 'stdaplno' => $stdaplno, 'stdno' => $_POST['stdno'], 'stdupfnctm' => $_POST['stdupfnctm'], 'stdnm' => $_POST['stdnm'], 'stdpw' => md5('11111111'), 'stdpt' => $stdpt, 'f_std_sexid' => $_POST['f_std_sexid'], 'f_std_rcid' => $_POST['f_std_rcid'], 'f_std_zzmmid' => $_POST['f_std_zzmmid'], 'stdnp' => $_POST['stdnp'], 'stdbtd' => $_POST['stdbtd'], 'stdsol' => $_POST['stdsol'], 'stdcee' => $_POST['stdcee'], 'stdsog' => $_POST['stdsog'], 'stdqq' => $_POST['stdqq'], 'f_std_xlid' => $_POST['f_std_xlid'], 'stdidcd' => strtoupper($_POST['stdidcd']), 'stdcp' => $_POST['stdcp'], 'stdrlta' => $_POST['stdrlta'], 'stdrltanm' => $_POST['stdrltanm'], 'stdrltaocpt' => $_POST['stdrltaocpt'], 'stdrltacp' => $_POST['stdrltacp'], 'stdrltb' => $_POST['stdrltb'], 'stdrltbnm' => $_POST['stdrltbnm'], 'stdrltbocpt' => $_POST['stdrltbocpt'], 'stdrltbcp' => $_POST['stdrltbcp'], 'stdhb' => $_POST['stdhb'], 'f_std_statid' => $_POST['f_std_statid'], 'stdpst' => $_POST['stdpst'], 'stdads' => $_POST['stdads'], 'stdmdftm' => date("Y-m-d H:i:s", time()), 'stdaddtm' => date("Y-m-d H:i:s", time()), 'stdtlp' => $_POST['stdtlp'], 'stdpertm' => $_POST['stdpertm'], 'stdertm' => $_POST['stdertm'], 'stdicbc' => $_POST['stdicbc'], 'stdrcmdnm' => $_POST['stdrcmdnm'], 'stdrcmdcp' => $_POST['stdrcmdcp'], 'stdpnttm' => $_POST['stdpnttm']);
//查一查有没有同名学生网名
if ($std->where("stdidcd='" . $data['stdidcd'] . "'")->find()) {
$data['status'] = 1;
$this->ajaxReturn($data, 'json');
} else {
if (substr($data['stdidcd'], 6, 4) . '-' . substr($data['stdidcd'], 10, 2) . '-' . substr($data['stdidcd'], 12, 2) != $data['stdbtd']) {
$data['status'] = 4;
$this->ajaxReturn($data, 'json');
} else {
if ($std->data($data)->add()) {
$data['status'] = 2;
$stdo = $std->field('stdid')->where("stdidcd='" . $data['stdidcd'] . "'")->find();
//注册学生到新班级新专业//班级有则注册,没有也必须占坑,这样在innerjoin的时候不至于因为木有,而导致数据无法获得,从而减小因为这个BUG造成的一系列的问题,专业必须注册
$stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
$dt = array('f_stdxqcls_stdid' => $stdo['stdid'], 'f_stdxqcls_xqid' => $_POST['f_stdxqcls_xqid'], 'f_stdxqcls_clsid' => $_POST['f_stdxqcls_clsid']);
$stdxqcls->data($dt)->add();
$stdxqmj = M($grdo['grdnm'] . '_stdxqmj');
$dt = array('f_stdxqmj_stdid' => $stdo['stdid'], 'f_stdxqmj_xqid' => $_POST['f_stdxqmj_xqid'], 'f_stdxqmj_mjid' => $_POST['f_stdxqmj_mjid']);
$stdxqmj->data($dt)->add();
$stdxqdm = M($grdo['grdnm'] . '_stdxqdm');
$dt = array('f_stdxqdm_stdid' => $stdo['stdid'], 'f_stdxqdm_xqid' => $_POST['f_stdxqdm_xqid'], 'f_stdxqdm_dmid' => $_POST['f_stdxqdm_dmid']);
$stdxqdm->data($dt)->add();
//.........这里部分代码省略.........
示例3: copyDir
/**
* 复制文件夹
*
* @param string $oldDir
* @param string $aimDir
* @param boolean $overWrite 该参数控制是否覆盖原文件
* @return boolean
*/
function copyDir($oldDir, $aimDir, $overWrite = false)
{
$aimDir = str_replace('', '/', $aimDir);
$aimDir = substr($aimDir, -1) == '/' ? $aimDir : $aimDir . '/';
$oldDir = str_replace('', '/', $oldDir);
$oldDir = substr($oldDir, -1) == '/' ? $oldDir : $oldDir . '/';
if (!is_dir($oldDir)) {
return false;
}
if (!file_exists($aimDir)) {
FileUtil::createDir($aimDir);
}
$dirHandle = opendir($oldDir);
while (false !== ($file = readdir($dirHandle))) {
if ($file == '.' || $file == '..') {
continue;
}
if (!is_dir($oldDir . $file)) {
FileUtil::copyFile($oldDir . $file, $aimDir . $file, $overWrite);
} else {
FileUtil::copyDir($oldDir . $file, $aimDir . $file, $overWrite);
}
}
return closedir($dirHandle);
}
示例4: plpxh
function plpxh()
{
$mk = $_GET['mk'];
$tm = date("Y-m-d H:i:s", time());
//左 专业id 右班级id 对照表
$dzb = array('1' => '18', '2' => '17', '3' => '8', '4' => '17', '5' => '17', '6' => '18', '7' => '17', '9' => '19', '10' => '19', '11' => '19', '12' => '16');
$zssz = M('zssz');
$zsszo = $zssz->find();
$grdid = $zsszo['f_zssz_grdid'];
$xqid = $zsszo['f_zssz_xqid'];
$grd = M('grd');
$grdo = $grd->where('grdid=' . $grdid)->find();
$cls = M($grdo['grdnm'] . '_cls');
$std = M($grdo['grdnm'] . '_std');
$std->join('inner join tb_' . $grdo['grdnm'] . '_stdxqdm ON stdid=f_stdxqdm_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
if ($mk == 'all') {
$where = "f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_stdxqdm_xqid=" . $xqid . " AND f_std_statid<>9";
} else {
if ($mk == 'zp') {
$where = "f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_stdxqdm_xqid=" . $xqid . " AND f_std_statid<>9 AND stdpt NOT LIKE '%default%'";
}
}
$where = $where . " AND stdno=''";
//取消了stdupfnctm 只针对学号没编的童鞋
$stdls = $std->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_dm ON f_stdxqdm_dmid=dmid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where($where)->order('mjnm ASC,stdaplno ASC')->select();
//先安排班级登记,然后获得前缀编学号,最后在pxh表里登记
$stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
$zspxh = M($grdo['grdnm'] . '_zspxh');
foreach ($stdls as $stdv) {
//通过专业-》班级
if ($stdv['stdno'] == '') {
//如果这货还没有编学号的话
$stdxqclso = $stdxqcls->where('f_stdxqcls_stdid=' . $stdv['stdid'] . ' AND f_stdxqcls_xqid=' . $xqid)->find();
$dt = array('f_stdxqcls_clsid' => $dzb[$stdv['f_stdxqmj_mjid']]);
$clso = $cls->where('clsid=' . $dzb[$stdv['f_stdxqmj_mjid']])->find();
$stdxqcls->where('stdxqclsid=' . $stdxqclso['stdxqclsid'])->setField($dt);
//为了防止转来的学生学号成为最大,影响整体的学号前缀,因此,我们只考虑原配的学号前缀已有的最大的那个童鞋去+1,这样就不会有重复了,不用管是否有学生转学来转学去
$stdlsforststdno = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_std ON f_stdxqcls_stdid=stdid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where("stdno LIKE '%" . $clso['clsxhprx'] . "%'")->order('stdno DESC')->select();
//查出一个班里的人,不管阿猫阿狗走了没走,只能在最大的数字上开刀
//先搞定学号,让后转移照片到指定文件夹
if ($stdlsforststdno) {
//有班级同学的话可以看其他同学的型号//取第一个最大的
$stdoclsmt = $stdlsforststdno[0];
if ($stdoclsmt['stdno'] == '') {
$stdno = $clso['clsxhprx'] . '01';
} else {
$tmp = explode($clso['clsxhprx'], $stdoclsmt['stdno']);
$tmp = intval($tmp[1]) + 1;
if (floor($tmp / 10) == 0) {
$stdno = $clso['clsxhprx'] . '0' . $tmp;
} else {
$stdno = $clso['clsxhprx'] . $tmp;
}
}
} else {
//没班级同学的话可以+
$stdno = $clso['clsxhprx'] . '01';
}
//排学号时,发现有非默认照片且没上传过,那么就给他传给指定文件夹一记,否则就照旧
if (strpos($stdv['stdpt'], 'default') == false && strpos($stdv['stdpt'], 'tmp') == true) {
$sys = M('sys');
$syso = $sys->find();
$stdpt = str_replace('/' . $syso['sysnm'] . '/', './', $stdv['stdpt']);
import('@.FileUtil.FileUtilAction');
$fu = new FileUtil();
$fu->copyFile($stdpt, './Uploads/std/' . $grdo['grdnm'] . '/1/' . $stdno . '.jpg');
$stdpt = '/' . $syso['sysnm'] . '/Uploads/std/' . $grdo['grdnm'] . '/1/' . $stdno . '.jpg';
} else {
$stdpt = $stdv['stdpt'];
}
$dt = array('stdno' => $stdno, 'stdpt' => $stdpt);
$std->where('stdid=' . $stdv['stdid'])->setField($dt);
$dt = array('f_zspxh_grdid' => $grdid, 'f_zspxh_stdid' => $stdv['stdid'], 'zspxhtm' => $tm, 'zspxhschqtm' => '');
$zspxh->data($dt)->add();
}
}
$data['status'] = 1;
$this->ajaxReturn($data, 'json');
}
示例5: lookupDocumentCollate
function lookupDocumentCollate($realfile = 0)
{
$model = D("MisFileManager");
$step = $_POST["step"];
if ($step == 2) {
$id = $_POST["id"] ? $_POST["id"] : 0;
$t = $_POST["t"] ? $_POST["t"] : 0;
$parentid = $_POST["parentid"] ? $_POST["parentid"] : 0;
if ($parentid <= 0) {
$this->error("不能归档到跟目录!");
}
$parentinfo = $model->find($parentid);
$data = array();
$data["category"] = $parentinfo["category"];
$data["remark"] = $_POST["remark"];
$data["orderno"] = $_POST["orderno"];
$data["position"] = $_POST["position"];
$data["page"] = $_POST["page"];
$data["type"] = 2;
$data["parentid"] = $parentid;
$data["createid"] = $_SESSION[C('USER_AUTH_KEY')];
$data["createtime"] = time();
if ($t == 0) {
//$t=时是附件归档
$model_t0 = M("mis_attached_record");
$info = $model_t0->find($id);
import('@.ORG.FileUtil');
$FileUtil = new FileUtil();
$socurse = UPLOAD_PATH . $info['attached'];
if (file_exists($socurse)) {
$basename = pathinfo($info['attached']);
$data["filepath"] = $parentinfo["filepath"] . "/" . $basename["basename"];
//查询是否已经归档
$fileList = $model->where(array('category' => $data["category"], 'filepath' => $data["filepath"], 'status' => 1))->select();
if ($fileList) {
$this->error('已经归档过了');
exit;
}
$data["uploadname"] = $basename["basename"];
$data["name"] = $info["upname"];
$to = UPLOAD_PATH . "MisFileManager/" . $data["filepath"];
$data["type"] = 0;
$FileUtil->copyFile($socurse, $to);
}
}
if ($t == 1) {
//$t=1知识库
$model_t1 = M("mis_knowledge_list");
$info = $model_t1->find($id);
$data["name"] = "文章_" . $info["title"] . "_" . date("ymd", time());
$data["filepath"] = "<a rel='__MODULE__view' target='navTab' href='__APP__/MisKnowledgeList/view/id/" . $id . "' title='" . $info["title"] . "'>查看</a>";
}
$model->data($data);
$result = $model->add();
if ($result) {
$this->success(L('_SUCCESS_'));
} else {
$this->error(L('_ERROR_'));
}
} else {
$id = $_GET["id"] ? $_GET["id"] : 0;
$t = $_GET["t"] ? $_GET["t"] : 0;
$this->assign('id', $id);
$this->assign('t', $t);
$managerid = array(1);
$sytlist = array();
$action = A("MisFileManager");
$arr[] = array("id" => 0, "pId" => -1, "realid" => 0, "category" => 0, "name" => "文档树形结构", "open" => true, "title" => "文档树形结构");
//系统默认的文件夹
$map = array();
$map['type'] = 1;
//文件夹
$map['status'] = 1;
//状态为正常
$map['issystem'] = 1;
//为系统文件
$map['category'] = array("neq", 5);
$sytlist = $model->where($map)->select();
$sytlist = array_merge($arr, $sytlist);
$map = array();
//查询我的文件夹
$map['type'] = 1;
$map['status'] = 1;
$map['category'] = 1;
$map['issystem'] = 0;
$map['createid'] = $_SESSION[C('USER_AUTH_KEY')];
$list = $model->where($map)->select();
if ($list) {
$sytlist = array_merge($sytlist, $list);
foreach ($list as $k => $v) {
array_push($managerid, $v["id"]);
}
}
//查询单位 公文
if ($_SESSION['a']) {
//如果是管理员不过滤
unset($map);
$map['type'] = 1;
$map['status'] = 1;
$map['category'] = array("not in", array(1, 5));
//.........这里部分代码省略.........
示例6: upgradePackage
function upgradePackage()
{
$nodeids = $_GET["id"];
$step = $_POST["step"];
if ($step == 2) {
$nodeids = $_POST["id"];
if ($nodeids) {
$ids = explode(",", $nodeids);
$nodeMap["id"] = array("in", $ids);
$nodeModel = M("node");
$nodearr = $nodeModel->where($nodeMap)->select();
//打包对应模块的数据库节点权限部分,如需打包数据库模块对应表需自己导出sql
if ($_POST['nodesql']) {
$sqlnode = $this->bulidNodeSql($nodearr);
}
$relatedfile = $_POST['relatedfile'];
//打包所需基本程序文件
if ($relatedfile) {
foreach ($nodearr as $k => $v) {
$modelname = $v["name"];
$a = LIB_PATH . "Action/" . $modelname . "Action.class.php";
$m = LIB_PATH . "Model/" . $modelname . "Model.class.php";
$t = TMPL_PATH . C('DEFAULT_THEME') . "/" . $modelname;
$d = APP_PATH . "Dynamicconf/Models/" . $modelname;
import('@.ORG.FileUtil');
$FileUtil = new FileUtil();
if (file_exists($a)) {
$a_a = APP_PATH . "/modelpack/" . $modelname . "/Admin/Lib/Action/" . $modelname . "Action.class.php";
$FileUtil->copyFile($a, $a_a);
}
if (file_exists($m)) {
$m_m = APP_PATH . "/modelpack/" . $modelname . "/Admin/Lib/Model/" . $modelname . "Model.class.php";
$FileUtil->copyFile($m, $m_m);
}
if (is_dir($t)) {
$t_t = APP_PATH . "/modelpack/" . $modelname . "/Admin/Tpl/" . C('DEFAULT_THEME') . "/" . $modelname;
$FileUtil->copyDirIncludeChildren($t, $t_t);
}
if (is_dir($d)) {
$d_d = APP_PATH . "/modelpack/" . $modelname . "/Admin/Dynamicconf/Models/" . $modelname;
$FileUtil->copyDirIncludeChildren($d, $d_d);
}
$this->getMd5fileByModel($modelname);
}
}
//othersql
$this->success("打包成功");
} else {
$this->error("找不到相应打包模块");
}
} else {
$ids = explode(",", $nodeids);
$nodeMap['level'] = array("in", array(1, 2, 4));
$nodeMap['id'] = array("in", $ids);
$nodeModel = M("node");
$count = $nodeModel->where($nodeMap)->find();
//echo $nodeModel->getLastsql();
if ($count) {
$this->error("只能选择对模块打包!");
}
$this->assign("ids", $nodeids);
$this->display();
}
}
示例7: update
function update()
{
header("Content-Type:text/html; charset=utf-8");
$stdid = $_POST['stdid'];
$zssz = M('zssz');
$zsszo = $zssz->find();
$grdid = $zsszo['f_zssz_grdid'];
$xqid = $zsszo['f_zssz_xqid'];
if ($stdid == 0) {
$f_mj_bxxsid = $_POST['f_mj_bxxsid'];
$f_std_grdid = $grdid;
$grd = M('grd');
$grdo = $grd->where('grdid=' . $f_std_grdid)->find();
$std = M($grdo['grdnm'] . '_std');
$bxxs = M('bxxs');
$bxxso = $bxxs->where('bxxsid=' . $f_mj_bxxsid)->find();
if (preg_match('/技能/', $bxxso['bxxsnm']) || preg_match('/自考/', $bxxso['bxxsnm'])) {
if ($_POST['stdaplno'] != '') {
$stdaplno = $_POST['stdaplno'];
} else {
$bxxs = M('bxxs');
$bxxso = $bxxs->where('bxxsid=' . $f_mj_bxxsid)->find();
$stdaplno = '';
if (preg_match('/技能/', $bxxso['bxxsnm']) || preg_match('/自考/', $bxxso['bxxsnm'])) {
if (preg_match('/技能/', $bxxso['bxxsnm'])) {
$stdaplno = 'J' . $grdo['grdnm'];
} else {
if (preg_match('/自考/', $bxxso['bxxsnm'])) {
$stdaplno = 'Z' . $grdo['grdnm'];
}
}
$stdls = $std->field('stdaplno')->where("stdaplno LIKE '%" . $stdaplno . "%'")->order('stdaplno DESC')->select();
if (count($stdls) > 0) {
$stdo = $stdls[0];
$hou = substr($stdo['stdaplno'], 5);
$hounew = intval($hou) + 1;
if (intval($hounew / 1000) > 0) {
$k = 0;
} else {
if (intval($hounew / 100) > 0) {
$k = 1;
} else {
if (intval($hounew / 10) > 0) {
$k = 2;
} else {
$k = 3;
}
}
}
} else {
$k = 3;
$hounew = 1;
}
$ling = '';
for ($i = 0; $i < $k; $i++) {
$ling = $ling . '0';
}
$stdaplno = $stdaplno . $ling . $hounew;
}
}
//可以只能计算学生的默认住宿
if (preg_match('/技能/', $bxxso['bxxsnm'])) {
$dmid = 3;
} else {
if ($_POST['f_std_sexid'] == 1) {
$dmid = 2;
} else {
if ($_POST['f_std_sexid'] == 2) {
$dmid = 1;
}
}
}
} else {
$stdaplno = '';
//一般都是空的,这里保留就是为了留个后门
//默认住宿
$dmid = 4;
}
//如果有学号就把文件名称改掉并从std/tmp/迁徙回来
if ($_POST['stdpt'] && $_POST['stdpt'] != C('PUBLIC') . '/IMG/default.jpg' && $_POST['stdno'] && !preg_match($_POST['stdno'], $_POST['stdpt'])) {
$sys = M('sys');
$syso = $sys->find();
$stdpt = str_replace('/' . $syso['sysnm'] . '/', './', $_POST['stdpt']);
import('@.FileUtil.FileUtilAction');
$fu = new FileUtil();
$fu->copyFile($stdpt, './Uploads/std/' . $grdo['grdnm'] . '/' . $_POST['f_std_sttid'] . '/' . $_POST['stdno'] . '.jpg');
$stdpt = '/' . $syso['sysnm'] . '/Uploads/std/' . $grdo['grdnm'] . '/' . $_POST['f_std_sttid'] . '/' . $_POST['stdno'] . '.jpg';
} else {
$stdpt = $_POST['stdpt'];
}
//先截获数据//学生基本部分
$data = array('f_std_sttid' => 1, 'f_std_grdid' => $grdid, 'stdaplno' => $stdaplno, 'stdno' => '', 'stdupfnctm' => '', 'stdnm' => $_POST['stdnm'], 'stdpw' => md5('11111111'), 'stdpt' => $stdpt, 'f_std_sexid' => $_POST['f_std_sexid'], 'f_std_rcid' => $_POST['f_std_rcid'], 'f_std_zzmmid' => $_POST['f_std_zzmmid'], 'stdnp' => $_POST['stdnp'], 'stdbtd' => $_POST['stdbtd'], 'stdsol' => $_POST['stdsol'], 'stdcee' => $_POST['stdcee'], 'stdsog' => $_POST['stdsog'], 'stdqq' => $_POST['stdqq'], 'f_std_xlid' => $_POST['f_std_xlid'], 'stdidcd' => strtoupper($_POST['stdidcd']), 'stdcp' => $_POST['stdcp'], 'stdrlta' => $_POST['stdrlta'], 'stdrltanm' => $_POST['stdrltanm'], 'stdrltaocpt' => $_POST['stdrltaocpt'], 'stdrltacp' => $_POST['stdrltacp'], 'stdrltb' => $_POST['stdrltb'], 'stdrltbnm' => $_POST['stdrltbnm'], 'stdrltbocpt' => $_POST['stdrltbocpt'], 'stdrltbcp' => $_POST['stdrltbcp'], 'stdhb' => $_POST['stdhb'], 'f_std_statid' => 1, 'stdpst' => $_POST['stdpst'], 'stdads' => $_POST['stdads'], 'stdmdftm' => date("Y-m-d H:i:s", time()), 'stdaddtm' => date("Y-m-d H:i:s", time()), 'stdtlp' => $_POST['stdtlp'], 'stdpertm' => '', 'stdertm' => '', 'stdicbc' => '', 'stdrcmdnm' => $_POST['stdrcmdnm'], 'stdrcmdcp' => $_POST['stdrcmdcp'], 'stdpnttm' => '');
//查一查有没有同名学生网名
if ($std->where("stdidcd='" . $data['stdidcd'] . "'")->find()) {
$data['status'] = 1;
$this->ajaxReturn($data, 'json');
} else {
if (substr($data['stdidcd'], 6, 4) . '-' . substr($data['stdidcd'], 10, 2) . '-' . substr($data['stdidcd'], 12, 2) != $data['stdbtd']) {
$data['status'] = 4;
$this->ajaxReturn($data, 'json');
//.........这里部分代码省略.........