addbottom.inc.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $info = pdo_get('zhtc_bottom', array('id' => $_GPC['id']));
  5. if (checksubmit('submit')) {
  6. if (!$_GPC['title']) {
  7. message('标题不能为空', '', 'error');
  8. }
  9. if (!$_GPC['logo'] || !$_GPC['logo2']) {
  10. message('图片不能为空', '', 'error');
  11. }
  12. $data['title'] = $_GPC['title'];
  13. $data['logo'] = $_GPC['logo'];
  14. $data['logo2'] = $_GPC['logo2'];
  15. if ($_GPC['title_color']) {
  16. $data['title_color'] = $_GPC['title_color'];
  17. } else {
  18. $data['title_color'] = "#ff7f46";
  19. }
  20. if ($_GPC['title_color2']) {
  21. $data['title_color2'] = $_GPC['title_color2'];
  22. } else {
  23. $data['title_color2'] = "#888";
  24. }
  25. if ($_GPC['item'] == 1) {
  26. $data['url'] = $_GPC['url'];
  27. } elseif ($_GPC['item'] == 2) {
  28. $data['src2'] = $_GPC['src2'];
  29. } elseif ($_GPC['item'] == 3) {
  30. $data['xcx_name'] = $_GPC['xcx_name'];
  31. $data['appid'] = trim($_GPC['appid']);
  32. }
  33. $data['item'] = $_GPC['item'];
  34. $data['num'] = $_GPC['num'];
  35. $data['uniacid'] = $_W['uniacid'];
  36. $data['state'] = $_GPC['state'];
  37. if ($_GPC['id'] == '') {
  38. $res = pdo_insert('zhtc_bottom', $data);
  39. if ($res) {
  40. message('添加成功!', $this->createWebUrl('bottom'), 'success');
  41. } else {
  42. message('添加失败!', '', 'error');
  43. }
  44. } else {
  45. $res = pdo_update('zhtc_bottom', $data, array('id' => $_GPC['id']));
  46. if ($res) {
  47. message('编辑成功!', $this->createWebUrl('bottom'), 'success');
  48. } else {
  49. message('编辑失败!', '', 'error');
  50. }
  51. }
  52. }
  53. include $this->template('web/addbottom');