public function edit_user() { $data = $this->postdata(); if (ifpermit($this->session->userdata('grade'), 6)) { $data['grade'] = getpermit($_POST[grade]); } if ($this->input->post('pass') != "") { $data['pass'] = md5($this->input->post('pass')); } $this->db->where('name', $_POST['name']); return $this->db->update('inf_user', $data); }
<li><a <?php echo $menu_bak_style; ?> href="<?php echo base_url(); ?> bak/style">款式统计表</a></li> </ul> </li> <?php } ?> <!-- 系统设置 --> <?php if (ifpermit($this->session->userdata('grade'), 8)) { ?> <li> <a href="#" class="nav-top-item <?php echo $menu_setting; ?> "> 设置 </a> <ul> <li><a <?php echo $menu_set_gen; ?> href="<?php echo base_url(); ?>
public function style() { if (ifpermit($this->session->userdata('grade'), 7)) { $sheet_title = "款式统计表"; $todaynow = strval(date("Ymd-His", time())); $filename = "款式统计表-" . $todaynow . ".xls"; $query = mysql_query("select * from `inf_v_style`"); $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator("ee945")->setLastModifiedBy("ee945")->setTitle("Office 2003 XLS Backup Document")->setSubject("Office 2003 XLS Backup Document")->setDescription("Record Database Backup, generated using PHP classes.")->setKeywords("office 2003 openxml php")->setCategory("backup hawb"); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '款式')->setCellValue('B1', '库存数量'); $i = 2; while ($row = mysql_fetch_array($query)) { $objPHPExcel->setActiveSheetIndex(0)->setCellValueExplicit('A' . $i, $row[0], PHPExcel_Cell_DataType::TYPE_STRING)->setCellValue('B' . $i, $row[1]); $i++; } $objPHPExcel->getActiveSheet()->setTitle($sheet_title); $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10); $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(10); ob_clean(); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="' . $filename . '"'); header('Cache-Control: max-age=0'); header('Cache-Control: max-age=1'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: cache, must-revalidate'); header('Pragma: public'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); exit; } }
function getchecked($prm, $i) { if (ifpermit($prm, $i)) { return "checked"; } }
public function del($id) { if (ifpermit($this->session->userdata('grade'), 4)) { $this->record_m->del_record($id); echo "<script LANGUAGE='Javascript'>location.href='" . base_url('record') . "'</script>"; } else { echo "<html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><script LANGUAGE='Javascript'>alert('操作失败!没有权限')</script></head>"; echo "<script LANGUAGE='Javascript'>location.href='" . base_url('record') . "'</script>"; } }