Ejemplo n.º 1
0
 function DropTables()
 {
     $moderator = new Moderator();
     $moderator->SetDatabase($this);
     $moderator->Drop();
     $message = new Message();
     $message->SetDatabase($this);
     $message->Drop();
     $topic = new Topic();
     $topic->SetDatabase($this);
     $topic->Drop();
     $user_info = new UserInfo();
     $user_info->SetDatabase($this);
     $user_info->Drop();
     $session = new Session();
     $session->SetDatabase($this);
     $session->Drop();
     $new = new News();
     $new->SetDatabase($this);
     $new->Drop();
     $shout = new Shout();
     $shout->SetDatabase($this);
     $shout->Drop();
     $paragraph = new Paragraph();
     $paragraph->SetDatabase($this);
     $paragraph->Drop();
     $privilege = new Privilege();
     $privilege->SetDatabase($this);
     $privilege->Drop();
     $role = new Role();
     $role->SetDatabase($this);
     $role->Drop();
     $menu_item = new MenuItem();
     $menu_item->SetDatabase($this);
     $menu_item->Drop();
     $module = new Module();
     $module->SetDatabase($this);
     $module->Drop();
     $page = new Page();
     $page->SetDatabase($this);
     $page->Drop();
     $article = new Article();
     $article->SetDatabase($this);
     $article->Drop();
     $subject = new Subject();
     $subject->SetDatabase($this);
     $subject->Drop();
     $menu = new Menu();
     $menu->SetDatabase($this);
     $menu->Drop();
     $profile = new Profile();
     $profile->SetDatabase($this);
     $profile->Drop();
     $user = new User();
     $user->SetDatabase($this);
     $user->Drop();
 }
Ejemplo n.º 2
0
			<tr>
				<td bgcolor="#EEEEEE" width="100%" valign="top" class="form_title" colspan="2">
				Notícias
				</td>
			</tr>
			<tr>
				<td bgcolor="#FFFFFF" width="30%" valign="center" align="right">
					Título:&nbsp;
				</td>
				<td bgcolor="#FFFFFF" width="70%" valign="center" align="left">
					<select name="p_news_id">
						<option value="">Selecione</option>

<?php 
$article = new News();
$article->SetDatabase($database);
$result = $article->Select();
while ($data = $database->FetchArray($result)) {
    $news_id = $data["news_id"];
    $news_title = $data["news_title"];
    echo "<option value=\"" . $news_id . "\">" . $news_title . "</option>";
}
?>

					</select>
				</td>
			</tr>
			<tr>
				<td bgcolor="#FFFFFF" width="100%" valign="center" align="center" colspan="2">
					<a href="javascript:Select();">Selecionar</a>&nbsp;
					<a href="javascript:Close();">Fechar</a>
Ejemplo n.º 3
0
        $news->SetUser($news_user_id);
        $news_id = $news->GetId();
        $news_title = $news->GetTitle();
        $news_date = $news->GetDate();
        $news_text = $news->GetText();
        $news_user_id = $news->GetUser();
        if ($news->Update()) {
            $message = $screen_module_name . " alterada com sucesso.";
        } else {
            $message = "Problemas na operação.";
        }
    }
    if ($action == 4) {
        $date = new Date();
        $news = new News();
        $news->SetDatabase($database);
        $news->SetId($news_id);
        if ($news->Delete()) {
            $message = $screen_module_name . " excluída com sucesso.";
            $news_id = "";
            $news_title = "";
            $news_date = $date->GetNowFull();
            $news_text = "";
            $news_user_id = "";
        } else {
            $message = "Problemas na operação.";
        }
    }
}
?>