Пример #1
0
         $date = get_date('Y-m-d H:i:s', PHP_TIME);
         $documentid = getGP('documentid', 'P');
         $annex = getGP('annex', 'P');
         $uid = $_USER->id;
         if (getGP('readuser', 'P') != '') {
             $readuser = getGP('readuser', 'P');
         } else {
             $readuser = "******";
         }
         $document = array('title' => $title, 'content' => $content, 'documentid' => $documentid, 'annex' => $annex, 'readuser' => $readuser, 'type' => $type, 'uid' => $uid, 'date' => $date, 'key' => 0);
         insert_db('document', $document);
         $id = $db->insert_id();
         //短消息
         if (getGP('sms_info_box_readuser', 'P') != '') {
             $content = $readuser . ':您有一个文件需要阅读,名称为:' . $title . ';请进行查看!<a href="admin.php?ac=views&fileurl=' . $fileurl . '&do=edit&id=' . $id . '&type=' . $type . '">点击查看>></a>';
             SMS_ADD_POST($readuser, $content, 0, 0, $_USER->id);
         }
         //手机短信
         if (getGP('sms_phone_box_readuser', 'P') != '') {
             $content = $readuser . ':您有一个文件需要阅读,请登录OA进行查看!';
             PHONE_ADD_POST(getGP('readuserphone', 'P'), $content, $readuser, 0, 0, $_USER->id);
         }
         $content = serialize($document);
         $title = '新增' . $_title['title'] . '信息';
         get_logadd($id, $content, $title, 34, $_USER->id);
     }
     show_msg($_title['title'] . '信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . $type . '');
 } else {
     $id = getGP('id', 'G', 'int');
     if ($id != '') {
         $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "document  WHERE id = '{$id}'  ");
Пример #2
0
        $content = "你有一条公文需要在" . (0 - $row['days']) . "天内完成审批!";
    } else {
        $content = "你有一条公文已超期" . $row['days'] . "天,请尽快处理!";
    }
    $query = $db->query("SELECT id,name,pkey,apptype FROM toa_personnel where fileid=" . $row['id'] . " and type=" . $row['tp'] . " and pkey in(0,4)");
    while ($log = $db->fetch_array($query)) {
        $i += 1;
        $content .= '<a href="admin.php?ac=' . $row['ftab'] . '&do=personnel&fileurl=app';
        $content .= '&fileid=' . $row['id'] . '&apptype=' . $log['apptype'] . '">进入办理<a/>';
        if ($log['pkey'] == '0') {
            SMS_ADD_POST($log['name'], $content, 0, 0, 1);
            echo $row['id'] . $content . "NAME:" . $log['name'] . "<br>";
        } else {
            $query2 = $db->query("SELECT name FROM toa_personnel_log where perid=" . $log['id'] . " and pkey=0");
            while ($logg = $db->fetch_array($query2)) {
                SMS_ADD_POST($logg['name'], $content, 0, 0, 1);
                echo "[多人]" . $row['id'] . $content . "NAME:" . $logg['name'] . "<br>";
            }
        }
    }
}
date_default_timezone_set("PRC");
echo date("Y-m-d H:i:s");
?>
<br>运行成功,共有<?php 
echo $i;
?>
条公文符合提醒条件!<br>5d64d624bb
<script language="javascript">

