Viewing file: module.php (25.72 KB) -rwxrwxrwx Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? class Laws { var $UserMode = true; var $AdminMode = true; var $SearchMode = true; var $PanelMode = true; var $UserAsynchMode = true; var $AdminAsynchMode = true; var $LawsTable; var $PublishersTable; var $TypesTable; var $SessionsTable; var $Directory; var $FilesDirectory; var $ClassName = 'Laws'; var $RowsByPage= 10; function Laws() { $this->FilesDirectory = "data/laws/"; $this->Directory = dirname(__FILE__); $this->LawsTable = new AMTable2('AMCMS_laws'); $this->LawsTable->AddIndexField('law_id'); $this->LawsTable->Module($this->ClassName);
$this->PublishersTable = new AMTable2('AMCMS_laws_publishers'); $this->PublishersTable->AddIndexField('publisher_id'); $this->PublishersTable->AddPositionField('publisher_position'); $this->PublishersTable->Module($this->ClassName);
$this->TypesTable = new AMTable2('AMCMS_laws_types'); $this->TypesTable->AddIndexField('type_id'); $this->TypesTable->AddPositionField('type_position'); $this->TypesTable->Module($this->ClassName);
$this->SessionsTable = new AMTable2('AMCMS_Laws_sessions'); $this->SessionsTable->AddIndexField('rec_id'); $this->SessionsTable->Module($this->ClassName); } function User() { global $ulang, $ULANG; $smarty = GetUserSmarty($this->ClassName); $publishers = $this->PublishersTable->GetRows("publisher_position DESC"); $types = $this->TypesTable->GetRows("type_position DESC");
foreach($types as $val) $t[$val['type_id']] = $val['type_name_'.$ulang]; foreach($publishers as $val) $p[$val['publisher_id']] = $val['publisher_name_'.$ulang];
$smarty->assign("publishers", $publishers); $smarty->assign("types", $types); if (!isset($_GET['date_type'])) $smarty->assign('date_type', 'nodate'); else $smarty->assign('date_type', $_GET['date_type']); $html = $smarty->fetch('form.tpl'); foreach($_GET as $key => $value) $_GET[$key] = mysql_real_escape_string($_GET[$key]); $_GET['date1'] = $_GET['law_date_year1']."-".addzero($_GET['law_date_month1'],2)."-".addzero($_GET['law_date_day1'],2); $_GET['date2'] = $_GET['law_date_year2']."-".addzero($_GET['law_date_month2'],2)."-".addzero($_GET['law_date_day2'],2); if ($_GET['law_type_id'] == 1 && $_GET['law_publisher_id'] == 3) { $where = array("(law_type_id = '1')", "(law_publisher_id = '3')"); if (strlen($_GET['law_number'] > 0)) $where []= "(law_number = '{$_GET['law_number']}')"; if (strlen($_GET['law_session_number'] > 0)) $where []= "(law_session_number = '{$_GET['law_session_number']}')"; if (strlen($_GET['law_session_convocation'] > 0)) $where []= "(law_session_convocation = '{$_GET['law_session_convocation']}')"; if ($_GET['date_type'] == "onedate") $where []= "(law_date = '{$_GET['date1']}')"; if ($_GET['date_type'] == "twodate") { $where []= "(law_date >= '{$_GET['date1']}')"; $where []= "(law_date <= '{$_GET['date2']}')"; } if (strlen($_GET['law_text']) > 0) { //$where [] = " MATCH (law_name_{$ulang}, law_index, law_preview) AGAINST ('{$_GET['law_text']}' IN BOOLEAN MODE)"; //$where [] = "(law_name_{$ulang} LIKE '%{$_GET['law_text']}%' OR law_index LIKE '%{$_GET['law_text']}%' OR law_preview LIKE '%{$_GET['law_text']}%')"; $words = explode(' ', $_GET['law_text']); foreach($words as &$value) { $value1 = trim($value); $value = "((law_name_{$ulang} LIKE '%{$value1}%') OR (law_index LIKE '%{$value1}%') OR (law_preview LIKE '%{$value1}%'))"; } $where []= '('. implode($words, ' AND ') .')'; } $wherePart = "WHERE ".implode("AND", $where);
$sql = "SELECT * FROM AMCMS_Laws_sessions ORDER BY rec_convocation DESC, rec_session DESC"; $res = mysql_query($sql);
$rows = array(); while($row = mysql_fetch_assoc($res)) $rows [$row['rec_convocation']][$row['rec_session']] = array();
$sql = "SELECT * FROM AMCMS_laws {$wherePart} ORDER BY law_session_convocation DESC, law_session_number DESC, law_date DESC, ABS(law_number) DESC"; //echo $sql; $res = mysql_query($sql); while($row = mysql_fetch_assoc($res)) $rows [$row['law_session_convocation']][$row['law_session_number']][] = $row; $smarty->assign("rows", $rows);
$html .= $smarty->fetch("sessions.tpl"); } else { $where = array("(true)"); if (strlen($_GET['law_publisher_id'] > 0)) $where []= "(law_publisher_id = '{$_GET['law_publisher_id']}')"; if (strlen($_GET['law_type_id'] > 0)) $where []= "(law_type_id = '{$_GET['law_type_id']}')"; if (strlen($_GET['law_number'] > 0)) $where []= "(law_number = '{$_GET['law_number']}')"; if (strlen($_GET['law_session_number'] > 0)) $where []= "(law_session_number = '{$_GET['law_session_number']}')"; if (strlen($_GET['law_session_convocation'] > 0)) $where []= "(law_session_convocation = '{$_GET['law_session_convocation']}')"; if ($_GET['date_type'] == "onedate") $where []= "(law_date = '{$_GET['date1']}')"; if ($_GET['date_type'] == "twodate") { $where []= "(law_date >= '{$_GET['date1']}')"; $where []= "(law_date <= '{$_GET['date2']}')"; } if (strlen($_GET['law_text']) > 0) { //$where [] = " MATCH (law_name_{$ulang}, law_index, law_preview) AGAINST ('{$_GET['law_text']}' IN BOOLEAN MODE)"; $words = explode(' ', $_GET['law_text']); foreach($words as &$value) { $value1 = trim($value); $value = "((law_name_{$ulang} LIKE '%{$value1}%') OR (law_index LIKE '%{$value1}%') OR (law_preview LIKE '%{$value1}%'))"; } $where []= '('. implode($words, ' AND ') .')';
} $wherePart = "WHERE ".implode("AND", $where); $pageNum = $_GET['pageNum']; if ($pageNum <= 0 || $pageNum >= 10000) $pageNum = 1; $index = 0; $link = ""; foreach($_GET as $key => $value) if ($key != 'pageNum') $link .= $key."=".$value."&"; $sql = "SELECT COUNT(*) as count FROM AMCMS_laws {$wherePart} ORDER BY law_session_convocation DESC, law_session_number DESC, law_date DESC, ABS(law_number) DESC"; $res = mysql_query($sql); $row = mysql_fetch_assoc($res); $rowsCount = $row['count'];
$pageNavigator = new CPageNavigator($rowsCount, $pageNum, $this->RowsByPage); $pageNavigatorHtml = $pageNavigator->GetNavigator("", $ULANG['LawsPagesBlockName']); $index = ($pageNum-1)*$this->RowsByPage; if ($rowsCount > 0) $html .= $pageNavigatorHtml;
$start = ($pageNum - 1)* $this->RowsByPage; $sql = "SELECT * FROM AMCMS_laws {$wherePart} ORDER BY law_date DESC, ABS(law_number) DESC, law_session_convocation DESC, law_session_number DESC LIMIT $start, {$this->RowsByPage}"; $res = mysql_query($sql); $rows = array(); $i = $start; while($row = mysql_fetch_assoc($res)) { $row['law_type'] = $t[$row['law_type_id']]; $row['law_publisher'] = $p[$row['law_publisher_id']]; $row['index'] = $i + 1; $rows []= $row; $i++; } $smarty->assign("rows", $rows); //foreach($rows as $key => $row) /* { $row = $rows[$i]; $smarty->assign('law_id', $row['law_id']); $smarty->assign('index', $i + 1); $smarty->assign('title', $row['law_name_'.$ulang]); $smarty->assign('type', $row['type_name_'.$ulang]); $smarty->assign('publisher', $row['publisher_name_'.$ulang]); $smarty->assign('number', $row['law_number']); $smarty->assign('date', GetUsefulDate($row['law_date'], false, true, false)); $smarty->assign('link', "/data/laws/".$row['law_filename']); $smarty->assign('session_number', $row['law_session_number']); $smarty->assign('session_convocation', $row['law_session_convocation']); $html .= "<br />".; //$index++; } */ $html .= $smarty->fetch('rows.tpl'); if ($rowsCount > 0) $html .= $pageNavigatorHtml; } $result['Title'] = GetParam("ModuleLaws", $ulang); $result['Content'] = $html; $navigator = new AMNavigator(); $navigator->AddLink(GetParam("ModuleLaws", $ulang), "/laws"); $result['GlobalParams']['Navigator'] = $navigator->Fetch(); $result['GlobalParams']['PageTitle'] = $navigator->GetTitleForPage(); $result['Module'] = $this->ClassName; $result['Print'] = true; return $result; } function UserAsynch() { global $ulang, $ULANG; if (isset($_GET['session_id']) && isset($_GET['convocation_id'])) { $sql = "SELECT * FROM AMCMS_Laws_sessions WHERE (rec_session = '{$_GET['session_id']}') AND (rec_convocation = '{$_GET['convocation_id']}')"; $res = mysql_query($sql); $row = mysql_fetch_assoc($res); echo $row['rec_text']; die; } if (isset($_GET['law_id']) && isset($_GET['text'])) { $law = $this->LawsTable->GetRowById($_GET['law_id']); echo $law['law_preview']; return; } if (isset($_GET['law_id'])) { $law = $this->LawsTable->GetRowById($_GET['law_id']); echo $law['law_name_'.$ulang]; return; } } function Menu() { global $ALANG; $arr = array(); $arr [] = array('title' => $ALANG['LawsMenuAdd'], 'link' => '?mod='.$this->ClassName.'&add'); $arr [] = array('title' => $ALANG['LawsMenuList'], 'link' => '?mod='.$this->ClassName.'&list'); if ($_SESSION['admin_type'] == 'root') { $arr [] = array('title' => $ALANG['LawsMenuPublishers'], 'link' => '?mod='.$this->ClassName.'&publishers'); $arr [] = array('title' => $ALANG['LawsMenuTypes'], 'link' => '?mod='.$this->ClassName.'&types'); } if (isset($_SESSION['admin_access']['laws'][1][1]) || $_SESSION['admin_type'] == 'root') { $arr [] = array('title' => 'Додати сесію', 'link' => '?mod='.$this->ClassName.'&sessionadd'); $arr [] = array('title' => 'Список сесій', 'link' => '?mod='.$this->ClassName.'&sessions'); } return $arr; } function Admin() { global $ALANG, $alang; $smarty = GetAdminSmarty($this->ClassName); if (isset($_GET['edit']) && isset($_GET['publisher_id'])) { if (isset($_POST['edit'])) { if ($_GET['publisher_id'] != 1 and $_GET['publisher_id'] != 2 and $_GET['publisher_id'] != 3) $error = $this->PublishersTable->Update($_POST, $_GET['publisher_id']); header("Location: ?mod=".$this->ClassName."&publishers"); } $row = $this->PublishersTable->GetRowById($_GET['publisher_id']); foreach($row as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'edit'); $result['Title'] = $ALANG['LawsPublisherEdit']; $result['Content'] = $smarty->fetch('publisher.tpl'); return $result; }
if (isset($_GET['types'])) { if (isset($_POST['add'])) { $id = $this->TypesTable->Insert($_POST); header("Location: ?mod=".$this->ClassName."&types"); } $fields = array("type_id", "type_name_".GetParam("DefaultLanguage")); $captions = array("#", $ALANG['Laws_type_name']); //$conditions = array("actual_type = '2'", "actual_date >= '{$date1}'", "actual_date < '{$date2}'"); $order = "type_position DESC"; $multiple = array("delete"); $links = array("checkbox", "delete", "edit"); $params = array("sortable" => "yes", "id" => "types"); $html = $this->TypesTable->GetAdminTable($fields, $captions, $conditions, $order, $links, $multiple, $params); foreach($_POST as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'add'); $smarty->assign('pagetitle', $ALANG['LawsTypeAdd']); $result['Title'] = $ALANG['LawsTypes']; $result['Content'] = $html.$smarty->fetch('type.tpl'); return $result; } if (isset($_GET['publishers'])) { if (isset($_POST['add'])) { $id = $this->PublishersTable->Insert($_POST); header("Location: ?mod=".$this->ClassName."&publishers"); } $fields = array("publisher_id", "publisher_name_".GetParam("DefaultLanguage")); $captions = array("#", $ALANG['Laws_publisher_name']); //$conditions = array("actual_type = '2'", "actual_date >= '{$date1}'", "actual_date < '{$date2}'"); $order = "publisher_position DESC"; $multiple = array("delete"); $links = array("checkbox", "delete", "edit"); $params = array("sortable" => "yes", "id" => "types"); $html = $this->PublishersTable->GetAdminTable($fields, $captions, $conditions, $order, $links, $multiple, $params); foreach($_POST as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'add'); $smarty->assign('pagetitle', $ALANG['LawsPublisherAdd']); $result['Title'] = $ALANG['LawsPublishers']; $result['Content'] = $html.$smarty->fetch('publisher.tpl'); return $result; } if (isset($_GET['edit']) && isset($_GET['type_id'])) { if (isset($_POST['edit'])) { if ($_GET['type_id'] != 1 and $_GET['type_id'] != 2) $error = $this->TypesTable->Update($_POST, $_GET['type_id']); header("Location: ?mod=".$this->ClassName."&types"); die; } $row = $this->TypesTable->GetRowById($_GET['type_id']); foreach($row as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'edit'); $result['Title'] = $ALANG['LawsTypeEdit']; $result['Content'] = $smarty->fetch('type.tpl'); return $result; } if (isset($_GET['add'])) { if (isset($_POST['add'])) { $_POST['law_date'] = $_POST['law_date_year']."-".$_POST['law_date_month']."-".$_POST['law_date_day']; $ext = strtolower(array_pop(explode(".", $_FILES['law_filename']['name']))); $filename = "doc".$_POST['law_date'].".".$ext; $num = 1; while (file_exists($this->FilesDirectory.$filename)) { $filename = "doc".$_POST['law_date']."-".$num.".".$ext; $num++; } if (strlen($_FILES['law_filename']['name'] > 0)) $_POST['law_filename'] = $filename; $_POST['law_name_ukr'] = addslashes($_POST['law_name_ukr']); $_POST['law_preview'] = addslashes($_POST['law_preview']); $id = $this->LawsTable->Insert($_POST); @move_uploaded_file($_FILES['law_filename']['tmp_name'], $this->FilesDirectory.$filename); header("Location: ?mod=".$this->ClassName."&list&year=".$_POST['law_date_year']); } $smarty->assign('oper', 'add'); $publishers = $this->PublishersTable->GetRows("publisher_position DESC"); $types = $this->TypesTable->GetRows("type_position DESC"); $smarty->assign("publishers", $publishers); $smarty->assign("types", $types); $t = array(); $p = array(); for ($i = 1; $i < 10; $i++) for ($j = 1; $j < 10; $j++) { if (isset($_SESSION['admin_access']['laws'][$i][$j])) { $t[$j] = 1; $p[$i] = 1; } } /* foreach($types as $key => $value) { if (!isset($t[$value['type_id']])) unset($types[$key]); } foreach($publishers as $key => $value) { if (!isset($p[$value['publisher_id']])) unset($publishers[$key]); }*/ $smarty->assign('law_date', GetCurrentDateAndTime()); $result['Title'] = $ALANG['LawsAdd']; $result['Content'] = $smarty->fetch('document.tpl'); return $result; } if (isset($_GET['sessionadd'])) { if (isset($_POST['sessionadd'])) { $id = $this->SessionsTable->Insert($_POST); header("Location: ?mod=".$this->ClassName."&sessions"); } $smarty->assign('oper', 'sessionadd'); $result['Title'] = 'Додавання сесії'; $result['Content'] = $smarty->fetch('session.tpl'); return $result; } if (isset($_GET['edit']) && isset($_GET['law_id'])) { if (isset($_POST['edit'])) { $_POST['law_date'] = $_POST['law_date_year']."-".$_POST['law_date_month']."-".$_POST['law_date_day']; $postfix = ""; if (strlen($_FILES['law_filename']['tmp_name']) > 0) { $row = $this->LawsTable->GetRowById($_GET['law_id']); @unlink($this->FilesDirectory.$row['law_filename']); $ext = strtolower(array_pop(explode(".", $_FILES['law_filename']['name']))); $filename = "doc".$_POST['law_date'].".".$ext; $num = 1; while (file_exists($this->FilesDirectory.$filename)) { $filename = "doc".$_POST['law_date']."-".$num.".".$ext; $num++; } $_POST['law_filename'] = $filename; } $this->LawsTable->Update($_POST, $_GET['law_id']); if (strlen($_FILES['law_filename']['tmp_name']) > 0) { @unlink($this->FilesDirectory.$filename); move_uploaded_file($_FILES['law_filename']['tmp_name'], $this->FilesDirectory.$filename); } header("Location: ?mod=".$this->ClassName."&list&year=".$_POST['law_date_year']); } $row = $this->LawsTable->GetRowById($_GET['law_id']); foreach($row as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'edit'); $publishers = $this->PublishersTable->GetRows("publisher_position DESC"); $types = $this->TypesTable->GetRows("type_position DESC"); $smarty->assign("publishers", $publishers); $smarty->assign("types", $types); $t = array(); $p = array(); for ($i = 1; $i < 10; $i++) for ($j = 1; $j < 10; $j++) { if (isset($_SESSION['admin_access']['laws'][$i][$j])) { $t[$j] = 1; $p[$i] = 1; } } foreach($types as $key => $value) { if (!isset($t[$value['type_id']])) unset($types[$key]); } foreach($publishers as $key => $value) { if (!isset($p[$value['publisher_id']])) unset($publishers[$key]); } $result['Title'] = $ALANG['LawEdition']; $result['Content'] = $smarty->fetch('document.tpl'); return $result; } if (isset($_GET['edit']) && isset($_GET['rec_id'])) { if (isset($_POST['edit'])) { $this->SessionsTable->Update($_POST, $_GET['rec_id']); header("Location: ?mod=".$this->ClassName."&sessions"); } $row = $this->SessionsTable->GetRowById($_GET['rec_id']); $smarty->assign('row', $row); foreach($row as $key => $value) $smarty->assign($key, $value); $smarty->assign('oper', 'edit'); $result['Title'] = 'Редагування інформації про сесію'; $result['Content'] = $smarty->fetch('session.tpl'); return $result; } if (isset($_GET['list'])) { $year = $_GET['year']; if ($_POST['year'] != 0) $year = $_POST['year']; $yearSelectorHtml = GetYearSelectForm("year", "post", $year, 1999); if ($year < 2000) $year = GetCurrentYear(); $date1 = "{$year}-01-01"; $date2 = ($year + 1)."-01-01";
$t = array(); $p = array(); for ($i = 1; $i < 10; $i++) for ($j = 1; $j < 10; $j++) { if (isset($_SESSION['admin_access']['laws'][$i][$j])) { $t[$j] = 1; $p[$i] = 1; } } $tt = implode(",",array_keys($t)); $pp = implode(",",array_keys($p)); $fields = array("law_name_".GetParam("DefaultLanguage"), "type_name_".GetParam("DefaultLanguage"), "publisher_name_".GetParam("DefaultLanguage"), "law_number", "law_date"); $captions = array($ALANG['Laws_publisher_name'], "", "", "", ""); if ($_SESSION['admin_type'] == 'root') $conditions = array("law_date >= '{$date1}'", "law_date < '{$date2}'", "law_type_id = type_id", "law_publisher_id = publisher_id"); else $conditions = array("law_date >= '{$date1}'", "law_date < '{$date2}'", "law_type_id = type_id", "law_publisher_id = publisher_id", "law_type_id IN ({$tt})", "law_publisher_id IN ({$pp})"); $order = "law_date DESC"; $multiple = array("delete"); $links = array("checkbox", "delete", "edit"); $params = array("id" => "laws", "tables" => array('AMCMS_laws_publishers', 'AMCMS_laws_types')); $html = $this->LawsTable->GetAdminTable($fields, $captions, $conditions, $order, $links, $multiple, $params); $result['pagename'] = $ALANG['LawsList']; $result['Title'] = $ALANG['LawsList']; $result['Content'] = $yearSelectorHtml.$html; return $result; } if (isset($_GET['sessions'])) { $fields = array("rec_convocation", "rec_session", "rec_date"); $captions = array("Скликання", "Сесія", "Дата"); $conditions = array("true"); $order = "rec_convocation DESC, rec_session DESC"; $multiple = array("delete"); $links = array("checkbox", "delete", "edit"); $params = array("id" => "laws"); $html = $this->SessionsTable->GetAdminTable($fields, $captions, $conditions, $order, $links, $multiple, $params); $result['pagename'] = 'Сесії'; $result['Title'] = 'Сесії'; $result['Content'] = $html; return $result; } } function Search($words) { global $ulang, $ULANG; $fields = array("law_name_".$ulang, "law_index", "law_preview"); $rows = SearchOnSite($words, array('law_name_'.$ulang, "law_date", "law_filename", "law_type_id", "law_publisher_id"), 'law_id', $fields, 'AMCMS_laws'); $searchRows = array(); if ($rows) { $types = $this->TypesTable->GetRows(); $publishers = $this->PublishersTable->GetRows(); foreach($types as $val) $t[$val['type_id']] = $val['type_name_'.$ulang]; foreach($publishers as $val) $p[$val['publisher_id']] = $val['publisher_name_'.$ulang]; foreach($rows as $key => $value) { $row['Module'] = $this->ClassName; $row['Date'] = $value['law_date']; $row['Title'] = $value['law_name_'.$ulang]." | ".$t[$value['law_type_id']]." | ".$p[$value['law_publisher_id']]; $row['Link'] = $row['NewWindowLink'] = "/data/laws/{$value['law_filename']}"; $row['Relev'] = $value['relev']; $searchRows [] = $row; } } return $searchRows; $rows = SearchOnSite($words, $text, 'law_name_'.$ulang, 'law_id', array('law_name_'.$ulang, 'law_index', 'law_preview'), 'AMCMS_laws'); $searchRows = array(); foreach($rows as $key => $value) { $law = $this->LawsTable->GetRowById($value['law_id']); $row['ModuleName'] = $ULANG['LawsName']; $row['Title'] = $value['law_name_'.$ulang]." | ".$types[$law['law_type_id']]['type_name_'.$ulang]." | ".$publishers[$law['law_publisher_id']]['publisher_name_'.$ulang]; $row['Link'] = 'data/laws/'.$law['law_filename']; $row['Download'] = 'data/laws/'.$law['law_filename']; $row['Relev'] = $value['relev']; //$row['NewWindowLink'] = '?page_id='.$value['law_id']; $searchRows [] = $row; } return $searchRows; } function SearchLaw($words, $text, $law_type_id, $law_publisher_id, $law_number, $law_session_number, $law_session_convocation, $date_type, $date1, $date2) { global $ulang, $ULANG; $rows = SearchOnSite($words, $text, 'law_name_'.$ulang, 'law_id', array('law_name_'.$ulang, 'law_index', 'law_preview'), 'AMCMS_laws'); $searchRows = array(); $types = $this->TypesTable->GetRows(); $publishers = $this->PublishersTable->GetRows(); foreach($rows as $key => $value) { $law = $this->LawsTable->GetRowById($value['law_id']); if ($law_publisher_id != 0 && $law_publisher_id != $law['law_publisher_id']) continue; if ($law_type_id != 0 && $law_type_id != $law['law_type_id']) continue; if ($law_number != "" && substr_count($law['law_number'], $law_number) == 0) continue; if ($law_session_number != "" && $law['law_session_number'] != $law_session_number) continue; if ($law_session_convocation != "" && $law['law_session_convocation'] != $law_session_convocation) continue; if ($date_type == "onedate" && $law['law_date'] != $date1) continue; if ($date_type == "twodate" && ($law['law_date'] < $date1 || $law['law_date'] > $date2)) continue; $law['type_name_'.$ulang] = $types[$law['law_type_id']]['type_name_'.$ulang]; $law['publisher_name_'.$ulang] = $publishers[$law['law_publisher_id']]['publisher_name_'.$ulang]; $searchRows [] = $law; } return $searchRows; } function AdminAsynch() { global $alang, $ALANG; $this->PublishersTable->Run($_POST); $this->TypesTable->Run($_POST); $this->SessionsTable->Run($_POST); $this->LawsTable->Run($_POST); } function Panel() { global $ULANG, $ulang; $smarty = GetUserSmarty($this->ClassName); $publishers = $this->PublishersTable->GetRows("publisher_position DESC"); $types = $this->TypesTable->GetRows("type_position DESC");
foreach($types as $val) $t[$val['type_id']] = $val['type_name_'.$ulang]; foreach($publishers as $val) $p[$val['publisher_id']] = $val['publisher_name_'.$ulang];
$smarty->assign("publishers", $publishers); $smarty->assign("types", $types); $smarty->assign('mod', $this->ClassName); $result[$this->ClassName] = array( 'Title' => GetParam("Module".$this->ClassName."Panel", $ulang), 'Content' => $smarty->fetch("panel.tpl"), 'Module' => $this->ClassName,); return $result; } function GetAdminAcessParams($params) { global $ALANG, $alang; $types = $this->TypesTable->GetRows(); $publishers = $this->PublishersTable->GetRows(); echo "<div id=\"PagesAdminParams\" style=\"padding-left: 30px; \">"; echo "<br />"; $sel = ""; if (isset($params['laws']['1']['1'])) $sel = "checked=\"checked\""; echo "<label><input type=\"checkbox\" name=\"laws[1][1]\" $sel value=\"1\" />"; echo $types[0]['type_name_'.$alang]." - ".$publishers[0]['publisher_name_'.$alang]; echo "</label><br />"; $sel = ""; if (isset($params['laws']['2']['1'])) $sel = "checked=\"checked\""; echo "<label><input type=\"checkbox\" name=\"laws[2][1]\" $sel value=\"1\" />"; echo $types[0]['type_name_'.$alang]." - ".$publishers[1]['publisher_name_'.$alang]; echo "</label><br />"; $sel = ""; if (isset($params['laws']['3']['2'])) $sel = "checked=\"checked\""; echo "<label><input type=\"checkbox\" name=\"laws[3][2]\" $sel value=\"1\" />"; echo $types[1]['type_name_'.$alang]." - ".$publishers[2]['publisher_name_'.$alang]; echo "</label><br />"; echo "</div>"; } }
$Modules ['Laws'] = new Laws(); ?>
|