| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- if (!defined('IN_MYMPS')) {
- exit('Forbidden');
- }
- require_once MYMPS_INC . '/class.fun.php';
- if (submit_check('shop_submit')) {
- $tname = isset($tname) ? trim($tname) : '';
- $introduce = trim($introduce);
- $catid = intval($catid);
- $areaid = intval($areaid);
- $msn = trim($msn);
- $mappoint = trim($mappoint);
- $address = trim($address);
- $busway = trim($busway);
- $busway = textarea_post_change($busway);
- $template = trim($template);
- $web = trim($web);
- $keywords = $keywords ? str_replace(',', ',', $keywords) : '';
- $name_file = 'banner';
- $ac = $ac ? $ac : 'base';
- $hourstime1 = $hourstime1 ? intval($hourstime1) : '';
- $hourstime2 = $hourstime2 ? intval($hourstime2) : '';
- $hourstime3 = $hourstime3 ? intval($hourstime3) : '';
- $hourstime4 = $hourstime4 ? intval($hourstime4) : '';
- $hourstime = $hourstime1 . ':' . $hourstime2 . '-' . $hourstime3 . ':' . $hourstime4;
- if (is_array($catid) && $if_corp == 1) {
- mymps_delete('member_category', 'WHERE userid = \'' . $s_uid . '\'');
- foreach ($catid as $kids => $vids) {
- $db->query('INSERT `' . $db_mymps . 'member_category` (userid,catid)VALUES(\'' . $s_uid . '\',\'' . $vids . '\')');
- }
- $catids = implode(',', $catid);
- }
- if ($if_corp == 1) {
- if ($ac == 'base') {
- if (empty($tname)) {
- write_msg('', '?m=shop&type=corp&error=39');
- }
- if (empty($areaid)) {
- write_msg('', '?m=shop&type=corp&error=40');
- }
- $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\'');
- write_msg('', '?m=shop&type=corp&success=13');
- }
- else if ($ac == 'template') {
- if ($_FILES[$name_file]['name']) {
- require_once MYMPS_INC . '/upfile.fun.php';
- check_upimage($name_file);
- $destination = '/banner/' . date('Ym') . '/';
- $mymps_image = start_upload($name_file, $destination, 0, '', '', $oldbanner, '');
- $picture = $mymps_image;
- unset($mymps_image);
- unset($_FILES);
- }
- else {
- $picture = $oldbanner ? $oldbanner : '';
- }
- $db->query('UPDATE `' . $db_mymps . 'member` SET template=\'' . $template . '\',banner=\'' . $picture . '\' WHERE userid = \'' . $s_uid . '\'');
- write_msg('', '?m=shop&type=corp&success=8&ac=template');
- }
- }
- else {
- if (empty($tname)) {
- write_msg('', '?m=shop&type=corp&error=39');
- }
- if (empty($areaid)) {
- write_msg('', '?m=shop&type=corp&error=40');
- }
- if (empty($address)) {
- write_msg('', '?m=shop&type=corp&error=45');
- }
- if (empty($introduce)) {
- write_msg('', '?m=shop&type=corp&error=46');
- }
- $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);
- write_msg('', '?m=shop&type=corp&success=14');
- }
- }
- else {
- $ac = $ac ? trim($ac) : 'base';
- if ($ac == 'base') {
- $acontent = get_editor('introduce', 'Member', $row['introduce'], '95%', '300px');
- $get_member_cat = get_member_cat(explode(',', $row['catid']), false);
- $row['busway'] = de_textarea_post_change($row['busway']);
- $location = location('corp');
- $q = explode('-', $row[hourstime]);
- $w = explode(':', $q[0]);
- $e = explode(':', $q[1]);
- $row['hourstime1'] = $w[0];
- $row['hourstime2'] = $w[1];
- $row['hourstime3'] = $e[0];
- $row['hourstime4'] = $e[1];
- include mymps_tpl('shop');
- }
- else {
- chk_member_purview('purview_banner');
- require_once MYMPS_DATA . '/config.inc.php';
- $location = location('corp');
- include mymps_tpl('shop_template');
- }
- }
- ?>
|