文件操作 - collection.php
返回文件管理
返回主菜单
删除本文件
文件: /root/.local/share/Trash/files/gpshowroommilano--com-SUSPENDED/--old_old/admin/collection.php
编辑文件内容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>GP Admin</title> <style> body{ padding:0; margin:0; background-image:url(../img/sfondo_uniforme.png); margin:0; font-family:Tahoma, Geneva, sans-serif; font-size:11px; line-height:16px;} a{ text-decoration:none; color:#fff;} .pulsante{ float:left; padding:5px 10px; font-size:12px; color:#000; background-color:#eee; border:0;} </style> </head> <body> <a href="../admin/"><img style="margin:20px;" src="../img/logo.png" width="152" height="103" /></a> <?php include("configurazione_collezione.php"); $id=$_POST["id"]; $id_categoria=$_POST["id_categoria"]; $id_collezione=$_POST["id_collezione"]; $id_brand=$_POST["id_brand"]; $ordine=$_POST["ordine"]; $foto=$_POST["foto"]; include('config.php'); $DB = new DB(); $DB->connect(); /////////////////////////////////////////////////////////////////////////////////////////// if(isset($_POST['aggiungi']) && $_FILES['foto']['name']) { if(!$ordine) $ordine = 0; $query = "INSERT INTO scarpe (id, id_brand, id_categoria, id_collezione, ordine) VALUES(NULL,'$id_brand','$id_categoria','$id_collezione','$ordine') "; mysql_query($query) or die('Error, query failed. ' . mysql_error()); //PRELEVO ID APPENA CREATO $query = "SELECT id FROM scarpe ORDER BY id DESC LIMIT 1"; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); $variabili_db = mysql_fetch_array($result); $id=$variabili_db["id"]; //aggiorna foto1 if($_FILES['foto']['name']) { $rand=rand(1000,9999); $uploaddir = '../collections/'; $uploadfile = $uploaddir . $rand."_".$_FILES['foto']['name']; $nomefile = "collections/".$rand."_".$_FILES['foto']['name']; move_uploaded_file($_FILES['foto']['tmp_name'], $uploadfile); $query = "UPDATE scarpe SET foto='$nomefile' WHERE id='$id' "; mysql_query($query) or die('Error, query failed. ' . mysql_error()); } } /////////////////////////////////////////////////////////////////////////////////////////// if(isset($_POST['modifica'])) { $id_categoria = $id_categoria; $id_collezione = $id_collezione; $id_brand = $id_brand; $query = "UPDATE scarpe SET id_categoria='$id_categoria',id_collezione='$id_collezione', id_brand='$id_brand', ordine='$ordine' WHERE id='$id' "; //aggiorna foto1 if($_FILES['foto']['name']) { $rand=rand(1000,9999); $uploaddir = '../collections/'; $uploadfile = $uploaddir . $rand."_".$_FILES['foto']['name']; $nomefile = "collections/".$rand."_".$_FILES['foto']['name']; move_uploaded_file($_FILES['foto']['tmp_name'], $uploadfile); $query = "UPDATE scarpe SET foto='$nomefile' WHERE id='$id' "; mysql_query($query) or die('Error, query failed. ' . mysql_error()); } mysql_query($query) or die('Error, query failed. ' . mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////// if(isset($_GET['elimina'])) { $id_del=$_GET['id_del']; $query = "DELETE FROM scarpe WHERE id='$id_del'"; mysql_query($query) or die('Error, query failed. ' . mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////// ?> <div style="float:left; width:100%; margin-top:20px;"> <?php if(!$_POST['action']=="modifica"){ ?> <form style="float:left; margin-left:20px; margin-top:20px;" id="form1" name="form1" method="post" action="" enctype="multipart/form-data"> <table width="500" border="0" align="left" cellpadding="5" cellspacing="2"> <tr> <td width="122" valign="top">foto</td> <td width="438"><input type="file" name="foto" id="foto" /> <br /> <?php if($foto) { ?> <img src="../<?=$foto?>" alt="" style="max-width:150px; max-height:150px;" /> <?php } ?></td> </tr> <tr> <td valign="top">collezione</td> <td> <select name="id_collezione"> <?php foreach($collezioni as $id_collezione_ => $nome_collezione_){ ?> <option value="<?=$id_collezione_?>" <? if($id_collezione_==$id_collezione) echo"selected='selected'"; ?> > <?=$nome_collezione_?> </option> <?php } ?> </select></td> </tr> <tr style="background-image:url(../img/sfondo_sfumato.jpg)"> <td valign="top">categoria</td> <td> <select name="id_categoria"> <?php $query2 = "SELECT id, nome FROM categorie"; $result2 = mysql_query($query2) or die('Error, query failed. ' . mysql_error()); while($row2 = mysql_fetch_array($result2)) { list($id_cat_, $nome_cat_) = $row2; ?> <option value="<?=$id_cat_?>" <?php if($id_cat_==$id_categoria) echo"selected='selected'"?> ><?=$nome_cat_?></option> <?php } ?> </select> </td> </tr> <tr> <td valign="top">brand</td> <td><select name="id_brand"> <?php $query = "SELECT id, nome FROM brand"; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); while($row = mysql_fetch_array($result)) { list($id_brand_, $nome_brand_) = $row; ?> <option value="<?=$id_brand_?>" <?php if($id_brand_==$id_brand) echo"selected='selected'"?> > <?=$nome_brand_?> </option> <?php } ?> </select></td> </tr> <tr> <td valign="top">ordine</td> <td><input name="ordine" type="text" id="ordine" size="2" maxlength="2" /></td> </tr> <tr style="background-image:url(../img/sfondo_sfumato.jpg)"> <td valign="top"> </td> <td><input class="pulsante" type="submit" name="aggiungi" id="aggiungi" value="INSERISCI PRODOTTO" /></td> </tr> </table> </form> <?php } //fine if else { $query = "SELECT id, foto, id_categoria, id_brand, id_collezione, ordine FROM scarpe WHERE id='$id' "; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); while($row = mysql_fetch_array($result)){ list($id, $foto, $id_categoria, $id_brand, $id_collezione, $ordine) = $row;} ?> <div style="float:left; margin-left:20px; "><?php if($foto) { ?><img src="../<?=$foto?>" alt="" style="max-height:250px;" /><?php } ?></div> <form style="float:left; margin-left:20px; margin-top:20px;" id="form1" name="form1" method="post" action="" enctype="multipart/form-data"> <table width="500" border="0" align="left" cellpadding="5" cellspacing="2"> <tr style="background-image:url(../img/sfondo_sfumato.jpg)"> <td width="148" valign="top">cambia foto</td> <td width="438"> <input type="file" name="foto" id="foto" /><br /> </td> </tr> <tr style="background-image:url(../img/sfondo_sfumato.jpg)"> <td>collezione</td> <td><select name="id_collezione"> <?php $query = "SELECT id, nome FROM collezioni ORDER BY id DESC"; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); while($row = mysql_fetch_array($result)) { list($id_collezione_, $nome_collezione_) = $row; ?> <option value="<?=$id_collezione_?>" <?php if($id_collezione_==$id_collezione) echo"selected='selected'"?> > <?=$nome_collezione_?> </option> <?php } ?> </select></td> </tr> <tr style="background-image:url(../img/sfondo_sfumato.jpg)"> <td><input name="id" type="hidden" id="id" value="<?php echo"$id";?>" /> categoria</td> <td><select name="id_categoria"> <?php $query2 = "SELECT id, nome FROM categorie"; $result2 = mysql_query($query2) or die('Error, query failed. ' . mysql_error()); while($row2 = mysql_fetch_array($result2)) { list($id_cat_, $nome_cat_) = $row2; ?> <option value="<?=$id_cat_?>" <?php if($id_cat_==$id_categoria) echo"selected='selected'"?> > <?=$nome_cat_?> </option> <?php } ?> </select></td> </tr> <tr> <td>brand</td> <td><select name="id_brand"> <?php $query = "SELECT id, nome FROM brand ORDER BY id DESC"; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); while($row = mysql_fetch_array($result)) { list($id_brand_, $nome_brand_) = $row; ?> <option value="<?=$id_brand_?>" <?php if($id_brand_==$id_brand) echo"selected='selected'"?> > <?=$nome_brand_?> </option> <?php } ?> </select></td> </tr> <tr> <td>ordine</td> <td><input name="ordine" type="text" id="ordine" size="2" maxlength="2" value="<?=$ordine?>" /></td> </tr> <tr> <td><br /></td> <td><input class="pulsante" type="submit" name="modifica" id="modifica" value="CONFERMA MODIFICA" /> <a style=" float:right;padding:1px 5px; background-color:#FFF; color:#999; border:#999 solid 1px;" href="?p=collection.php&id_del=<?=$id?>&elimina=1">ELIMINA PRODOTTO</a></td> </tr> </table> </form> <?php }//fine else ?> </div> <div id="lista_prodotti" style="float:left; width:100%; margin-top:20px; border-top:#eee solid 2px;"> <?php $query = "SELECT id, id_categoria, id_collezione, id_brand, foto, ordine FROM scarpe WHERE id_collezione<='$collezione_attuale' ORDER BY id_brand DESC, id_categoria DESC, ordine ASC "; $result = mysql_query($query) or die('Error, query failed. ' . mysql_error()); while($row = mysql_fetch_array($result)) { list($id, $id_categoria, $id_collezione, $id_brand, $foto, $ordine) = $row; $query2 = "SELECT nome FROM brand WHERE id='$id_brand'"; $result2 = mysql_query($query2) or die('Error, query failed. ' . mysql_error()); while($row2 = mysql_fetch_array($result2)){list($nome_brand) = $row2;} $query3 = "SELECT nome FROM categorie WHERE id='$id_categoria'"; $result3 = mysql_query($query3) or die('Error, query failed. ' . mysql_error()); while($row3 = mysql_fetch_array($result3)){list($nome_categoria) = $row3;} $query2 = "SELECT nome FROM collezioni WHERE id='$id_collezione'"; $result2 = mysql_query($query2) or die('Error, query failed. ' . mysql_error()); while($row2 = mysql_fetch_array($result2)){list($nome_collezione) = $row2;} if($id_collezione!=$id_collezione_prev) { ?> <div style='float:left; width:100%; background-color:#999; color:#fff; margin-top:40px; font-size:20px;'> <div style="float:left; margin:20px;"><?=$nome_collezione?></div> </div> <?php } if($id_categoria!=$id_categoria_prev || $id_brand!=$id_brand_prev) { ?> <div style='float:left; width:100%; border-bottom:#eee solid 2px; margin-top:40px; font-size:20px;'> <div style="float:left; margin:20px;"><?=$nome_categoria?> / <?=$nome_brand?></div> </div> <?php } ?> <div id="prodotto" style="float:left; border-bottom:#eee solid 2px; border-right:#eee solid 2px; background-color:#fff; padding:5px; margin:10px 0px 0px 10px; width:100px; height:70px; text-align:center;"> <a href="#" onclick="document.getElementById('form_<?=$id?>').submit();"><img src="../<?=$foto?>" style="max-width:100px; max-height:70px;" /></a> <form style="float:right; width:100%; text-align:right;" action="" method="post" name="form_<?=$id?>" id="form_<?=$id?>"> <input type="hidden" name="action" value="modifica" /> <input type="hidden" name="id" value="<?=$id?>" /> <input type="hidden" name="id_categoria" value="<?=$id_categoria?>" /> <input type="hidden" name="id_collezione" value="<?=$id_collezione?>" /> <input type="hidden" name="foto" value="<?=$foto?>" /> <input type="hidden" name="ordine" value="<?=$ordine?>" /> <input type="hidden" name="id_brand" value="<?=$id_brand?>" /> </form> </div> <?php $id_brand_prev=$id_brand; $id_categoria_prev=$id_categoria; $id_collezione_prev=$id_collezione; } //fine while ?> </div> <?php $DB->disconnect(); ?> </body> </html>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件