$mod_seq_prefix = $adb->query_result($mod_seq_string, 0, 'prefix'); $mod_seq_no = $adb->query_result($mod_seq_string, 0, 'cur_id'); if ($adb->num_rows($mod_seq_string) == 0 || $focus->checkModuleSeqNumber($focus->table_name, $mod_seq_field['column'], $mod_seq_prefix . $mod_seq_no)) { echo '<br><font color="#FF0000"><b>' . getTranslatedString('LBL_DUPLICATE') . ' ' . getTranslatedString($mod_seq_field['label']) . ' - ' . getTranslatedString('LBL_CLICK') . ' <a href="index.php?module=Settings&action=CustomModEntityNo&parenttab=Settings&selmodule=' . $currentModule . '">' . getTranslatedString('LBL_HERE') . '</a> ' . getTranslatedString('LBL_TO_CONFIGURE') . ' ' . getTranslatedString($mod_seq_field['label']) . '</b></font>'; } else { $smarty->assign("MOD_SEQ_ID", $autostr); } } else { $smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]); } // END // Gather the help information associated with fields $smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule)); // END if ($focus->id != '') { $smarty->assign("ROWCOUNT", getImageCount($focus->id)); } if (isset($cust_fld)) { $smarty->assign("CUSTOMFIELD", $cust_fld); } $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT'])); //Tax handling (get the available taxes only) - starts if ($focus->mode == 'edit') { $retrieve_taxes = true; $productid = $focus->id; $tax_details = getTaxDetailsForProduct($productid, 'available_associated'); } elseif ($_REQUEST['isDuplicate'] == 'true') { $retrieve_taxes = true; $productid = $_REQUEST['record']; $tax_details = getTaxDetailsForProduct($productid, 'available_associated'); } else {
list($Size) = $DB->next_record(); $Cache->cache_value('ptpimg_sql_size', array($Size), 60); // 30 minutes } return $Size; } switch ($Action) { case 'random': // random $Count = getImageCount(); // Grab image count $Rand = rand(1, $Count); $DB->query("SELECT Code, Type, Size FROM uploads LIMIT {$Rand}, 1"); list($Code, $Type, $Size) = $DB->next_record(); echo json_encode(array(array('code' => $Code, 'type' => $Type, 'size' => $Size))); break; case 'last5': // last5 $DB->query("SELECT Code, Type, Size FROM uploads ORDER BY ID DESC LIMIT 5"); $Data = array(); while (list($Code, $Type, $Size) = $DB->next_record()) { $Data[] = array('code' => $Code, 'type' => $Type, 'size' => $Size); } echo json_encode(array($Data)); break; case 'stats': // stats $Size = getTotalSize(); $Count = getImageCount(); echo json_encode(array(array('size' => $Size, 'count' => $Count))); }