本文整理汇总了PHP中rotate函数的典型用法代码示例。如果您正苦于以下问题:PHP rotate函数的具体用法?PHP rotate怎么用?PHP rotate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rotate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: node
public function node()
{
$node_model = M("Node");
if (!empty($_POST['eq_pid'])) {
$eq_pid = $_POST['eq_pid'];
} else {
$eq_pid = $node_model->where('pid=0')->order('sort asc')->getField('id');
}
//dump($node_model -> select());
$node_list = $node_model->order('sort asc')->select();
$node_list = tree_to_list(list_to_tree($node_list, $eq_pid));
$node_list = rotate($node_list);
//dump($node_list);
$node_list = implode(",", $node_list['id']) . ",{$eq_pid}";
$where['id'] = array('in', $node_list);
$menu = $node_model->field('id,pid,name,url')->where($where)->order('sort asc')->select();
$tree = list_to_tree($menu);
$this->assign('eq_pid', $eq_pid);
$list = tree_to_list($tree);
$this->assign('node_list', $list);
//$this->assign('menu',sub_tree_menu($list));
$role = M("Role")->order('sort asc')->select();
$this->assign('list', $role);
$list = $node_model->where('pid=0')->order('sort asc')->getField('id,name');
$this->assign('groupList', $list);
$this->display();
}
示例2: index
public function index()
{
$widget['date'] = true;
$this->assign("widget", $widget);
$this->assign('user_id', get_user_id());
$auth = $this->config['auth'];
$this->assign('auth', $auth);
if ($auth['admin']) {
$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();
$dept_tree = list_to_tree($dept_menu, $dept_id);
$count = count($dept_tree);
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,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,name');
$this->assign('emp_list', $emp_list);
}
}
$map = $this->_search();
if ($auth['admin']) {
if (empty($map['dept_id'])) {
if (!empty($dept_list)) {
$map['dept_id'] = array('in', array_merge($dept_list, array($dept_id)));
} else {
$map['dept_id'] = array('eq', $dept_id);
}
}
} else {
$map['user_id'] = get_user_id();
}
if (method_exists($this, '_search_filter')) {
$this->_search_filter($map);
}
$model = D("WorkLog");
if (!empty($model)) {
$this->_list($model, $map);
}
$this->display();
}
示例3: del_tag
function del_tag($tag_id)
{
$model = M("UserTag");
$tag_list = tree_to_list(list_to_tree($this->get_tag_list("id,pid,name"), $tag_id));
$tag_list = rotate($tag_list);
$tag_list = implode(",", $tag_list['id']) . ",{$tag_id}";
$where['id'] = array('in', $tag_list);
$this->where($where)->delete();
$this->_del_data_by_tag($tag_list);
}
示例4: get_dept_list
public function get_dept_list($id)
{
$dept = tree_to_list(list_to_tree(M("Dept")->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",{$id}";
$model = M("User");
$where['dept_id'] = array('in', $dept);
$data = $model->where($where)->select();
return $data;
}
示例5: read
function read()
{
$id = $_REQUEST['id'];
$model = M("Dept");
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",{$id}";
$model = D("UserView");
$where['is_del'] = array('eq', '0');
$where['dept_id'] = array('in', $dept);
$data = $model->where($where)->select();
$this->ajaxReturn($data, "", 1);
}
示例6: _assign_badge_count
protected function _assign_badge_count()
{
$node_list = D("Node")->access_list();
$system_folder_menu = D("SystemFolder")->get_folder_menu();
$user_folder_menu = D("UserFolder")->get_folder_menu();
$node_list = array_merge($node_list, $system_folder_menu, $user_folder_menu);
foreach ($node_list as $val) {
$badge_function = $val['badge_function'];
if (!empty($badge_function) and function_exists($badge_function) and $badge_function != 'badge_sum') {
if ($badge_function == 'badge_count_system_folder' or $badge_function == 'badge_count_user_folder') {
$badge_count[$val['id']] = $badge_function($val['fid']);
} else {
$badge_count[$val['id']] = $badge_function();
}
}
}
//$node_tree = list_to_tree($node_list);
foreach ($node_list as $key => $val) {
if ($val['badge_function'] == 'badge_sum') {
$child_menu = list_to_tree($node_list, $val['id']);
$child_menu = tree_to_list($child_menu);
//dump($child_menu);
$child_menu_id = rotate($child_menu);
$count = 0;
if (isset($child_menu_id['id'])) {
$child_menu_id = $child_menu_id['id'];
$count = 0;
foreach ($child_menu_id as $k1 => $v1) {
if (!empty($badge_count[$v1])) {
$count += $badge_count[$v1];
}
}
}
$badge_sum[$val['id']] = $count;
}
}
if (!empty($badge_count)) {
if (!empty($badge_sum)) {
$total = $badge_count + $badge_sum;
} else {
$total = $badge_count;
}
$this->assign('badge_count', $total);
}
}
示例7: _check_auth
private function _check_auth($auth_list)
{
$arrtmp = explode(';', $auth_list);
foreach ($arrtmp as $item) {
if (strlen($item) > 2) {
if (stripos($item, "dept_") !== false) {
$arr_dept = explode('|', $item);
$dept_id = substr($arr_dept[1], 5);
$emp_list = D("Contact")->get_dept_list($dept_id);
$emp_list = rotate($emp_list);
if (in_array($_SESSION['emp_no'], $emp_list["emp_no"])) {
return true;
}
} else {
if (stripos($item, $_SESSION['emp_no'])) {
return true;
}
}
}
}
return false;
}
示例8: flow_list
protected function flow_list()
{
$user_id = get_user_id();
$model = D('Flow');
//带审批的列表
$FlowLog = M("FlowLog");
$where['emp_no'] = $user_id;
$where['_string'] = "result is null";
$log_list = $FlowLog->where($where)->field('flow_id')->select();
if (!empty($log_list)) {
$log_list = rotate($log_list);
$map['id'] = array('in', $log_list['flow_id']);
$todo_flow_list = $model->{$where}($map)->field("id,title,create_time")->select();
$this->assign("todo_flow_list", $todo_flow_list);
}
//已提交
$map = array();
$map['user_id'] = $user_id;
$map['step'] = array('gt', 10);
$submit_process_list = $model->where($map)->field("id,title,create_time")->select();
$this->assign("submit_flow_list", $submit_process_list);
}
示例9: get_relation_list
public function get_relation_list($relation, $row_list = null)
{
if (!empty($relation)) {
$where['relation'] = array('eq', $relation);
if (!empty($row_list)) {
if (is_array($row_list)) {
$row_list = array_filter($row_list);
} else {
$row_list = array_filter(explode(",", $row_list));
}
$where['row_id'] = array('in', $row_list);
}
$list = $this->where($where)->field("row_id,relation_id")->select();
$list = rotate($list);
$relation_module = explode("|", $relation);
$row_module = $relation_module[0];
$relation_module = $relation_module[1];
$model = M($relation_module);
$where['id'] = array('in', $list['relation_id']);
$list = $model->where($where)->select();
return $list;
}
}
示例10: read
function read()
{
$type = $_REQUEST['type'];
$id = $_REQUEST['id'];
switch ($type) {
case "company":
$model = M("Dept");
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",{$id}";
case "emp":
$model = M("Dept");
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",{$id}";
$sql = D("UserView")->buildSql();
$model = new Model();
$where['dept_id'] = array('in', $dept);
$where['is_del'] = array('eq', 0);
$data = $model->table($sql . "a")->where($where)->select();
break;
case "rank":
$sql = D("UserView")->buildSql();
$model = new Model();
$where['rank_id'] = array('eq', $id);
$where['is_del'] = array('eq', 0);
$data = $model->table($sql . "a")->where($where)->select();
break;
case "position":
$sql = D("UserView")->buildSql();
$model = new Model();
$where['position_id'] = array('eq', $id);
$where['is_del'] = array('eq', 0);
$data = $model->table($sql . "a")->where($where)->select();
break;
case "personal":
$model = D("UserTag");
if ($id == "#") {
$data = $model->get_data_list("Contact");
$data = rotate($data);
$data = $data['row_id'];
$where['id'] = array('not in', implode(",", $data));
} else {
$test = $model;
$data = $model->get_data_list("Contact", $id);
$data = rotate($data);
$data = $data['row_id'];
$where['id'] = array('in', implode(",", $data));
}
$model = M("Contact");
$where['is_del'] = array('eq', 0);
$data = $model->where($where)->field('id,name,position as position_name,email')->select();
//echo $model->getLastSql();
break;
default:
}
$new = array();
if (true) {
// 读取成功
$this->ajaxReturn($data, dump($test, false), 1);
}
}
示例11: get_auth
function get_auth()
{
$access_list = D("Node")->access_list();
$access_list = array_filter($access_list, array($this, 'filter_module'));
$access_list = rotate($access_list);
$module_list = $access_list['url'];
$module_list = array_map(array($this, "get_module"), $module_list);
$module_list = str_replace("_", "", $module_list);
$access_list_admin = array_filter(array_combine($module_list, $access_list['admin']));
$access_list_write = array_filter(array_combine($module_list, $access_list['write']));
$access_list_read = array_filter(array_combine($module_list, $access_list['read']));
$module_name = strtolower(MODULE_NAME);
$auth['admin'] = array_key_exists($module_name, $access_list_admin) || array_key_exists("##" . $module_name, $access_list_admin);
$auth['write'] = array_key_exists($module_name, $access_list_write) || array_key_exists("##" . $module_name, $access_list_write);
$auth['read'] = array_key_exists($module_name, $access_list_read) || array_key_exists("##" . $module_name, $access_list_read);
if ($auth['admin'] == true) {
$auth['write'] = true;
}
if ($auth['write'] == true) {
$auth['read'] = true;
}
return $auth;
}
示例12: _assign_group_list
protected function _assign_group_list()
{
$model = M("WorkflowType");
$where['group'] = array("neq", "");
$group_list = $model->where($where)->distinct("group")->field("group")->select();
$group_list = rotate($group_list);
$group_list = array_combine($group_list["group"], $group_list["group"]);
$this->assign("group_list", $group_list);
}
示例13: autoRotate
/**
* Image Rotation
*
* @return void
*/
public function autoRotate()
{
if (!$this->checkPackageRequirements('exif')) {
$this->setError(\Lang::txt('You need the PHP exif library installed to rotate image based on Exif Orientation value.'));
return false;
}
if ($this->image_type == IMAGETYPE_JPEG) {
$this->exif_data = exif_read_data($this->source);
if (isset($this->exif_data['Orientation'])) {
switch ($this->exif_data['Orientation']) {
case 2:
$this->flip(true, false);
break;
case 3:
$this->rotate(180);
break;
case 4:
$this->flip(false, true);
break;
case 5:
$this->rotate(270);
$this->flip(true, false);
break;
case 6:
$this->rotate(270);
break;
case 7:
$this - rotate(90);
$this->flip(true, false);
break;
case 8:
$this->rotate(90);
break;
}
}
}
}
示例14: get_mail_list_by_dept_id
private function get_mail_list_by_dept_id($id)
{
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",{$id}";
$model = M("User");
$where['dept_id'] = array('in', $dept);
$where['is_del'] = array('eq', 0);
$where['email'] = array('neq', '');
$data = $model->where($where)->select();
return $data;
}
示例15: backup
die;
}
if ($argv[1] == "--backup") {
backup();
die;
}
if ($argv[1] == "--conf") {
buildconf();
die;
}
if ($argv[1] == "--restore-id") {
restore_id($argv[2]);
die;
}
if ($argv[1] == "--rotate") {
rotate($argv[2]);
die;
}
if ($argv[1] == "--tofile") {
sargToFile($argv[2]);
die;
}
if ($argv[1] == "--status") {
status();
die;
}
// exec.sarg.php --conf
function SargDefault($SargConfig)
{
if ($SargConfig["report_type"] == null) {
$SargConfig["report_type"] = "topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads";