Esempio n. 1
0
function user_listByPriv($USER_PRIV)
{
    global $USER_COUNT;
    global $MANAGE_FLAG;
    global $MODULE_ID;
    global $db;
    $OPTION_TEXT = "";
    if ($MANAGE_FLAG) {
        $query = "SELECT USER_ID,USER_NAME from user where USER_PRIV=" . $USER_PRIV;
    } else {
        $query = "SELECT USER_ID,USER_NAME from user where USER_PRIV=" . $USER_PRIV . " and  NOT_LOGIN!='1'";
    }
    if ($MODULE_ID != '1') {
        $query = getRoleByUser($query, "user_id");
    }
    $query = $query . " order by USER_NO,USER_NAME";
    $cursor = $db->Execute($query);
    $ROW1 = $cursor->GetArray();
    for ($j = 0; $j < sizeof($ROW1); $j++) {
        ++$USER_COUNT;
        $USER_ID = $ROW1[$j]['USER_ID'];
        $USER_NAME = $ROW1[$j]['USER_NAME'];
        $OPTION_TEXT .= "<tr class='TableData' onclick=javascript:add_user('" . $USER_ID . "','" . $USER_NAME . "') style='cursor:pointer' align='center'>\r\n           <td class='menulines' id='" . $USER_ID . "' name='" . $USER_NAME . "' flag='1'>\r\n           " . htmlspecialchars($USER_NAME) . "</td></tr>";
    }
    return $OPTION_TEXT;
}
Esempio n. 2
0
function user_tree_list($DEPT_ID)
{
    global $connection;
    global $DEEP_COUNT;
    global $USER_COUNT;
    global $MANAGE_FLAG;
    global $MODULE_ID;
    global $db;
    global $seldeptidArray;
    $query = "SELECT DEPT_ID,DEPT_NAME from department where DEPT_PARENT='" . $DEPT_ID . "' order by DEPT_NO";
    $cursor1 = $db->Execute($query);
    $ROW = $cursor1->GetArray();
    $OPTION_TEXT = "";
    $DEEP_COUNT1 = $DEEP_COUNT;
    $DEEP_COUNT .= " ";
    for ($i = 0; $i < sizeof($ROW); $i++) {
        $DEPT_ID = $ROW[$i]['DEPT_ID'];
        if (!in_array($DEPT_ID, $seldeptidArray)) {
            continue;
        }
        $DEPT_NAME = $ROW[$i]['DEPT_NAME'];
        $DEPT_NAME = htmlspecialchars($DEPT_NAME);
        $OPTION_TEXT .= "<tr class='TableHeader'><td><b>" . $DEEP_COUNT1 . "├" . $DEPT_NAME . "</b></td></tr>";
        if ($MANAGE_FLAG) {
            $query = "SELECT USER_ID,USER_NAME from user where DEPT_ID=" . $DEPT_ID;
        } else {
            $query = "SELECT USER_ID,USER_NAME from user where DEPT_ID=" . $DEPT_ID . " and  NOT_LOGIN!='1'";
        }
        if ($MODULE_ID == 1) {
            $query = getRoleByUser($query, "user_id");
        }
        $query = $query . " order by USER_NO,USER_NAME";
        $cursor = $db->Execute($query);
        $ROW1 = $cursor->GetArray();
        for ($j = 0; $j < sizeof($ROW1); $j++) {
            ++$USER_COUNT;
            $USER_ID = $ROW1[$j]['USER_ID'];
            $USER_NAME = $ROW1[$j]['USER_NAME'];
            $OPTION_TEXT .= "<tr class='TableData' onclick=javascript:click_user('" . $USER_ID . "') style='cursor:pointer' align='center'>\r\n           <td class='menulines' id='" . $USER_ID . "' title='" . $USER_NAME . "' flag='1'>\r\n           " . htmlspecialchars($USER_NAME) . "</td></tr>";
        }
        $OPTION_TEXT .= user_tree_list($DEPT_ID);
    }
    $DEEP_COUNT = $DEEP_COUNT1;
    return $OPTION_TEXT;
}
if ($_GET['action'] == "delete_array") {
    $selectid = $_GET['selectid'];
    $selectid = explode(",", $selectid);
    $db->StartTrans();
    require_once "../Framework/uploadFile.php";
    for ($i = 0; $i < sizeof($selectid); $i++) {
        if ($selectid[$i] != "") {
            deleteFile("workplanmain_detail", "id", $selectid[$i], "fujian");
            $mainrowid = returntablefield("workplanmain_detail", "id", $selectid[$i], "mainrowid");
            $sql = "delete from workplanmain_detail where id=" . $selectid[$i];
            $db->Execute($sql);
            updateWorkplanmain($mainrowid);
        }
    }
    //是否事务出现错误
    if ($db->HasFailedTrans()) {
        print "<script language=javascript>alert('错误:" . str_replace("'", "\\'", $db->ErrorMsg()) . "');window.history.back(-1);</script>";
    } else {
        page_css("任务执行记录");
        $return = FormPageAction("action", "init_default");
        print_infor("任务执行记录已删除", 'trip', "location='?{$return}'", "?{$return}", 0);
    }
    $db->CompleteTrans();
    exit;
}
addShortCutByDate("begintime", "开始时间");
$SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "createman");
//$SYSTEM_PRINT_SQL=1;
$filetablename = 'workplanmain_detail';
$parse_filename = 'workplanmain_detail';
require_once 'include.inc.php';
Esempio n. 4
0
                array_push($FILENAMEArray, $FILENAME);
            }
        }
        //$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
        $mail->Send();
        $_POST['SEND_FLAG'] = 1;
        while (list($key, $value) = each($FILENAMEArray)) {
            @unlink($value);
        }
    } catch (phpmailerException $e) {
        $error = $e->errorMessage();
        //Pretty error messages from PHPMailer
    } catch (Exception $e) {
        $error = $e->getMessage();
        //Boring error messages from anything else!
    }
    if ($error != '') {
        $error = str_replace("\n", '', $error);
        $error = str_replace("\r", '', $error);
        $error = preg_replace('/<[^>]+>/iU', '', $error);
        print "<script language=javascript>alert('邮件发送失败,原因:" . $error . "');history.back(-1);</script>";
        exit;
    }
}
addShortCutByDate("SEND_TIME", "发送时间");
$SYSTEM_ADD_SQL = $SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "FROM_ID");
//数据表模型文件,对应Model目录下面的email_newai.ini文件
//如果是需要复制此模块,则需要修改$parse_filename参数的值,然后对应到Model目录 新文件名_newai.ini文件
$filetablename = 'email';
$parse_filename = 'email';
require_once '../JXC/include.inc.php';
Esempio n. 5
0
if ($_GET['action'] == "delete_array") {
    $selectid = $_GET['selectid'];
    $selectid = explode(",", $selectid);
    for ($i = 0; $i < sizeof($selectid); $i++) {
        if ($selectid[$i] != "") {
            $sql = "delete from message where msgtype='公告通知' and guanlianid=" . $selectid[$i];
            $db->Execute($sql);
        }
    }
}
if ($_GET['action'] == "view_default") {
    /*
    $id=$_GET['id'];
    $sql="select * from message where userid='".$_SESSION['LOGIN_USER_ID']."' and guanlianid=$id";
    $rs=$db->Execute($sql);
    $rs_a=$rs->GetArray();
    $messageid=0;
    if(sizeof($rs_a)==1)
    	$messageid=$rs_a[0]['id'];
    if($messageid>0)
    {
    	$sql="update message set flag=1 where id=$messageid";
    	$db->Execute($sql);
    }
    */
}
addShortCutByDate("createtime", "发布时间");
$SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "from_user");
$filetablename = 'notify';
$parse_filename = 'notify';
require_once 'include.inc.php';
Esempio n. 6
0
	parent.user.location="children.php?MODULE_ID=&DEPT_ID="+the_id+"&CHECKED="+checked+"&"+para_id+"="+para_value;
}

</script>
</head>

<body class="bodycolor"  topmargin="1" leftmargin="0" onload="kword.focus();">
<div style="border:1px solid #000000;margin-left:2px;background:#FFFFFF;">
  <input type="text" id="kword" name="kword" value="按客户名称、拼音码搜索..." onfocus="ctroltime=setTimeout(CheckSend,100);" onblur="clearTimeout(ctroltime);if(this.value=='')this.value='按客户名称、拼音码搜索...';" class="SmallInput" style="border:0px; color:#A0A0A0;width:145px;"><img id="search_icon" src="../../../Framework/images/quicksearch.gif" align=absmiddle style="cursor:pointer;">
</div>

<table class="TableBlock trHover" width="100%" align="center">

<?php 
print "\n\t<tr class=TableHeader>\n\t<td align=center >所属用户 </td>\n\t</tr>\n\t<tr class=TableData>\n\t<td align=center onclick=\"javascript:seluser='';CheckSend();\" style=\"cursor:pointer\"><全部用户></td>\n\t</tr>\n\t";
$sql = "select * from user where 1=1 ";
$sql = getRoleByUser($sql, "user_id");
$sql .= " order by user_name";
$rs = $db->CacheExecute(5, $sql);
$rs_a = $rs->GetArray();
for ($i = 0; $i < sizeof($rs_a); $i++) {
    $所属用户 = $rs_a[$i]['USER_NAME'];
    print "\n\t<tr class=TableData>\n\t<td align=center onclick=\"javascript:seluser='******'USER_ID'] . "';CheckSend();\" style=\"cursor:pointer\">" . $所属用户 . "</td>\n\t</tr>\n\t";
}
?>

