📄 view_images.php
字号:
<?php
include_once "logincheck.php";
include_once "myconnect.php";
if(!isset($_REQUEST["sb_id"]))
{
header("Location: gen_confirm_mem.php?errmsg=".urlencode("Invalid access, unable to continue."));
die();
}
$sb_id=(int)$_REQUEST["sb_id"];
////////---chking
$sbq_off_chk="select * from sbbleads_offers where sb_id=$sb_id and sb_uid=".$_SESSION["sbbleads_userid"];
//die($sbq_off_chk);
$sbrs_off_chk=mysql_query($sbq_off_chk);
if(mysql_num_rows($sbrs_off_chk) < 1)
{
header("Location: gen_confirm_mem.php?errmsg=".urlencode("Invalid access, unable to continue."));
die();
}
include_once "styles.php";
echo '<title>Manage Sell Offer Images</title>';
$sbrow_off_chk=mysql_fetch_array($sbrs_off_chk);
////////////////---------expiry check
$sbq_con="select * from sbbleads_config where sb_id=1";
$sqrow_con=mysql_fetch_array(mysql_query($sbq_con));
if(($sqrow_con["sb_image_magik"]=="enable"))
{
$img_path="thumbs2/";
$img_pmt="";
}
else
{
$img_path="uploadedimages/";
$img_pmt="width=".$sqrow_con["sb_th_width2"]." height=".$sqrow_con["sb_th_width2"];
}
$sbexpiry_duration=$sqrow_con["sb_expiry_sell"];
$sbq_off_chk1="select * from sbbleads_offers where sb_id=$sb_id and DATE_ADD(sb_postedon,INTERVAL $sbexpiry_duration MONTH) > NOW()";
$sbrs_off_chk1=mysql_query($sbq_off_chk1);
if(mysql_num_rows($sbrs_off_chk1) == 1 )
$sbexpired=false;
else
$sbexpired=true;
////////---------
$sbq_gro='select * from sbbleads_groups where sb_memtype='.$_SESSION["sbbleads_memtype"];
$sbrow_gro=mysql_fetch_array(mysql_query($sbq_gro));
$row_con=mysql_fetch_array(mysql_query("select * from sbbleads_config where sb_id=1"));
$sbq_off_img="select * from sbbleads_offer_images where sb_offer_id=$sb_id";
//die($sbq_off_img);
$sql=mysql_query($sbq_off_img);
$num=mysql_num_rows($sql);
$pid=$sb_id;
?>
<div align="center">
<script language="JavaScript">
function checkFile(form1)
{
if (form1.userfile.value == "")
{
alert("Please choose a file to upload");
form1.userfile.focus();
return (false);
}
if ( !form1.userfile.value.match(/(\.jpg|\.png|\.gif|\.bmp|\.jpeg)$/i) )
{
alert("Please upload .gif/.jpg/.jpeg/.bmp/.png files only");
form1.userfile.focus();
return (false);
}
return(true);
}
function submit_frm(frm)
{
if(checkFile(frm))
{
frm.action="upload_image.php";
frm.submit();
}
}
</script>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font class="normal">
<?
if (isset($_REQUEST["msg"]))
{
echo "<font color='red'>".$_REQUEST["msg"]."</font><br>";
}
?>
After Uploading image(s) you can <a href=" " onClick="window.close();">close</a>
this window to return to members area.</font></td>
</tr>
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="titlestyle"> Images for <?php echo $sbrow_off_chk["sb_title"]; ?></td>
</tr>
<tr>
<td align="left" class="innertablestyle"> <div align="left"><font class="normal">Maximum
Allowed - <font class="red"><?php echo $sbrow_gro["sb_img_cnt"];?></font><br>
</font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100" align="left" valign="top"> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#EEEEEE">
<?
if($rst=mysql_fetch_array($sql))
{
?>
<?
$cnt=0;
$row=0;
while($rst)
{
$cnt++;
if($cnt%3==1)
{
$row++;
?>
<tr class="innertablestyle">
<?
}
?>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="innertablestyle">
<tr>
<td align="left" valign="top"><div align="center"><img height="<?php echo $sqrow_con["sb_th_width2"]; ?>" width="<?php echo $sqrow_con["sb_th_width2"]; ?>" src="<? echo $img_path.$rst["sb_img_url"];?>" ><br>
<a href="delete_image.php?id=<? echo $rst["sb_id"]."&pid=$sb_id"; ?>" class="insidelink"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Remove</font></a></div></td>
</tr>
</table></td>
<?
$rst=mysql_fetch_array($sql);
if(!($rst))
{
$blankpad=(($row*3)-$cnt)%3;
while($blankpad>0)
{
?>
<td><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF" class="innertablestyle">
<tr align="center" valign="middle">
<td><img src="images/spacer.gif" height="<?php echo $sqrow_con["sb_th_width2"]; ?>" width="<?php echo $sqrow_con["sb_th_width2"]; ?>" border=0><br>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
</tr>
</table></td>
<?
$blankpad--;}
}
if($cnt%3==0)
{
?>
</tr>
<?
}
}// end while
?>
<?
}// end if
else
echo "<font size='2' color='#FF0000' face='Verdana, Arial, Helvetica, sans-serif'>You have not added any image.</font>";
?>
</table></td>
</tr>
<tr>
<td align="left"> </td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006699" class='normal' face="Arial, Helvetica, sans-serif">
<?php
if( ($num<$sbrow_gro["sb_img_cnt"]) && (!$sbexpired))
{
?>
</td>
</tr>
<tr>
<td height="25" align="left" valign="middle"> </td>
</tr>
<tr>
<td height="25" align="left" valign="middle" class="titlestyle"> Upload
Image</td>
</tr>
<tr>
<td align="left" valign="top"><font class='normal'>
<FORM method=post enctype="multipart/form-data" name=form123 onSubmit="return checkFile(this);" >
<div align="center">
<TABLE width="100%" border=0 align=center cellPadding=5 cellSpacing=0 class="onepxtable">
<TBODY>
<TR vAlign=center class="innertablestyle">
<TD colspan="3"><table>
<tr>
<td valign="top" width="15"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">1.</font></td>
<td width="470"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">To
upload an image, click the 'Browse' button to select
the file, or type the path to the file in the Text-box
below.</font></td>
</tr>
<tr>
<td valign="top" width="15"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">2.</font></td>
<td width="470"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">Then
click 'Upload' button.</font></td>
</tr>
<tr>
<td valign="top" width="15"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">3.</font></td>
<td width="470"><font class='red' >NOTE</font><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">:</font><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">
The file transfer can take from a few seconds up to
a few minutes depending on the size of the file. Please
have patience while the file is being uploaded.</font></td>
</tr>
<tr>
<td valign="top" width="15"><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">4.</font></td>
<td width="470"><font class='red' >NOTE</font><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">:
The file will be renamed if the file with the same name
already exists.</font></td>
</tr>
</table></TD>
</TR>
<TR vAlign=center class="innertablestyle">
<TD colspan="3"><font class='normal' face="Arial, Helvetica, sans-serif"><strong>Hit
the [Browse] button to find the file on your computer.
</strong></font></TD>
</TR>
<TR vAlign=center class="innertablestyle">
<TD width="40%" align="right" class='innertablestyle'> <div align="right"><strong><font color="#000000" class='normal' face="Arial, Helvetica, sans-serif">Image
<input type="hidden" name="pid" value="<? echo $pid;?>">
</font></strong></div></TD>
<TD width="6" align="left" valign="top"><font class='red' >*</font></TD>
<TD width="354"><font class='normal' face="Arial, Helvetica, sans-serif" color="#666666">
<INPUT NAME=userfile SIZE=30 TYPE=file MaxFileSize="1000000" >
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
</font></TD>
</TR>
<TR align=right class="innertablestyle">
<TD width="40%" class='innertablestyle'> <div align="center">
</div></TD>
<TD width="6"><font class='normal' face="Arial, Helvetica, sans-serif"> </font></TD>
<TD width="60%" align="left"> <input type="button" name="Button" value="Upload" onClick="javascript:submit_frm(this.form);"></TD>
</TR>
<TR align=left class="innertablestyle">
<TD colspan="3"><font class='red'>NOTE: Please have patience,
you will not receive any notification until the file is completely
transferred.</font></TD>
</TR>
</TBODY>
</TABLE>
</div>
</FORM>
<?php }
elseif(!$sbexpired)
echo "<font class='normal'>You can't add more than ".$sbrow_gro["sb_img_cnt"]." image(s).</font>";
else
echo "<font class='normal'>You can't add images to an expired offer.</font>";
?>
</font></td>
</tr>
</table>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -