0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
customtanningbed_dot_com
/
admin
/
[
Home
]
File: standup.php
<?php session_start(); $a2=$_SESSION['admin']; if($a2!=1) { echo "<center><h2>Sorry,but you don't have permission to view this page ,you loser!</center></h2>"; include("index.php");exit(); } include_once("config.php"); $id=$_REQUEST['id']; if(!isset($id)) $id="main"; function type($type1) { switch($type1) { case "gif": $ext1="gif"; return($ext1); break; case "jpg": $ext1="jpg"; return($ext1); break; case "png": $ext1="png"; return($ext1); break; default: //echo "<b>Sorry the image you uploaded is not valid"; } } function createXmlstandup() { $str6=""; $str=""; $sql="SELECT * FROM `standup`"; $rs=mysql_query($sql); $str1='<?xml version="1.0" encoding="iso-8859-1" ?>'; $str2='<catalog BGImgPath="" descColor="0XFF0000" descSize="18" playerHeading="South Beach Stand Ups!!">'; while($row=mysql_fetch_array($rs)) { $t=$row['thumb']; $f=$row['big']; $l=$row['left']; $r=$row['right']; //$a=$row['image1']; //$h=$row['heading']; //$sh=$row['subheading']; //$str4=""; $str8='<item thumbPath="'.str_replace("../","",$t).'" colorCode="" topImgPath="'.str_replace("../","",$f).'" leftImgPath="'.str_replace("../","",$l).'" rightImgPath="'.str_replace("../","",$r).'">'; $str4='<![CDATA[]]>'; $str9='</item>'; $str6.=$str8.$str4.$str9; } $str5='</catalog>'; $str.=$str2.$str6.$str5; $totstr=$str; if(file_exists("../xml/catalog7.xml")) { $ptr=fopen("../xml/catalog7.xml","w"); fwrite($ptr,$totstr); fclose($ptr); } } function add() { $f1=$_FILES['thumb']['name']; $f2=$_FILES['big']['name']; $tem_f1=$_FILES['thumb']['tmp_name']; $tem_f2=$_FILES['big']['tmp_name']; $type1=explode(".",$f1); $type2=explode(".",$f2); $ext=type($type1[1]); $ext1=type($type2[1]); $sql1="select * from `standup` order by `id` desc limit 0,1"; $rs1=mysql_query($sql1); $row1=mysql_fetch_array($rs1); $id2=$row1['id']+1; $des_f1="../images/STANDUP/thumbs/".$type1[0].$id2.".".$ext; $des_f2="../images/STANDUP/product/".$type2[0].$id2.".".$ext1; move_uploaded_file($tem_f1,$des_f1); move_uploaded_file($tem_f2,$des_f2); $sql="insert into standup(`thumb`,`big`)values('$des_f1','$des_f2')"; $rs=mysql_query($sql); if($rs) { createXmlstandup(); } } function edit() { $id1=$_REQUEST['id']; $f1=$_FILES['thumb']['name']; $f2=$_FILES['big']['name']; $tem_f1=$_FILES['thumb']['tmp_name']; $tem_f2=$_FILES['big']['tmp_name']; $type1=explode(".",$f1); $type2=explode(".",$f2); $ext=type($type1[1]); $ext1=type($type2[1]); $sql1="select * from `standup` order by `id` desc limit 0,1"; $rs1=mysql_query($sql1); $row1=mysql_fetch_array($rs1); $id2=$row1['id']+1; $des_f1="../images/STANDUP/thumbs/".$type1[0].$id2.".".$ext; $des_f2="../images/STANDUP/product/".$type2[0].$id2.".".$ext1; move_uploaded_file($tem_f1,$des_f1); move_uploaded_file($tem_f2,$des_f2); $sql="select * from standup where `id`='$id1'"; $rs1=mysql_query($sql); $row=mysql_fetch_array($rs1); if(empty($f1)) { $des_f1=$row['thumb']; } else { unlink($row['thumb']); } if(empty($f2)) { $des_f2=$row['big']; } else { unlink($row['big']); } $sql1="update `standup` set `thumb`='$des_f1', `big`='$des_f2' where `id`='$id1'"; $rs=mysql_query($sql1); if($rs) { createXmlstandup(); } else { echo "<b>Not updated</b>"; //include("Tropical_Rayz_BF_Series.php"); } } function del() { $id1=$_REQUEST['id']; $sql1="select * from standup where `id`='$id1'"; $rs1=mysql_query($sql1); $row1=mysql_fetch_array($rs1); $th=$row1['thumb']; $fr=$row1['big']; $sql="delete from standup where `id`='$id1'"; $rs=mysql_query($sql); if($rs) { createXmlstandup(); if(file_exists($th)) { unlink($th); } if(file_exists($fr)) { unlink($fr); } } } if($_REQUEST['mode']=="add1") { add(); $id="main"; } if($_REQUEST['mode']=="edit1") { edit(); $id="main"; } if($_REQUEST['mode']=="del1") { del(); $id="main"; } ?> <!DOCTYPEl html PUBLIC "-//W3C//DTD .php 1.0 Transitional//EN" "http://www.w3.org/TR/.php1/DTD/.html1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/.html"> <head> <meta http-equiv="Content-Type" content="text.html; charset=iso-8859-1" /> <title>CUSTOM TANNING BED ADMIN PANEL</title> <link href="adminCSS.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="mainTableBorder"> <tr> <?php include_once("header.php")?> </tr> <tr> <td align="center" valign="top" class="menuItemsDeco"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><?php include_once("menu.php")?></td> </tr> </table> </td> <td align="left" valign="top" class="dataArea"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td align="center"></td> </tr> <?php if($id=="main"){?> <tr> <td align="center" class="productTitile">Update Flash Player Images</td> </tr> <tr> <td class="productInnerBoder"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="containHeader"> <td width="7%" align="center">SLNo </td> <td width="31%" align="center">Thumb Image </td> <td width="39%" align="center">Big Image </td> <td width="10%" align="center">Edit </td> <td width="11%" align="center">Delete</td> </tr> <?php $sql2="select * from `standup`"; $i=1; $rs1=mysql_query($sql2); while($row1=mysql_fetch_array($rs1)) { ?> <tr> <td align="center"><?php echo $i?></td> <td align="center"><img src="<?php echo $row1['thumb']?>" alt="" name="thumb" width="100" height="32" id="thumb" /></td> <td align="center"><img src="<?php echo $row1['big']?>" alt="" name="thumb" width="100" height="32" id="thumb" /></td> <td align="center"><a href="standup.php?id=editimg&mode=<?php echo $row1['id'] ?>">Edit </a></td> <td align="center"><a href="standup.php?id=<?php echo $row1['id']?>&mode=del1">Delete </a></td> <td align="center"> </td> </tr><?php $i++;}?> <!-- <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr>--> </table></td> </tr> <tr> <td align="center"><span class="buttomDeco"><a href="standup.php?id=addimg">Add New Images Set</a></span> </td> </tr><?php }?> <tr> <td> </td> </tr><?php if($id=="addimg"){?> <tr> <td align="center" class="productTitile">Add New Image Set </td> </tr> <tr> <td class="productInnerBoder"><form action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data" name="form2" id="form2"> <input type="hidden" name="mode" value="add1" /> <table width="90%" border="0" align="center" cellpadding="05" cellspacing="0"> <tr> <td width="33%">Thumb Image </td> <td width="67%"><label> <input type="file" name="thumb" /> </label></td> </tr> <tr> <td>Big Image </td> <td><label> <input name="big" type="file" id="big" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit2" value="Submit" /> </label></td> </tr> </table> </form></td> </tr> <tr> <td> </td> </tr><?php }?> <tr> <?php if($id=="editimg"){ $id1=$_REQUEST['mode']; $sql2="select * from `standup` where `id`='$id1'"; $rs1=mysql_query($sql2); $row1=mysql_fetch_array($rs1);?> <td> <form action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data" name="form2" id="form2"> <input type="hidden" name="mode" value="edit1" /> <input type="hidden" name="id" value="<?php echo $row1['id']?>" /><table width="90%" border="0" align="center" cellpadding="05" cellspacing="0"> <tr> <td width="33%">Thumb Image </td> <td width="67%"><label> <input name="thumb" type="file" id="thumb" /> <img src="<?php echo $row1['thumb']?>" alt="" name="thumb" width="100" height="32" id="thumb" /></label></td> </tr> <tr> <td>Big Image </td> <td><label> <input name="big" type="file" id="big" /> <img src="<?php echo $row1['big']?>" alt="" name="thumb" width="100" height="32" id="thumb" /></label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit22" value="Submit" /> </label></td><?php }?> </tr> </table></form> </tr> </table></td> </tr> </table> <?php include_once("poweredby.php")?> </body> </html>