?? class.viewhandler.inc.php
字號:
<?php // Hack to allow PHP4 use stripos() that is only supported in PHP5if (!function_exists("stripos")) { function stripos($str,$needle) { return strpos(strtolower($str),strtolower($needle)); }}// ******************** END IF $topviewer *******************************$stitle = $_GET['stitle'];$ratesort = $_GET['ratesort'];$current_page = $_GET['current_page'];$this->FG_ORDER = $_GET['order']; // really need ?!$this->FG_SENS = $_GET['sens']; // really need ?if ((count($list)>0) && is_array($list)){ $ligne_number=0;?><script language="JavaScript" type="text/JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}function openURLFilter(theLINK){ selInd = document.theFormFilter.choose_list.selectedIndex; if(selInd==0){return false;} goURL = document.theFormFilter.choose_list.options[selInd].value; this.location.href = theLINK + goURL;}//--></script> <table width="<?php echo $this->FG_VIEW_TABLE_WITDH; ?>" border="0" align="center" cellpadding="0" cellspacing="0"> <?php IF ($this -> CV_DISPLAY_LINE_TITLE_ABOVE_TABLE){ ?> <TR> <TD class="tdstyle_002"><span> <b><?php echo $this -> CV_TEXT_TITLE_ABOVE_TABLE?></b></span> </TD> </TR> <?php } //END IF ?> <?php IF ($this -> CV_DISPLAY_FILTER_ABOVE_TABLE){ ?> <TR><FORM NAME="theFormFilter"> <input type="hidden" name="popup_select" value="<?php echo $_GET['popup_select']?>"> <input type="hidden" name="popup_formname" value="<?php echo $_GET['popup_formname']?>"> <input type="hidden" name="popup_fieldname" value="<?php echo $_GET['popup_fieldname']?>"> <TD class="tdstyle_002"><span > <SELECT name="choose_list" size="1" class="form_input_select" style="width: 185px;" onchange="openURLFilter('<?php echo $_SERVER['PHP_SELF'].$this->CV_FILTER_ABOVE_TABLE_PARAM?>')"> <OPTION><?php echo gettext("Sort");?></OPTION> <?php // TODO not sure for what should be used that, because exist already a filter. if (!isset($list_site)) $list_site = $list; foreach ($list_site as $recordset){ ?> <OPTION class=input value='<?php echo $recordset[0]?>' <?php if ($recordset[0]==$site_id) echo "selected";?>><?php echo $recordset[1]?></OPTION> <?php } ?> </SELECT> </SPAN></TD></FORM> </TR> <?php } //END IF ?> <tr> <td class="viewhandler_table2_td3"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><span class="viewhandler_span1"> - <?php echo strtoupper($this->FG_INSTANCE_NAME) ?> LIST - </span></td> <td align="right"> <span class="viewhandler_span1"> <?php echo $this -> FG_NB_RECORD.' '.gettext("Records"); ?></span></td> </tr> </table></td> </tr> <?php // Add filter FG_FILTER_APPLY , FG_FILTERFIELD and FG_FILTER_FORM_ACTION if ($this -> FG_FILTER_APPLY || $this -> FG_FILTER_APPLY2){ ?> <tr><FORM NAME="theFormFilter" action="<?php echo $_SERVER['PHP_SELF']?>"> <input type="hidden" name="atmenu" value="<?php echo $_GET['atmenu']?>"> <input type="hidden" name="popup_select" value="<?php echo $_GET['popup_select']?>"> <input type="hidden" name="popup_formname" value="<?php echo $_GET['popup_formname']?>"> <input type="hidden" name="popup_fieldname" value="<?php echo $_GET['popup_fieldname']?>"> <INPUT type="hidden" name="form_action" value="<?php echo $this->FG_FILTER_FORM_ACTION ?>"> <td class="viewhandler_filter_td1"> <span > <?php if ($this -> FG_FILTER_APPLY){ ?> <font class="viewhandler_filter_on"><?php echo gettext("FILTER ON ");?> <?php echo strtoupper($this->FG_FILTERFIELDNAME)?> :</font> <INPUT type="text" name="filterprefix" value="" class="form_input_text"> <INPUT type="hidden" name="filterfield" value="<?php echo $this->FG_FILTERFIELD?>"> <?php if ($this -> FG_FILTERTYPE == 'INPUT'){ // IT S OK }elseif ($this -> FG_FILTERTYPE == 'POPUPVALUE'){ ?> <a href="#" onclick="window.open('<?php echo $this->FG_FILTERPOPUP[0]?>popup_formname=theFormFilter&popup_fieldname=filterprefix' <?php echo $this->FG_FILTERPOPUP[1]?>);"><img src="<?php echo Images_Path_Main;?>/icon_arrow_orange.gif"/></a> <?php } } if ($this -> FG_FILTER_APPLY2){ ?> - <font class="viewhandler_filter_on"><?php echo gettext("FILTER ON");?><?php echo strtoupper($this->FG_FILTERFIELDNAME2)?> :</font> <INPUT type="text" name="filterprefix2" value="" class="form_input_text"> <INPUT type="hidden" name="filterfield2" value="<?php echo $this->FG_FILTERFIELD2?>"> <?php if ($this -> FG_FILTERTYPE2 == 'INPUT'){ // IT S OK }elseif ($this -> FG_FILTERTYPE2 == 'POPUPVALUE'){ ?> <a href="#" onclick="window.open('<?php echo $this->FG_FILTERPOPUP2[0]?>popup_formname=theFormFilter&popup_fieldname=filterprefix2' <?php echo $this->FG_FILTERPOPUP2[1]?>);"><img src="<?php echo Images_Path_Main;?>/icon_arrow_orange.gif"/></a> <?php } } ?> <input type="SUBMIT" value="<?php echo gettext("APPLY FILTER ");?>" class="form_input_button"/> </span> </td></FORM> </tr> <?php } ?> <TR> <TD> <TABLE border="0" cellPadding="2" cellSpacing="2" width="100%"> <TR class="form_head"> <?php for($i=0;$i<$this->FG_NB_TABLE_COL;$i++){ ?> <td class="tableBody" style="padding: 2px;" align="center" width="<?php echo $this->FG_TABLE_COL[$i][2]?>" > <strong> <?php if (strtoupper($this->FG_TABLE_COL[$i][4])=="SORT"){?> <a href="<?php echo $_SERVER['PHP_SELF']."?stitle=$stitle&atmenu=$atmenu¤t_page=$current_page&order=".$this->FG_TABLE_COL[$i][1]."&sens="; if ($this->FG_SENS=="ASC"){echo"DESC";}else{echo"ASC";} echo $this-> CV_FOLLOWPARAMETERS;?>"> <font color="#FFFFFF"><?php } ?> <?php echo $this->FG_TABLE_COL[$i][0]?> <?php if ($this->FG_ORDER==$this->FG_TABLE_COL[$i][1] && $this->FG_SENS=="ASC"){?> <img src="<?php echo Images_Path_Main;?>/icon_up_12x12.GIF" border="0"> <?php }elseif ($this->FG_ORDER==$this->FG_TABLE_COL[$i][1] && $this->FG_SENS=="DESC"){?> <img src="<?php echo Images_Path_Main;?>/icon_down_12x12.GIF" border="0"> <?php }?> <?php if (strtoupper($this->FG_TABLE_COL[$i][4])=="SORT"){?> </font></a> <?php }?> </strong></TD> <?php } if ($this->FG_DELETION || $this->FG_EDITION || $this -> FG_OTHER_BUTTON1 || $this -> FG_OTHER_BUTTON2){ ?> <td width="<?php echo $this->FG_ACTION_SIZE_COLUMN?>" align="center" class="tableBody" ><strong> <?php echo gettext("ACTION");?></strong> </td> <?php } ?> </TR> <?php /********************** START BUILDING THE TABLE WITH BROWSING VALUES ************************/ for ($ligne_number=0;$ligne_number<count($list);$ligne_number++){ ?> <TR bgcolor="<?php echo $this->FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]?>" onmouseover="bgColor='#FFDEA6'" onMouseOut="bgColor='<?php echo $this->FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]?>'"> <?php $k=0; for($i=0;$i<$this->FG_NB_TABLE_COL;$i++){ /********************** select the mode to browse define the column value : lie, list, value, eval.... ************************/ if ($this->FG_TABLE_COL[$i][6]=="lie"){ $instance_sub_table = new Table($this->FG_TABLE_COL[$i][7], $this->FG_TABLE_COL[$i][8]); $sub_clause = str_replace("%id", $list[$ligne_number][$i-$k], $this->FG_TABLE_COL[$i][9]); $select_list = $instance_sub_table -> Get_list ($this->DBHandle, $sub_clause, null, null, null, null, null, null); $field_list_sun = split(',',$this->FG_TABLE_COL[$i][8]); $record_display = $this->FG_TABLE_COL[$i][10]; for ($l=1;$l<=count($field_list_sun);$l++){ $record_display = str_replace("%$l", $select_list[0][$l-1], $record_display); } }elseif ($this->FG_TABLE_COL[$i][6]=="eval"){ $string_to_eval = $this->FG_TABLE_COL[$i][7]; // %4-%3 for ($ll=0;$ll<=15;$ll++){ if ($list[$ligne_number][$ll]=='') $list[$ligne_number][$ll]=0; $string_to_eval = str_replace("%$ll", $list[$ligne_number][$ll], $string_to_eval); } eval("\$eval_res = $string_to_eval;"); $record_display = $eval_res; //$record_display = "\$eval_res = $string_to_eval"; }elseif ($this->FG_TABLE_COL[$i][6]=="list"){ $select_list = $this->FG_TABLE_COL[$i][7]; $record_display = $select_list[$list[$ligne_number][$i-$k]][0]; }elseif ($this->FG_TABLE_COL[$i][6]=="value"){ $record_display = $this->FG_TABLE_COL[$i][7]; $k++; }else{ $record_display = $list[$ligne_number][$i-$k]; } /********************** IF LENGHT OF THE VALUE IS TOO LONG IT MIGHT BE CUT ************************/ if ( is_numeric($this->FG_TABLE_COL[$i][5]) && (strlen($record_display) > $this->FG_TABLE_COL[$i][5]) ){ $record_display = substr($record_display, 0, $this->FG_TABLE_COL[$i][5]).""; } /*
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -