本文整理汇总了PHP中intval函数的典型用法代码示例。如果您正苦于以下问题:PHP intval函数的具体用法?PHP intval怎么用?PHP intval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了intval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onls
function onls()
{
$logdir = UC_ROOT . 'data/logs/';
$dir = opendir($logdir);
$logs = $loglist = array();
while ($entry = readdir($dir)) {
if (is_file($logdir . $entry) && strpos($entry, '.php') !== FALSE) {
$logs = array_merge($logs, file($logdir . $entry));
}
}
closedir($dir);
$logs = array_reverse($logs);
foreach ($logs as $k => $v) {
if (count($v = explode("\t", $v)) > 1) {
$v[3] = $this->date($v[3]);
$v[4] = $this->lang[$v[4]];
$loglist[$k] = $v;
}
}
$page = max(1, intval($_GET['page']));
$start = ($page - 1) * UC_PPP;
$num = count($loglist);
$multipage = $this->page($num, UC_PPP, $page, 'admin.php?m=log&a=ls');
$loglist = array_slice($loglist, $start, UC_PPP);
$this->view->assign('loglist', $loglist);
$this->view->assign('multipage', $multipage);
$this->view->display('admin_log');
}
示例2: search_ac_init
function search_ac_init(&$a)
{
if (!local_channel()) {
killme();
}
$start = x($_REQUEST, 'start') ? $_REQUEST['start'] : 0;
$count = x($_REQUEST, 'count') ? $_REQUEST['count'] : 100;
$search = x($_REQUEST, 'search') ? $_REQUEST['search'] : "";
if (x($_REQUEST, 'query') && strlen($_REQUEST['query'])) {
$search = $_REQUEST['query'];
}
// Priority to people searches
if ($search) {
$people_sql_extra = protect_sprintf(" AND `xchan_name` LIKE '%" . dbesc($search) . "%' ");
$tag_sql_extra = protect_sprintf(" AND term LIKE '%" . dbesc($search) . "%' ");
}
$r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d \n\t\t{$people_sql_extra}\n\t\tORDER BY `xchan_name` ASC ", intval(local_channel()));
$results = array();
if ($r) {
foreach ($r as $g) {
$results[] = array("photo" => $g['xchan_photo_s'], "name" => '@' . $g['xchan_name'], "id" => $g['abook_id'], "link" => $g['xchan_url'], "label" => '', "nick" => '');
}
}
$r = q("select distinct term, tid, url from term where type in ( %d, %d ) {$tag_sql_extra} group by term order by term asc", intval(TERM_HASHTAG), intval(TERM_COMMUNITYTAG));
if (count($r)) {
foreach ($r as $g) {
$results[] = array("photo" => $a->get_baseurl() . '/images/hashtag.png', "name" => '#' . $g['term'], "id" => $g['tid'], "link" => $g['url'], "label" => '', "nick" => '');
}
}
header("content-type: application/json");
$o = array('start' => $start, 'count' => $count, 'items' => $results);
echo json_encode($o);
logger('search_ac: ' . print_r($x, true));
killme();
}
示例3: system_add_credentials
function system_add_credentials()
{
if (!isset($_POST['AddCredentials'])) {
$details = new stdClass();
$details->system_id = intval($this->uri->segment(3, 0));
if (!is_int($details->system_id) or $details->system_id == 0) {
redirect('main/list_devices');
}
$this->load->model("m_system");
$this->data['system_id'] = $details->system_id;
$this->data['ip_address'] = ip_address_from_db($this->m_system->check_man_ip_address($details->system_id));
$this->data['heading'] = 'Add Device SNMP Credentials';
$this->data['include'] = 'v_add_system_c';
$this->load->view('v_template', $this->data);
} else {
$system_id = $_POST['system_id'];
$this->load->model("m_system");
$this->load->library('encrypt');
if ($_POST['snmp_community'] > '' and $_POST['snmp_version'] > '' and $_POST['ip_address'] > '') {
$encode['ip_address'] = $_POST['ip_address'];
$encode['snmp_version'] = $_POST['snmp_version'];
$encode['snmp_community'] = $_POST['snmp_community'];
$encoded = json_encode($encode);
$encoded = $this->encrypt->encode($encoded);
$this->m_system->update_system_man($system_id, 'access_details', $encoded);
if ($_POST['snmp_scan'] == TRUE) {
redirect('admin_system/system_snmp/' . $system_id);
} else {
redirect('main/system_display/' . $system_id);
}
} else {
redirect('admin_system/system_add_credentials/' . $system_id);
}
}
}
示例4: _rotate_step
function _rotate_step($step, $mode = 1)
{
$step_h = intval($step / 256);
$step_l = $step % 256;
$data = array(255, AGB_ID, 6, 105, 1, $mode, 1, $step_h, $step_l);
send_data(PORT_AGB, $data);
}
示例5: filter_css_object
function filter_css_object($css, $panels_data, $post_id)
{
foreach ($panels_data['grids'] as $gi => $grid) {
$grid_id = !empty($grid['style']['id']) ? (string) sanitize_html_class($grid['style']['id']) : intval($gi);
$top_padding = isset($grid['style']['top_padding']) ? $grid['style']['top_padding'] : null;
$bottom_padding = isset($grid['style']['bottom_padding']) ? $grid['style']['bottom_padding'] : null;
// Filter the bottom margin for this row with the arguments
if ($top_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 1920);
}
if ($bottom_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 1920);
}
$top_padding = isset($grid['style']['tablet_top_padding']) ? $grid['style']['tablet_top_padding'] : null;
$bottom_padding = isset($grid['style']['tablet_bottom_padding']) ? $grid['style']['tablet_bottom_padding'] : null;
// Filter the bottom margin for this row with the arguments
if ($top_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 960);
}
if ($bottom_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 960);
}
$top_padding = isset($grid['style']['mobile_top_padding']) ? $grid['style']['mobile_top_padding'] : null;
$bottom_padding = isset($grid['style']['mobile_bottom_padding']) ? $grid['style']['mobile_bottom_padding'] : null;
// Filter the bottom margin for this row with the arguments
if ($top_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 478);
}
if ($bottom_padding) {
$css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 478);
}
}
return $css;
}
示例6: buildjs
function buildjs()
{
$t = $_GET["t"];
$time = time();
$MEPOST = 0;
header("content-type: application/x-javascript");
$tpl = new templates();
$page = CurrentPageName();
$array = unserialize(@file_get_contents($GLOBALS["CACHEFILE"]));
$prc = intval($array["POURC"]);
$title = $tpl->javascript_parse_text($array["TEXT"]);
$md5file = trim(md5_file($GLOBALS["LOGSFILES"]));
echo "// CACHE FILE: {$GLOBALS["CACHEFILE"]} {$prc}%\n";
echo "// LOGS FILE: {$GLOBALS["LOGSFILES"]} - {$md5file} " . strlen($md5file) . "\n";
if ($prc == 0) {
if (strlen($md5file) < 32) {
echo "\n\t// PRC = {$prc} ; md5file={$md5file}\n\tfunction Start{$time}(){\n\t\t\tif(!RTMMailOpen()){return;}\n\t\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
return;
}
}
if ($md5file != $_GET["md5file"]) {
echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
return;
}
if ($prc > 100) {
echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
return;
}
if ($prc == 100) {
echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\t\$('#SQUID_ARTICA_QUOTA_RULES').flexReload();\n\t\tRTMMailHide();\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
return;
}
echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
}
示例7: nv_getAllowed
/**
* nv_getAllowed()
*
* @return
*/
function nv_getAllowed()
{
global $module_data, $db, $admin_info;
$sql = 'SELECT id,full_name,admins FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department';
$result = $db->query($sql);
$contact_allowed = array('view' => array(), 'reply' => array(), 'obt' => array());
while ($row = $result->fetch()) {
$id = intval($row['id']);
if (defined('NV_IS_SPADMIN')) {
$contact_allowed['view'][$id] = $row['full_name'];
$contact_allowed['reply'][$id] = $row['full_name'];
}
$admins = $row['admins'];
$admins = array_map('trim', explode(';', $admins));
foreach ($admins as $a) {
if (preg_match('/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})$/i', $a)) {
$admins2 = array_map('intval', explode('/', $a));
if ($admins2[0] == $admin_info['admin_id']) {
if ($admins2[1] == 1 and !isset($contact_allowed['view'][$id])) {
$contact_allowed['view'][$id] = $row['full_name'];
}
if ($admins2[2] == 1 and !isset($contact_allowed['reply'][$id])) {
$contact_allowed['reply'][$id] = $row['full_name'];
}
if ($admins2[3] == 1 and !isset($contact_allowed['obt'][$id])) {
$contact_allowed['obt'][$id] = $row['full_name'];
}
}
}
}
}
return $contact_allowed;
}
示例8: hikashopSubscriptionType
function hikashopSubscriptionType()
{
if (!HIKASHOP_PHP5) {
$acl =& JFactory::getACL();
} else {
$acl = JFactory::getACL();
}
if (!HIKASHOP_J16) {
$this->groups = $acl->get_group_children_tree(null, 'USERS', false);
} else {
$db = JFactory::getDBO();
$db->setQuery('SELECT a.*, a.title as text, a.id as value FROM #__usergroups AS a ORDER BY a.lft ASC');
$this->groups = $db->loadObjectList('id');
foreach ($this->groups as $id => $group) {
if (isset($this->groups[$group->parent_id])) {
$this->groups[$id]->level = intval(@$this->groups[$group->parent_id]->level) + 1;
$this->groups[$id]->text = str_repeat('- - ', $this->groups[$id]->level) . $this->groups[$id]->text;
}
}
}
$this->choice = array();
$this->choice[] = JHTML::_('select.option', 'none', JText::_('HIKA_NONE'));
$this->choice[] = JHTML::_('select.option', 'special', JText::_('HIKA_CUSTOM'));
$js = "function updateSubscription(map){\r\n\t\t\tchoice = document.adminForm['choice_'+map];\r\n\t\t\tchoiceValue = 'special';\r\n\t\t\tfor (var i=0; i < choice.length; i++){\r\n\t\t\t\tif (choice[i].checked){\r\n\t\t\t\t\tchoiceValue = choice[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\thiddenVar = document.getElementById('hidden_'+map);\r\n\t\t\tif(choiceValue != 'special'){\r\n\t\t\t\thiddenVar.value = choiceValue;\r\n\t\t\t\tif(hiddenVar.value == 'none') hiddenVar.value = '';\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = 'none';\r\n\t\t\t}else{\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = '';\r\n\t\t\t\tspecialVar = eval('document.adminForm.special_'+map);\r\n\t\t\t\tfinalValue = '';\r\n\t\t\t\tfor (var i=0; i < specialVar.length; i++){\r\n\t\t\t\t\tif (specialVar[i].checked){\r\n\t\t\t\t\t\tfinalValue += specialVar[i].value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\thiddenVar.value = finalValue;\r\n\t\t\t}\r\n\t\t}";
if (!HIKASHOP_PHP5) {
$doc =& JFactory::getDocument();
} else {
$doc = JFactory::getDocument();
}
$doc->addScriptDeclaration($js);
}
示例9: getLocation
function getLocation($str)
{
$array_size = intval(substr($str, 0, 1));
// 拆成的行数
$code = substr($str, 1);
// 加密后的串
$len = strlen($code);
$subline_size = $len % $array_size;
// 满字符的行数
$result = array();
$deurl = "";
for ($i = 0; $i < $array_size; $i += 1) {
if ($i < $subline_size) {
array_push($result, substr($code, 0, ceil($len / $array_size)));
$code = substr($code, ceil($len / $array_size));
} else {
array_push($result, substr($code, 0, ceil($len / $array_size) - 1));
$code = substr($code, ceil($len / $array_size) - 1);
}
}
for ($i = 0; $i < ceil($len / $array_size); $i += 1) {
for ($j = 0; $j < count($result); $j += 1) {
$deurl = $deurl . "" . substr($result[$j], $i, 1);
}
}
return str_replace("^", "0", urldecode($deurl));
}
示例10: pc_tag
/**
* PC标签中调用数据
* @param array $data 配置数据
*/
public function pc_tag($data)
{
$siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();
$r = $this->db->select(array('pos' => $data['pos'], 'siteid' => $siteid));
$str = '';
if (!empty($r) && is_array($r)) {
foreach ($r as $v) {
if (defined('IN_ADMIN') && !defined('HTML')) {
$str .= '<div id="block_id_' . $v['id'] . '" class="admin_block" blockid="' . $v['id'] . '">';
}
if ($v['type'] == '2') {
extract($v, EXTR_OVERWRITE);
$data = string2array($data);
if (!defined('HTML')) {
ob_start();
include $this->template_url($id);
$str .= ob_get_contents();
ob_clean();
} else {
include $this->template_url($id);
}
} else {
$str .= $v['data'];
}
if (defined('IN_ADMIN') && !defined('HTML')) {
$str .= '</div>';
}
}
}
return $str;
}
示例11: get
public function get()
{
$id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit;
if ($data = $this->db->getby_id($id)) {
if (!($str = S('dbsource_' . $id))) {
if ($data['type'] == 1) {
// 自定义SQL调用
$get_db = Loader::model("get_model");
$sql = $data['data'] . (!empty($data['num']) ? " LIMIT {$data['num']}" : '');
$str = $get_db->query($sql);
} else {
$filepath = APPS_PATH . $data['application'] . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . $data['application'] . '_tag.php';
if (file_exists($filepath)) {
$yun_tag = Loader::lib($data['application'] . ':' . $data['application'] . '_tag');
if (!method_exists($yun_tag, $data['do'])) {
exit;
}
$sql = string2array($data['data']);
$sql['do'] = $data['do'];
$sql['limit'] = $data['num'];
unset($data['num']);
$str = $yun_tag->{$data}['do']($sql);
} else {
exit;
}
}
if ($data['cache']) {
S('tpl_data/dbsource_' . $id, $str, $data['cache']);
}
}
echo $this->_format($data['id'], $str, $data['dis_type']);
}
}
示例12: buildjs
function buildjs()
{
$t = $_GET["t"];
$time = time();
$MEPOST = 0;
$cachefile = $GLOBALS["PROGRESS_FILE"];
$logsFile = $GLOBALS["LOG_FILE"];
header("content-type: application/x-javascript");
$tpl = new templates();
$page = CurrentPageName();
$array = unserialize(@file_get_contents($cachefile));
$prc = intval($array["POURC"]);
$title = $tpl->javascript_parse_text($array["TEXT"]);
if ($prc == 0) {
echo "\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n}\nsetTimeout(\"Start{$time}()\",1000);";
return;
}
$md5file = md5_file($logsFile);
if ($md5file != $_GET["md5file"]) {
echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('filename','" . urlencode($_GET["filename"]) . "');\n\t\tXHR.appendData('key','" . urlencode($_GET["key"]) . "');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
return;
}
if ($prc > 100) {
echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
return;
}
if ($prc == 100) {
echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLayersTabsAllAfter();\n\t\tRTMMailHide();\n\t\tCacheOff();\n\t\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
return;
}
echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
//Loadjs('$page?build-js=yes&t=$t&md5file={$_GET["md5file"]}');
}
示例13: sn_ube_simulator_decode_replay
function sn_ube_simulator_decode_replay($str_data)
{
$fleet_id = 0;
$arr_data_unpacked = explode('!', $str_data);
foreach ($arr_data_unpacked as $data_piece) {
if (!$data_piece) {
continue;
}
if ($data_piece == 'A' || $data_piece == 'D') {
$fleet_type = $data_piece;
continue;
}
$arr_unit_strings = explode(';', $data_piece);
foreach ($arr_unit_strings as $str_unit_string) {
if (!$str_unit_string) {
continue;
}
$arr_unit_data = explode(',', $str_unit_string);
if ($arr_unit_data[1]) {
$unpacked[$fleet_type][$fleet_id][$arr_unit_data[0]] = intval($arr_unit_data[1]);
}
}
$fleet_id++;
}
return $unpacked;
}
示例14: outputContent
/**
* Output the content of the resource
*
* @param array $options An array of options for the output
*/
public function outputContent(array $options = array())
{
if (empty($options['rpc_type'])) {
$options['rpc_type'] = 'XML';
}
$resourceClass = 'mod' . $options['rpc_type'] . 'RPCResource';
if (!$this->modx->resource instanceof $resourceClass) {
$this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server class.');
}
$this->modx->resource->process();
$this->modx->resource->_output = $this->modx->resource->_content;
/* collect any uncached element tags in the content and process them */
$this->modx->getParser();
$maxIterations = intval($this->modx->getOption('parser_max_iterations', null, 10));
$this->modx->parser->processElementTags('', $this->modx->resource->_output, true, false, '[[', ']]', array(), $maxIterations);
$this->modx->parser->processElementTags('', $this->modx->resource->_output, true, true, '[[', ']]', array(), $maxIterations);
if (!$this->getServer()) {
$this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server.');
}
$this->server->service();
ob_get_level() && @ob_end_flush();
while (ob_get_level() && @ob_end_clean()) {
}
exit;
}
示例15: init
public function init()
{
$model = $this->model;
if (!$this->extra_fields) {
$this->extra_fields = array();
}
if (empty($_POST['id'])) {
$this->data = $model::model()->findAll(array('order' => 'display_order asc'));
} else {
$this->data = array();
foreach ($_POST['id'] as $i => $id) {
$item = new $model();
$item->id = $id;
$item->name = $_POST['name'][$i];
$attributes = $item->getAttributes();
if (array_key_exists('active', $attributes)) {
$item->active = isset($_POST['active'][$i]) || intval($id) == 0 ? 1 : 0;
}
foreach ($this->extra_fields as $field) {
$item->{$field['field']} = $_POST[$field['field']][$i];
}
$this->data[] = $item;
}
}
return parent::init();
}