欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

使用PHP开发HR系统(4)

程序员文章站 2023-11-04 12:23:10
本节我们讲述如何引入页面框架来建立漂亮的主页。 打开https://www.js-css.cn/divcss/admin/metro/index.html网站,看到如下页面: 这里有很多漂亮的控件可以使用,页面风格也比较统一,可以用这个来快速构建我们自己的页面; 1 添加文件 1) 在HRMS工程下 ......

   

本节我们讲述如何引入页面框架来建立漂亮的主页。

==================================================================================================

打开网站,看到如下页面:

 

这里有很多漂亮的控件可以使用,页面风格也比较统一,可以用这个来快速构建我们自己的页面;

   

1 添加文件

1) 在hrms工程下新建assets文件夹,把我们需要的文件分别添加 进去,如下图;

使用PHP开发HR系统(4)

这里对不同类型的文件做了分门别类的放置,看起来更规整一些;

   

2、修改main_list.php文件

由上面的配置文件我们可以看出,我们需要名称为main的控制器,打开application->controllers文件夹,看到目录下

有一个welcome.php的文件,这个就是系统默认调用的文件;

   

1)在application->controllers目录下新建main.php文件,输入以下代码:

<?php

defined('basepath') or exit('no direct script access allowed');

?><!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>hr manage system</title>

<meta content="width=device-width, initial-scale=1.0" name="viewport" />

<meta content="" name="description" />

<meta content="mosaddek" name="author" />        

<!--        <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"/>-->

<!--        <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">-->

   

<link rel="stylesheet" href="<?php echo base_url('assets/font-awesome/css/font-awesome.min')?>">

<link rel="stylesheet" href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css')?>">

<link rel="stylesheet" href="<?php echo base_url('assets/bootstrap/css/bootstrap-responsive.min.css')?>">

<link rel="stylesheet" href="<?php echo base_url('assets/bootstrap/css/bootstrap-fileupload.css')?>">

<link rel="stylesheet" href="<?php echo base_url('assets/css/style.css')?>">

<link rel="stylesheet" href="<?php echo base_url('assets/css/style-responsive.css')?>">        

<link rel="stylesheet" href="<?php echo base_url('assets/css/style-default.css')?>">

   

<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/uniform/css/uniform.default.css')?>">        

<link rel="stylesheet" href="<?php echo base_url('assets/data-tables/dt_bootstrap.css')?>">

</head>

   

<body class="fixed-top">

<!-- begin header -->

<div id="header" class="navbar navbar-inverse navbar-fixed-top">

<!-- begin top navigation bar -->

<div class="navbar-inner">

<div class="sidebar-toggle-box hidden-phone">

<div class="fa fa-reorder tooltips" data-placement="right" data-original-title="toggle navigation"></div>

</div>

<!--end sidebar toggle-->

<!-- begin logo -->

<a class="brand" href="<?php echo site_url('main/display/main'); ?>">

<img src="<?php echo base_url('assets/img/logo.png')?>" alt="metro lab" />

</a>

   

<!-- begin responsive menu toggler -->

<!-- <a class="btn btn-navbar collapsed" id="main_menu_trigger" data-toggle="collapse" data-target=".nav-collapse">

<span class="fa fa-bar"></span>

<span class="fa fa-bar"></span>

<span class="fa fa-bar"></span>

<span class="arrow"></span>

</a>-->

<div id="top_menu" class="nav notify-row">

<!-- begin notification -->

</div>

<div class="top-nav ">

<ul class="nav pull-right top-menu">

<!-- begin support -->

<li class="dropdown mtop5">

   

<a class="dropdown-toggle element" data-placement="bottom" data-toggle="tooltip" href="#" data-original-title="chat">

<i class="fa fa-comments-o"></i>

</a>

</li>

<li class="dropdown mtop5">

<a class="dropdown-toggle element" data-placement="bottom" data-toggle="tooltip" href="#" data-original-title="help">

<i class="fa fa-headphones"></i>

</a>

</li>

<!-- end support -->

<!-- begin user login dropdown -->

<li class="dropdown">

<a href="#" class="dropdown-toggle" data-toggle="dropdown">

<img src="<?php echo base_url('assets/img/avatar1_small.jpg')?>" alt="">

<span class="username">jhon doe</span>

<b class="caret"></b>

</a>

<ul class="dropdown-menu extended logout">

<li>

        <a href="#">swing</a></li>

<li>

<li><a href="#"><i class="fa fa-user"></i>我的资料</a></li>

<li><a href="#"><i class="fa fa-cog"></i>我的设置</a></li>

