dlinaddacthx.inc.php 1.1 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. $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']})";
  6. $user=pdo_fetchall($sql);
  7. $info = pdo_get('zhtc_acthxlist',array('id'=>$_GPC['id']));
  8. if(checksubmit('submit')){
  9. $data['user_id']=$_GPC['user_id'];
  10. $data['act_id']=$_GPC['act_id'];
  11. if($_GPC['id']==''){
  12. $res=pdo_insert('zhtc_acthxlist',$data);
  13. if($res){
  14. message('添加成功',$this->createWebUrl2('dlinacthx',array('act_id' => $_GPC['act_id'])),'success');
  15. }else{
  16. message('添加失败','','error');
  17. }
  18. }else{
  19. $res = pdo_update('zhtc_acthxlist', $data, array('id' => $_GPC['id']));
  20. if($res){
  21. message('编辑成功',$this->createWebUrl2('dlinacthx',array('act_id' => $_GPC['act_id'])),'success');
  22. }else{
  23. message('编辑失败','','error');
  24. }
  25. }
  26. }
  27. include $this->template('web/dlinaddacthx');