get_pubuser(1, "staff", $flowuser[0], "+选择审批人员", 120, 20); } else { //不可选 get_pubuser(1, "staff", $flowuser[0], "+选择审批人员", 120, 20, $flow['flowuser']); } } else { //多人审批 if ($flow['flowkey1'] == '1') { //可选 get_pubuser(2, "staff", $flow['flowuser'], "+选择审批人员", 40, 4); } else { //不可选 echo "<textarea name='staff' cols='40' rows='4'"; echo " readonly style='background-color:#F5F5F5;color:#006600;'>"; echo $flow['flowuser'] . "</textarea>"; echo "<input type='hidden' name='staffid' value='" . get_realid($flow['flowuser']) . "' />"; } } echo '<br>'; echo get_smsbox("审批人员", "shownamemaster") . '</td></tr>'; ?> <tr align="center" class="TableControl"> <td colspan="2" nowrap height="35"> <input type="button" name="Submit" value="提交审批" class="BigButtonBHover" onclick="sendForm();"> </td> </tr> </table> </form> </body>
$personnel1 = array('pertype' => $pertype, 'approvaldate' => get_date('Y-m-d H:i:s', PHP_TIME), 'lnstructions' => '此步骤己超时,由系统自动处理!'); update_db('workclass_personnel', $personnel1, array('perid' => $row['perid'])); if ($row['appkey'] == 1) { //多人审批 $per_log = array('pertype' => $pertypelog, 'approvaldate' => get_date('Y-m-d H:i:s', PHP_TIME), 'lnstructions' => '此步骤己超时,由系统自动处理!'); update_db('workclass_personnel_log', $per_log, array('perid' => $row['perid'])); } //创建下一步流程[当默认审批人员为空时不创建] if ($flow2['flowuser'] != '') { if ($flow2['flowdatetype'] == 1) { $flowdate = get_date('Y-m-d H:i:s', PHP_TIME + $flow2['flowdate'] * 60); } if ($flow2['flowkey2'] == 1) { //多人审批 $personnel2 = array('name' => $flow2['flowuser'], 'uid' => get_realid($flow2['flowuser']), 'pertype' => 0, 'workid' => $row['workid'], 'flowid' => $flow2['fid'], 'appkey' => $flow2['flowkey2'], 'appkey1' => $flow2['flowkey3'], 'typeid' => $row['typeid'], 'flowdatetype' => $flow2['flowdatetype'], 'flowdate' => $flowdate); insert_db('workclass_personnel', $personnel2); $pid = $db->insert_id(); $staff = explode(',', $flow2['flowuser']); $staffid = explode(',', get_realid($flow2['flowuser'])); for ($i = 0; $i < sizeof($staffid); $i++) { $personnel_log = array('name' => $staff[$i], 'uid' => $staffid[$i], 'pertype' => 0, 'perid' => $pid, 'workid' => $row['workid'], 'typeid' => $row['typeid']); insert_db('workclass_personnel_log', $personnel_log); } } else { $flowuser = explode(',', $flow2['flowuser']); $personnel2 = array('name' => $flowuser[0], 'uid' => get_userid($flowuser[0]), 'pertype' => 0, 'workid' => $row['workid'], 'flowid' => $flow2['fid'], 'appkey' => $flow2['flowkey2'], 'appkey1' => $flow2['flowkey3'], 'typeid' => $row['typeid'], 'flowdatetype' => $flow2['flowdatetype'], 'flowdate' => $flowdate); insert_db('workclass_personnel', $personnel2); } } } echo $pid;
function get_usershow($vuidtype = '', $url = '') { global $db; global $_USER; $sql = "SELECT id,keytypeuser FROM " . DB_TABLEPRE . "user where id='" . $_USER->id . "' and keytype='1' "; if ($result = $db->fetch_one_array($sql)) { //return '<img class="v-al-middle" src="template/default/images/2EDkuGH6eXMM.gif" /><a id="J-show-amount" href="'.$url.'" >查看下属成员信息</a>'; $html .= '<style type="text/css"> #attachshow{display:none;}</style><a href="#"'; $html .= 'onClick="showMenus('; $html .= "'attachshow'"; $html .= ')" style="line-height:30px;"><span>查看下属成员信息'; $html .= '<img src="template/default/images/2EC5tZlqdV.gif"'; $html .= ' align="absmiddle"></span></a>'; $html .= '<div class="attach_div" id="attachshow" align="left">'; $html .= '<a href="' . $url . '&vuidtype="><img src="template/default/images/newfolder.gif" '; $html .= 'align="absmiddle" width=16 height=16>只看自己</a>'; $html .= '<a href="' . $url . '&vuidtype=-1"><img src="template/default/images/movetofolder.gif" '; $html .= 'align="absmiddle" width=16 height=16>所有成员</a>'; $query = $db->query("SELECT a.id,b.name FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b where a.id=b.uid and a.id in (" . get_realid($result['keytypeuser']) . ") ORDER BY a.numbers Asc"); while ($row = $db->fetch_array($query)) { $html .= '<a href="' . $url . '&vuidtype=' . $row['id'] . '"><img src="template/default/images/2EDkuGH6eXMM.gif" '; $html .= 'align="absmiddle" width=16 height=16>' . $row['name'] . '</a>'; } $html .= '</div>'; } return $html; }
function crm_flow_add($modid = '') { global $db; $flow = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "crm_flow WHERE modid = '" . $modid . "' and flownum>1"); echo '<table class="TableBlock" border="0" width="90%" align="center"> <tr> <td nowrap class="TableHeader" colspan="2"><b> 审批人员</b></td> </tr> <tr> <td nowrap class="TableContent" width="15%"> 设置审批人员:'; get_helps(); echo '</td> <td class="TableData"> <input type="hidden" name="flowid" value="' . $flow['fid'] . '" /> <input type="hidden" name="appkey" value="' . $flow['flowkey2'] . '" /> <input type="hidden" name="appkey1" value="' . $flow['flowkey3'] . '" />'; if ($flow['flowkey2'] == '2') { //单人审批 if ($flow['flowkey1'] == '1') { //可选 get_pubuser(1, "userkey", '', "+选择审批人员", 120, 20); } else { get_pubuser(1, "userkey", '', "+选择审批人员", 120, 20, $flow['flowuser']); } } else { if ($flow['flowkey1'] == '1') { //可选 get_pubuser(2, "userkey", $flow['flowuser'], "+选择审批人员", 40, 4); } else { echo "<textarea name='userkey' cols='40' rows='4'"; echo " readonly style='background-color:#F5F5F5;color:#006600;'>"; echo $flow['flowuser'] . "</textarea>"; echo "<input type='hidden' name='userkeyid' value='" . get_realid($flow['flowuser']) . "' />"; } } echo ' <br>'; get_smsbox("审批人员", "work"); echo '<br> 注:流程第一步审批人员,这里选择你的下一级办理人,必需填写! </td> </tr> </table>'; }