Esempio n. 1
0
 /**
  * 获得一个Request的变量
  * 如果没有在request中定义,则返回一个null
  * 不推荐直接使用,尽量使用in
  *
  * @param string $varname
  * @return mix
  */
 protected function getRequestVar($varname)
 {
     if (isset($_REQUEST[$varname])) {
         /**
          * 容不得考虑仔细了,先满足了再说
          * 系统耦合度已经越来越高了..要坏掉了
          * @author terry
          * @version 0.1.0
          * Thu Feb 14 10:26:10 CST 2008
          */
         if (Watt_Session::getSession()->getUserId()) {
             return $_REQUEST[$varname];
         } else {
             //仅过滤未登录用户输入的信息
             $filterList = Tpm_Config::getUserConfig(Watt_Config::getDefaultZuId(), 'filter_words');
             return Watt_Util_String::filterString($_REQUEST[$varname], $filterList);
         }
         //return $_REQUEST[$varname];
     } else {
         return null;
     }
 }
Esempio n. 2
0
 /**
  *  1 | >0  current version is greater than $toCompareVersion
  *  0 =     current version is equare to $toCompareVersion
  * -1 | <0  current version is less than $toCompareVersion
  * 
  * @return >0 | 0 | <0
  * @author terry
  * Sat Jun 23 12:52:34 CST 2007
  */
 public function compareCurrentVersionToTqVersion($toCompareVersion)
 {
     return Watt_Util_String::compareVersion($this->getTqVersion(), $toCompareVersion);
 }
Esempio n. 3
0
    /**
     * 说明
     *
     * 返回数据列表
     */
    private function html_data()
    {
        /*/$html_data	=	'<table border=1 width=100%>';*/
        // +--------------------------锁定表格--------------------------+
        if ($this->lock_table != 'OFF') {
            $html_data = '<SCRIPT language=JavaScript >
			var DataFields=new Array()
			';
            if (is_array($this->pure_data)) {
                $js_key = 0;
                foreach ($this->pure_data as $key => $var) {
                    $html_data .= "\n\t\t\t\t\t\tDataFields[" . $js_key . "] =new Array(";
                    foreach ($var as $key => $value) {
                        //$value	=	htmlspecialchars($value);
                        $value = addslashes($value);
                        $value = str_replace("\n", "\\", $value);
                        $html_data .= "\"" . $value . "\",";
                    }
                    $html_data = rtrim($html_data, ",");
                    $html_data .= ")\n\t\t\t\t\t\t\t\t   ";
                    $js_key++;
                }
            }
            $html_data .= '</SCRIPT>';
            $html_data .= $this->lock_js();
            $html_data .= '<TR>
			<TD  colspan=50><TABLE cellSpacing=0 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD ><DIV id=TonyDataTable></DIV></TD></TR></TBODY></TABLE></TD></TR>';
            return $html_data;
        }
        // +--------------------------end锁定表格--------------------------+
        // +-------------------------------js-鼠标单击的颜色------------------------------------+
        $html_data .= '<script>
		function R_changeBG(RocID)
		{
			if(document.all)
			{
				var Roc = document.getElementById(RocID)
				var BackGround = Roc.style.background.toUpperCase();
				if (BackGround.match("#FFFADF"))
				{
					Roc.style.background = "#EEF0F6";
				}
				else
				{
					Roc.style.background = "#FFFADF";
				}
			}
		}
						</script>';
        // +-------------------+
        if (is_array($this->pure_data)) {
            foreach ($this->pure_data as $keyz => $var) {
                $html_data .= "<tr  id=\"Roc" . $i . "\" " . $this->html_style[data] . "  onclick=\"R_changeBG('Roc" . $i . "');\" onMouseOver=\"this.className ='bg';\" onMouseOut=\"this.className='source'\">";
                //修改成样式了 Victor 20070613
                foreach ($var as $key => $value) {
                    $html_data .= "<td>" . $value . "</td>";
                }
                $html_data .= "</tr>";
                $i++;
            }
            //小计
            if ($this->xs_xiaoji) {
                $html_data .= "<tr  id=\"Roc" . $i . "\" " . $this->html_style[data] . "  onclick=\"R_changeBG('Roc" . $i . "');\" onMouseOver=\"this.style.backgroundColor ='#FFFFFF';\" onMouseOut=\"this.style.backgroundColor ='#EEF0F6';\">";
                $j = 0;
                foreach ($this->m_tot_arr as $key => $value) {
                    if ($j) {
                        if ($this->format) {
                            if (is_float($value)) {
                                $html_data .= "<td align='right'><b>" . ($value ? Watt_Util_String::sechof($value) : '') . "</b></td>";
                            } else {
                                $html_data .= "<td align='right'><b>" . ($value ? $value : '') . "</b></td>";
                            }
                        } else {
                            $html_data .= "<td align='right'><b>" . ($value ? $value : '') . "</b></td>";
                        }
                    } else {
                        $html_data .= "<td><b>" . $this->z_language['小计'] . "</b></td>";
                    }
                    $j++;
                }
                $html_data .= "</tr>";
            }
            //合计
            if ($this->xs_heji) {
                $html_data .= "<tr  id=\"Roc" . $i . "\" " . $this->html_style[data] . "  onclick=\"R_changeBG('Roc" . $i . "');\" onMouseOver=\"this.style.backgroundColor ='#FFFFFF';\" onMouseOut=\"this.style.backgroundColor ='#EEF0F6';\">";
                $j = 0;
                foreach ($this->tot_arr as $key => $value) {
                    if ($j) {
                        if ($this->format) {
                            if (is_float($value)) {
                                $html_data .= "<td align='right'><b>" . ($value ? Watt_Util_String::sechof($value) : '') . "</b></td>";
                            } else {
                                $html_data .= "<td align='right'><b>" . ($value ? $value : '') . "</b></td>";
                            }
                        } else {
                            $html_data .= "<td align='right'><b>" . ($value ? $value : '') . "</b></td>";
                        }
                    } else {
                        $html_data .= "<td><b>" . $this->z_language['合计'] . "</b></td>";
                    }
                    $j++;
                }
                $html_data .= "</tr>";
            }
        }
        //$html_data	.=	'</table>';
        return $html_data;
    }
Esempio n. 4
0
 public static function statWordsNum($str)
 {
     return Watt_Util_String::getSingleLetterUnicode($str) + Watt_Util_String::getStringUnicode($str);
 }