• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_dept_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_dept_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_dept_name函数的具体用法?PHP get_dept_name怎么用?PHP get_dept_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_dept_name函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _before_insert

 function _before_insert(&$data, $options)
 {
     $type = $data["type"];
     $dept_id = get_dept_id();
     $data['dept_id'] = $dept_id;
     $data['dept_name'] = get_dept_name();
     $data['emp_no'] = get_emp_no();
     $doc_no_format = M("FlowType")->where("id={$type}")->getField("doc_no_format");
     $short_dept = M("Dept")->where("id={$dept_id}")->getField('short');
     $short_flow = M("FlowType")->where("id={$type}")->getField('short');
     $sql = "SELECT count(*) count FROM `" . $this->tablePrefix . "flow` WHERE type={$type} ";
     $sql .= " and year(FROM_UNIXTIME(create_time))>=year(now())";
     if (strpos($doc_no_format, "{DEPT}") !== false) {
         $sql .= " and dept_id=" . get_dept_id();
     }
     $rs = $this->db->query($sql);
     $count = $rs[0]['count'] + 1;
     if (strpos($doc_no_format, "{DEPT}") !== false) {
         $doc_no_format = str_replace("{DEPT}", $short_dept, $doc_no_format);
     }
     if (strpos($doc_no_format, "{SHORT}") !== false) {
         $doc_no_format = str_replace("{SHORT}", $short_flow, $doc_no_format);
     }
     if (strpos($doc_no_format, "{YYYY}") !== false) {
         $doc_no_format = str_replace("{YYYY}", date('Y', mktime()), $doc_no_format);
     }
     if (strpos($doc_no_format, "{YY}") !== false) {
         $doc_no_format = str_replace("{YY}", date('y', mktime()), $doc_no_format);
     }
     if (strpos($doc_no_format, "{M}") !== false) {
         $doc_no_format = str_replace("{M}", date('m', mktime()), $doc_no_format);
     }
     if (strpos($doc_no_format, "{D}") !== false) {
         $doc_no_format = str_replace("{D}", date('d', mktime()), $doc_no_format);
     }
     if (strpos($doc_no_format, "{#}") !== false) {
         $doc_no_format = str_replace("{#}", str_pad($count, 1, "0", STR_PAD_LEFT), $doc_no_format);
     }
     if (strpos($doc_no_format, "{##}") !== false) {
         $doc_no_format = str_replace("{##}", str_pad($count, 2, "0", STR_PAD_LEFT), $doc_no_format);
     }
     if (strpos($doc_no_format, "{###}") !== false) {
         $doc_no_format = str_replace("{###}", str_pad($count, 3, "0", STR_PAD_LEFT), $doc_no_format);
     }
     if (strpos($doc_no_format, "{####}") !== false) {
         $doc_no_format = str_replace("{####}", str_pad($count, 4, "0", STR_PAD_LEFT), $doc_no_format);
     }
     if (strpos($doc_no_format, "{#####}") !== false) {
         $doc_no_format = str_replace("{#####}", str_pad($count, 5, "0", STR_PAD_LEFT), $doc_no_format);
     }
     if (strpos($doc_no_format, "{######}") !== false) {
         $doc_no_format = str_replace("{######}", str_pad($count, 6, "0", STR_PAD_LEFT), $doc_no_format);
     }
     $data['doc_no'] = $doc_no_format;
 }
开发者ID:zqstudio2015,项目名称:smeoa,代码行数:55,代码来源:FlowModel.class.php


示例2: _update

 /** 插入新新数据  **/
 protected function _update()
 {
     $model = D("MonthlyReport");
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     if (in_array('user_id', $model->getDbFields())) {
         $model->user_id = get_user_id();
     }
     if (in_array('user_name', $model->getDbFields())) {
         $model->user_name = get_user_name();
     }
     if (in_array('dept_id', $model->getDbFields())) {
         $model->dept_id = get_dept_id();
     }
     if (in_array('dept_name', $model->getDbFields())) {
         $model->dept_name = get_dept_name();
     }
     $model->create_time = time();
     /*保存当前数据对象 */
     $list = $model->save();
     if ($list !== false) {
         //保存成功
         $this->assign('jumpUrl', get_return_url());
         $this->success('保存成功!');
     } else {
         $this->error('保存失败!');
         //失败提示
     }
 }
开发者ID:zqstudio2015,项目名称:smeoa,代码行数:31,代码来源:MonthlyReportAction.class.php


示例3: get_user_tel

echo get_user_tel();
?>
 </td>
					    </tr>
					</table>
				</div>
				<div class="username">
					<a href="<?php 
echo U('grzhongxin/index');
?>
" style="color:#fff"><?php 
echo session('user_name');
?>
</a>
					<!-- <?php 
echo get_dept_name();
?>
 -->
					 |&nbsp;
					<a href="<?php 
echo U('login/logout');
?>
" style="color:#fff">退出</a>
				</div>
			</div>
		</div><!-- #header -->
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<div class="sidebar" id="sidebar">	
					<!-- <div id="user_info" class="text-center hidden-xs"  >
						<span >当前用户:<?php 
