public function reBdpHandle() { $info = photoUpload(); $pn = $info[photo]['savepath'] . $info[photo]['savename']; $id = $_GET['id']; if ($info) { $arr = array('bname' => I('bname'), 'fpara' => I('fpara'), 'home' => I('home'), 'email' => I('email'), 'introduction' => I('introduction'), 'pathname' => $pn); $db = M('bdpeople')->where(array('id' => $id))->save($arr); if ($db) { $this->success('修改成功!', U('Admin/Index/listBdp')); } else { $this->error('修改失败!', U('Admin/Index/listBdp')); } } else { $arr = array('bname' => I('bname'), 'fpara' => I('fpara'), 'home' => I('home'), 'email' => I('email'), 'introduction' => I('introduction')); $db = M('bdpeople')->where(array('id' => $id))->save($arr); if ($db) { $this->success('修改成功!', U('Admin/Index/listBdp')); } else { $this->error('修改失败!', U('Admin/Index/listBdp')); } } }
public function addlpichandle() { $info = photoUpload(); $pn = $info['photo']['savepath'] . $info['photo']['savename']; $db = M('lpic')->add(array('pathname' => $pn)); if ($db) { $this->success('添加成功!', U('Admin/Lab/listlpic')); } else { $this->error('添加失败!', U('Admin/Lab/lsitlpic')); } }
function xiugai($tablename, $id) { $info = photoUpload(); if ($info) { $pathname = $info['photo']['savepath'] . $info['photo']['savename']; $arr = array('pathname' => $pathname, 'ptitle' => I('ptitle'), 'pcontent' => I('pcontent')); $db = M($tablename)->where(array('id' => $id))->save($arr); if ($db) { return 1; } else { return 0; } } else { $arr = array('ptitle' => I('ptitle'), 'pcontent' => I('pcontent')); $db = M('picnews')->where(array('id' => $id))->save($arr); if ($db) { return 1; } else { return 0; } } }