当前位置: 首页>>代码示例>>PHP>>正文


PHP Export::saveUsers方法代码示例

本文整理汇总了PHP中Export::saveUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::saveUsers方法的具体用法?PHP Export::saveUsers怎么用?PHP Export::saveUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Export的用法示例。


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

示例1: elseif

            break;
        case 'import-users':
            $status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
            if (is_numeric($status))
                $msg = "Successfully imported $status clients";
            else
                $errors['err'] = $status;
            break;
        default:
            $errors['err'] = 'Unknown action/command';
            break;
    }
} elseif($_REQUEST['a'] == 'export') {
    require_once(INCLUDE_DIR.'class.export.php');
    $ts = strftime('%Y%m%d');
    if (!($token=$_REQUEST['qh']))
        $errors['err'] = 'Query token required';
    elseif (!($query=$_SESSION['users_qs_'.$token]))
        $errors['err'] = 'Query token not found';
    elseif (!Export::saveUsers($query, "users-$ts.csv", 'csv'))
        $errors['err'] = 'Internal error: Unable to dump query results';
}

$page = $user? 'user-view.inc.php' : 'users.inc.php';

$nav->setTabActive('users');
require(STAFFINC_DIR.'header.inc.php');
require(STAFFINC_DIR.$page);
include(STAFFINC_DIR.'footer.inc.php');
?>
开发者ID:Jride,项目名称:OSTicket-Thaiconnections,代码行数:30,代码来源:users.php

示例2: elseif

                $errors['err'] = "Coming soon!";
            }
            break;
        case 'import-users':
            $status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
            if (is_numeric($status)) {
                $msg = "Successfully imported {$status} clients";
            } else {
                $errors['err'] = $status;
            }
            break;
        default:
            $errors['err'] = 'Unknown action/command';
            break;
    }
} elseif ($_REQUEST['a'] == 'export') {
    require_once INCLUDE_DIR . 'class.export.php';
    $ts = strftime('%Y%m%d');
    if (!($token = $_REQUEST['qh'])) {
        $errors['err'] = 'Query token required';
    } elseif (!($query = $_SESSION['users_qs_' . $token])) {
        $errors['err'] = 'Query token not found';
    } elseif (!Export::saveUsers($query, "users-{$ts}.csv", 'csv')) {
        $errors['err'] = 'Internal error: Unable to dump query results';
    }
}
$page = $user ? 'user-view.inc.php' : 'users.inc.php';
$nav->setTabActive('users');
require STAFFINC_DIR . 'header.inc.php';
require STAFFINC_DIR . $page;
include STAFFINC_DIR . 'footer.inc.php';
开发者ID:ed00m,项目名称:osTicket-1.8,代码行数:31,代码来源:users.php

示例3: sprintf

                }
            }
            break;
        case 'import-users':
            $status = User::importFromPost($_FILES['import'] ?: $_POST['pasted']);
            if (is_numeric($status)) {
                $msg = sprintf(__('Successfully imported %1$d %2$s.'), $status, _N('end user', 'end users', $status));
            } else {
                $errors['err'] = $status;
            }
            break;
        default:
            $errors['err'] = __('Unknown action');
            break;
    }
} elseif ($_REQUEST['a'] == 'export') {
    require_once INCLUDE_DIR . 'class.export.php';
    $ts = strftime('%Y%m%d');
    if (!($token = $_REQUEST['qh'])) {
        $errors['err'] = __('Query token required');
    } elseif (!($query = $_SESSION['users_qs_' . $token])) {
        $errors['err'] = __('Query token not found');
    } elseif (!Export::saveUsers($query, __("users") . "-{$ts}.csv", 'csv')) {
        $errors['err'] = __('Internal error: Unable to dump query results');
    }
}
$page = $user ? 'user-view.inc.php' : 'users.inc.php';
$nav->setTabActive('users');
require STAFFINC_DIR . 'header.inc.php';
require STAFFINC_DIR . $page;
include STAFFINC_DIR . 'footer.inc.php';
开发者ID:gizur,项目名称:osticket,代码行数:31,代码来源:users.php


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