inputModel.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. class inputClassModel extends Model
  3. {
  4. public function initModel()
  5. {
  6. $this->settable('flow_element');
  7. }
  8. public function getsubtable($modeid,$iszb=1, $hang=1, $ism=0, &$zbshu=1)
  9. {
  10. if($iszb<=0)$iszb=1;
  11. if($hang<=0)$hang=1;
  12. $rows = $this->getall("`mid`='$modeid' and `iszb`=$iszb and `islu`=1",'`isbt`,`fields`,`fieldstype`,`name`','`sort`');
  13. if(!$rows)return '';
  14. $xu = $iszb-1;
  15. $str = '<table class="tablesub" id="tablesub'.$xu.'" style="width:100%;" border="0" cellspacing="0" cellpadding="0">';
  16. $str.='<tr>';
  17. $str.='<td width="10%" nowrap>序号</td>';
  18. $yfsr= array('hidden','fixed');
  19. $yczd= array();
  20. $zlen= 0;
  21. foreach($rows as $k=>$rs){
  22. $zlen++;
  23. $xh = '';
  24. if($rs['isbt']==1)$xh='*';
  25. if(in_array($rs['fieldstype'], $yfsr)){
  26. $yczd[] = $rs['fields'];
  27. continue;
  28. }
  29. $str.='<td nowrap>'.$xh.''.$rs['name'].'</td>';
  30. }
  31. $strm = '<table class="tablesub" id="tablesub'.$xu.'" style="width:100%;" border="0" cellspacing="0" cellpadding="0"><tr style="display:none"><td>{subzbname'.$xu.'}</td></tr>';
  32. $zbshu = $zlen;
  33. $str.='<td width="5%" nowrap>操作</td>';
  34. $str.='</tr>';
  35. $strm1= '';
  36. for($j=0;$j<$hang;$j++){
  37. $str.='<tr>';
  38. $str.='<td>[xuhao'.$xu.','.$j.']</td>';
  39. $yoi =0;
  40. $tstr= '';
  41. foreach($rows as $k=>$rs){
  42. if(in_array($rs['fieldstype'], $yfsr))continue;
  43. $tstr='['.$rs['fields'].''.$xu.','.$j.']';
  44. if(isset($rows[$k+1]) && in_array($rows[$k+1]['fieldstype'], $yfsr)){
  45. $tstr.='['.$rows[$k+1]['fields'].''.$xu.','.$j.']'; //隐藏字段
  46. }
  47. $xh = '';
  48. if($rs['isbt']==1)$xh='*';
  49. $strm1.='<div class="divzb0"><div class="divzb1"><div style="margin-right:8px">'.$xh.''.$rs['name'].'</div></div><div class="divzb2" align="left">'.$tstr.'</div></div>';
  50. $str .='<td>'.$tstr.'</td>';
  51. $yoi++;
  52. }
  53. $str.='<td>{删,'.$xu.'}</td>';
  54. $str.='</tr>';
  55. }
  56. $str.='</table>';
  57. //$strm.= '<td>[xuhao'.$xu.',0]'.$strm1.'{删,'.$xu.'}</td></tr></table>';
  58. $strm.= '<tr><td>';
  59. $strm.= '<div style="height:35px;overflow:hidden;padding-left:10px;margin-top:5px"><div style="float:left;line-height:35px;color:#888888;font-size:12px;">{subzbname'.$xu.'}</div><div style="width:60px;float:left;">[xuhao'.$xu.',0]</div></div>';
  60. $strm.= '<div style="background:white;padding:8px">'.$strm1.'</div>';
  61. $strm.= '&nbsp;&nbsp;&nbsp;{删,'.$xu.'}';
  62. $strm.= '</td></tr></table>';
  63. if($ism==0)$str.='<div class="addys">{新增,'.$xu.'}</div>';
  64. if($ism==1){
  65. $str.='<div>{新增,'.$xu.'}</div>';
  66. $strm.='<div style="margin:8px">{新增,'.$xu.'}</div>';
  67. return $strm;//如果你想移动端录入页显示一起就返回这个
  68. }
  69. return $str;
  70. }
  71. }
粤ICP备19079148号