<li><a href="login.html"><i class="fa fa-key"></i>退出</a></li>

</ul>

</li>

<!-- end user login dropdown -->

</ul>

<!-- end top navigation menu -->

</div>                

</div>

</div>

<!-- end header -->

   

<!-- begin container -->

<div id="container" class="row-fluid">

<div class="sidebar-scroll" style="overflow: hidden;" tabindex="5000">

<div id="sidebar" class="nav-collapse collapse">

   

<!-- begin responsive quick search form -->

<div class="navbar-inverse">

<form class="navbar-search visible-phone">

<input class="search-query" placeholder="search" type="text">

</form>

</div>

<!-- end responsive quick search form -->

<!-- begin sidebar menu -->

<ul class="sidebar-menu">

<li class="sub-menu active">

<a class="" href="index.php">

<i class="fa fa-dashboard"></i>

<span>控制台</span>

</a>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-book"></i>

<span>人力资源规划</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a class="" href="general.html">人力资源规划</a></li>

</ul>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-cogs"></i>

<span>招聘与配置</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a class="" href="calendar.html">招聘</a></li>

</ul>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-tasks"></i>

<span>培训与开发</span>

<span class="arrow"></span>

</a>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-th"></i>

<span>绩效管理</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a class="" href="basic_table.html">简单表格</a></li>

<li><a class="" href="dynamic_table.html">动态表格</a></li>

<li><a class="" href="editable_table.html">可编辑表格</a></li>

</ul>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-fire"></i>

<span>薪酬福利管理</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a class="" href="font_awesome.html">fontawesome图标</a></li>

<li><a class="" href="glyphfa fas.html">glyphicons图标</a></li>

</ul>

</li>

<li class="sub-menu">

<a class="" href="javascript:;">

<i class="fa fa-trophy"></i>

<span>劳动关系管理</span>

<span class="arrow"></span>

</a>

</li>

<li class="sub-menu">

<a class="" href="javascript:;">

<i class="fa fa-map-marker"></i>

<span>系统设置</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a href="vector_map.html" class="">用户管理</a></li>

<li><a href="google_map.html" class="">角色管理</a></li>

</ul>

</li>

<li class="sub-menu">

<a href="javascript:;" class="">

<i class="fa fa-file-alt"></i>

<span>报表分析</span>

<span class="arrow"></span>

</a>

<ul class="sub">

<li><a class="" href="blank.html">空白页面</a></li>

</ul>

</li>

<!-- end sidebar menu -->

</div>

</div>        

<div id="main-content">

<!-- begin page container-->

<div class="container-fluid">

<!-- begin page header-->

<div class="row-fluid">

<div class="span12">

<!-- begin page title & breadcrumb-->

<h3 class="page-title">

控制台

</h3>

<ul class="breadcrumb">

<li>

<a href="home.php">首页</a>

<span class="divider">/</span>

</li>

<li class="active">

人力资源总览

</li>

<li class="pull-right search-wrap">

<form action="search_result.html" class="hidden-phone">

<div class="input-append search-input-area">

<input class="" id="appendedinputbutton" type="text">

<button class="btn" type="button"><i class="fa fa-search"></i> </button>

</div>

</form>

</li>

</ul>

<!-- end page title & breadcrumb-->

</div>

</div>

<!-- end page header-->

<!-- begin page content-->

<div class="row-fluid">

<!--begin metro states-->

<div class="metro-nav">

<div class="metro-nav-block nav-block-orange">

<a data-original-title="" href="#">

<i class="fa fa-user"></i>

<div class="info">7048</div>

<div class="status">在职人员总数</div>

</a>

</div>

<div class="metro-nav-block nav-olive">

<a data-original-title="" href="#">

<i class="fa fa-tags"></i>

<div class="info">1023</div>

<div class="status">待招聘人数</div>

</a>

</div>

<div class="metro-nav-block nav-block-yellow">

<a data-original-title="" href="#">

<i class="fa fa-comments-alt"></i>

<div class="info">490</div>

<div class="status">本月入职人数</div>

</a>

</div>

<div class="metro-nav-block nav-block-green double">

<a data-original-title="" href="#">

<i class="fa fa-eye-open"></i>

<div class="info">288</div>

<div class="status">本月离职人数</div>

</a>

</div>

<div class="metro-nav-block nav-block-red">

<a data-original-title="" href="#">

<i class="fa fa-bar-chart"></i>

<div class="info">255</div>

<div class="status">本月待招聘人数</div>

</a>

</div>

</div>

<div class="metro-nav">

<div class="metro-nav-block nav-light-purple double">

<a data-original-title="" href="#">

<i class="fa fa-shopping-cart"></i>

