You Are Here : /var/www/virtual/tvarditsa.org/admin/ |
Current File : /var/www/virtual/tvarditsa.org/admin/update_doc.php |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>update</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; } body { background-color: #fcfcf3; } a:link { color: #000000; } a:visited { color: #000000; } a:hover { color: #000000; } a:active { color: #000000; } --> </style></head> <body> <? include ('../classes/pager.class.php');?> <? if((int)$_GET['del_id']!=0){ $dell = new Pager(); $dell->set_condition("id='".(int)$_GET['del_id']."'"); $dell->delete ('doc_and'); } if( ($_POST['data']['id_doc']!=0) && ($_FILES['pic']['name']!='') ){ $f=date("YmdHis").'_'.$_FILES['pic']['name']; move_uploaded_file ( $_FILES['pic']['tmp_name'], 'doc_and/'.$f ) ; $_POST['data']['path_doc']=$f; $update3 = new Pager(); //$update3->debug=TRUE; $update3->insert ('doc_and', $_POST['data']); } if($_POST['data']['id_doc']!=0) $_GET['id']= $_POST['data']['id_doc']; $ls_doc = new Pager(); $ls_doc->set_condition('id_doc = '.intval($_GET['id'])); $ls_doc->set_records(-1); $rsz = $ls_doc->create ('doc_and', '*'); ?> <table cellspacing="0" cellpadding="2" border="0" align="center"> <tr> <td style="border-bottom: 1px solid Black;" width="50%"><strong>Добавяне на документи</strong></td> <td style="border-left: 1px solid Black; border-bottom: 1px solid Black;"width="50%"> <div align="center"><strong>Добавени документи</strong></div></td> </tr> <tr> <td valign="top" > <form action="update_doc.php" method="post" enctype="multipart/form-data" name="forma1" id="forma1"> <font size="2">избери документ:</font><br> <input size="12" type="File" name="pic" value="Browse" size="5"> <br><font size="2">описание:</font><br> <input type="text" name="data[opisanie]" value=""> <input type="hidden" name="data[id_doc]" value="<?=intval($_GET['id'])?>"><br> <input type="submit" name="save" value="Добави"> </form> </td> <td valign="top"style="border-left: 1px solid Black;"> <? if(is_array($rsz['data'])){?> <table cellspacing="0" cellpadding="3" border="0"> <?foreach($rsz['data'] as $k_ls =>$lsz){?> <tr> <td><a href="doc_and/<?=$lsz['path_doc']?>" target="_blank"><img src="img/document_dirty.gif" alt="" width="16" height="19" border="0"></a></td> <td><a href="doc_and/<?=$lsz['path_doc']?>" target="_blank"><?=$lsz['opisanie']?></a></td> <td><a href="update_doc.php?id=<?=intval($_GET['id']);?>&del_id=<?=$lsz['id']?>" >|изтрий|</a></td> </tr> <?}?> </table> <?}else echo"<br><br><br><br>";?> </td> </tr> </table> </body> </html>