setTimeout("go();",3600000);
Пример #3
0
         $news = array('category' => $category, 'receive' => $receive, 'subject' => $subject, 'content' => $content, 'appendix' => $appendix, 'type' => $type, 'date' => $udate, 'pic' => $pic, 'uid' => $uid);
         insert_db('news', $news);
         $id = $db->insert_id();
         if (getGP('shownamemasterid', 'P') != '') {
             $shownamemaster = explode(',', getGP('shownamemasterid', 'P'));
             for ($i = 0; $i < sizeof($shownamemaster); $i++) {
                 $news_read = array('disdate' => $udate, 'uid' => $shownamemaster[$i], 'dkey' => '0', 'newsid' => $id);
                 insert_db('news_read', $news_read);
             }
         }
         if (getGP('sms_info_box_shownamemaster', 'P') != '') {
             $content = '';
             $content = '您有一条新的' . $_news['title'] . '需要阅读,请点击查';
             $content .= '看!<a href="admin.php?ac=news&fileurl=administrative&do=views';
             $content .= '&id=' . $id . '&type=' . $type . '">点击阅读>></a>';
             SMS_ADD_POST($receive, $content, 0, 0, $_USER->id);
         }
         //手机短信
         if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
             $content = '';
             $content = '您有一新企业消息[' . $_news['title'] . ']需要阅读;请登录OA进行阅读!';
             PHONE_ADD_POST(getGP('shownamemasterphone', 'P'), $content, $receive, 0, 0, $_USER->id);
         }
         $content = '';
         $content = serialize($news);
         $title = '新增' . $_news['title'];
         get_logadd($id, $content, $title, 13, $_USER->id);
     }
     show_msg($_news['title'] . '信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . $type);
 } else {
     $id = getGP('id', 'G', 'int');
Пример #4
0
         insert_db('plan', $plan);
         $id = $db->insert_id();
         if (getGP('sms_info_box_person', 'P') != '') {
             $content = '您有一个计划需要执行,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>';
             //接收人;内容;类型(1:有返回回值;0:无返回值);URL
             SMS_ADD_POST($person, $content, 0, 0, $_USER->id);
         }
         //手机短信
         if (getGP('sms_phone_box_person', 'P') != '') {
             $content = '您有一个计划需要执行,请登录OA进行处理!';
             PHONE_ADD_POST(getGP('personphone', 'P'), $content, $person, 0, 0, $_USER->id);
         }
         //////////////////////////////////////////////////
         if (getGP('sms_info_box_participation', 'P') != '') {
             $content = '您有一个计划需要参与,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>';
             SMS_ADD_POST($participation, $content, 0, 0, $_USER->id);
         }
         //手机短信
         if (getGP('sms_phone_box_participation', 'P') != '') {
             $content = '您有一个计划需要参与,请登录OA进行处理!';
             PHONE_ADD_POST(getGP('participationphone', 'P'), $content, $participation, 0, 0, $_USER->id);
         }
         $content = serialize($plan);
         $title = '新增工作计划';
         get_logadd($id, $content, $title, 12, $_USER->id);
     }
     show_msg('计划信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
 } else {
     $id = getGP('id', 'G', 'int');
     if ($id != '') {
         $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "plan  WHERE id = '{$id}'  ");
Пример #5
0
             }
         }
     }
     //处理库存
     if ($pkeys == 5 && getGP('modid', 'P') == 'crm_purchase') {
         global $db;
         $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "crm_prod_view where viewid='" . $viewid . "' and type=2 ORDER BY id Asc");
         while ($rs = $db->fetch_array($query)) {
             $crm_stock = array('pid' => $rs['pid'], 'stocknum' => $rs['number'], 'unit' => $rs['unit'], 'number' => "T" . get_date('YmdHis', PHP_TIME), 'type' => 2, 'date' => get_date('Y-m-d H:i:s', PHP_TIME), 'uid' => $_USER->id);
             insert_db('crm_stock', $crm_stock);
         }
     }
     //通知审批人员
     if (getGP('sms_info_box_shownamemaster', 'P') != '') {
         $content1 = '您有一个工作流程需要审批,请点击进入工作流进行审批!';
         SMS_ADD_POST(getGP('staff', 'P'), $content1, 0, 0, $_USER->id);
     }
     //手机短信
     if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
         $content2 = '您有一个工作流程需要审批,请登录OA进行审批!';
         PHONE_ADD_POST(getGP('staffphone', 'P'), $content2, getGP('staff', 'P'), 0, 0, $_USER->id);
     }
     $content = serialize($personnel1);
     $title = '审批工作流';
     get_logadd($id, $content, $title, 14, $_USER->id);
     show_msg('工作流己成功审批!', 'admin.php?ac=' . str_replace('crm_', '', getGP('modid', 'P')) . '&fileurl=' . $fileurl . '');
 } else {
     //获取工作流信息
     $sql = "SELECT * FROM " . DB_TABLEPRE . $_GET['modid'] . "  WHERE id = '" . $_GET['viewid'] . "'";
     $row = $db->fetch_one_array($sql);
     //获取当前流程
Пример #6
0
         }
     }
     //通知审批人员
     if (getGP('sms_info_box_shownamemaster', 'P') != '') {
         $content1 = '您有一个项目' . $mod['modname'] . '需要审批,请进入项目' . $mod['modname'] . '进行审批!';
         SMS_ADD_POST(getGP('staff', 'P'), $content1, 0, 0, $_USER->id);
     }
     //手机短信
     if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
         $content2 = '您有一个项目' . $mod['modname'] . '需要审批,请登录OA进行审批!';
         PHONE_ADD_POST(getGP('staffphone', 'P'), $content2, getGP('staff', 'P'), 0, 0, $_USER->id);
     }
     //通知其它人员
     if (getGP('viewuser', 'P') != '') {
         $content3 = '您接收到一条来自项目' . $mod['modname'] . '的通知,请进入项目' . $mod['modname'] . '进行查看!';
         SMS_ADD_POST(getGP('viewuser', 'P'), $content3, 0, 0, $_USER->id);
     }
     //手机短信
     if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
         $content4 = '您有一个项目' . $mod['modname'] . '需要审批,请登录OA进行审批!';
         PHONE_ADD_POST(getGP('viewuserphone', 'P'), $content4, getGP('viewuser', 'P'), 0, 0, $_USER->id);
     }
     $content = serialize($personnel1);
     $title = '审批项目' . $mod['modname'];
     get_logadd($id, $content, $title, 32, $_USER->id);
     show_msg('项目' . $mod['modname'] . '己成功审批!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&modid=' . $modid . '&projectid=' . $projectid . '&typeid=' . $typeid . '&type=1');
 } else {
     //获取项目信息
     $sql = "SELECT * FROM " . DB_TABLEPRE . "project_log  WHERE lid = '" . $_GET['lid'] . "'";
     $row = $db->fetch_one_array($sql);
     //获取当前流程
Пример #7
0
                    $s++;
                    $wage_data = array('viewid' => $vid, 'tid' => $type['tid'], 'name' => $type['name'], 'content' => mb_convert_encoding($result[$i][$s], "UTF-8", "GB2312"), 'type' => 2, 'uid' => $result[$i][0], 'wid' => $wid);
                    insert_db('wage_data', $wage_data);
                }
            }
            //echo $result[$i][0].'<br>';
        }
        fclose($handle);
        //关闭指针
        echo '导入成功';
        exit;
        //show_msg('人员工资信息导入成功!', 'admin.php?ac='.$ac.'&fileurl='.$fileurl.'&do=log&wid='.getGP('wid','P'));
    }
    include_once 'template/excel.php';
} elseif ($do == 'sms') {
    if ($_POST['view'] != '') {
        $uid = getGP('uid', 'P', 'array');
        $name = getGP('name', 'P', 'array');
        $content = getGP('content', 'P', 'array');
        foreach ($uid as $id) {
            SMS_ADD_POST($name[$id], $content[$id], 0, 0, $_USER->id);
        }
        show_msg('工资条发送成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=sms&wid=' . ($name = getGP('wid', 'P')));
    } else {
        $sql = "SELECT * FROM " . DB_TABLEPRE . "wage  WHERE wid = '" . $_GET['wid'] . "'";
        $row = $db->fetch_one_array($sql);
        $sql = "SELECT * FROM " . DB_TABLEPRE . "wage_log  WHERE wid = '" . $row['wid'] . "' order by lid asc";
        $result = $db->fetch_all($sql);
        include_once 'template/sms.php';
    }
}
Пример #8
0
function crm_flow_save($modid = '', $vid = 0, $userkey, $userkeyid, $flowid, $appkey, $appkey1, $sms_info_box_work, $sms_phone_box_work, $userkeyphone)
{
    global $db, $_USER;
    $sql = "SELECT * FROM " . DB_TABLEPRE . "crm_flow  WHERE modid = '" . $modid . "' and flownum=1 order by fid asc";
    $flow = $db->fetch_one_array($sql);
    $personnel1 = array('name' => get_realname($_USER->id), 'uid' => $_USER->id, 'designationdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'approvaldate' => get_date('Y-m-d H:i:s', PHP_TIME), 'lnstructions' => '生成流程申请单,系统自动完成该步骤', 'pertype' => 1, 'viewid' => $vid, 'modid' => $modid, 'flowid' => $flow['fid'], 'appkey' => 2, 'appkey1' => 2);
    insert_db('crm_personnel', $personnel1);
    //写入审批流程
    $personnel2 = array('name' => $userkey, 'uid' => $userkeyid, 'designationdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'pertype' => 0, 'viewid' => $vid, 'modid' => $modid, 'flowid' => $flowid, 'appkey' => $appkey, 'appkey1' => $appkey1);
    //echo var_dump($personnel2);
    //exit;
    insert_db('crm_personnel', $personnel2);
    $pid = $db->insert_id();
    if ($appkey == '1') {
        $userkey = explode(',', $userkey);
        $userkeyid = explode(',', $userkeyid);
        for ($i = 0; $i < sizeof($userkeyid); $i++) {
            $personnel_log = array('name' => $userkey[$i], 'uid' => $userkeyid[$i], 'pertype' => 0, 'perid' => $pid, 'viewid' => $vid, 'modid' => $modid);
            insert_db('crm_personnel_log', $personnel_log);
        }
    }
    //提示
    if ($sms_info_box_work != '') {
        $content = '您有一个新CRM流程需要审批,请点击查看!<a href="admin.php?ac=personnel&fileurl=crm&viewid=' . $vid . '&modid=' . $modid . '">点击审批>></a>';
        //接收人;内容;类型(1:有返回回值;0:无返回值);URL
        SMS_ADD_POST($userkey, $content, 0, 0, $_USER->id);
    }
    //手机短信
    if ($sms_phone_box_work != '') {
        $content = '您有一个新CRM流程需要审批,请登录OA进行审批!';
        PHONE_ADD_POST($userkeyphone, $content, $userkey, 0, 0, $_USER->id);
    }
}
Пример #9
0
    $ids = explode(',', str_replace("515158,", "", $arr_id));
    $goods_title = explode(',', str_replace("515158,", "", $arr_goods_title));
    $goods_specification = explode(',', str_replace("515158,", "", $arr_goods_specification));
    $goods_unit = explode(',', str_replace("515158,", "", $arr_goods_unit));
    $goods_goodsnumber = explode(',', str_replace("515158,", "", $arr_goods_goodsnumber));
    $goods_price = explode(',', str_replace("515158,", "", $arr_goods_price));
    $pricenum = '0';
    for ($i = 0; $i < sizeof($ids); $i++) {
        $pricenum = $pricenum + $goods_goodsnumber[$i] * $goods_price[$i];
    }
    $goods_purchase = array('application' => $application, 'number' => $number, 'startdate' => $startdate, 'pricenum' => $pricenum, 'content' => $content, 'purchase' => $purchase, 'key1' => 1, 'uid' => $_USER->id);
    insert_db('goods_purchase', $goods_purchase);
    $id = $db->insert_id();
    for ($i = 0; $i < sizeof($ids); $i++) {
        $goods_purchase_view = array('goods_purchase' => $id, 'officegoods' => $ids[$i], 'title' => $goods_title[$i], 'specification' => $goods_specification[$i], 'unit' => $goods_unit[$i], 'price' => $goods_price[$i], 'goodsnumber' => $goods_goodsnumber[$i], 'date' => get_date('y-m-d H:i:s', PHP_TIME), 'uid' => $_USER->id);
        insert_db('goods_purchase_view', $goods_purchase_view);
    }
    //发送提示信息
    //短消息
    if (getGP('sms_info_box_purchase', 'P') != '') {
        $content = '您有一个采购任务需要执行,编号为:' . $number . ';请进行处理!<a href="admin.php?ac=goods_purchase_views&do=list&fileurl=goods&id=' . $id . '">点击处理>></a>';
        //接收人;内容;类型(1:有返回回值;0:无返回值);URL
        SMS_ADD_POST($purchase, $content, 0, 0, $_USER->id);
    }
    //手机短信
    if (getGP('sms_phone_box_purchase', 'P') != '') {
        $content = '您有一个采购任务需要执行,编号为:' . $number . ';请登录OA进行处理!';
        PHONE_ADD_POST(getGP('purchasephone', 'P'), $content, $purchase, 0, 0, $_USER->id);
    }
    show_msg('您要处理的信息操作成功!', 'admin.php?ac=goods_purchase&fileurl=' . $fileurl . '');
}
Пример #10
0
     //手机短信
     if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
         $content2 = '您有一个工作流程需要审批,请登录OA进行审批!';
         PHONE_ADD_POST(getGP('staffphone', 'P'), $content2, getGP('staff', 'P'), 0, 0, $_USER->id);
     }
     //通知其它人员
     if (getGP('viewuser', 'P') != '') {
         $content3 = '您接收到一条来自工作流的通知,请点击“<a href="admin.php?ac=list&do=view&fileurl=workclass&workid=' . $workid . '">查看</a>”工作流!';
         SMS_ADD_POST(getGP('viewuser', 'P'), $content3, 0, 0, $_USER->id);
     }
     $content4 = '审批流程“' . getGP('title', 'P') . '“于“' . get_date('Y-m-d H:i:s', PHP_TIME) . '“被' . get_realname($_USER->id) . '审批完成,请点击“<a href="admin.php?ac=list&do=view&fileurl=workclass&workid=' . $workid . '">查看</a>”工作流!';
     //通知前几步审批人员
     $sqlu = "SELECT * FROM " . DB_TABLEPRE . "workclass_personnel WHERE workid = '" . $workid . "' and perid <" . $perid . "";
     $results = $db->query($sqlu);
     while ($upfid = $db->fetch_array($results)) {
         SMS_ADD_POST($upfid['name'], $content4, 0, 0, $_USER->id);
     }
     //手机短信
     if (getGP('sms_phone_box_shownamemaster', 'P') != '') {
         $content4 = '您有一个工作流程需要审批,请登录OA进行审批!';
         PHONE_ADD_POST(getGP('viewuserphone', 'P'), $content4, getGP('viewuser', 'P'), 0, 0, $_USER->id);
     }
     $content = serialize($personnel1);
     $title = '审批工作流';
     get_logadd($id, $content, $title, 14, $_USER->id);
     show_msg('工作流己成功审批!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=1');
 } else {
     //获取工作流信息
     $sql = "SELECT * FROM " . DB_TABLEPRE . "workclass  WHERE id = '" . $_GET['workid'] . "'";
     $row = $db->fetch_one_array($sql);
     //获取当前流程
Пример #11
0
         //出席人员
         if (getGP('sms_info_box_participation', 'P') != '') {
             $content = '';
             $content = '您有一个会议需要出席,申请人是:"' . $apppersonsms . '",请注意查看会议出席时间!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>';
             SMS_ADD_POST($attendance, $content, 0, 0, $_USER->id);
         }
         if (getGP('sms_phone_box_participation', 'P') != '') {
             $content = '';
             $content = '您有一个会议需要出席,申请人是:"' . $apppersonsms . '",请登录OA查看会议出席时间!';
             PHONE_ADD_POST(getGP('participationphone', 'P'), $content, $attendance, 0, 0, $_USER->id);
         }
         //审批人员
         if (getGP('sms_info_box_staffid', 'P') != '') {
             $content = '';
             $content = $staffidsms . ':有一个会议申请需要您审批,申请人是:"' . $apppersonsms . '",请进入会议管理进行审批!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击审批>></a>';
             SMS_ADD_POST($staffidsms, $content, 0, 0, $_USER->id);
         }
         if (getGP('sms_phone_box_staffid', 'P') != '') {
             $content = '';
             $content = $staffidsms . ':有一个会议申请需要您审批,申请人是:"' . $apppersonsms . '",请登录OA进行审批!';
             PHONE_ADD_POST(getGP('staffidphone', 'P'), $content, $staffidsms, 0, 0, $_USER->id);
         }
         $content = '';
         $content = serialize($conference);
         $title = '新增会议信息';
         get_logadd($id, $content, $title, 19, $_USER->id);
     }
     show_msg('会议信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
 } else {
     $id = getGP('id', 'G', 'int');
     if ($id != '') {