LONTE SHELL EDITION


Dashboard -*- SHOW INFO -*- HASH identify -*- Config -*- Jumping

You Are Here : /var/www/virtual/tvarditsa.org/admin/
Upload File :
Current File : /var/www/virtual/tvarditsa.org/admin/news.php

<script type="text/javascript">
  _editor_url = '../htmlarea/';
  _editor_lang = 'en';
</script>
<script type="text/javascript" src="../htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="../htmlarea/lang/en.js"></script>
<script type="text/javascript">

HTMLArea.loadPlugin("TableOperations"); 

function initDocument() {
    var config = new HTMLArea.Config();
    config.width = 'auto';
    config.height = '450px';
    config.pageStyle = 'body { background-color: #FFFFFF; color : #000000; font-size : 12px; font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif; }';
    config.toolbar = [
    [ "bold", "italic", "underline", "strikethrough", "subscript", "superscript", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "insertorderedlist", "insertunorderedlist", "outdent", "indent",  "separator", "undo", "redo", "separator", "htmlmode" ],
    [ "forecolor", "hilitecolor", "separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable"]
    ];
    config.statusBar = true;

    var editor1 = new HTMLArea("story", config);
    editor1.registerPlugin(TableOperations); 
    editor1.generate();
};
    
havehtmlarea = true;
</script> 
<?

include ("../classes/pager.class.php");

if($_GET['del_id']!=0){

 $search_p = new Pager();
 $search_p->set_condition("id='".(int)$_GET['del_id']."'");
 $pic=$search_p->create ('new_'.$language,'*');


  $_POST['data']['pic']='';
  $news=new Pager();
  $news->set_condition ('id = '.$_GET['del_id']);
  $news->update ('new_'.$language,$_POST['data']);

  @unlink("pic_news/".$pic['data'][0]['pic']);    
  }




  $news=new Pager();
  $news->set_offset (0);
  $news->set_records (1);
  $news->set_condition ('id = '.(int)$_GET['id']);
  $i = $news->create ('new_'.$language,'*', true);
  ?>
  
  <div align="center"><font size="-6"><br></font><font size="2"><strong>&nbsp;<u><?php if (sizeof($i['data']) > 0) { ?>Редактиране<?php } else { ?>Добавяне<?php } ?> на <?if($i['data'][0]['tip']==0)echo'новина';else echo 'курсове';?></u></strong>&nbsp;<br></font><font size="-6"><br></font></div>

<form name="adddir" method="post" action="?lang=<?= $language; ?>&action=update_news" enctype="multipart/form-data">
<input type="hidden" name="data[id]" value="<?=(int)$i['data'][0]['id']; ?>">
<input type="hidden" name="update" value="1">


<table align="center" cellspacing="0" cellpadding="2" border="0" bgcolor="#F7F8EF" width="630" style="border: 1px solid Black;">

<tr>
    <td align="right" width="80"><br><font size="2" color="#000000">Заглавие:</font></td>
    <td width="440"><br><input type="text" name="data[title]" size="61" value="<?= htmlspecialchars(stripslashes($i['data'][0]['title']), ENT_QUOTES); ?>" style="font-weight: bold;"></td>
</tr>
<tr>
    <td align="right" width="80"><font size="2" color="#000000">Дата:</font></td>
    <td width="440"><input type="text" name="data[posted]" size="25" value="<?php
if ($i['data'][0]['posted']!='')echo $i['data'][0]['posted']; else echo date('Y-m-d') ;

?>" style="font-weight: bold;"></td>
</tr>
<tr>
    <td align="right" width="80"><font size="2" color="#000000">Активация</font></td>
    <td width="440"><select name="data[status]">
    <option value="0" <?if ($i['data'][0]['status']==0)echo "selected"?>>Активна</option>
    <option value="1" <?if ($i['data'][0]['status']==1)echo "selected"?>>Неактивирана</option>
    <option value="2" <?if ($i['data'][0]['status']==2)echo "selected"?>>Актуална</option>
  </select>
</td>
</tr>
</tr>
<tr>
    <td align="right" width="80"><font size="2" color="#000000">Текст:</font></td>
    <td width="440">
	<?$story=$i['data'][0]['story'];
  	  $story = str_replace("&nbsp;", "", "$story");
	  //$story = str_replace("<br />", "<P></P>", "$story");
	  //$story = str_replace("<BR>", "<P></P>", "$story");
	  ?>
	  
	  <textarea cols="60" rows="12" id="story" name="data[story]"><?=htmlspecialchars(stripslashes($story), ENT_QUOTES);
	?></textarea>
    </td>
</tr>
<?if($i['data'][0]['pic']!=''){?>
<tr>
<td>Снимка към новината</td>
<td><strong><?=$i['data'][0]['pic']?></strong>&nbsp;&nbsp;|&nbsp;<?if($i['data'][0]['pic']!=''){?><a href="?lang=<?= $language; ?>&action=news&del_id=<?=$i['data'][0]['id']?>&id=<?=(int)$_GET['id']?>">изтрий</a><?}?>&nbsp;|
</td>
</tr>
<?}?>

<tr>
<td>
Добави <?if($i['data'][0]['pic']!=''){?>нова<?}?> снимка</td>
<td><input type="file" name="pic"> </td>
</tr>
<tr>
    <td colspan="2">
<div align="center"><font size="-6"><br></font><input name="submitform" type="submit" value="<?php if (sizeof($i['data']) > 0) { ?>Запиши<?php } else { ?>Добави<?php } ?> <?if($i['data'][0]['tip']==0)echo'новина';else echo 'курсове';?>" style="width: 440px; font-weight: bold;"></div>
</form><td>
</tr>
</table><br>
<br>