Exemplo n.º 1
0
 public static function WrapLinkToButton($link, $text = NULL)
 {
     if ($text === NULL) {
         $text = Language::Word('get download link');
     }
     $link = 'http://' . $_SERVER["HTTP_HOST"] . $link;
     return '<button class="btn btn-info" onclick="get_temporary_link(\'' . urlencode($link) . '\');">' . $text . '</button>';
 }
Exemplo n.º 2
0
 public static function ToString($err)
 {
     if (is_a($err, 'Error')) {
         return Error::ToString($err->id) . ': ' . $err->mesg;
     }
     switch ($err) {
         case self::no_translation:
             return Language::Word('no translation');
         case self::db_error:
             return Language::Word('internal database error');
         case self::arg_not_valid:
             return Language::Word('argument not valid');
         case self::ambiguously:
             return Language::Word('ambigiously');
         case self::not_found:
             return Language::Word('not found');
         case self::error:
             return Language::Word('error');
     }
 }
Exemplo n.º 3
0
function PairLabelAndInputFileArea($labes_width, $file_width, $label)
{
    $res = '';
    $res .= '<div class="row">';
    $res .= '<div class="' . ColAllTypes($labes_width) . ' vcenter" align="right">';
    $res .= '<b>' . $label . '</b>';
    $res .= '</div>';
    $res .= '<div class="' . ColAllTypes($file_width) . ' vcenter" align="center" style="padding: 0px;">';
    $res .= '<div id="files_area" class="files_area">';
    $res .= '<input type="file" onchange="send_files(this.files);" id="one_file_upload" style="display: none;">';
    $res .= '<button onclick="elem(\'one_file_upload\').click(); return false;" type="button" class="btn btn-default" style="padding: 0px; position: absolute; top: 0px; left: 0px; width: 100%;">' . Language::Word('add file') . '</button>';
    $res .= '<ul id="progress_bars" style="list-style-type: none;">';
    $res .= '</ul>';
    $res .= '</div>';
    $res .= '</div>';
    $res .= '<input id="files_count" type="hidden" name="files_count" value="0">';
    $res .= '</div>';
    return $res;
}
Exemplo n.º 4
0
$is_public = true;
include_once 'utility_lgmis_lib.php';
include_once $link_to_utility_authorization;
$header = Language::PublicMenu('contacts');
$content = '';
$footer = '';
$header_type = 'h4';
$title = Language::PublicMenu('contacts');
$content .= '<br><div class="row" align="center">';
$content .= '<div class="' . ColAllTypes(6) . ' vcenter">';
$content .= '<iframe class="google-map" src="https://www.google.com/maps/embed?pb=!1m24!1m8!1m3!1d8994.513616455022!2d37.532702!3d55.695448!3m2!1i1024!2i768!4f13.1!4m13!3e2!4m5!1s0x46b54cf533082589%3A0x402540c5efcc4157!2z0KHRgtCw0L3RhtC40Y8g0LzQtdGC0YDQviDCq9Cj0L3QuNCy0LXRgNGB0LjRgtC10YLCuywg0KDQvtGB0YHQuNGP!3m2!1d55.692679999999996!2d37.536882!4m5!1s0x46b54c6129ed4359%3A0xe03aa689c99f60f5!2z0KTQsNC60YPQu9GM0YLQtdGCINCS0JzQmiDQnNCT0KMsINGD0LvQuNGG0LAg0JvQtdCx0LXQtNC10LLQsCwg0KHRgtCw0YDQstC40LvRjCwg0JzQvtGB0LrQvtCy0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwsINCg0L7RgdGB0LjRjw!3m2!1d55.698434999999996!2d37.530196!5e0!3m2!1sru!2sru!4v1432075564575"></iframe>';
$content .= '</div>';
$content .= '<div class="' . ColAllTypes(6) . ' vcenter">' . Language::Address() . '</div>';
$content .= '</div>';
$content .= '<br>';
$users = User::FetchAllEmployes();
$size = count($users);
if ($size > 0) {
    $content .= '<hr><div class="row" align="center">' . ToPageHeader(Language::Word('employees'), 'h4', 'grey') . '</div><hr>';
    require $link_to_pagination_init_template;
    for ($i = $from; $i <= $to; ++$i) {
        $content .= $users[$i]->ToHTMLAutoShortForTable(GetUserPrivileges());
        if ($i != $to) {
            $content .= '<hr>';
        }
    }
    require $link_to_pagination_show_template;
    $content .= $pagination;
}
$no_content_center = true;
include $link_to_public_template;
Exemplo n.º 5
0
        </div>
        <?php 
