当前位置: 首页>>代码示例>>PHP>>正文


PHP simbio_form_element::hiddenField方法代码示例

本文整理汇总了PHP中simbio_form_element::hiddenField方法的典型用法代码示例。如果您正苦于以下问题:PHP simbio_form_element::hiddenField方法的具体用法?PHP simbio_form_element::hiddenField怎么用?PHP simbio_form_element::hiddenField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simbio_form_element的用法示例。


在下文中一共展示了simbio_form_element::hiddenField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: viewKardexes

 /**
  * View kardex list
  * @return  string
  **/
 public function viewKardexes()
 {
     $_can_read = utility::havePrivilege('serial_control', 'r');
     $_can_write = utility::havePrivilege('serial_control', 'w');
     // start the output buffer
     ob_start();
     ?>
     <script type="text/javascript">
     function confirmProcess(int_serial_id, int_kardex_id)
     {
         var confirmBox = confirm('Are you sure to remove selected Kardex data?' + "\n" + 'Once deleted, it can\'t be restored!');
         if (confirmBox) {
             // set hidden element value
             document.hiddenActionForm.serialID.value = int_serial_id;
             document.hiddenActionForm.remove.value = int_kardex_id;
             // submit form
             document.hiddenActionForm.submit();
         }
     }
     </script>
     <?php 
     $_table = new simbio_table();
     $_table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
     $_table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
     $_table->highlight_row = true;
     $_table->setHeader(array('&nbsp;', __('Date Expected'), __('Date Received'), __('Seq. Number'), __('Note')));
     if ($_can_read and $_can_write) {
         $_add_link = '<span title="Add New Kardex" class="extendLink">&nbsp;</span>';
         $_date_exp = simbio_form_element::dateField('dateExpected[0]');
         $_date_rec = simbio_form_element::dateField('dateReceived[0]');
         $_seq_num = simbio_form_element::textField('text', 'seqNumber[0]', '', 'width: 100%;');
         $_notes = simbio_form_element::textField('text', 'notes[0]', '', 'width: 100%;');
         $_table->appendTableRow(array($_add_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
         $_table->setCellAttr(1, null, 'valign="top" class="alterCell2" style="font-weight: bold; width: auto;"');
         $_table->setCellAttr(1, 0, 'valign="top" class="alterCell2" style="font-weight: bold; width: 5%;"');
         $_table->setCellAttr(1, 1, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
         $_table->setCellAttr(1, 2, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
     }
     $_row = 2;
     foreach ($this->getKardexes() as $_kardex) {
         // alternate the row color
         $_row_class = $_row % 2 == 0 ? 'alterCell' : 'alterCell2';
         if ($_can_read and $_can_write) {
             // kardex removal links
             $_remove_link = '<a href="#" onclick="confirmProcess(' . $this->serial_id . ', ' . $_kardex['kardex_id'] . ')" class="trashLink notAJAX">&nbsp;</a>';
             $_date_exp = simbio_form_element::dateField('dateExpected[' . $_kardex['kardex_id'] . ']', $_kardex['date_expected']);
             $_date_rec = simbio_form_element::dateField('dateReceived[' . $_kardex['kardex_id'] . ']', $_kardex['date_received']);
             $_seq_num = simbio_form_element::textField('text', 'seqNumber[' . $_kardex['kardex_id'] . ']', $_kardex['seq_number'], 'width: 100%;');
             $_notes = simbio_form_element::textField('text', 'notes[' . $_kardex['kardex_id'] . ']', $_kardex['notes'], 'width: 100%;');
         } else {
             $_remove_link = '&nbsp;';
             $_date_exp = $_kardex['date_expected'];
             $_date_rec = $_kardex['date_received'];
             $_seq_num = $_kardex['seq_number'];
             $_notes = $_kardex['notes'];
         }
         $_table->appendTableRow(array($_remove_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
         $_table->setCellAttr($_row, null, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: auto;"');
         $_table->setCellAttr($_row, 0, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 5%;"');
         $_table->setCellAttr($_row, 1, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
         $_table->setCellAttr($_row, 2, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
         $_row++;
     }
     // button
     $_button_grp = '<div style="padding: 3px; background: #999999;"><input type="submit" class="button" name="saveKardexes" value="' . __('Save') . '" /></div>';
     // header
     echo '<div style="padding: 5px; background: #CCCCCC;">' . __('Kardex Detail for subscription') . ' <strong>' . $this->serial_period . '</strong></div>';
     if ($_can_read and $_can_write) {
         echo '<form method="post" name="kardexListForm" id="kardexListForm" action="' . $_SERVER['PHP_SELF'] . '">';
         echo $_button_grp;
     }
     echo $_table->printTable();
     if ($_can_read and $_can_write) {
         echo $_button_grp;
         echo simbio_form_element::hiddenField('serialID', $this->serial_id);
         echo '</form>';
         // hidden form
         echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="serialID" value="0" /><input type="hidden" name="remove" value="0" /></form>';
     }
     /* main content end */
     $_content = ob_get_clean();
     return $_content;
 }
开发者ID:slims,项目名称:s3st15_matoa,代码行数:87,代码来源:serial_base_lib.inc.php


注:本文中的simbio_form_element::hiddenField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。