You Are Here : /var/www/virtual/tvarditsa.org/admin/ |
Current File : /var/www/virtual/tvarditsa.org/admin/news.php1 |
<? 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> <u><?php if (sizeof($i['data']) > 0) { ?>Редактиране<?php } else { ?>Добавяне<?php } ?> на <?if($i['data'][0]['tip']==0)echo'новина';else echo 'курсове';?></u></strong> <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> </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(" ", "", "$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> | <?if($i['data'][0]['pic']!=''){?><a href="?lang=<?= $language; ?>&action=news&del_id=<?=$i['data'][0]['id']?>&id=<?=(int)$_GET['id']?>">изтрий</a><?}?> | </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>