echo '<div id="footer" align="center">';
echo '<div class="row">';
echo '<div class="' . ColAllTypes(12) . '" align="center">';
require_once $link_to_public_footer_template;
echo '</div>';
echo '</div>';
echo '</div>';
?>
    </div>
    <div style="position: absolute; top: 20px; right: 50px;">
        <a onclick="changeLanguage('rus');"><img class="lang_flag" src=<?php 
echo '"' . Link::Get($link_to_service_images) . 'rus_flag.png"';
?>
 ></a><a onclick="changeLanguage('eng');"><img class="lang_flag" src=<?php 
echo '"' . Link::Get($link_to_service_images) . 'eng_flag.png"';
?>
 ></a>
    </div>
    <div style="position: fixed; top: 20px; left: 50px;">
        <a class="btn btn" href=<?php 
echo '"' . Link::Get($link_to_admin) . '"';
?>
 ><?php 
echo Language::Word('private office');
?>
</a>
    </div>
    </body>
</html>
Exemplo n.º 6
0
 $content .= '<div class="row" align="center">';
 $content .= '<div class="' . ColAllTypes(4) . '"><img src="' . Link::Get($user->GetPathToPhoto()) . '" class="img-avatar"></div>';
 $content .= '<div class="' . ColAllTypes(8) . '">';
 $content .= '<br><div class="row" align="center">';
 $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('position') . ':</font></div>';
 $content .= '<div class="' . ColAllTypes(6) . '" align="left">' . $user->GetPosition() . '</div>';
 $content .= '</div>';
 $articles = Article::FetchCountOf(['where' => 'author_id = ' . $user->GetID()]);
 $content .= '<div class="row" align="center">';
 $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('news published') . ':</font></div>';
 $content .= '<div class="' . ColAllTypes(6) . '" align="left">' . $articles . '</div>';
 $content .= '</div>';
 $content .= '<hr>';
 $content .= ToPageHeader(Language::PublicMenu('contacts'), 'h4', 'grey');
 $content .= '<div class="row" align="center">';
 $content .= '<div class="' . ColAllTypes(6) . '" align="right"><font color="grey">' . Language::Word('mail') . ':</font></div>';
 $content .= '<div class="' . ColAllTypes(6) . '" align="left"><a href="mailto:' . $user->GetEmail() . '">' . $user->GetEmail() . '</a></div>';
 $content .= '</div>';
 $content .= '</div>';
 $content .= '</div>';
 $content .= '<hr>';
 $blocks = UserBlock::FetchAllByAuthorID($user->GetID());
 $size = count($blocks);
 if ($size) {
     require $link_to_pagination_init_template;
     for ($i = $from; $i <= $to; ++$i) {
         $content .= $blocks[$i]->ToHTMLAutoFull(GetUserPrivileges()) . '<hr>';
     }
     require $link_to_pagination_show_template;
     $content .= $pagination;
 }