开发者ID:2ger,项目名称:trunk,代码行数:31,代码来源:a79be0626fb132d7a42abd3a0710d2fd.php


示例4: addLog

 /**
  * 添加日志
  * @param int $uid
  * @param string $content 今日总结
  * @param string $plan 计划
  * @param string $feedback 问题反馈
  * @param int $time
  * @param int $type 1为安卓 2为ios
  */
 public function addLog()
 {
     $uid = UID;
     // $uid=$_REQUEST['uid'];
     $content = $_REQUEST['content'];
     // $plan=$_REQUEST['plan'];
     // $feedback=$_REQUEST['feedback'];
     $time = NOW_TIME;
     $type = $_REQUEST['type'] ? $_REQUEST['type'] : 1;
     //		if($type!=1){
     //			$content=base64_decode($content);
     //			$plan=base64_decode($plan);
     //			$feedback=base64_decode($feedback);
     //		}
     $model = D('work_log');
     $data = array('user_id' => $uid, 'user_name' => get_user_name(), 'dept_id' => get_dept_id(), 'dept_name' => get_dept_name(), 'create_time' => time(), 'content' => $content ? $content : '', 'start_date' => date('Y-m-d', $time), 'end_date' => date('Y-m-d', $time));
     $res = $model->add($data);
     if ($res) {
         $this->result('1', '添加成功!');
     } else {
         $this->result('0', '未知错误!');
     }
 }
开发者ID:TipTimesPHP,项目名称:tyj_oa,代码行数:32,代码来源:MobilePhoneLogAction.class.php


示例5: mine

 public function mine()
 {
     $widget['date-range'] = true;
     $this->assign("widget", $widget);
     $this->assign('user_id', get_user_id());
     $this->assign("title", '日志查询');
     $auth = $this->config['auth'];
     $this->assign('auth', $auth);
     if ($_GET['id']) {
         $id = $_GET['id'];
         $this->assign("XIN", 0);
     } else {
         $id = get_user_id();
         $this->assign("XIN", 1);
     }
     if ($auth['admin']) {
         $rolein = false;
         $role = D('role_user')->where('user_id = ' . get_user_id())->field('role_id')->select();
         for ($i = 0; $i < count($role); $i++) {
             if ($role[$i]['role_id'] == 1 || $role[$i]['role_id'] == 12) {
                 $rolein = true;
                 continue;
             }
         }
         $node = D("Dept");
         $dept_id = get_dept_id();
         $dept_name = get_dept_name();
         $menu = array();
         $dept_menu = $node->field('id,pid,name')->where("is_del=0")->order('sort asc')->select();
         if ($rolein) {
             $dept_tree = list_to_tree($dept_menu);
         } else {
             $dept_tree = list_to_tree($dept_menu, $dept_id);
         }
         $count = count($dept_tree);
         //            dump(get_user_id());
         //            exit;
         if (empty($count)) {
             /*获取部门列表*/
             $html = '';
             $html = $html . "<option value='{$dept_id}'>{$dept_name}</option>";
             $this->assign('dept_list', $html);
             /*获取人员列表*/
             $where['dept_id'] = array('eq', $dept_id);
             $emp_list = D("User")->where($where)->getField('id,emp_name');
             //				$this->assign('emp_list',$emp_list);
         } else {
             /*获取部门列表*/
             $this->assign('dept_list', select_tree_menu($dept_tree));
             $dept_list = tree_to_list($dept_tree);
             $dept_list = rotate($dept_list);
             $dept_list = $dept_list['id'];
             /*获取人员列表*/
             $where['dept_id'] = array('in', $dept_list);
             $emp_list = D("User")->where($where)->getField('id,emp_name');
             //				$this->assign('emp_list',$emp_list);
         }
     }
     $map = $this->_search();
     $map['user_id'] = $id;
     if (method_exists($this, '_search_filter')) {
         $this->_search_filter($map);
     }
     $model = D("WorkLog");
     if (!empty($model)) {
         $this->_list($model, $map);
         //			$this -> _list($model,'');
     }
     $this->assign("uid", $id);
     $this->display();
 }
开发者ID:TipTimesPHP,项目名称:tyj_oa,代码行数:71,代码来源:WorkLogAction.class.php


