<?php
require_once "../auth/config.php";
$link = mysql_connect($hostname, $username,$password);
$res=mysql_select_db($dbname,$link);
$idd=$_GET['idd'];
$home=$_GET['home'];
$opr=$_GET['opr'];
if($opr=="insertimg")
{
$qry="select * from images";
$result=mysql_query($qry,$link);
$i=1;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
$field[$i] = $line['field'];
$image[$i] = $line['image'];
$height[$i] = $line['height'];
$width[$i] = $line['width'];
$uheight[$i] = $line['uheight'];
$uwidth[$i] = $line['uwidth'];
$img=$line['imgid'];
$imgid[$i]=$img;
$typ[$i] = $line['typ'];
$i++;
}
if($typ[$idd]=="updated")
{
$stt1="display---<img id=cruimg src='$home"."includes/print.php?cnt=$idd' width=$uwidth[$idd] height=$uheight[$idd]>";
echo"$stt1";
}else if($typ[$idd]=="default")
{
$stt="display---<img id=cruimg src='$home"."image/img$idd.gif' width=$width[$idd] height=$height[$idd]>";
echo"$stt";
}
}else if($opr=="setdefault")
{
$qry="update images set typ='default'";
$result=mysql_query($qry,$link);
if ($result)
{
echo"default---<div align=center style='color:green; font-size:14px;'>updated image is changed to default image</div>";
}
}
?>