</table>

</body>
</html>
<?php

ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
error_reporting(E_WARNING | E_ERROR);
$user_id = $_SESSION['LOGIN_USER_ID'];
$dept_id = $_SESSION['LOGIN_DEPT_ID'];
$user_priv = $_SESSION['LOGIN_USER_PRIV'];
$module_desc = "客户服务";
$max_count = "4";
$module_body = "";
$sql = "select * from crm_service where (严重程度='2' or 严重程度='3') ";
$sql = getRoleByUser($sql, "创建人");
$sql = $sql . " order by 创建时间 desc limit 0 , {$max_count}";
$rs = $db->CacheExecute(150, $sql);
$rs_a = $rs->GetArray();
$count = $max_count - count($rs_a);
$module_body .= "<table border=\"0\"  width=\"100%\">";
if (count($rs_a) > 0) {
    for ($i = 0; $i < count($rs_a); $i++) {
        $编号 = $rs_a[$i]['编号'];
        $服务编号 = '单号:' . $rs_a[$i]['服务编号'];
        $customerName = returntablefield("customer", "rowid", $rs_a[$i]['客户名称'], "supplyname");
        $servicetype = returntablefield("crm_dict_servicetypes", "编号", $rs_a[$i]['服务编号'], "名称");
        $servicestate = returntablefield("crm_dict_servicestatus", "编号", $rs_a[$i]['严重程度'], "名称");
        if ($rs_a[$i]['严重程度'] == 2) {
            $servicestate = "<font color=red>" . $servicestate . "</font>";
        }
        if ($rs_a[$i]['严重程度'] == 3) {
            $servicestate = "<font color=blue>" . $servicestate . "</font>";
        }
Esempio n. 8
0
    echo $USER_ID;
    echo "\" title=\"";
    echo $USER_NAME;
    echo "\" flag=\"1\" align=\"center\" onclick=\"javascript:click_user('";
    echo $USER_ID;
    echo "')\" style=\"cursor:pointer\">\r\n  ";
    echo htmlspecialchars($USER_NAME);
    echo "  </td>\r\n</tr>\r\n\r\n";
}
if ($USER_PRIV != "") {
    $query = "SELECT USER_ID,USER_NAME from user where (USER_PRIV_OTHER like '" . $USER_PRIV . ",%' or USER_PRIV_OTHER like '%,{$USER_PRIV},%') and USER_PRIV!='{$USER_PRIV}' and DEPT_ID!=0 ";
    if (!$MANAGE_FLAG) {
        $query .= " and NOT_LOGIN!='1'";
    }
    if ($MODULE_ID == 1) {
        $query = getRoleByUser($query, "USER_ID");
    }
    $query .= " order by USER_NO,USER_NAME";
    $cursor = $db->Execute($query);
    $ROW = $cursor->GetArray();
    $USER_COUNT1 = 0;
    for ($i = 0; $i < sizeof($ROW); $i++) {
        ++$USER_COUNT;
        ++$USER_COUNT1;
        $USER_ID = $ROW[$i]['USER_ID'];
        $USER_NAME = $ROW[$i]['USER_NAME'];
        if ($USER_COUNT1 == 1) {
            echo "<tr class=\"TableHeader\">\r\n  <td colspan=\"2\" align=\"center\"><b>辅助角色</b></td>\r\n</tr>\r\n<tr class=\"TableControl\">\r\n  <td onclick=\"javascript:add_all('2');\" style=\"cursor:pointer\" align=\"center\">全部添加</td>\r\n</tr>\r\n<tr class=\"TableControl\">\r\n  <td onclick=\"javascript:del_all('2');\" style=\"cursor:pointer\" align=\"center\">全部删除</td>\r\n</tr>\r\n";
        }
        echo "\r\n<tr class=\"TableData\" onclick=\"javascript:click_user('";
        echo $USER_ID;
<?php

ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
error_reporting(E_WARNING | E_ERROR);
require_once 'lib.inc.php';
$GLOBAL_SESSION = returnsession();
validateMenuPriv("手机短信");
addShortCutByDate("nowtime", "提交时间");
$SYSTEM_ADD_SQL = $SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "userid");
//数据表模型文件,对应Model目录下面的sms_sendlist_newai.ini文件
//如果是需要复制此模块,则需要修改$parse_filename参数的值,然后对应到Model目录 新文件名_newai.ini文件
$filetablename = 'sms_sendlist';
$parse_filename = 'sms_sendlist';
require_once 'include.inc.php';
if ($_GET['action'] == "add_default") {
    $sendlist = $_GET['sendlist'];
    $sendlistarray = explode(",", $sendlist);
    $textareaInitValue = "";
    for ($i = 0; $i < count($sendlistarray); $i++) {
        if ($sendlistarray[$i] == '') {
            continue;
        }
        if ($_GET['fromsrc'] == 'user') {
            $linkman = returntablefield("user", "UID", $sendlistarray[$i], "MOBIL_NO,USER_NAME");
            if ($linkman['MOBIL_NO'] != '') {
                if ($textareaInitValue == '') {
                    $textareaInitValue = $linkman['MOBIL_NO'] . " " . $linkman['USER_NAME'];
                } else {
                    $textareaInitValue = $textareaInitValue . "\\n" . $linkman['MOBIL_NO'] . " " . $linkman['USER_NAME'];
                }
Esempio n. 10
0
    $结束时间 = $_POST['结束时间'] . " 23:59:59";
    $sql = "delete from system_log where `DATE`>='{$开始时间}' and `DATE`<='{$结束时间}'";
    $db->Execute($sql);
    优化数据表("system_log");
    print_infor("您的操作已经完成,请返回...", '', "location='?'", "?");
    exit;
}
定时执行函数($函数名称 = '自动清除30天以前的历史日志记录', $间隔时间 = '30');
function 自动清除30天以前的历史日志记录()
{
    global $db;
    $sql = "delete from system_log where datediff(now(),DATE)>=21";
    $db->Execute($sql);
    //print $sql."<BR>";
}
$SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "USERID");
//数据表模型文件,对应Model目录下面的system_log_newai.ini文件
//如果是需要复制此模块,则需要修改$parse_filename参数的值,然后对应到Model目录 新文件名_newai.ini文件
$filetablename = 'system_log';
$parse_filename = 'system_log';
require_once 'include.inc.php';
//print_R($_SESSION);
$总角色数组 = explode(',', $_SESSION['LOGIN_USER_PRIV'] . "," . $_SESSION['LOGIN_USER_PRIV_OTHER']);
if ($_GET['action'] == "init_default" && in_array('1', $总角色数组) && $_GET['actionadv'] != "exportadv_default") {
    print "<SCRIPT>\n\tfunction td_calendar(fieldname) {\n\t\tmyleft=document.body.scrollLeft+event.clientX-event.offsetX-80;\n\t\tmytop=document.body.scrollTop+event.clientY-event.offsetY+140;\n\t\twindow.showModalDialog(fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:200px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\n\t\t}\n\t</SCRIPT>";
    print "<FORM name=form1 action=\"?action=DataDealDelte&pageid=1\" method=post encType=multipart/form-data>";
    print "<table class=TableBlock width=100%>";
    print "<tr class=TableContent><td>\n\t\t&nbsp;<font color=green>按操作时间进行删除记录\n\t开始时间: <INPUT class=SmallInput maxLength=20  name=开始时间 value=\"" . date("Y-m-d", mktime(1, 1, 1, date('m'), date('d') - 21, date('Y'))) . "\"  >\n\t<input type=\"button\"  title=''  value=\"选择\" class=\"SmallButton\" onclick=\"td_calendar('../../Framework/sms_index/calendar_begin.php?datetime=开始时间');\" title=\"选择\" name=\"button\">\n\t结束时间:<INPUT class=SmallInput maxLength=20  name=结束时间 value=\"" . date("Y-m-d", mktime(1, 1, 1, date('m'), date('d'), date('Y'))) . "\"  >\n\t<input type=\"button\"  title=''  value=\"选择\" class=\"SmallButton\" onclick=\"td_calendar('../../Framework/sms_index/calendar_begin.php?datetime=结束时间');\" title=\"选择\" name=\"button\">\n\t<input type=submit class=SmallButton name='提交' value='提交'>\n\t</font>\n\t\t</td></tr>";
    print "</table>";
    print "</FORM>";
}
Esempio n. 11
0
    if ($I < 10) {
        $I = "0" . $I;
    }
    echo "          <option value=\"";
    echo $I;
    echo "\" ";
    if ($I == $DAY) {
        echo "selected";
    }
    echo ">";
    echo $I;
    echo "日</option>\r\n";
}
echo "        </select><input type=\"button\" value=\" > \" class=\"ArrowButton\" style=\"font-weight:bold\" title=\"下一天\" onclick=\"set_day(1);\">\r\n ";
$sql = "select * from user where 1=1";
getRoleByUser($sql, "USER_ID");
$sql .= " order by USER_NAME";
$rs = $db->Execute($sql);
$rs_a = $rs->GetArray();
echo "<select name='user_id' class=\"SmallSelect\" style=\"font-weight:bold\" onchange=\"document.form1.BTN_OP.value='0';My_Submit();\">";
foreach ($rs_a as $row) {
    $check = "";
    if ($user_id == $row['USER_ID']) {
        $check = "selected";
    }
    echo "<option value='" . $row['USER_ID'] . "' {$check}>" . $row['USER_NAME'] . "</option>";
}
echo "</select>     </td>\r\n      <td align=\"right\">\r\n        <input type=\"button\"  value=\"新建日程\" class=\"SmallButton\" onClick=\"new_cal('" . date("H") . "');\" title=\"创建新的日程,以便提醒自己\">\r\n        <select name=\"VIEW\" class=\"SmallSelect\" onchange=\"set_view();\">\r\n          <option value=\"day\">&nbsp;日列表</option>\r\n          <option value=\"week\">&nbsp;周列表</option>\r\n          <option value=\"month\" selected>&nbsp;月列表</option>\r\n        </select>\r\n      </td>\r\n    </tr>\r\n   </form>\r\n  </table>\r\n\r\n";
$CUR_TIME = date("Y-m-d H:i:s", time());
$query = "SELECT * from calendar where USER_ID='" . $user_id . "' and ((CAL_TIME>='" . date("Y-m-d", $MONTH_BEGIN) . " 00:00:00' and CAL_TIME<='" . date("Y-m-d", $MONTH_END) . " 23:59:59') or (END_TIME>='" . date("Y-m-d", $MONTH_BEGIN) . " 00:00:00' and END_TIME<='" . date("Y-m-d", $MONTH_END) . " 23:59:59') or (CAL_TIME<'" . date("Y-m-d", $MONTH_BEGIN) . " 00:00:00' and END_TIME>'" . date("Y-m-d", $MONTH_END) . " 23:59:59')) order by CAL_TIME";
$rs = $db->Execute($query);
$GLOBAL_SESSION = returnsession();
$SYSTEM_PRIV_STOP = "1";
validateMenuPriv("报销申请");
//$SYSTEM_PRINT_SQL = 1;
//print_r($_GET);exit;
if ($_GET['action'] == "edit_TongYi") {
    page_css();
    $billid = $_GET['单号'];
    $sql = "update crm_feiyong_sq set 是否审核='2',审核人='" . $_SESSION['LOGIN_USER_ID'] . "',审核日期=now() where 单号='{$billid}'";
    $rs = $db->Execute($sql);
    $billinfo = returntablefield("crm_feiyong_sq", "单号", $billid, "费用类型,金额,录单员");
    $feiyongname = returntablefield("v_feiyongbaoxiao", "id", $billinfo['费用类型'], "typename");
    newMessage($billinfo['录单员'], $feiyongname . '(金额:' . $billinfo['金额'] . ')--已通过!', '报销申请', '../CRM/crm_feiyong_sq_newai.php?' . base64_encode('action=view_default&单号=' . $billid), $billid);
    $return = FormPageAction("action", "init_default");
    print_infor("<b>审核通过</b>", 'trip', "location='?{$return}'", "?" . $return, 1);
    exit;
}
if ($_GET['action'] == "edit_FouJue") {
    page_css();
    $billid = $_GET['单号'];
    $sql = "update crm_feiyong_sq set 是否审核='3',审核人='" . $_SESSION['LOGIN_USER_ID'] . "',审核日期=now() where 单号='{$billid}'";
    $rs = $db->Execute($sql);
    $return = FormPageAction("action", "init_default");
    print_infor("<b>审核否决</b>", 'trip', "location='?{$return}'", "?" . $return, 1);
    exit;
}
$SYSTEM_ADD_SQL = getRoleByUser($SYSTEM_ADD_SQL, "录单员");
addShortCutByDate("创建时间", "创建时间");
$filetablename = 'crm_feiyong_sq';
$parse_filename = 'crm_feiyong_sq';
require_once 'include.inc.php';