addacthx.inc.php 1021 B

1234567891011121314151617181920212223242526
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $sql =" select id,name from ".tablename('zhtc_user')." where uniacid={$_W['uniacid']} and name!='' and id not in (select user_id from" .tablename('zhtc_acthxlist')."where act_id={$_GPC['act_id']})";
  5. $user=pdo_fetchall($sql);
  6. $info = pdo_get('zhtc_acthxlist',array('id'=>$_GPC['id']));
  7. if(checksubmit('submit')){
  8. $data['user_id']=$_GPC['user_id'];
  9. $data['act_id']=$_GPC['act_id'];
  10. if($_GPC['id']==''){
  11. $res=pdo_insert('zhtc_acthxlist',$data);
  12. if($res){
  13. message('添加成功',$this->createWebUrl('acthx',array('act_id' => $_GPC['act_id'])),'success');
  14. }else{
  15. message('添加失败','','error');
  16. }
  17. }else{
  18. $res = pdo_update('zhtc_acthxlist', $data, array('id' => $_GPC['id']));
  19. if($res){
  20. message('编辑成功',$this->createWebUrl('acthx',array('act_id' => $_GPC['act_id'])),'success');
  21. }else{
  22. message('编辑失败','','error');
  23. }
  24. }
  25. }
  26. include $this->template('web/addacthx');