public function actionUpdate($id) { self::validateAdmin(); $platform = platform::getPlatformById($id); if (isset($_POST['submit'])) { $option['name_platforms'] = $_POST['name_platforms']; $option['sort'] = $_POST['sort']; $option['status'] = $_POST['status']; $errors = false; if (!isset($option['name_platforms']) || empty($option['name_platforms'])) { $errors[] = "Введите имя категории"; print_r($errors); } if ($errors == false) { $id = platform::updatePlatform($id, $option); header("Location: /evkazolinAdminka/category/"); } } require_once ROOT . '/views/admin_category/update.php'; return true; }
<?php require_once 'object_set.php'; class platform extends object_set { function table_name() { return "t_platform"; } function auto_id() { return true; } } $platform = new platform(); $platform->process();
/** * @return void * @param array $imagelist * @param string $extractloc * @desc Create a HTML table filled with media found by the 'scan' feature OR the zip-upload. * @access public */ function createFileList(&$imagelist, $extractloc = "") { global $mosConfig_live_site, $mosConfig_absolute_path; $this->createCheckAllScript(); $tabcnt = 0; $this->_counter = 0; $i = 0; $table_class = " class=\"adminform\""; $header_class = " class=\"sectiontableheader\""; if ($this->_isBackend) { $table_class = " class=\"adminlist\""; $header_class = ""; $this->_tabclass = array("row0", "row1"); } echo "<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"95%\"{$table_class}>\n" . "\t\t\t<tr{$header_class}>\n" . "\t\t\t\t<th width=\"50\"> </th>\n" . "\t\t\t\t<th align=\"left\">" . _ZOOM_FILENAME . "</th>\n" . "\t\t\t\t<th align=\"left\">" . _ZOOM_HD_PREVIEW . "</th>\n" . "\t\t\t</tr>\n"; foreach ($imagelist as $image) { $i++; $bgcolor = $i & 1 ? $this->_tabclass[1] : $this->_tabclass[0]; $tag = strtolower(ereg_replace(".*\\.([^\\.]*)\$", "\\1", $image)); if ($this->isImage($tag)) { if (!$this->platform->is_file($image)) { $image_path = $mosConfig_absolute_path . "/" . $extractloc . "/" . $image; $image_virt = $mosConfig_live_site . "/" . $extractloc . "/" . $image; $imginfo = $this->platform->getimagesize($image_path); $ratio = max($imginfo[0], $imginfo[1]) / $this->_CONFIG['size']; $ratio = max($ratio, 1.0); $imgWidth = (int) ($imginfo[0] / $ratio); $imgHeight = (int) ($imginfo[1] / $ratio); } else { $image_path = $image; $image_virt = $image_path; $imginfo = $this->platform->getimagesize($image_virt); $ratio = max($imginfo[0], $imginfo[1]) / $this->_CONFIG['size']; $ratio = max($ratio, 1.0); $imgWidth = (int) ($imginfo[0] / $ratio); $imgHeight = (int) ($imginfo[1] / $ratio); } } elseif ($this->isAudio($tag)) { $image_virt = $mosConfig_live_site . "/components/com_zoom/www/images/filetypes/audio.png"; $imgWidth = $imgHeight = 64; } elseif ($this->isDocument($tag)) { $image_virt = $mosConfig_live_site . "/components/com_zoom/www/images/filetypes/document.png"; $imgWidth = $imgHeight = 64; } elseif ($this->isMovie($tag)) { $image_virt = $mosConfig_live_site . "/components/com_zoom/www/images/filetypes/video.png"; $imgWidth = $imgHeight = 64; } echo "\t\t\t<tr class=\"" . $bgcolor . "\">\n" . "\t\t\t\t<td align=\"center\" width=\"10\"><input type=\"checkbox\" name=\"scannedimg[]\" value=\"" . $this->_counter . "\" id=\"mediumno_{$i}\" checked></td>\n" . "\t\t\t\t<td width=\"100%\"><span onmousedown=\"document.getElementById('mediumno_{$i}').checked = (document.getElementById('mediumno_{$i}').checked ? false : true);\">" . $image . "</span><br />\n"; if ($this->isImage($tag)) { echo "\t\t\t\t\t<input type=\"checkbox\" name=\"rotate[]\" value=\"1\">" . _ZOOM_ROTATE . " \n" . "\t\t\t\t\t<input type=\"radio\" name=\"rotate" . $this->_counter . "\" value=\"90\">" . _ZOOM_CLOCKWISE . "\n" . "\t\t\t\t\t<input type=\"radio\" name=\"rotate" . $this->_counter . "\" value=\"-90\">" . _ZOOM_CCLOCKWISE . "\n" . "\t\t\t\t</td>\n"; } else { echo "\t\t\t\t</td>\n"; } echo "\t\t\t\t<td><img src=\"" . $image_virt . "\" border=\"0\" width=\"" . $imgWidth . "\" height=\"" . $imgHeight . "\"></td>\n" . "\t\t\t</tr>\n"; $tabcnt++; $this->_counter++; } echo "\t\t\t<tr{$header_class}>\n" . "\t\t\t\t<th height=\"20\" align=\"center\" align=\"left\"><input type=\"checkbox\" name=\"checkall\" onclick=\"checkUncheckAll(this, 'scannedimg[]');\" id=\"checkall\" checked></th>\n" . "\t\t\t\t<th height=\"20\" colspan=\"20\" align=\"left\" onmousedown=\"document.getElementById('checkall').checked = (document.getElementById('checkall').checked ? false : true);checkUncheckAll(document.getElementById('checkall'), 'scannedimg[]');\">\n" . "\t\t\t<strong><label onclick=\"javascript: return (document.getElementById('checkall') ? false : true);checkUncheckAll(document.getElementById('checkall'), 'scannedimg[]');\" for=\"checkall\">" . _ZOOM_HD_CHECKALL . "</label></strong>\n" . "\t\t\t\t</th>\n" . "\t\t\t</tr>\n" . "\t\t\t</table>\n"; }