Exemplo n.º 7
0
                $content .= '<textarea id="text_block" name="text_block"></textarea>';
                $content .= '</div>';
                $content .= '</div>';
                $content .= '<script>';
                $content .= 'CKEDITOR.replace("text_block",';
                $content .= '{ filebrowserImageUploadUrl: "' . $link_to_img_upload . '?type=' . Project::$type . '&id=' . $id . '&add=add&glob_id=' . $project->id . '",';
                $content .= 'filebrowserImageBrowseUrl : "' . $link_to_img_browse . '?type=' . Project::$type . '&id=' . $project->id . '&edit=edit",';
                $content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],';
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
                $title = Language::Word('language adding');
                $header = $title;
            }
        } else {
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $project = Project::FetchByID($_REQUEST['id']);
            $title = Language::Word('project');
            $header = htmlspecialchars($project->name);
            $content = $project->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 8
0
                if ($content_type != 'all_reps') {
                    $ids = '';
                    for ($i = 0, $cnt = count($target); $i < $cnt; ++$i) {
                        $ids .= '(id = ' . $target[$i] . ')';
                        if ($i < $cnt - 1) {
                            $ids .= ' OR';
                        }
                    }
                    $reports = Report::FetchBy(['where_addition' => $ids, 'limit' => $limit, 'offset' => $from, 'order_by' => 'id DESC']);
                } else {
                    $reports = Report::FetchBy(['limit' => $limit, 'offset' => $from, 'order_by' => 'id DESC']);
                }
                for ($i = 0; $i < $limit; ++$i) {
                    $content .= $reports[$i]->ToHTMLAutoShortForTable(GetUserPrivileges());
                }
                $content .= '</tbody>';
                $content .= '</table>';
                $content .= '</div>';
                $content .= '</div>';
                require $link_to_pagination_show_template;
                $content .= $pagination;
            } else {
                $content .= ToPageHeader(Language::Word('absense'), "h3", "black");
            }
        default:
            break;
    }
} else {
    $content = MenuButton(Language::Word('reports'), $link_to_admin_bookkeeping . '?content_type=' . $content_types_short['reports'], 'btn-default', '', 'get');
}
include_once $link_to_admin_template;
    $content .= '<tr>';
    $content .= '<th class="text-center">' . Language::Word('full name') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('date') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('comment') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('mail') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('telephone') . '</th>';
    $content .= '<th class="text-center">' . Language::Word('actions') . '</th>';
    $content .= '</tr>';
    $content .= '</thead>';
    $content .= '<tbody>';
    $from = -1;
    $to = -1;
    require $link_to_pagination_init_template;
    for ($i = $from; $i <= $to; ++$i) {
        $request = $reg_requests[$i];
        if ($request == NULL) {
            echo 'error on ' . $i . '<br>';
        } else {
            $content .= $request->ToHTMLAutoShortForTable(GetUserPrivileges());
        }
    }
    $content .= '</tbody>';
    $content .= '</table>';
    $content .= '</div>';
    $pagination = '';
    require $link_to_pagination_show_template;
    $content .= $pagination;
} else {
    $content = ToPageHeader(Language::Word('absense'), "h3", "black");
}
include $link_to_admin_template;
Exemplo n.º 10
0
 public function GetLinkToFile()
 {
     global $link_to_utility_download;
     global $link_to_logo;
     $text = Language::Word('download file');
     if ($this->is_directory) {
         $text = Language::Word('download zip');
     }
     $res = '<a class="btn btn-warning" href="' . $this->GetURLToFile() . '">' . $text . '</a>';
     return $res;
 }
Exemplo n.º 11
0
include_once $link_to_utility_authorization;
if (isset($_POST['id']) && isset($_GET['id']) && $_POST['id'] !== $_GET['id']) {
    $content = AlertMessage('alert-danger', 'Неоднозначные id');
} else {
    $project = Project::FetchByID($_REQUEST['id']);
    $header = '';
    $content = '';
    $footer = '';
    $header_type = 'h4';
    if ($project === NULL) {
        $title = Language::Word('error');
        $header = $title;
        $content = Language::Word('internal server error');
    } else {
        if ($project === Error::no_translation) {
            $title = Language::Word('error');
            $header = Language::Word('sorry');
            $content = Language::Word('no translation for this project');
        } else {
            $title = $project->name;
            $header = htmlspecialchars($project->name);
            $content .= '<br><div class="row" align="center">';
            $content .= Language::Word('direction of project') . ': ' . Direction::FetchByID($project->direction_id)->LinkToThis();
            $content .= '</div>';
            $content .= '<br><hr>';
            $content .= '<div class="row"><div class="' . ColAllTypes(12) . '">' . $project->text_block . '</div></div>';
            $no_content_center = true;
        }
    }
}
include $link_to_public_template;
Exemplo n.º 12
0
?>
);
                } else {
                    unsetError(password_field);
                }

            	return error_flag != true;
            }
        </script>
    </head>

    <body>
    	<?php 