<div class="info">$8979322442</div>

<div class="status">本年薪酬福利</div>

</a>

</div>

<div class="metro-nav-block nav-light-blue double">

<a data-original-title="" href="#">

<i class="fa fa-tasks"></i>

<div class="info">$37624</div>

<div class="status">本月薪酬福利</div>

</a>

</div>

</div>

<div class="space10"></div>

<!--end metro states-->

</div>

   

<!-- end page content-->

</div>

<!-- end page container-->

</div>        

</div>

   

 

<!-- begin footer -->

<div id="footer">

2018 &copy; metroadmin.

</div>

   

<!-- begin javascripts -->

<!-- load javascripts at bottom, this will reduce page load time -->

<!--        <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>-->

<script src="<?php echo base_url('assets/js/jquery-3.2.1.min.js')?>"></script>

<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.nicescroll.js')?>"></script>

<script type="text/javascript" src="<?php echo base_url('assets/jquery-slimscroll/jquery-ui-1.9.2.custom.min.js')?>"></script>

<script type="text/javascript" src="<?php echo base_url('assets/jquery-slimscroll/jquery.slimscroll.min.js')?>"></script>

<script src="<?php echo base_url('assets/fullcalendar/fullcalendar.min.js')?>"></script>

<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.min.js')?>"></script>

<script src="<?php echo base_url('assets/js/jquery.blockui.js')?>"></script>

<script src="<?php echo base_url('assets/uniform/jquery.uniform.min.js')?>"></script>

   

<!-- ie8 fixes -->

<!--[if lt ie 9]>

<script src="js/excanvas.js"></script>

<script src="js/respond.js"></script>

<![endif]-->

<script type="text/javascript" src="<?php echo base_url('assets/jquery-easy-pie-chart/jquery.easy-pie-chart.js')?>"></script>

<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.sparkline.js')?>"></script>

<script src="<?php echo base_url('assets/chart-master/chart.js')?>"></script>

<script src="<?php echo base_url('assets/js/jquery.scrollto.min.js')?>"></script>

   

<!--common script for all pages-->

<script src="<?php echo base_url('assets/js/common-scripts.js')?>"></script>

<!--script for this page only-->

<script src="<?php echo base_url('assets/js/easy-pie-chart.js')?>"></script>

<script src="<?php echo base_url('assets/js/sparkline-chart.js')?>"></script>

<script src="<?php echo base_url('assets/js/home-page-calender.js')?>"></script>

<script src="<?php echo base_url('assets/js/home-chartjs.js')?>"></script>

   

   

<?php switch($page){

case "users":?>

<div id="footer">

</div>

<!--editable table script-->

<script src="<?php echo base_url('assets/js/editable-table.js')?>"></script>

<script src="<?php echo base_url('assets/data-tables/jquery.datatables.js')?>"></script>

<script src="<?php echo base_url('assets/data-tables/dt_bootstrap.js')?>"></script>        

<script>

jquery(document).ready(function() {

editabletable.init();

});

</script>

<?php break; ?>

<?php } ?>

<!--end body-->

</body>

</html>

   

2)修改配置文件application->config->config.php文件

配置节

$config['base_url'] = '';

修改为:

$config['base_url'] = 'http://localhost/hrms/';

3 运行测试

运行发现主页如下;

使用PHP开发HR系统(4)

   

总结:

本节我们利用成熟的页面框架建立了我们漂亮的主页,其中assets目录下各文件夹的含义如下:

目录

含义

官方网站

bootstrap

bootstrap 是一个用于快速开发 web 应用程序和网站的前端框架。bootstrap 是基于html、css、javascript 的。

chart-master

图表绘制工具库,其中chart.js是一个简单、面向对象、为设计者和开发者准备的图表绘制工具库;

  

css

本程序自定义css库

  

data-tables

数据表格相关的工具

font-awesome

为bootstrap而设计的图标库

https://fontawesome.com/

fullcalendar

日历控件

  

img

本程序用到的图片

  

jquery-easy-pie-chart

easy pie chart是一个轻量级的jquery插件,主要用来渲染和制作漂亮的饼图及动画效果,基于与html5的canvas元素

  

jquery-slimscroll

slimscroll是一个4.6kb的jquery插件,把任何div元素包裹的内容区加上具有好的滚动条。slimscroll不占用任何视觉空间,它只出现在一个用户启动的鼠标。用户可以拖动滚动条或使用鼠标滚轮改变滚动值

https://github.com/rochal/jquery-slimscroll/releases

uniform

jquery表单美化插件

  

js

本程序用到的js插件

  

====================================the end==========================