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}' "); get_key('date_plan_edit'); $startdate = explode(' ', $user['startdate']); $starttime = explode(':', $startdate[1]); $enddate = explode(' ', $user['enddate']); $endtime = explode(':', $enddate[1]);
$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}' "); get_key("office_document_edit_" . getGP('type', 'G') . ""); $_title['name'] = '编辑'; } else { get_key("office_document_Increase_" . getGP('type', 'G') . ""); $_title['name'] = '发布';
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); //获取当前流程 $sql = "SELECT a.*,b.flowname,b.flownum,b.flowuser,b.flowkey,b.flowkey1,b.flowkey2,b.flowkey3 FROM " . DB_TABLEPRE . "project_personnel a," . DB_TABLEPRE . "project_flow b WHERE a.flowid=b.fid and a.projectid = '" . $_GET['lid'] . "' and a.appkey2=2 and (a.pertype=0 or a.pertype=4) order by a.perid desc"; $per = $db->fetch_one_array($sql); if ($per['flowkey'] != '2') { //获取下一步流程 $sql = "SELECT * FROM " . DB_TABLEPRE . "project_flow WHERE flownum >'" . $per['flownum'] . "' and tplid='" . $modid . "' and flowkey4=2 order by flownum asc";
$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'); if ($id != '') { $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "news WHERE id = '{$id}' "); get_key($keynews . '_edit'); $_title['name'] = '编辑'; } else { get_key($keynews . '_Increase');
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); //获取当前流程 $sql = "SELECT a.*,b.flowname,b.flownum,b.flowuser,b.flowkey,b.flowkey1,b.flowkey2,b.flowkey3 FROM " . DB_TABLEPRE . "crm_personnel a," . DB_TABLEPRE . "crm_flow b WHERE a.flowid=b.fid and a.viewid = '" . $_GET['viewid'] . "' and a.modid = '" . $_GET['modid'] . "' and (a.pertype=0 or a.pertype=4) order by a.perid desc"; $per = $db->fetch_one_array($sql); if ($per['flowkey'] != '2') { //获取下一步流程 $sql = "SELECT * FROM " . DB_TABLEPRE . "crm_flow WHERE flownum >'" . $per['flownum'] . "' and modid='" . $_GET['modid'] . "' order by flownum asc";
<?php (!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!'); get_key("office_sms_Increase"); empty($do) && ($do = 'list'); if ($do == 'list') { include_once 'template/smsadd.php'; } elseif ($do == 'save') { $savetype = getGP('savetype', 'P'); $content = trim(preg_replace("/[\\s]+/", '', getGP('content', 'P'))); PHONE_ADD_POST(getGP('receivephone', 'P'), $content, getGP('receive', 'P'), 0, 0, $_USER->id); $content = getGP('receivephone', 'P') . get_log(1) . getGP('content', 'P') . get_log(1) . getGP('receive', 'P') . get_log(1) . $_USER->id; $title = '发送手机短信'; get_logadd($id, $content, $title, 6, $_USER->id); show_msg('手机短信发送成功!', 'admin.php?ac=smsindex&fileurl=sms'); }
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); } }
$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 . ''); }
} 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 != '') { get_key("istration_conference_edit"); $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "conference WHERE id = '{$id}'"); $startdate = explode(' ', $user['startdate']); $starttime = explode(':', $startdate[1]); $enddate = explode(' ', $user['enddate']);