GIF89a; Mini Shell

Mini Shell

Direktori : /home/serb/www/m/admin/
Upload File :
Current File : /home/serb/www/m/admin/edit_postad.php

<?
include("sessionout.php");
 include("../lib/globals.php");
 include("../lib/common.php");
 include("../lib/functions.php");
 
 
 
 
 
 
 $id=$_POST["id"];
 $sb=$_POST["Submit"];
 if($sb=="Process")
	{	
		if($_FILES['ad_image1']['name'])
		{
			$manu_imagename1=time().$_FILES['ad_image1']['name'];
			move_uploaded_file($_FILES['ad_image1']['tmp_name'],'../avtar/'.$manu_imagename1);
		}
		else
		{
			$manu_imagename1=$_POST['img1'];
		}
		
		if($_POST['picid1'])
		{
			$pics1_insert="UPDATE escort_photo SET picture='$manu_imagename1' where id='".$_POST['picid1']."'";
			execute_query($pics1_insert);
		}
		
		
		
		    if($_FILES['ad_image2']['tmp_name'])
						 {
							$manu_imagename11=time().$_FILES['ad_image2']['name'];
							move_uploaded_file($_FILES['ad_image2']['tmp_name'],'../avtar/'.$manu_imagename11);
						 }
					else
			
					{
				
						$manu_imagename11=$_POST['img2'];
				
					}
					
				if($_POST['picid2'])
				{
					$pics2_insert="UPDATE escort_photo SET picture='$manu_imagename11' where id='".$_POST['picid2']."'";
					execute_query($pics2_insert);
				}	
					
					
					
					
		if($_FILES['ad_image3']['tmp_name'])
						 {
							$manu_imagename12=time().$_FILES['ad_image3']['name'];
							move_uploaded_file($_FILES['ad_image3']['tmp_name'],'../avtar/'.$manu_imagename12);
						 }
					else
			
					{
				
						$manu_imagename12=$_POST['img3'];
				
					}
					
					if($_POST['picid3'])
						{
							$pics3_insert="UPDATE escort_photo SET picture='$manu_imagename12' where id='".$_POST['picid3']."'";
							execute_query($pics3_insert);
						}	
					
					
					
					
		if($_FILES['ad_image4']['tmp_name'])
						 {
							$manu_imagename13=time().$_FILES['ad_image4']['name'];
							move_uploaded_file($_FILES['ad_image4']['tmp_name'],'../avtar/'.$manu_imagename13);
						 }
					else
			
					{
				
						$manu_imagename13=$_POST['img4'];
				
					}
					
					if($_POST['picid4'])
					 {
						$pics4_insert="UPDATE escort_photo SET picture='$manu_imagename13' where id='".$_POST['picid4']."'";
						execute_query($pics4_insert);
			          }	
					
					 $sql_picsavl="SELECT * FROM escort_photo where postid='".$_POST['ad_id']."'";
					$res_picsavl=execute_query($sql_picsavl);
					$row_picsavl=mysql_num_rows($res_picsavl);
					if($row_picsavl<=0)
					  {
						
						 if($_FILES['ad_image1']['name'])
							{
						  		$pics1_insert="INSERT into escort_photo(id,postid,userid,picture)values('','".$_POST['ad_id']."','".$_POST['userid']."','$manu_imagename1')";
								execute_query($pics1_insert);
							}
							
							 if($_FILES['ad_image2']['name'])
							{
						  		$pics2_insert="INSERT into escort_photo(id,postid,userid,picture)values('','".$_POST['ad_id']."','".$_POST['userid']."','$manu_imagename11')";
								execute_query($pics2_insert);
							}
							 if($_FILES['ad_image3']['name'])
							{
						  		$pics3_insert="INSERT into escort_photo(id,postid,userid,picture)values('','".$_POST['ad_id']."','".$_POST['userid']."','$manu_imagename12')";
								execute_query($pics3_insert);
							}
							 if($_FILES['ad_image4']['name'])
							{
						  		$pics4_insert="INSERT into escort_photo(id,postid,userid,picture)values('','".$_POST['ad_id']."','".$_POST['userid']."','$manu_imagename13')";
								execute_query($pics4_insert);
							}
						  
						  
					  }
					
					
					
					
					
					$desp=addslashes($_POST['ad_desp']);
					$date=date('Y-m-d');
				
					if(($_POST['prlCities']=='-1') && ($_POST['visitor_city']==""))
					{
						
						
						 $statename=$_POST['ptcity'];
						
						 $cityname=$_POST['ptstate'];
						 $countryname=$_POST['ptcountry'];
						
						
						
						
						
						
					}
					else
					{
						
						if($_POST['visitor_country']=='US')
								{
									$sql_state="SELECT * FROM states Where id='".$_POST['prlState']."'";
									$res_state=execute_query($sql_state);
									$row_state=mysql_fetch_array($res_state);
									
									$statename=$row_state['name'];
									$cityname=$_POST['prlCities'];
									$countryname=$_POST['visitor_country'];
									
								}
							else
								{
									
									 $statename=$_POST['visitor_state'];
									 $cityname=$_POST['visitor_city'];
									 $countryname=$_POST['visitor_country'];
									 
								}
						 
					}
					
		
		$insert_sql="update escort_details set description='$desp',tel_national='".$_POST['phNumber']."',email='".$_POST['emailAddress']."',escort_city='$cityname',escort_state='$statename',country_name='$countryname',updatedate='$date' WHERE id='".$_POST['ad_id']."'";
		execute_query($insert_sql);
		
   		
		
		
		
?>
	<script>
		window.location.href="list_post_ad.php";
	</script>
<?
	}
	$sel="select * from escort_details where id='".$_GET['id']."'";
	$res=execute_query($sel);
	$row=mysql_fetch_array($res);
