inc_shop.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. if (!defined('IN_MYMPS')) {
  3. exit('Forbidden');
  4. }
  5. require_once MYMPS_INC . '/class.fun.php';
  6. if (submit_check('shop_submit')) {
  7. $tname = isset($tname) ? trim($tname) : '';
  8. $introduce = trim($introduce);
  9. $catid = intval($catid);
  10. $areaid = intval($areaid);
  11. $msn = trim($msn);
  12. $mappoint = trim($mappoint);
  13. $address = trim($address);
  14. $busway = trim($busway);
  15. $busway = textarea_post_change($busway);
  16. $template = trim($template);
  17. $web = trim($web);
  18. $keywords = $keywords ? str_replace(',', ',', $keywords) : '';
  19. $name_file = 'banner';
  20. $ac = $ac ? $ac : 'base';
  21. $hourstime1 = $hourstime1 ? intval($hourstime1) : '';
  22. $hourstime2 = $hourstime2 ? intval($hourstime2) : '';
  23. $hourstime3 = $hourstime3 ? intval($hourstime3) : '';
  24. $hourstime4 = $hourstime4 ? intval($hourstime4) : '';
  25. $hourstime = $hourstime1 . ':' . $hourstime2 . '-' . $hourstime3 . ':' . $hourstime4;
  26. if (is_array($catid) && $if_corp == 1) {
  27. mymps_delete('member_category', 'WHERE userid = \'' . $s_uid . '\'');
  28. foreach ($catid as $kids => $vids) {
  29. $db->query('INSERT `' . $db_mymps . 'member_category` (userid,catid)VALUES(\'' . $s_uid . '\',\'' . $vids . '\')');
  30. }
  31. $catids = implode(',', $catid);
  32. }
  33. if ($if_corp == 1) {
  34. if ($ac == 'base') {
  35. if (empty($tname)) {
  36. write_msg('', '?m=shop&type=corp&error=39');
  37. }
  38. if (empty($areaid)) {
  39. write_msg('', '?m=shop&type=corp&error=40');
  40. }
  41. $db->query('UPDATE `' . $db_mymps . 'member` SET keywords=\'' . $keywords . '\',tname=\'' . $tname . '\',catid=\'' . $catid . '\',areaid=\'' . $areaid . '\',introduce=\'' . $introduce . '\',address=\'' . $address . '\',busway=\'' . $busway . '\',mappoint=\'' . $mappoint . '\',msn=\'' . $msn . '\',web=\'' . $web . '\',hourstime=\'' . $hourstime . '\' ' . $where . ' AND if_corp = \'1\'');
  42. write_msg('', '?m=shop&type=corp&success=13');
  43. }
  44. else if ($ac == 'template') {
  45. if ($_FILES[$name_file]['name']) {
  46. require_once MYMPS_INC . '/upfile.fun.php';
  47. check_upimage($name_file);
  48. $destination = '/banner/' . date('Ym') . '/';
  49. $mymps_image = start_upload($name_file, $destination, 0, '', '', $oldbanner, '');
  50. $picture = $mymps_image;
  51. unset($mymps_image);
  52. unset($_FILES);
  53. }
  54. else {
  55. $picture = $oldbanner ? $oldbanner : '';
  56. }
  57. $db->query('UPDATE `' . $db_mymps . 'member` SET template=\'' . $template . '\',banner=\'' . $picture . '\' WHERE userid = \'' . $s_uid . '\'');
  58. write_msg('', '?m=shop&type=corp&success=8&ac=template');
  59. }
  60. }
  61. else {
  62. if (empty($tname)) {
  63. write_msg('', '?m=shop&type=corp&error=39');
  64. }
  65. if (empty($areaid)) {
  66. write_msg('', '?m=shop&type=corp&error=40');
  67. }
  68. if (empty($address)) {
  69. write_msg('', '?m=shop&type=corp&error=45');
  70. }
  71. if (empty($introduce)) {
  72. write_msg('', '?m=shop&type=corp&error=46');
  73. }
  74. $db->query('UPDATE `' . $db_mymps . 'member` SET keywords=\'' . $keywords . '\',tname=\'' . $tname . '\',catid=\'' . $catids . '\',areaid=\'' . $areaid . '\',introduce=\'' . $introduce . '\',address=\'' . $address . '\',busway=\'' . $busway . '\',mappoint=\'' . $mappoint . '\',msn=\'' . $msn . '\',template=\'' . $template . '\',template=\'' . $template . '\',web=\'' . $web . '\',if_corp=\'1\',hourstime=\'' . $hourstime . '\' ' . $where);
  75. write_msg('', '?m=shop&type=corp&success=14');
  76. }
  77. }
  78. else {
  79. $ac = $ac ? trim($ac) : 'base';
  80. if ($ac == 'base') {
  81. $acontent = get_editor('introduce', 'Member', $row['introduce'], '95%', '300px');
  82. $get_member_cat = get_member_cat(explode(',', $row['catid']), false);
  83. $row['busway'] = de_textarea_post_change($row['busway']);
  84. $location = location('corp');
  85. $q = explode('-', $row[hourstime]);
  86. $w = explode(':', $q[0]);
  87. $e = explode(':', $q[1]);
  88. $row['hourstime1'] = $w[0];
  89. $row['hourstime2'] = $w[1];
  90. $row['hourstime3'] = $e[0];
  91. $row['hourstime4'] = $e[1];
  92. include mymps_tpl('shop');
  93. }
  94. else {
  95. chk_member_purview('purview_banner');
  96. require_once MYMPS_DATA . '/config.inc.php';
  97. $location = location('corp');
  98. include mymps_tpl('shop_template');
  99. }
  100. }
  101. ?>