if ($lastcol != 0) { // if this is not the first column print "</TABLE></TD>" . ln(1); // close last column } $lastcol = $edit->ColumnNumber; print "<td class='edittable'><TABLE align=CENTER>" . ln(1); // start a new column } print "<TR><td class='edittable' align=right>" . iif($edit->FieldType == 'button' or $edit->FieldType == 'words', '', $edit->Title) . "</TD><td class='edittable'>"; //left hand side of table (eg.title)) $gstarray = makeddarray($edit->FieldType, $edit->TableArray); //--- setup array for dropdown BuildDropDownArray($edit, '', '', -1); //---builde javascript arrays for dropdowns inputtype($q, $edit, $tablevalues, $id, '', '', $gstarray, '', $uniq); //right hand side of table (eg.input) print "</TD></TR>"; // } } print "</TABLE><TR><td class='edittable'>" . stringofbreaks(40) . "</TD></TR>" . ln(1); print "</TABLE></div>" . ln(1); addrows(2); //make a gap between fields and the end of the table addbreaks(30); //--- write out javascript arrays for populating dropdowns print "<script type='text/javascript' language='javascript'>\n\n"; for ($i = 0; $i < count($GLOBALS['theArray']); $i++) { print $GLOBALS['theArray'][$i] . "\n"; } //--- fill dropdowns with javascript arrays
$i = 0; foreach ($arr_rules as $cur) { $arr['rules'][$i] = array('id' => $cur['id'], 'name' => $cur['name'], 'url' => tracklink() . "/{$cur['name']}/source/campaign-ads"); $arr_destinations = array(); $default_destination_id = ''; foreach ($cur['items'] as $cur_item_val) { if ($cur_item_val['inner'][0]['value'] != '') { $arr_destinations[$cur_item_val['inner'][0]['value']]++; } // Set default out for this link, separate section if ($cur_item_val['root']['type'] == 'geo_country' && $cur_item_val['root']['value'] == 'default') { $default_destination_id = $cur_item_val['inner'][0]['value']; continue; } // Add item to conditions section $arr['rules'][$i]['conditions'][] = array('textinput' => inputtype($cur_item_val['root']['type']), 'getinput' => $cur_item_val['root']['type'] == 'get', 'type' => $condition_types[$cur_item_val['root']['type']], 'select_type' => $cur_item_val['root']['type'], 'value' => $cur_item_val['root']['value'], 'destination_id' => $cur_item_val['inner'][0]['value']); } $arr_destinations = array_keys($arr_destinations); $destinations_count = count($arr_destinations); switch ($destinations_count) { case 0: break; case 1: $str = current($arr_destinations); $arr['rules'][$i]['destination'] = $arr_offers[$str]['offer_name']; $arr['rules'][$i]['destination_id'] = $arr_offers[$str]['id']; break; default: $arr['rules'][$i]['destination_multi'] = declination($destinations_count, array(' оффер', ' оффера', ' офферов')); break; }
$fastdeliveryfield = array(); unset($fieldfastdelivery['availability']); unset($fieldfastdelivery['countries']); if ($getresult[0]->fastdelivery) { $fastShipArr = $getresult[0]->fastdelivery; $unserializeVal = unserialize($fastShipArr); $fieldfastdelivery['enabled']['default'] = $unserializeVal['enabled']; $fieldfastdelivery['cost']['default'] = $unserializeVal['cost']; } foreach ($fieldfastdelivery as $title => $fieldArray) { $fastdelivery .= '<tr valign="top"> <th class="titledesc" scope="row"> <label for="woocommerce_flat_rate_enabled">' . $fieldArray["title"] . '</label> </th>'; $inputarg = array('type' => $fieldArray['type'], 'fieldarray' => $fieldArray); $inputfield = inputtype($title, $inputarg, 'fastdelivery'); $fastdelivery .= '<td class="forminp"> <fieldset> <legend class="screen-reader-text"><span>Enable/Disable</span></legend> <label for="woocommerce_flat_rate_enabled">' . $inputfield . ' ' . $fieldArray["label"] . '</label><br></fieldset></td></tr>'; } $fastdelivery .= '</tbody></table>'; /* * HTML field for wight wise shipping */ $objweightwiseshipp = new BST_Weight_Based_Shipping(); /* Array of form field */ $formhtmlarr = $objweightwiseshipp->htmlform(); //__p($formhtmlarr); /* convert array to html