示例6: addLog

 /**
  * 添加日志
  * @param int $uid
  * @param string $content 今日总结
  * @param string $plan 计划
  * @param string $feedback 问题反馈
  * @param int $time
  * @param int $type 1为安卓 2为ios
  */
 public function addLog()
 {
     $uid = $_REQUEST('uid');
     $content = $_REQUEST('content');
     $plan = $_REQUEST('plan');
     $feedback = $_REQUEST('feedback');
     $time = $_REQUEST('time');
     $type = $_REQUEST('type') ? $_REQUEST('type') : 1;
     if ($type != 1) {
         $content = base64_decode($content);
         $plan = base64_decode($plan);
         $feedback = base64_decode($feedback);
     }
     $model = D('work_log');
     $data = array('user_id' => $uid, 'user_name' => get_user_name(), 'dept_id' => get_dept_id(), 'dept_name' => get_dept_name(), 'create_time' => time(), 'content' => $content ? $content : '', 'plan' => $plan ? $plan : '', 'feedback' => $feedback ? $feedback : '', 'start_date' => date('Y-m-d', $time), 'end_date' => date('Y-m-d', $time));
     $res = $model->add($data);
     if ($res) {
         $this->result('1', '添加成功!');
     } else {
         $this->result('0', '未知错误!');
     }
 }
开发者ID:TipTimesPHP,项目名称:tyj_oa_cp,代码行数:31,代码来源:MobilePhoneLogAction.class.php


示例7: addAndEdditDoc

 /**
  * 添加 AND 临时保存  草稿箱修改公文 
  * @param unknown $doc_type 公文类型
  * @param unknown $doc_model 发文字号
  * @param unknown $doc_level 秘密等级
  * @param unknown $doc_acute 紧急程度
  * @param unknown $doc_title 公文标题	
  * @param unknown $doc_content 公文内容
  * @param unknown $doc_keyword 关键词
  * @param string $people_sh 传uid
  * @param string $people_qf 传uid
  * @param string $people_sj 传uid 多人逗号分隔
  * @param string $sid 附件id 多个附件 分号分割
  * @param int $type 1为安卓 2为ios
  * @param int $status 1 添加 2保存 3修改
  * @param int $flow_id 传入要修改的公文id
  */
 public function addAndEdditDoc()
 {
     // var_dump('5456656');
     // exit;
     $doc_type = $_REQUEST['doc_type'];
     $doc_model = $_REQUEST['doc_model'];
     $doc_level = $_REQUEST['doc_level'];
     $doc_acute = $_REQUEST['doc_acute'];
     $doc_title = $_REQUEST['doc_title'];
     $doc_content = $_REQUEST['doc_content'];
     $doc_keyword = $_REQUEST['keyword'];
     $people_sh = $_REQUEST['people_sh'];
     $people_qf = $_REQUEST['people_qf'];
     $people_sj = $_REQUEST['people_sj'];
     $sid = $_REQUEST['sid'];
     $type = $_REQUEST['type'];
     $status = $_REQUEST['status'];
     $id = $_REQUEST['flow_id'];
     $flow = M('flow');
     if ($type == 2) {
         $doc_type = base64_decode($doc_type);
         $doc_level = base64_decode($doc_level);
         $doc_model = base64_decode($doc_model);
         $doc_acute = base64_decode($doc_acute);
         $doc_title = base64_decode($doc_title);
         $doc_content = base64_decode($doc_content);
         $doc_keyword = base64_decode($doc_keyword);
     }
     $str = '';
     $peopel_sj = explode(',', $people_sj);
     for ($i = 0; $i < count($peopel_sj); $i++) {
         $str .= get_userName($peopel_sj[$i]) . "|";
         $html = '<span>' . get_userName($peopel_sj[$i]) . '</span>';
     }
     $id = get_user_id();
     $data = array('docNo' => $doc_model, 'name' => $doc_title, 'content' => $doc_content, 'drafter_name' => get_user_name(), 'confirm' => get_userName($people_sh) . '|', 'confirm_name' => get_userName($people_sh), 'consult' => get_userName($people_qf), 'consult_name' => get_userName($people_qf), 'refer' => $str, 'refer_name' => $html, 'add_file' => $sid, 'user_id' => get_user_id(), 'emp_no' => get_userEmpNo($id), 'user_name' => get_user_name(), 'dept_id' => get_dept_id(), 'dept_name' => get_dept_name(), 'create_time' => time(), 'update_time' => 0, 'step' => $status == 1 ? 20 : 10, 'is_del' => 0, 'doc_type' => $doc_type, 'doc_level' => $doc_level, 'doc_acute' => $doc_acute);
     // var_dump($data);
     // exit;
     $res = $flow->add($data);
     if ($status <= 2) {
         if ($res) {
             $log_data = array('flow_id' => $res, 'emp_no' => get_userName($people_sh), 'step' => 21, 'create_time' => time(), 'update_time' => time(), 'is_del' => 0);
             M('flow_log')->add($log_data);
             $this->result('1', '添加成功!');
         } else {
             $this->result('0', '未知错误!');
         }
     } else {
         if ($status > 2) {
             $info = M('Flow')->where(array('id' => $id))->save($data);
             if ($info) {
                 $this->result('1', '保存成功!');
             } else {
                 $this->result('0', '失败!');
             }
         }
     }
 }
开发者ID:TipTimesPHP,项目名称:tyj_oa,代码行数:75,代码来源:MobilePhoneFlowAction.class.php



注:本文中的get_dept_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_description函数代码示例发布时间:2022-05-15
下一篇:
PHP get_dept_id函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap