Пример #1
0
 public function createUser($user_id)
 {
     $user_ids = "";
     $user_arr = explode(",", $user_id);
     foreach ($user_arr as $key => $value) {
         $user_ids .= "'" . $value . "',";
     }
     $user_ids = rtrim($user_ids, ",");
     $sync = array();
     $query = "SELECT USER_ID,USER_NAME,DEPT_ID,DEPT_ID_OTHER,USER_PRIV_NAME,USER_PRIV,MOBIL_NO,SEX,TEL_NO_DEPT,EMAIL FROM USER where USER_ID IN (" . $user_ids . ")";
     $cursor = exequery(TD::conn(), $query);
     while ($ROW = mysql_fetch_array($cursor)) {
         $USER_ID = $ROW['USER_ID'];
         $USER_NAME = $ROW['USER_NAME'];
         $DEPT_ID = $ROW['DEPT_ID'];
         $DEPT_ID_OTHER = $ROW['DEPT_ID_OTHER'];
         $USER_PRIV_NAME = $ROW['USER_PRIV_NAME'];
         $USER_PRIV = $ROW['USER_PRIV'];
         $MOBIL_NO = $ROW['MOBIL_NO'];
         $SEX = $ROW['SEX'];
         $TEL_NO_DEPT = $ROW['TEL_NO_DEPT'];
         $EMAIL = $ROW['EMAIL'];
         if ($EMAIL == "" && !preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO)) {
             $sync['failed'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
         } else {
             $_dept = array();
             $_dept[] = $this->deptinfo[$DEPT_ID]['weixin_dept_id'];
             if ($DEPT_ID_OTHER != "") {
                 $_dept_arr = array_filter(explode(",", $DEPT_ID_OTHER));
                 foreach ($_dept_arr as $key => $value) {
                     $_dept[] = $this->deptinfo[$value]['weixin_dept_id'];
                 }
             }
             $rs = $this->postData($this->url['create'], array("userid" => $USER_ID, "name" => $USER_NAME, "department" => $_dept, "position" => $USER_PRIV_NAME, "mobile" => preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO) ? $MOBIL_NO : "", "gender" => $SEX, "tel" => $TEL_NO_DEPT, "email" => $EMAIL));
             if ($rs['errcode'] == 0) {
                 $sync['success'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
             } else {
                 if ($rs['errcode'] == 60102) {
                     $sync['exists'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
                 }
             }
         }
     }
     parent::logs("user_import", serialize($sync));
     return array("success" => count($sync['success']), "failed" => count($sync['failed']), "exists" => count($sync['exists']));
 }
Пример #2
0
<?php

include_once "inc/auth.inc.php";
$HTML_PAGE_TITLE = _("数据导入 - 人员 - 查看日志");
$HTML_PAGE_BASE_STYLE = FALSE;
include_once "inc/header.inc.php";
require_once "inc/weixinqy/class/weixinqy.funcs.php";
$file = htmlspecialchars($_GET['file']);
//( );
$rs = array();
$WeiXinQY = new WeiXinQY();
$rs = $WeiXinQY->logsDetail("user_import", $file);
$style = array("failed" => array("error", _("失败")), "success" => array("success", _("成功")), "exists" => array("warning", _("忽略")));
echo "<body>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo MYOA_STATIC_SERVER;
echo "/static/js/bootstrap/css/bootstrap.css\">\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo MYOA_STATIC_SERVER;
echo "/static/modules/weixinqy/style.css\">\r\n<script type=\"text/javascript\">\r\nfunction goback(){\r\n    location.href = 'oa_user_logs.php';\r\n}\r\n</script>\r\n<div>\r\n    <div class=\"back-bar\"><button class=\"btn btn-small\" type=\"button\" onclick=\"goback()\">";
echo _("返回");
echo "</button></div>\r\n    <table class=\"table table-bordered\">\r\n        <colgroup>\r\n            <col width=\"150\"></col>\r\n            <col></col>\r\n            <col></col>\r\n            <col></col>\r\n            <col width=\"80\"></col>\r\n        </colgroup>\r\n        <thead>\r\n            <tr>\r\n                <th>";
echo _("时间");
echo "</th>\r\n                <th>";
echo _("成功");
echo "</th>\r\n                <th>";
echo _("失败");
echo "</th>\r\n                <th>";
echo _("忽略");
echo "</th>\r\n                <th>";
echo _("总计");
echo "</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td>";
echo date("Y-m-d H:i");
Пример #3
0
<?php

include_once "inc/auth.inc.php";
include_once "inc/utility_all.php";
$HTML_PAGE_TITLE = _("数据导入 - 人员 - 导入日志");
$HTML_PAGE_BASE_STYLE = FALSE;
include_once "inc/header.inc.php";
require_once "inc/weixinqy/class/weixinqy.funcs.php";
//( );
$rs = array();
$WeiXinQY = new WeiXinQY();
$rs = $WeiXinQY->showlogs("user_import");
echo "<body class=\"abody\">\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo MYOA_STATIC_SERVER;
echo "/static/js/bootstrap/css/bootstrap.css\">\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo MYOA_STATIC_SERVER;
echo "/static/modules/weixinqy/style.css\">\r\n<div>\r\n";
if (count($rs) == 0) {
    echo "    <p>";
    echo _("暂无日志");
    echo "</p>\r\n";
    exit;
}
echo "    <table class=\"table table-striped\">\r\n        <colgroup>\r\n            <col width=\"150\"></col>\r\n            <col></col>\r\n            <col width=\"100\"></col>\r\n        </colgroup>\r\n        <thead>\r\n            <tr>\r\n                <th>";
echo _("时间");
echo "</th>\r\n                <th>";
echo _("结果");
echo "</th>\r\n                <th>";
echo _("操作");
echo "</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            ";
foreach ($rs as $key => $value) {