echo '<div class="row">';
echo '<div class="' . ColAllTypes(12) . '" align="center">';
echo ToPageHeader(Language::Word('registration'));
echo '</div>';
echo '</div>';
echo '<div class="row">';
if ($no_content_center) {
    echo '<div class="' . ColAllTypes(12) . '">';
} else {
    echo '<div class="' . ColAllTypes(12) . '" align="center">';
}
echo RequestOnRegister::FormForCreating();
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="' . ColAllTypes(12) . '" align="center">';
echo $footer;
echo '</div>';
Exemplo n.º 13
0
$is_public = false;
include_once 'utility_lgmis_lib.php';
include_once $link_to_utility_authorization;
$header = '';
$content = '';
$footer = '';
$on_start_page = true;
$header .= Language::Word('main admin page');
$user = User::FetchBy(['select_list' => 'position', 'eq_conds' => ['id' => GetUserID()], 'is_unique' => true]);
if (GetUserPrivileges() == admin_user_id) {
    //Manage staff
    $content .= MenuButton(Language::Word('staff management'), $link_to_admin_manage_staff, 'btn-default', '', 'get');
    //Manage content
    $content .= MenuButton(Language::Word('content management'), $link_to_admin_manage_content, 'btn-default', '', 'get');
    //Requests on register
    $content .= MenuButton(Language::Word('requests on register'), $link_to_admin_requests_on_register, 'btn-default', '', 'get');
} else {
    //Manage staff
    $content .= MenuButton(Language::Word('our collective'), $link_to_admin_manage_staff, 'btn-default', '', 'get');
    //Manage content
    $content .= MenuButton(Language::Word('our content'), $link_to_admin_manage_content, 'btn-default', '', 'get');
}
$content .= MenuButton(Language::Word('file manager'), $link_to_admin_file_manager, 'btn-default', '', 'get');
if ($user->GetPositionNum() != NotEmployeeNum) {
    $content .= MenuButton(Language::Word('bookkeeping'), $link_to_admin_bookkeeping, 'btn-default', '', 'get');
}
include $link_to_admin_template;
if ($need_to_show_timer) {
    echo 'secs: ' . (microtime(true) - $start_timer__);
}
Exemplo n.º 14
0
 public function ToHTMLEditing()
 {
     global $user_blocks_in_db;
     global $link_to_admin_user_block;
     global $positions;
     global $link_to_utility_sql_worker;
     $positions = Language::GetPositions();
     $res = '';
     $res .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">';
     $res .= '<div class="row">';
     $res .= '<div class="' . ColAllTypes(1) . '"></div>';
     $res .= '<div class="' . ColAllTypes(5) . ' vcenter" align="right">';
     $res .= '<div class="row">';
     $res .= '<img src="' . $this->path_to_photo . '" class="img-rounded img-avatar">';
     $res .= '</div>';
     $res .= '<div class="row">';
     $res .= PairLabelAndInputFile(3, 5, Language::Word('upload image'), 'img');
     $res .= '</div>';
     $res .= '</div>';
     $res .= '<div class="' . ColAllTypes(5) . ' vcenter" align="left">';
     $res .= PairLabelAndInput(2, 10, Language::Word('name'), 'name', Language::Word('insert name'), $this->name);
     $res .= PairLabelAndInput(2, 10, Language::Word('surname'), 'surname', Language::Word('insert surname'), $this->surname);
     $res .= PairLabelAndInput(2, 10, Language::Word('fathername'), 'fathername', Language::Word('insert fathername'), $this->fathername);
     if ($this->login != 'admin' && GetUserLogin() == 'admin') {
         $tmp = User::FetchAllByPosition(DirectorPositionNum);
         if (($tmp != NULL || GetUserLogin() != 'admin') && $this->position != DirectorPositionNum) {
             unset($positions[DirectorPositionNum]);
         }
         $res .= PairLabelAndSelect(2, 10, Language::Word('position'), 'position', $positions, $selected_field = array($this->position, $positions[$this->position]));
     } else {
         $res .= PairLabelAndPanel(2, 10, Language::Word('position'), htmlspecialchars(Language::Position($this->position)));
     }
     $res .= PairLabelAndInput(2, 10, Language::Word('mail'), 'email', Language::Word('insert mail'), $this->email);
     $res .= PairLabelAndInput(2, 10, Language::Word('telephone'), 'telephone', Language::Word('insert telephone'), $this->telephone);
     if ($this->login == GetUserLogin() && $this->login != 'admin') {
         $res .= PairLabelAndInput(2, 10, Language::Word('login'), 'login', Language::Word('insert login'), $this->login);
     } else {
         $res .= PairLabelAndPanel(2, 10, Language::Word('login'), $this->login);
     }
     $res .= PairLabelAndInput(2, 10, Language::Word('birthday'), 'birth_day', 'dd', date('j', $this->birthday));
     $res .= PairLabelAndInput(2, 10, Language::Word('birthmonth'), 'birth_month', 'mm', date('n', $this->birthday));
     $res .= PairLabelAndInput(2, 10, Language::Word('birthyear'), 'birth_year', 'yyyy', date('Y', $this->birthday));
     if ($this->login == GetUserLogin()) {
         $res .= PairLabelAndPassword(4, 8, Language::Word('old password'), 'password_old', Language::Word('only for password changing'));
         $res .= PairLabelAndPassword(4, 8, Language::Word('new password'), 'password_new1', Language::Word('only for password changing'));
         $res .= PairLabelAndPassword(4, 8, Language::Word('repeat new password'), 'password_new2', Language::Word('only for password changing'));
     }
     $res .= '</div>';
     $res .= '</div>';
     $res .= DialogInputsYesNo('edit', $_POST['type'], $_POST['id'], Language::Word('save'), Language::Word('cancel'));
     $res .= '</form>';
     return $res;
 }
