コード例 #1
0
ファイル: MooMySQLDebug.inc.php プロジェクト: noikiy/zays
\t.moodebugtable td, .moodebugtable2 td {border:1px solid #000;background:#EFF5D9;padding: 2px;font-size: 12px;}
\t.moodebugtable2 th {background:#E5EAD1;}
\t.moodebugtable2 td {background:#FFFFFF;}
\t.firsttr td {border-top:0;}
\t.firsttd {border-left:none !important;}
\t.bold {font-weight:bold;}
\t</style>
\t<div id="MooPHP_debug" style="display:;">
EOF;
    $class = 'moodebugtable2';
    if (empty($_MooPHP['debug_query'])) {
        $_MooPHP['debug_query'] = array();
    }
    foreach ($_MooPHP['debug_query'] as $key => $debug) {
        $class == 'moodebugtable' ? $class = 'moodebugtable2' : ($class = 'moodebugtable');
        echo '<table cellspacing="0" class="' . $class . '"><tr><th rowspan="2" width="20">' . ($key + 1) . '</th><td width="60">' . $debug['time'] . ' ms</td><td class="bold">' . MooHtmlspecialchars($debug['sql']) . '</td></tr>';
        if (!empty($debug['info'])) {
            echo '<tr><td>Info</td><td>' . $debug['info'] . '</td></tr>';
        }
        if (!empty($debug['explain'])) {
            echo '<tr><td>Explain</td><td><table cellspacing="0"><tr class="firsttr"><td width="5%" class="firsttd">id</td><td width="10%">type</td><td width="12%">table</td><td width="5%">type</td><td width="20%">possible_keys</td><td width="10%">key</td><td width="8%">key_len</td><td width="5%">ref</td><td width="5%">rows</td><td width="20%">Extra</td></tr><tr>';
            foreach ($debug['explain'] as $key => $explain) {
                $key == 'id' ? $tdclass = ' class="firsttd"' : ($tdclass = '');
                if (empty($explain)) {
                    $explain = '-';
                }
                echo '<td' . $tdclass . '>' . $explain . '</td>';
            }
            echo '</tr></table></td></tr>';
        }
        echo '</table>';
コード例 #2
0
ファイル: index.php プロジェクト: noikiy/zays
function about_getsave()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    $sid = $user_arr['sid'];
    $uid = $user_arr['uid'];
    if (empty($uid)) {
        header("location:login.html");
    }
    $returnurl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $ispost = MooGetGPC('ispost', 'integer', 'P');
    if ($ispost == 1) {
        $type1 = MooGetGPC('type1', 'integer', 'P');
        $type2 = MooGetGPC('type2', 'integer', 'P');
        $complaint_type = MooGetGPC('complaint_type', 'integer', 'P');
        // 提交的内容不能超过600长度的字符
        //$message1 = MooCutstr(MooGetGPC('message1','string'),600);
        //$message2 = MooCutstr(MooGetGPC('message2','string'),600);
        $message1 = safeFilter(MooGetGPC('message1', 'string', 'P'));
        $message2 = safeFilter(MooGetGPC('message2', 'string', 'P'));
        $message1 = MooHtmlspecialchars($message1);
        $message2 = MooHtmlspecialchars($message2);
        if ($complaint_type == 1) {
            if ($type1 == 0) {
                //提示消息
                MooMessage("请选择对网站功能的评价反馈意见类型!", $returnurl, '02');
                exit;
            }
            if ($message1 == '') {
                //提示消息
                MooMessage("请提供宝贵的对网站功能评价反馈的意见!", $returnurl, '02');
                exit;
            }
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_getadvice SET uid='{$userid}',stat1='{$type1}',stat2='1',content='{$message1}',submitdate='{$timestamp}'");
        } else {
            if (!$sid) {
                MooMessage("您还没有专属真爱一生,不能进行此操作!", $returnurl, '02');
                exit;
            }
            $fraction = MooGetGPC('fraction', 'string', 'P');
            if ($type2 == 0) {
                //提示消息
                MooMessage("请选择反馈对真爱一生人工服务意见类型!", $returnurl, '02');
                exit;
            }
            if ($fraction < 1) {
                //提示消息
                MooMessage("请给您的专属真爱一生打分!", $returnurl, '02');
                exit;
            }
            if ($message2 == '') {
                //提示消息
                MooMessage("请提供宝贵的对真爱一生人工服务的评价!", $returnurl, '02');
                exit;
            }
            $fraction_arr = array(1 => '非常不满意', 2 => '不满意', 3 => '一般', 4 => '满意', 5 => '非常满意');
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_getadvice SET uid='{$userid}',stat1='{$type2}',stat2='2',content='{$message2}',submitdate='{$timestamp}', fraction='{$fraction}', sid='{$sid}'");
            $awoketime = time() + 3600;
            $reptime = time();
            if ($fraction < 3) {
                //查此客服的组长
                $sql = "SELECT manage_list FROM web_admin_manage WHERE type=1 AND find_in_set({$sid},manage_list) LIMIT 1";
                $manage_list = $_MooClass['MooMySQL']->getOne($sql);
                if (!empty($manage_list)) {
                    $group_leader = implode(',', $GLOBALS['admin_leader']);
                    $sql = "SELECT uid,groupid FROM web_admin_user WHERE uid IN({$manage_list['manage_list']}) AND groupid IN({$group_leader})";
                    $admin_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                }
                $leaderid = $admin_user['uid'];
                $title = '会员 ' . $uid . ' 对客服 ' . $sid . ' 的服务评价:' . $fraction_arr[$fraction];
                $sql_remark = "insert into web_admin_remark set sid='{$leaderid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$reptime}'";
                $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql_remark);
            }
            $title = '会员 ' . $uid . ' 对您的服务评价:' . $fraction_arr[$fraction];
            $sql_remark = "insert into web_admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$reptime}'";
            $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql_remark);
        }
        if ($type2 == 1 || $type1 == 1) {
            $msg = "感谢您对真爱一生网一如既往的支持与厚爱,愿您早日找到属于自己的缘分!服务热线400-8787-920,祝您生活愉快!";
        } elseif ($type2 == 2 || $type1 == 2) {
            $msg = "感谢您对真爱一生网的关注,给您带来的不便,请您谅解!您的情况相关部门会进行严肃核查并给您合理答复。真爱一生网一直致力于改善和提高服务质量,同时也希望得到您的监督。服务热线400-8787-920,祝您生活愉快!";
        } elseif ($type2 == 3 || $type1 == 3) {
            $msg = "感谢您提出的宝贵意见,您的意见将会及时的反馈到相关部门,感谢您的大力支持,服务热线400-8787-920,祝您生活愉快!";
        }
        //邮件回复提醒
        $sql = "INSERT INTO {$GLOBALS['dbTablePre']}services(s_cid,s_uid,s_fromid,s_title,s_content,s_time,is_server,sid,flag)\n\t\t\t\tVALUES(3,{$uid},'{$sid}','真爱一生消息','{$msg}','{$GLOBALS['timestamp']}','1','{$sid}','1')";
        $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        //短信回复提醒
        $msg = "您的意见已收到,我们会第一时间处理。感谢您的支持。祝您生活愉快!客服热线:4006780405";
        Push_message_intab($user_arr['uid'], $user_arr['telphone'], "邮件回复", $msg, "system");
        /*if($type1!='0' && $type2=='0'){
        			if($message1==''){
        				//提示消息
        				MooMessage("请提供宝贵的对网站功能评价反馈的意见!", $returnurl,'02');
        				exit;
        			}	
        		}
        		if($type1=='0' && $type2!='0'){
        			if($message2==''){
        				//提示消息
        				MooMessage("请提供宝贵的对真爱一生人工服务的评价!", $returnurl,'02');
        				exit;
        			}	
        		}
        		if($type1!='0' && $type2!='0'){
        			if($message1==''){
        				//提示消息
        				MooMessage("请提供宝贵的对网站功能评价反馈的意见!", $returnurl,'02');
        				exit;
        			}	
        			if($message2==''){
        				//提示消息
        				MooMessage("请提供宝贵的对真爱一生人工服务的评价!", $returnurl,'02');
        				exit;
        			}	
        		}
        		if($type1=='0' && $type2=='0'){
        			//提示消息
        			MooMessage("请选择反馈意见类型!", $returnurl,'02');
        			exit;
        		}
        		if($message1!='' && $type1=='0'){
        			//提示消息
        			MooMessage("请选择对网站功能的评价反馈意见类型!", $returnurl,'02');
        			exit;
        		}
        		if($message2!='' && $type2=='0'){
        			//提示消息
        			MooMessage("请选择对真爱一生人工服务的评价类型!", $returnurl,'02');
        			exit;
        		}
        */
        //note 	如果提交成功显示页面
        if ($message1 || $message2) {
            //提示消息
            MooMessage("您的反馈成功,感谢您的反馈!", "index.php?n=service", '05');
        }
        exit;
    }
    $left_menu = 'getsave';
    require MooTemplate('public/about_getsave', 'module');
}
コード例 #3
0
 /**
  * 生成表单信息
  *
  * @param string $setName : 设置的标题名称
  * @param string $varName : 生产的表单变量的名称
  * @param string $value : 生产的表单初始值
  * @param string $type : 生产的表单类型
  * @param string $width :左表格和占的宽度比例
  * @param string $disabled : 是否禁止提交或者设置为只读(readonly)
  * @param string $hidden : 是否增加隐藏的折叠层
  * @param string $comment : 设置的说明
  * @param array $lang : 语言包数组
  * @return void stdout
  */
 function showForm($setName, $varName, $value, $type = 'radio', $width = '45%', $disabled = '', $hidden = 0, $comment = '', $lang = array())
 {
     $check = array();
     $check['default'] = isset($check['default']) ? $check['default'] : '';
     $check['true'] = isset($check['true']) ? $check['true'] : '';
     $check['false'] = isset($check['false']) ? $check['false'] : '';
     $lang = !empty($lang) ? $lang : array('yes' => 'yes', 'no' => 'no', 'default' => 'default');
     $check['disabled'] = $disabled ? ' disabled' : '';
     $width = !$width ? '45%' : $width;
     $aligntop = $type == "textarea" || $width != "45%" ? "valign=\"top\"" : NULL;
     echo "<tr><td width=\"{$width}\" class=\"altbg1\" {$aligntop}>" . '<b>' . $setName . '</b>' . ($comment ? '<br /><span class="smalltxt">' . $comment . '</span>' : NULL) . ($disabled ? '<br /><span class="smalltxt" style="color:#FF0000">' . $lang[$setName . '_disabled'] . '</span>' : NULL) . '</td>' . '<td class="altbg2">';
     if ($type == 'radio') {
         $value ? $check['true'] = "checked" : ($check['false'] = "checked");
         $value ? $check['false'] = '' : ($check['true'] = '');
         $check['hidden1'] = $hidden ? 'onclick="$(\'hidden_' . $setName . '\').style.display = \'\';"' : '';
         $check['hidden0'] = $hidden ? 'onclick="$(\'hidden_' . $setName . '\').style.display = \'none\';"' : '';
         echo "<input class=\"radio\" type=\"radio\" name=\"{$varName}\" value=\"1\" {$check['true']} {$check['hidden1']} {$check['disabled']}> {$lang['yes']} &nbsp; &nbsp; \n" . "<input class=\"radio\" type=\"radio\" name=\"{$varName}\" value=\"0\" {$check['false']} {$check['hidden0']} {$check['disabled']}> {$lang['no']}\n";
     } elseif ($type == 'radioPlus') {
         $value == -1 ? $check['default'] = 'checked' : ($value ? $check['true'] = 'checked' : ($check['false'] = 'checked'));
         echo "<input class=\"radio\" type=\"radio\" name=\"{$varName}\" value=\"-1\" {$check['default']}> " . $lang['default'] . " &nbsp; &nbsp; \n" . "<input class=\"radio\" type=\"radio\" name=\"{$varName}\" value=\"1\" {$check['true']}> {$lang['yes']} &nbsp; &nbsp; \n" . "<input class=\"radio\" type=\"radio\" name=\"{$varName}\" value=\"0\" {$check['false']}> {$lang['no']}\n";
     } elseif ($type[0] == 'm') {
         if (substr($type, 1) == 'radio') {
             $radiocheck = array($value => ' checked');
             $split = count($varName[1]) > 2 ? '<br />' : ' &nbsp; &nbsp; ';
             foreach ($varName[1] as $varary) {
                 $onclick = '';
                 if (!empty($varary[2])) {
                     foreach ($varary[2] as $ctrlid => $display) {
                         $onclick .= '$(\'' . $ctrlid . '\').style.display = \'' . $display . '\';';
                     }
                 }
                 $varary[0] = isset($varary[0]) ? $varary[0] : '';
                 $varary[1] = isset($varary[1]) ? $varary[1] : '';
                 $varName[0] = isset($varName[0]) ? $varName[0] : '';
                 if (!empty($varary[0])) {
                     $radiochecked = !empty($radiocheck[$varary[0]]) ? $radiocheck[$varary[0]] : '';
                 } else {
                     $radiochecked = '';
                 }
                 $onclick = $onclick ? ' onclick="' . $onclick . '"' : '';
                 echo '<input class="radio" type="radio" name="' . $varName[0] . '" value="' . $varary[0] . '"' . $radiochecked . $check['disabled'] . $onclick . '> ' . $varary[1] . $split;
             }
         } else {
             $checkboxs = count($varName[1]);
             $value = sprintf('%0' . $checkboxs . 'b', $value);
             $i = 1;
             foreach ($varName[1] as $key => $var) {
                 echo '<input class="checkbox" type="checkbox" name="' . $varName[0] . '[' . $i . ']" value="1"' . ($value[$checkboxs - $i] ? ' checked' : '') . ' ' . (!empty($varName[2][$key]) ? $varName[2][$key] : '') . '> ' . $var . '<br />';
                 $i++;
             }
         }
     } elseif ($type == 'text' || $type == 'password') {
         echo "<input type=\"{$type}\" size=\"50\" name=\"{$varName}\" value=\"" . MooHtmlspecialchars($value) . "\" {$check['disabled']}>\n";
     } elseif ($type == 'calendar') {
         echo "<input type=\"{$type}\" size=\"50\" name=\"{$varName}\" value=\"" . MooHtmlspecialchars($value) . "\" onclick=\"showcalendar(event, this)\">\n";
     } elseif ($type == 'textarea') {
         $readonly = $disabled ? 'readonly' : '';
         echo "<img src=\"./" . MOOPHP_ADMIN_DIR . "/images/zoomin.gif\" onmouseover=\"this.style.cursor='pointer'\" onclick=\"zoomtextarea('{$varName}', 1)\"> <img src=\"./" . MOOPHP_ADMIN_DIR . "/images/zoomout.gif\" onmouseover=\"this.style.cursor='pointer'\" onclick=\"zoomtextarea('{$varName}', 0)\"><br /><textarea {$readonly} rows=\"6\" name=\"{$varName}\" id=\"{$varName}\" cols=\"50\">" . MooHtmlspecialchars($value) . "</textarea>";
     } elseif ($type == 'select') {
         echo '<select name="' . $varName[0] . '" style="width: 55%">';
         foreach ($varName[1] as $option) {
             $selected = $option[0] == $value ? 'selected' : '';
             echo "<option value=\"{$option['0']}\" {$selected}>" . $option[1] . "</option>\n";
         }
         echo '</select>';
     } else {
         echo $type;
     }
     echo '</td></tr>';
     if ($hidden) {
         echo '</tbody><tbody class="sub" id="hidden_' . $setName . '" style="display: ' . ($value ? '' : 'none') . '">';
     }
     echo "\n\n";
 }