人人商城

manage.ctrl.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('permission');
  8. $account_info = permission_user_account_num();
  9. $do = safe_gpc_belong($do, array('create', 'list', 'create_display'), 'list');
  10. if($do == 'create') {
  11. if(!checksubmit()) {
  12. echo '非法提交';
  13. return;
  14. }
  15. if (!permission_user_account_creatable($_W['uid'], WEBAPP_TYPE_SIGN)) {
  16. itoast('创建PC个数已满', url('account/display', array('type' => WEBAPP_TYPE_SIGN)));
  17. }
  18. $data = array(
  19. 'name' => safe_gpc_string($_GPC['name']),
  20. 'description' => safe_gpc_string($_GPC['description'])
  21. );
  22. $account_table = table('account');
  23. $account_table->searchWithTitle($data['name']);
  24. $account_table->searchWithType(ACCOUNT_TYPE_WEBAPP_NORMAL);
  25. $exists = $account_table->searchAccountList();
  26. if (!empty($exists)) {
  27. itoast('该PC名称已经存在!', url('account/display', array('type' => XZAPP_TYPE_SIGN)), 'error');
  28. }
  29. $webapp = table('webapp');
  30. $uniacid = $webapp->createWebappInfo($data, $_W['uid']);
  31. if($uniacid){
  32. itoast('创建成功', url('account/display', array('type' => WEBAPP_TYPE_SIGN)));
  33. }
  34. }
  35. if($do == 'create_display') {
  36. if(!permission_user_account_creatable($_W['uid'], WEBAPP_TYPE_SIGN)) {
  37. itoast('创建PC个数已满', url('account/display', array('type' => WEBAPP_TYPE_SIGN)));
  38. }
  39. template('webapp/create');
  40. }