Example #1
0
     echo "\n<FORM method='post' name='commonfrm' enctype='multipart/form-data' action='$parent?common_mod=postadd$temp_query'  onSubmit='submitonce(this)'>\n";
     echo "<TABLE WIDTH='100%'' BORDER='1'' BGCOLOR=#C0C0FF>";
     $result=executesql("show fields from $common_tbname");
     $cols=mysql_num_rows($result);
     for ($i=0;$i<$cols;$i++) {
         $value=mysql_result($result,$i,'field');
         $type=mysql_result($result,$i,'type');
         $chsvalue=getchsname($value,$common_chsfield);
         $inputfield='';

					$factarray="common_ar_$value";
					$factarray=$$factarray;
					if (is_array($factarray)) {  //采用单选输入框
						$rel_array="common_rel_$value";
						$rel_array=$$rel_array;
						$inputfield=extinput($value,1,$fact,$factarray,$rel_array);
					}else{
      			$inputfield=getinput($value,$type,$fact,$len,$appendstyle);
					}
         	if ($inputfield<>'') {
         		echo "<TR>";
         		echo "<TD>$chsvalue</TD>\n";
         		echo "<TD>$inputfield</TD></TR>\n";
         	}
     }

     $cols--;
     echo "<TR><TD colspan=$cols><INPUT TYPE='SUBMIT' name='add' value='确认'><TD></TR></TABLE></FORM>\n";
     exit;
  }
Example #2
0
    for ($i=0;$i< $common->cols;$i++){
    	$value=$common->fieldsinfo[$i]->name;
    	$chsvalue=$common->getchsname($value);
  		$factarray="common_ar_$value";
  		$factarray=$$factarray;
  		$appendstyle="common_ap_$value";
  		$appendstyle=$$appendstyle;
  		$fact="common_default_$value";
  		$fact=$$fact;
  		$tmp="common_extprg_".$value; //如果这个字段存在扩展调用外部程序,则隐藏
  		if (isset($$tmp))
  			$appendstyle="hidden";
  		if (is_array($factarray)) {  //采用单选输入框
  			$rel_array="common_rel_$value";
  			$rel_array=$$rel_array;
  			$inputfield=extinput($value,1,$fact,$factarray,$rel_array,$appendstyle,$common->fieldsinfo[$i]->maxlength);
  		}else{
        $inputfield=getinput($value,$common->fieldsinfo[$i]->type,$fact,$common->fieldsinfo[$i]->maxlength,$appendstyle);
  		}
			$tmp="common_attach_$value";
			if ($$tmp==1) {
				$fact=uniqid("xq");
				$inputfield="<INPUT TYPE=hidden NAME=\"$value\" value=\"$fact\"><iframe allowTransparency=true height=80 width=308 SCROLLING=AUTO FRAMEBORDER=0 src=\"$parentdir/attachment.php?attachid=$fact\" ></iframe>";
			}
      if ($inputfield<>'') {
        if ($appendstyle=="hidden") {
        	echo $inputfield;
        }else{
           echo "<TH>$chsvalue</TH>\n";
           echo "<TD>$inputfield</TD></TR>\n";
         }