?>
<!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=iso-8859-1" />
<title>Escortservice</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../validator/frm_validator.js"></script>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function selectCity(country_id){
	if(country_id!="-1"){
		loadData('state',country_id);
		$("#city_dropdown").html("<option value='-1'>Select city</option>");	
	}else{
		$("#state_dropdown").html("<option value='-1'>Select state</option>");
		$("#city_dropdown").html("<option value='-1'>Select city</option>");		
	}
}

function selectState(state_id){
	if(state_id!="-1"){
		loadData('city',state_id);
	}else{
		$("#city_dropdown").html("<option value='-1'>Select city</option>");		
	}
}

function loadData(loadType,loadId){
	var dataString = 'loadType='+ loadType +'&loadId='+ loadId;
	$("#"+loadType+"_loader").show();
    $("#"+loadType+"_loader").fadeIn(400).html('Please wait...');
	$.ajax({
		type: "POST",
		url: "loadData.php",
		data: dataString,
		cache: false,
		success: function(result){
			$("#"+loadType+"_loader").hide();
			$("#"+loadType+"_dropdown").html("<option value='-1'>Select "+loadType+"</option>");  
			$("#"+loadType+"_dropdown").append(result);  
		}
	});
}
</script>
<script language="javascript">

function openmobilecareer(ctname)
{
	if(ctname=='US')
	{
	  document.getElementById('openus').style.display="block";
	  document.getElementById('openother').style.display="none";
	}
	else
	{
		document.getElementById('openother').style.display="block";
		document.getElementById('openus').style.display="none";
	}
}



</script>




<script>
    function validate4()
	{
	   if(frmValidate('f1','country','country','YES','')== false)
	   {
	     return false;
	   }
	   if(frmValidate('f1','state','state','YES','')== false)
	   {
	     return false;
	   }
	   
	   
	   
    } 
	
	
  function del_record(id)
   {
	 var msg="Sure to delete image of this escort ";
	 var choice=confirm(msg);
	 if(choice)
	 {
	   var target="deleteimages.php?id="+id;
	   //alert(target);
	   window.location.href=target;
	 }
   }
</script>
</head>
<body>
<table width="790" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"><table width="790" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top" class="td1"><table width="790" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="343" align="left" valign="top">&nbsp;</td>
            <td width="447" align="left" valign="top">&nbsp;</td>
          </tr>
          <tr>
			<td height="38" align="right" valign="middle" class="topnav"><p style="margin-left:23px;"><img src="img/logo.png" alt="" /></p></td>
           <td align="center" valign="middle" class="footer-link">Administrator Control Panel</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="td2">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="5"></td>
      </tr>
      <tr>
        <td align="center" valign="top" class="td4"><table width="768" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="6"></td>
            </tr>
          <tr>
            <td align="center" valign="top" class="td5">&nbsp;</td>
          </tr>
          <tr>
            <td align="center" valign="top" class="td9"><table width="751" border="0" align="center" class="bordermain">
              <tr>
                <td><? include("menu.php");?></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center">
				<form action="<? print $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="f1" >
				<table width="735" border="0" align="center" cellspacing="1" class="Table4">
                  <tr>
                    <td colspan="2" align="center" class="tblHeader2">Edit Ad</td>
                  </tr>
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                   
                 
                  
                  
                  
                 
                   <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                   <tr class="mouseOver">
                    <td width="33%" align="right" ><strong>Description: &nbsp;</strong></td>
                    <td width="67%" align="left" >
                    	<textarea name="ad_desp" style="width:350px; height:200px;"><?=$row['description']?></textarea>
                    </td>
                  </tr>
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                                  
                 
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" ></td>
                  </tr>               
                  <tr class="mouseOver">
                    <td width="22%" align="right"><strong>Phone Number:</strong> &nbsp;</td>
                    <td width="78%" align="left">
                     &nbsp;<input name="phNumber" type="text" class="content" id="eng_menu" size="50" value="<?=$row['tel_national']?>" />
                    </td>
                  </tr>
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" ></td>
                  </tr>     
                  <tr class="mouseOver">
                    <td width="22%" align="right"><strong>Location:</strong> &nbsp;</td>
                    <td width="78%" align="left">
                    <?
						echo $row['escort_city'].' '.$row['escort_state'].' '.$row['country_name']
					
					?>
                   	
                    </td>
                  </tr>
                   <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" ></td>
                  </tr>
                   <tr class="mouseOver">
                   <td colspan="2" align="left" style="font-size:16px;">you can change your location:</td>
                  </tr>
                   <tr class="mouseOver">
                    <td width="22%" align="right"><strong>&nbsp;Select Country :</strong> &nbsp;</td>
                    <td width="78%" align="left">
                   	<select class="drp_img2" id="visitor_country" name="visitor_country" onChange="openmobilecareer(this.value)">

                        <option value="">Select Country</option>
                         
                         <?
                                                
                          $sql_country="select * from countries";
                                                
                         $country_res=execute_query($sql_country);
                                                
                         while($country_row=mysql_fetch_array($country_res)){
                                                
                          ?>
                                                
                         <option value="<?=$country_row['ccode']?>"><?=$country_row['country']?></option>
                                                
                         <? }?>
                      </select>
                    </td>
                    
                  </tr>
                  
                    <tr  class="mouseOver"></tr>
                       <tr class="mouseOver">
                       	<td colspan="2">
                                   	     	<div style="display:none; width:500px; margin:0 auto;" id="openus">
                                                            	<table border="0" cellpadding="0" cellspacing="0">
                                                            		<tr>
                                                                    	<td width="150" align="right">&nbsp;Working State:</td>
                                                                        <td width="78%" align="left" style="padding-left:20px;">
                                                                           <!--<input type="text" name="visitor_state" value="<?=$row_postad['escort_state']?>" class="main_input" />-->
                                                                             <select name="prlState" id="state_dropdown" class="drp_img2" onChange="selectState(this.options[this.selectedIndex].value)"> 
                                                                                <option value="-1">Select state</option>        
                                                                             <? 
                                                                                 $sql_state="SELECT * FROM states ORDER BY name";
                                                                                 $res_state=execute_query($sql_state);
                                                                                 while($row_state=mysql_fetch_array($res_state))
                                                                                  { 
                                                                                  ?>
                                                                                 <option value="<?=$row_state['id'] ?>"><?=$row_state['name'] ?></option>
                                                                               <? } ?>                              
                                                                      </select> 
                                                                         </td>
                                                                    </tr>
                                                                    <tr height="5"></tr>
                                                                    <tr>
                                                                        <td width="150" align="right">&nbsp;Working City:</td>
                                                                        <td width="78%" align="left" style="padding-left:20px;">
                                                                        <!--<input type="text" name="visitor_city" value="<?=$row_postad['escort_city']?>" class="main_input" />-->
                                                                            <select name="prlCities" id="city_dropdown" class="drp_img2">
                                                                                 <option value="-1"  name="cityname"></option>               
                                                                            </select> 
                                                                        </td>
                                                                    </tr>
                                                            	</table>
                                                            </div>
                                                                                                              
                                                        
                                                        </td>
                                                    
                                                    </tr>
                                                    
                                                    <tr class="mouseOver">
                                                    	<td colspan="2">
                                                       
                                                           	<div style="width:500px; margin:0 auto;" id="openother">
                                                            	<table border="0" cellpadding="0" cellspacing="0">
                                                            		<!--<tr>
                                                                    	<td width="200">&nbsp;Working State:</td>
                                                                        <td>
                                                                           <input type="text" name="visitor_state" value="<?=$row_postad['escort_state']?>" class="main_input" />
                                                                            
                                                                         </td>
                                                                    </tr>
                                                                    <tr height="5"></tr>-->
                                                                    <tr>
                                                                        <td width="150" align="right">&nbsp; Working City:</td>
                                                                        <td width="78%" align="left" style="padding-left:20px;">
                                                                        <input type="text" name="visitor_city" class="main_input" />
                                                                            <!--<select class="drp_img2" id="visitor_city" name="visitor_city">
                                                                            </select>-->
                                                                        </td>
                                                                    </tr>
                                                            	</table>
                                                            </div>
                                                        	    
                                                        
                                                        </td>
                                                    
                                                    </tr>
                 
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" ></td>
                  </tr>              
                  <tr class="mouseOver">
                    <td width="22%" align="right"><strong>Email:</strong> &nbsp;</td>
                    <td width="78%" align="left">
                     &nbsp;<input name="emailAddress" type="text" class="content" id="eng_menu" size="50" value="<?=$row['email']?>" />
                    </td>
                  </tr>
                   <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                  <?
					$sql_image="SELECT * FROM escort_photo WHERE postid='".$_GET["id"]."'";
					$res_image=execute_query($sql_image);
					$num_image=mysql_num_rows($res_image);
					if($num_image>0)
					 {
						 $ctt=1;
						while($row_image=mysql_fetch_array($res_image))
						{
					 ?>
					 
						 <tr class="mouseOver">							
							<td align="left" valign="top" class="gtext"><strong></strong></td>
							<td align="left" class="gtext">
                            <img src="../avtar/<?=$row_image['picture']?>" height="180px" width="150px" />
                            <input type="file" name="ad_image<?=$ctt?>"  />
                            
                            <input type="hidden" name="img<?=$ctt?>" value="<?=$row_image['picture']?>"  />
                            <input type="hidden" name="picid<?=$ctt?>" value="<?=$row_image['id']?>"  />
                          <a href="#" onClick="del_record('<? print $row_image['id'];?>');"> <img src="../images/delete.png" /></a>
                            </td>
							
						  </tr>
						 
							  <tr class="mouseOver" height="5"></tr>
						  <?
						   $ctt=$ctt+1;
				         }
				
				
				
					 } else {?>
                     
                       <tr class="mouseOver">
                        <td width="22%" align="right"><strong>Image1:</strong> &nbsp;</td>
                        <td width="78%" align="left">
                         &nbsp;<input type="file" name="ad_image1"  />
                         <input type="hidden" name="new1" value="1" />
                        </td>
                      </tr>
                      
                      <tr class="mouseOver">
                        <td align="right">&nbsp;</td>
                        <td align="left" ></td>
                      </tr>   
                         <tr class="mouseOver">
                        <td width="22%" align="right"><strong>Image2:</strong> &nbsp;</td>
                        <td width="78%" align="left">
                         &nbsp;<input type="file" name="ad_image2"  />
                         <input type="hidden" name="new2" value="2" />
                        </td>
                      </tr>
                      <tr class="mouseOver">
                        <td align="right">&nbsp;</td>
                        <td align="left" ></td>
                      </tr>   
                         <tr class="mouseOver">
                        <td width="22%" align="right"><strong>Image3:</strong> &nbsp;</td>
                        <td width="78%" align="left">
                         &nbsp;<input type="file" name="ad_image3"  />
                         <input type="hidden" name="new3" value="3" />
                        </td>
                      </tr>
                      <tr class="mouseOver">
                        <td align="right">&nbsp;</td>
                        <td align="left" ></td>
                      </tr>   
                         <tr class="mouseOver">
                        <td width="22%" align="right"><strong>Image4:</strong> &nbsp;</td>
                        <td width="78%" align="left">
                         &nbsp;<input type="file" name="ad_image4"  />
                         <input type="hidden" name="new4" value="4" />
                        </td>
                      </tr>
                  
                  
                  
                     
                     
                     <? } ?> 
                 
                 
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                  <tr class="mouseOver">
                    <td align="right">
                    	<input type="hidden" name="ad_id" value="<?=$_GET['id'] ?>" />
                        <input type="hidden" name="userid" value="<?=$row['user_id']?>" />
                        <input type="hidden" name="ad_img1" value="<?=$row['image1']?>" />
                        
                        <input type="hidden" name="ptcity" value="<?=$row['escort_city']?>" />
                        <input type="hidden" name="ptstate" value="<?=$row['escort_state']?>" />
                        <input type="hidden" name="ptcountry" value="<?=$row['country_name']?>" />
                        
                        
                        
                        <!--<input type="hidden" name="ad_img2" value="<?=$row['user_image2']?>" />
                        <input type="hidden" name="ad_img3" value="<?=$row['user_image3']?>" />
                        <input type="hidden" name="ad_img4" value="<?=$row['user_image4']?>" />-->
                        <input name="Submit" type="submit" class="butn3" value="Process" />
                    	&nbsp;
                    </td>
                    <td align="left" >&nbsp;
                        <input name="Submit2" type="reset" class="butn3" value="Reset" /></td>
                  </tr>
                  <tr class="mouseOver">
                    <td align="right">&nbsp;</td>
                    <td align="left" >&nbsp;</td>
                  </tr>
                </table>
				</form>	
				</td>
                </tr>
              
            </table>
			
			</td>
          </tr>
          <tr>
            <td width="232" align="center" valign="top" class="td5">&nbsp;</td>
            </tr>
          <tr>
            <td height="6"></td>
            </tr>
        </table></td>
      </tr>
      
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="top" class="footer-bac">
		<p style="text-align:center; padding:35px 0 5px 0px;"><a href="main.php" class="footer-link">Administrator Control Panel </a></p>
		<p class="footer-text1" style="text-align:center;">Escortservice</p>
		</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

./BlackJoker Mini Shell 1.0