Exemplo n.º 15
0
<?php

require_once 'utility_lgmis_lib.php';
require_once $link_to_utility_authorization;
if (isset($_POST['id']) && isset($_GET['id']) && $_POST['id'] !== $_GET['id']) {
    $content = AlertMessage('alert-danger', 'Неоднозначные id');
} else {
    $user = User::FetchBy(['eq_conds' => ['id' => $_REQUEST['id']], 'is_unique' => true]);
    if (Error::IsError($user)) {
        echo Error::ToString($user);
        exit;
    }
    $prev_page = '';
    if (isset($_REQUEST['edit'])) {
        $title = Language::Word('profile edit');
        $header = $title;
        $content = $user->ToHTMLEditing();
    } else {
        $title = $user->GetName();
        $header = htmlspecialchars(Language::Translit($user->GetName() . ' ' . $user->GetSurname() . ' ' . $user->GetFathername()));
        $content = $user->ToHTMLAutoFull(GetUserPrivileges());
        $no_content_center = true;
    }
}
require_once $link_to_admin_template;
Exemplo n.º 16
0
								<tr>
									<td>Login</td>
									<td><input type="text" id="login" name="login"/></td>
								</tr>
								<tr>
									<td>Password</td>
									<td><input type="password" name="password" /></td>
								</tr>
								<tr>
									<td>
										<input type="submit" name="enter" value=<?php 
        echo '"' . Language::Word('login') . '"';
        ?>
 />
									</td>
									<td>
										<input type="button" name="register" value=<?php 
        echo '"' . Language::Word('registration') . '"';
        ?>
 onclick="toRegisterPage();" />
									</td>
								</tr>
							</table>
						</form>
					</td>
				</tr>
			</table>
			<?php 
        exit;
    }
}
Exemplo n.º 17
0
                $content .= '<script>';
                $content .= 'CKEDITOR.replace("text_block",';
                $content .= '{ filebrowserImageUploadUrl: "' . $link_to_img_upload . '?type=' . TextPart::$type . '&id=' . $id . '&add=add&glob_id=' . $text_part->GetID() . '",';
                $content .= 'filebrowserImageBrowseUrl : "' . $link_to_img_browse . '?type=' . TextPart::$type . '&id=' . $text_part->GetID() . '&edit=edit",';
                $content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],';
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
                $title = Language::Word('language adding');
                $header = $title;
            }
        } else {
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $text_part = TextPart::FetchByID($_REQUEST['id']);
            $title = '';
            $header = '';
            $content = '';
            $title = Language::Word('text block');
            $header = htmlspecialchars($text_part->GetName());
            $content = $text_part->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 18
0
             case TextPart::$type:
                 $assoc = $_POST;
                 $assoc['author_id'] = $_POST['id'];
                 unset($assoc['id']);
                 $part = TextPart::FetchFromAssoc($assoc);
                 if ($part === NULL) {
                     $content = AlertMessage('alert-danger', Language::Word('error during text block adding'));
                 } else {
                     $glob_id = 0;
                     if (isset($_POST['glob_id'])) {
                         $glob_id = $_POST['glob_id'];
                     }
                     if (TextPart::InsertToDB($part, $_POST['language'], $glob_id)) {
                         $content = AlertMessage('alert-success', Language::Word('text block is successfully added'));
                     } else {
                         $content = AlertMessage('alert-danger', Language::Word('error during text block inserting'));
                     }
                 }
                 break;
             default:
                 # code...
                 break;
         }
         require_once $link_to_admin_template;
         exit;
     } else {
         echo 'id is not specified';
     }
 } else {
     echo 'type is not specified';
 }
Exemplo n.º 19
0
                $content .= 'filebrowserImageBrowseUrl : "' . $link_to_img_browse . '?' . http_build_query($assoc) . '",';
                $content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],';
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
            }
        } else {
            if (!isset($_REQUEST['full'])) {
                echo 'action_type is unset. Must be "full"';
                exit;
            }
            if (!isset($_REQUEST['type'])) {
                echo 'object type is unset. Must be "user"';
                exit;
            }
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $user_block = UserBlock::FetchByID($_REQUEST['id']);
            $title = Language::Word('user block');
            $header = htmlspecialchars($user_block->name);
            $content = $user_block->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 20
0
 public function InsertToDB()
 {
     global $db_connection;
     $res = User::FetchBy(['eq_conds' => ['login' => $this->login], 'select_list' => 'id', 'is_unique' => true]);
     if (!Error::IsError($res)) {
         self::$last_error = Language::Word('user with such login already exists');
         return false;
     }
     $name_tmp = $db_connection->real_escape_string($this->name);
     $surname_tmp = $db_connection->real_escape_string($this->surname);
     $fathername_tmp = $db_connection->real_escape_string($this->fathername);
     $login_tmp = $db_connection->real_escape_string($this->login);
     $email_tmp = $db_connection->real_escape_string($this->email);
     $telephone_tmp = $db_connection->real_escape_string($this->telephone);
     $text_tmp = $db_connection->real_escape_string($this->text);
     $res = $db_connection->query("INSERT INTO `register_requests`\r\n\t\t\t\t(`name`, `surname`, `fathername`, `login`, `password`, `request_time`, `email`, `telephone`, `text`)\r\n\t\t\t\tVALUES\r\n\t\t\t\t('" . $name_tmp . "', '" . $surname_tmp . "', '" . $fathername_tmp . "',\r\n\t\t\t\t\t'" . $login_tmp . "', '" . password_hash($this->password, PASSWORD_DEFAULT) . "', CURRENT_TIMESTAMP, '" . $email_tmp . "', '" . $telephone_tmp . "',\r\n\t\t\t\t\t'" . $text_tmp . "')");
     if (!$res) {
         self::$last_error = $db_connection->error;
         return false;
     }
     return true;
 }
Exemplo n.º 21
0
                if ($size) {
                    require $link_to_pagination_init_template;
                    for ($i = $from; $i <= $to; ++$i) {
                        $project = $projects[$i];
                        if ($i === $from || $i > $from && $projects[$i - 1]->direction_id != $project->direction_id) {
                            if ($i != $from) {
                                $content .= '<hr>';
                            }
                            $content .= '<div align="left" style="padding: 15px; background-color: #eeeeee;">';
                            $content .= Language::Word('direction') . ': ' . Direction::FetchByID($project->direction_id)->LinkToThis();
                            $content .= '</div><hr>';
                        }
                        $content .= $project->ToHTMLAutoShortForTable(GetUserPrivileges());
                    }
                } else {
                    $content .= ToPageHeader(Language::Word('no projects'), 'h3', 'black');
                }
                $header .= Language::PublicMenu('projects');
            }
        }
    } else {
        //Manage articles
        $content .= MenuButton(Language::PublicMenu('articles'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['articles']);
        //Manage directions
        $content .= MenuButton(Language::PublicMenu('directions'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['directions']);
        //Manage projects
        $content .= MenuButton(Language::PublicMenu('projects'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['projects']);
    }
}
$pagination = '';
if ($size) {
Exemplo n.º 22
0
 >
                        <input type="hidden" name="id" value=<?php 
    echo '"' . User::FetchBy(['eq_conds' => ['login' => $_SESSION['user_login']], 'select_list' => 'id', 'is_unique' => true])->GetID() . '"';
    ?>
 >
                        <input type="hidden" name="prev_page" value=<?php 
    echo '"' . $_SERVER['REQUEST_URI'] . '"';
    ?>
 >
                    </form>
                </li>
                <li>
                    <form class="navbar-form navbar-left dropdown" method="post" action="">
                        <div class="input-group">
                            <input style="min-width: 300px;" id="glob_search_input" placeholder=<?php 
    echo '"' . Language::Word('start to insert something') . '"';
    ?>
 onkeyup="showGlobalSearch(this);" class="form-control" aria-haspopup="true" name="search" type="text">
                            <ul id="glob_search_list" class="dropdown-menu" role="menu" style="display: none; overflow: scroll; max-height: 300px;">
                            </ul>
                            <span class="input-group-addon"><span class="glyphicon glyphicon glyphicon-search" aria-hidden="true"></span></span>
                            <!--<button type="button" class="btn btn-default">Test</button>-->
                        </div>
                    </form>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a style="margin: 0px; padding: 0px;" href=<?php 
    echo '"' . $link_to_utility_interceptor . '?lang=rus"';
    ?>
 ><img class="lang_flag" src=<?php 
Exemplo n.º 23
0
 public function ToHTMLDel()
 {
     global $link_to_utility_interceptor;
     $args = array('action_link' => $link_to_utility_interceptor, 'action_type' => 'del', 'obj_type' => self::$type, 'id' => $this->id, 'info' => Language::Word('are you shure that you want to delete report with header') . ' ' . htmlspecialchars($this->name) . '?');
     return ActionButton($args);
 }
Exemplo n.º 24
0
 public function ToHTMLFullVers()
 {
     global $link_to_admin_direction;
     global $link_to_admin_manage_content;
     global $link_to_public_direction;
     global $content_types_short;
     global $link_to_public_content;
     global $use_mod_rewrite;
     $mod_rewrite = 0;
     if (isset($use_mod_rewrite) && $use_mod_rewrite === true) {
         $mod_rewrite = 1;
     }
     $args = array();
     if (IsSessionPublic()) {
         $args = array('action_link' => $link_to_public_direction, 'action_type' => 'full', 'obj_type' => Direction::$type, 'id' => $this->id, 'btn_text' => Language::Word('learn more'), 'method' => 'get', 'mod_rewrite' => $mod_rewrite, 'prev_page' => $link_to_public_content . '?content_type=' . $content_types_short['directions']);
     } else {
         $args = array('action_link' => $link_to_admin_direction, 'action_type' => 'full', 'obj_type' => Direction::$type, 'id' => $this->id, 'prev_page' => $link_to_admin_manage_content . '?content_type=' . $content_types_short['directions'], 'method' => 'get');
     }
     return ActionButton($args);
 }
Exemplo n.º 25
0
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '<div class="modal fade" id="myModal" tabindex="-1" role="dialog">';
$content .= '<div class="modal-dialog" role="document">';
$content .= '<div class="modal-content">';
$content .= '<div class="modal-header">';
$content .= '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
$content .= '<h4 class="modal-title" id="myModalLabel">' . Language::Word('options') . ': ' . Language::Word('permissions') . '</h4>';
$content .= '</div>';
$content .= '<div class="modal-body">';
$content .= '<div class="btn-group" data-toggle="buttons" id="options_permissions">';
$content .= '<label class="btn btn-primary active">';
$content .= '<input type="radio" name="options" id="for_employees" autocomplete="off" checked>' . Language::Word('for employees');
$content .= '</label>';
$content .= '<label class="btn btn-primary">';
$content .= '<input type="radio" name="options" id="for_registered" autocomplete="off" checked>' . Language::Word('for registered');
$content .= '</label>';
$content .= '</div>';
$content .= '</div>';
$content .= '<div class="modal-footer">';
$content .= '<button type="button" class="btn btn-default" data-dismiss="modal">' . Language::Word('cancel') . '</button>';
$content .= '<button type="button" class="btn btn-primary" onclick="saveFiles();">' . Language::Word('save') . '</button>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
include $link_to_admin_template;
Exemplo n.º 26
0
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
                $title = Language::Word('language adding');
                $header = $title;
            }
        } else {
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $ob_id = $_REQUEST['id'];
            $ob = Article::FetchBy(['eq_conds' => array('id' => $ob_id), 'is_unique' => true]);
            if (Error::IsError($ob)) {
                $content = AlertMessage('alert-danger', Error::ToString($ob));
            } else {
                $title = '';
                $header = '';
                $content = '';
                $title = Language::Word('article');
                $header = htmlspecialchars($ob->GetName());
                $content = $ob->ToHTMLAutoFull(GetUserPrivileges());
            }
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 27
0
            $content .= 'allowedContent: true, });';
            $content .= 'CKEDITOR.config.height = 400;';
            $content .= '</script>';
            $content .= '<div class="row">';
            $content .= DialogInputsYesNo('edit', $_POST['type'], $ob_id, Language::Word('save'), Language::Word('cancel'));
            $content .= '</div>';
            $content .= '</form>';
            $title = Language::Word('report editing');
            $header = $title;
        }
    } else {
        if (!isset($_REQUEST['id'])) {
            echo 'user id is unset';
            exit;
        }
        $ob = Report::FetchBy(['eq_conds' => ['id' => $_REQUEST['id']], 'is_unique' => true]);
        $user_id = GetUserID();
        $user = User::FetchBy(['eq_conds' => ['id' => $user_id], 'is_unique' => true, 'select_list' => 'received_reports']);
        if ($user_id !== $ob->GetAuthorID() && !in_array($ob->GetID(), $user->GetReceivedReports()) && GetUserPrivileges() !== admin_user_id) {
            $content = AlertMessage('alert-danger', Language::Word('access denied'));
        } else {
            $title = '';
            $header = '';
            $content = '';
            $title = Language::Word('report');
            $header = htmlspecialchars($ob->GetName());
            $content = $ob->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 28
0
                        $content .= '<th class="text-center">' . Language::Word('author') . '</th>';
                        $content .= '<th class="text-center">' . Language::Word('date') . '</th>';
                        $content .= '<th class="text-center">' . Language::Word('role') . '</th>';
                        $content .= '<th class="text-center">' . Language::Word('actions') . '</th>';
                        $content .= '</tr>';
                        $content .= '</thead>';
                        $content .= '<tbody>';
                        for ($i = $from; $i <= $to; ++$i) {
                            $content .= $parts[$i]->ToHTMLAutoShortForTable(GetUserPrivileges());
                        }
                        $content .= '</tbody>';
                        $content .= '</table>';
                        $content .= '</div>';
                        $content .= '</div>';
                    } else {
                        $content .= ToPageHeader(Language::Word('absense'), 'h3', 'black');
                    }
                    $header .= ' :' . Language::PublicMenu('about_us');
                }
            }
        }
    }
    $prev_page = $link_to_admin_manage_content;
} else {
    //Manage articles
    $content .= MenuButton(Language::PublicMenu('articles'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['articles'], 'btn-default', '', 'get');
    //Manage directions
    $content .= MenuButton(Language::PublicMenu('directions'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['directions'], 'btn-default', '', 'get');
    //Manage projects
    $content .= MenuButton(Language::PublicMenu('projects'), $_SERVER['PHP_SELF'] . '?content_type=' . $content_types_short['projects'], 'btn-default', '', 'get');
    if (GetUserPrivileges() === admin_user_id) {
Exemplo n.º 29
0
                $content .= '<textarea id="text_block" name="text_block"></textarea>';
                $content .= '</div>';
                $content .= '</div>';
                $content .= '<script>';
                $content .= 'CKEDITOR.replace("text_block",';
                $content .= '{ filebrowserImageUploadUrl: "' . $link_to_img_upload . '?type=' . Direction::$type . '&id=' . $id . '&add=add&glob_id=' . $direction->id . '",';
                $content .= 'filebrowserImageBrowseUrl : "' . $link_to_img_browse . '?type=' . Direction::$type . '&id=' . $direction->id . '&edit=edit",';
                $content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],';
                $content .= 'allowedContent: true, });';
                $content .= 'CKEDITOR.config.height = 400;';
                $content .= '</script>';
                $content .= '<div class="row">';
                $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">';
                $content .= '</div>';
                $content .= '</form>';
                $title = Language::Word('language adding');
                $header = $title;
            }
        } else {
            if (!isset($_REQUEST['id'])) {
                echo 'user id is unset';
                exit;
            }
            $direction = Direction::FetchByID($_REQUEST['id']);
            $title = Language::Word('direction');
            $header = htmlspecialchars($direction->name);
            $content = $direction->ToHTMLAutoFull(GetUserPrivileges());
        }
    }
}
include_once $link_to_admin_template;
Exemplo n.º 30
0
 public function ToHTMLDel()
 {
     global $link_to_utility_interceptor;
     $args = array('action_link' => $link_to_utility_interceptor, 'action_type' => 'del', 'obj_type' => UserBlock::$type, 'id' => $this->id, 'info' => Language::Word('are you shure that you want to delete block') . ' ' . $this->name . '?');
     return ActionButton($args);
 }