{include file="adm-header.tpl"}
<div class="content">
{if $error != null}<div class="error">{$error}</div>{/if}
{if $success != null}<div class="success">{$success}</div>{/if}
{foreach from=$edit item=E}
<table width="100%" cellspacing="2" cellpadding="2">
<tr class="th_1"><td colspan="2" >Edycja obiektu : {$E.obName}  </td></tr>
        <tr>
                <td class="td_1">Dodał</td>
                <td class="td_2"><input type="text" name="" value="{$E.userName} - {$E.obDate}" style="width: 300px;" DISABLED /> &nbsp;
                abonamenty <a onclick="document.getElementById('ab_info').style.display=''" style="cursor: pointer;"><img src="../img/pomoc.png" border="0" class="img" /></a>
                <span id="ab_info" style="display: none; position: absolute; border: 1px solid #bab7b7; padding: 5px; background: #fff; margin-left: 6px;">

                <table width="300px">
												<tr><td align=right><a onclick="document.getElementById('ab_info').style.display='none'" style="cursor: pointer; float: right; margin-left: 10px;">[zamknij]</a><td></tr>
                        <tr><td valign=top><form action="administrator.php?mod=edit&id={$id}" method="post">Emisja obiektu do: {$E.obDateEnd} <br>- przedłuż o &nbsp;<input type="text" name="day1" value="" style="width: 30px;" />&nbsp; dni &nbsp;<input type="hidden" name="ab1" value="" /><input type="submit" value="zapisz" style="background: #fff;" /></form><br></td></tr>
                        <tr><td><form action="administrator.php?mod=edit&id={$id}" method="post">Promocja obiektu do: {if $E.obPromo == '1'}{$E.obPromoDateEnd}{else}brak...{/if} <br>- przedłuż o &nbsp;<input type="text" name="day2" value="" style="width: 30px;" />&nbsp; dni &nbsp;<input type="hidden" name="ab2" value="" /><input type="submit" value="zapisz" style="background: #fff;" />&nbsp; lub <a onclick="location.href='administrator.php?mod=edit&id={$id}&ab=1'" style="cursor: pointer;">usuń</a></form></td></tr>
												 <tr>
                                <td><form action="administrator.php?mod=edit&id={$id}" method="post">Last Minute do: {if $E.obLastMinute == '1'}{$E.obLastMinuteDateEnd}{else}brak...{/if} </br>- przedłuż o &nbsp;<input type="text" name="day3" value="" style="width: 30px;" />&nbsp; dni &nbsp;<input type="hidden" name="ab3" value="" /><input type="submit" value="ok" style="background: #fff;" />&nbsp; lub <a onclick="location.href='administrator.php?mod=edit&id={$id}&ab=2'" style="cursor: pointer;">usuń</a></form></td>
                        </tr>
                        <tr>
                                <td><form action="administrator.php?mod=edit&id={$id}" method="post">Wyróżnienie obiektu do: {if $E.obWyroz == '1'}{$E.obWyrozDateEnd}{else}brak...{/if} </br>- przedłuż o &nbsp;<input type="text" name="day4" value="" style="width: 30px;" />&nbsp; dni &nbsp;<input type="hidden" name="ab4" value="" /><input type="submit" value="ok" style="background: #fff;" />&nbsp; lub <a onclick="location.href='administrator.php?mod=edit&id={$id}&ab=4'" style="cursor: pointer;">usuń</a></form></td>
                        </tr>

                </table>
                </span>
                </td>
        <form action="administrator.php?mod=edit&id={$id}" method="post">
        </tr>
        <tr>
                <td class="td_1">Nazwa obiektu</td>
                <td class="td_2"><input type="text" name="name" value="{$E.obName}" style="width: 300px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Typ transakcji</td>
                <td class="td_2">																			
                           <select name="kategoria" style="width: 150px;">
                           <option value="1">- wybierz</option>
							{foreach from=$showKategoria item=KT}
							<option value="{$KT.katId}" {if $KT.katId == $E.obKat }SELECTED{/if}>- {$KT.katName}</option>{/foreach}  
                            </select>
                </td>
		</tr>	
		

														
        <tr>
                <td class="td_1">Typ oferty</td>
		        <td class="td_2">
					<select name="type" style="width: 230px;">
                   <option value="">- wybierz</option>
                    {foreach from=$showType item=T}
                     <option value="{$T.typeId}" {if $T.typeId == $E.obTypeId}SELECTED{/if}>- {$T.typeName}</option>
                    {/foreach}
                   </select>
               </td>
		</tr>																								




        <tr>
                <td class="td_1">Ulica</td>
                <td class="td_2"><input type="text" name="adress" value="{$E.obAdress}" style="width: 300px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Dzielnica</td>
                <td class="td_2"><input type="text" name="dzielnica" value="{$E.obDzielnica}" style="width: 300px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Miasto ( miejscowość )</td>
                <td class="td_2"><input type="text" name="city" value="{$E.obCity}" style="width: 200px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Województwo</td>
                <td class="td_2">
                        <select name="state" style="width: 170px;">
                        <option value="42">- wybierz</option>
                        {foreach from=$showState item=S}
                        <option value="{$S.stateId}" {if $S.stateId == $E.obStateId}SELECTED{/if}>- {$S.stateName}</option>
                        {/foreach}
                        </select>
                </td>
        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
       <tr>
                <td class="td_1">Region geo</td>
                <td class="td_2">
                        <select name="region" style="width: 250px;">
                        <option value="0">- wybierz</option>
                        {foreach from=$showRegion item=R}
                        <option value="{$R.regionId}" {if $R.regionId == $E.obRegion}SELECTED{/if}>- {$R.regionName}</option>
                        {/foreach}
                        </select>
                </td>
        </tr>
        <tr>
                <td class="td_1">Przy drodze</td>
                <td class="td_2">
                        <select name="droga" style="width: 154px;">
                        <option value="0">- wybierz</option>
                        {foreach from=$showDroga item=D}
                        <option value="{$D.drogaId}" {if $D.drogaId == $E.obDroga}SELECTED{/if}>- {$D.drogaName}</option>
                        {/foreach}
                        </select>
                </td>
        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
                <td class="td_1">Telefon</td>
                <td class="td_2"><input type="text" name="tel" value="{$E.obTel}" style="width: 100px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Adres Email</td>
                <td class="td_2"><input type="text" name="email" value="{$E.obEmail}" style="width: 200px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Strona WWW</td>
                <td class="td_2"><input type="text" name="www" value="{$E.obWww}" style="width: 300px;" /></td>
        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
		
        <tr>
              <td class="td_1">Rok budowy</td>
              <td class="td_2"><input type="text" name="rok" value="{$E.obRok}" style="width: 60px;" /</td>
       </tr>
       <tr>
             <td class="td_1">Typ zabudowy</td>
             <td class="td_2">
				<select name="rodzaj" style="width: 154px;">
              <option value="9">- wybierz</option>
             {foreach from=$showRodzaj item=RO}
             <option value="{$RO.rodzajId}" {if $RO.rodzajId == $E.obRodzaj}SELECTED{/if}>- {$RO.rodzajName}</option>
            {/foreach}
             </select>
			 </td>
       </tr>
       <tr>
             <td class="td_1">Typ obiektu</td>
             <td class="td_2">
				<select name="rynek" style="width: 154px;">
              <option value="2">- wybierz</option>
               {foreach from=$showRynek item=RY}
               <option value="{$RY.rynekId}" {if $RY.rynekId == $E.obRynek}SELECTED{/if}>- {$RY.rynekName}</option>
               {/foreach}
            </select>
			 </td>
		</tr>
        <tr>
             <td class="td_1">Pow. mieszkalna (m2)</td>
             <td class="td_2"><input type="text" name="pom" value="{$E.obPowM}" style="width: 60px;" /></td>
        </tr>
		<tr>
            <td class="td_1" >Pow. całkowita (m2)</td>
            <td class="td_2"><input type="text" name="poc" value="{$E.obPoC}" style="width: 60px;" /></td>
	    </tr>
		<tr>
            <td class="td_1">Liczba pięter</td>
            <td class="td_2"><input type="text" name="pietra" value="{$E.obPietra}" style="width: 60px;" /></td>
       </tr>
		<tr>
            <td class="td_1">Piętro</td>
            <td class="td_2"><input type="text" name="pietro" value="{$E.obPietro}" style="width: 60px;" /></td>
       </tr>
		<tr>
           <td class="td_1">Liczba pokoi</td>
           <td class="td_2"><input type="text" name="pokoje" value="{$E.obPokoje}" style="width: 60px;" /></td>	
		</tr>												
		<tr>
           <td class="td_1">Pow. działki (m2)</td>
           <td class="td_2"><input type="text" name="pow" value="{$E.obPowD}" style="width: 110px;" /></td>	
		</tr>	
		<tr>
           <td  class="td_1">Budulec</td>
           <td  class="td_2">																				
            <select name="budulec" style="width: 154px;">
            <option value="9">- wybierz</option>
            {foreach from=$showBudulec item=BU}
			<option value="{$BU.budulecId}" {if $BU.budulecId == $E.obBudulec}SELECTED{/if}>- {$BU.budulecName}</option>
			{/foreach}                                                                 
           </select>		
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Dach</td>
           <td  class="td_2">																				
            <select name="dach" style="width: 154px;">
            <option value="8">- wybierz</option>
            {foreach from=$showDach item=DA}
			<option value="{$DA.dachId}" {if $DA.dachId == $E.obDach}SELECTED{/if}>- {$DA.dachName}</option>
			{/foreach}                                                                
           </select>	
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Droga dojazdowa</td>
           <td  class="td_2">																				
           <select name="dojazd" style="width: 154px;">
            <option value="5">- wybierz</option>
            {foreach from=$showDojazd item=DO}
			<option value="{$DO.dojazdId}" {if $DO.dojazdId == $E.obDojazd}SELECTED{/if}>- {$DO.dojazdName}</option>
			{/foreach}
          </select>		
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Ogrodzenie działki</td>
           <td  class="td_2">																				
          <select name="ogrodzenie" style="width: 154px;">
           <option value="6">- wybierz</option>
         {foreach from=$showOgrodzenie item=OG}
		<option value="{$OG.ogrodzenieId}" {if $OG.ogrodzenieId == $E.obOgrodzenie}SELECTED{/if}>- {$OG.ogrodzenieName}</option>
			{/foreach}
           </select>		
          </td>
       </tr>
		<tr>
           <td  class="td_1">Ogrzewanie</td>
           <td  class="td_2">																				
           <select name="ogrzewanie" style="width: 154px;">
           <option value="10">- wybierz</option>
           {foreach from=$showOgrzewanie item=OG}
			<option value="{$OG.ogrzewanieId}" {if $OG.ogrzewanieId == $E.obOgrzewanie}SELECTED{/if}>- {$OG.ogrzewanieName}</option>
			{/foreach}
            </select>		
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Kanalizacja</td>
           <td  class="td_2">																				
           <select name="kanalizacja" style="width: 154px;">
            <option value="3">- wybierz</option>
            {foreach from=$showKanalizacja item=KA}
			<option value="{$KA.kanalizacjaId}" {if $KA.kanalizacjaId == $E.obKanalizacja}SELECTED{/if}>- {$KA.kanalizacjaName}</option>
			{/foreach}
           </select>		
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Okna</td>
           <td  class="td_2">																				
          <select name="okna" style="width: 154px;">
           <option value="1">- wybierz</option>
           {foreach from=$showOkna item=OK}
			<option value="{$OK.oknaId}" {if $OK.oknaId == $E.obOkna}SELECTED{/if}>- {$OK.oknaName}</option>
			{/foreach}
            </select>		
          </td>
       </tr>	
		<tr>
           <td  class="td_1">Stan budynku</td>
           <td  class="td_2">																				
          <select name="stan" style="width: 154px;">
           <option value="3">- wybierz</option>
           {foreach from=$showStan item=ST}
			<option value="{$ST.stanId}" {if $ST.stanId == $E.obStan}SELECTED{/if}>- {$ST.stanName}</option>
			{/foreach}
           </select>		
          </td>
       </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
                <td class="td_1">Cena </td>
                <td class="td_2"><input type="text" name="priceOn" value="{$E.obPriceOn}" style="width: 70px;" /> zł</td>
        </tr>

        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
                <td class="td_1">Media:</td>
                <td class="td_2">
                        <table>
<tr>
                                        				<td width="180px"><input type="checkbox" name="a[]" value="a1" {if strstr($E.obTeren, 'a1')}CHECKED{/if} />&nbsp;&nbsp; Woda</td>
                                        				<td width="180px"><input type="checkbox" name="a[]" value="a2" {if strstr($E.obTeren, 'a2')}CHECKED{/if} />&nbsp;&nbsp; Prąd</td>
                                        				<td width="180px"><input type="checkbox" name="a[]" value="a8" {if strstr($E.obTeren, 'a8')}CHECKED{/if} />&nbsp;&nbsp; Siła</td>
                                       					<td width="180px"><input type="checkbox" name="a[]" value="a4" {if strstr($E.obTeren, 'a4')}CHECKED{/if} />&nbsp;&nbsp; Gaz</td>
                                					</tr>
						</table>
				</td></tr>
                                            
                                                       <tr>
                                                                <td><br /></td>
                                                        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
      <td class="td_1">Dodatkowe dane:</td>               
		<td class="td_2">
                        <table>
		
                                                        <tr>
                                      						  <td width="180px"><input type="checkbox" name="b[]" value="b1" {if strstr($E.obRoom, 'b1')}CHECKED{/if} />&nbsp;&nbsp; Aneks kuchenny</td>
                                  						      <td width="180px"><input type="checkbox" name="b[]" value="b2" {if strstr($E.obRoom, 'b2')}CHECKED{/if} />&nbsp;&nbsp; Umeblowane</td>
                                   						      <td width="180px"><input type="checkbox" name="b[]" value="b3" {if strstr($E.obRoom, 'b3')}CHECKED{/if} />&nbsp;&nbsp; Strych</td>
                                					          <td width="180px"><input type="checkbox" name="b[]" value="b4" {if strstr($E.obRoom, 'b4')}CHECKED{/if} />&nbsp;&nbsp; Winda</td>
                                						</tr>
                                						<tr>
                                        					  <td><input type="checkbox" name="b[]" value="b5" {if strstr($E.obRoom, 'b5')}CHECKED{/if} />&nbsp;&nbsp; Telefon</td>
                                       						  <td><input type="checkbox" name="b[]" value="b6" {if strstr($E.obRoom, 'b6')}CHECKED{/if} />&nbsp;&nbsp; Internet</td>
                                       						  <td><input type="checkbox" name="b[]" value="b7" {if strstr($E.obRoom, 'b7')}CHECKED{/if} />&nbsp;&nbsp; Domofon</td>
                                      						  <td><input type="checkbox" name="b[]" value="b8" {if strstr($E.obRoom, 'b8')}CHECKED{/if} />&nbsp;&nbsp; Monitoring</td>
                                						</tr>
                               							 <tr>
                                       						 <td><input type="checkbox" name="b[]" value="b9" {if strstr($E.obRoom, 'b9')}CHECKED{/if} />&nbsp;&nbsp; Ochrona</td>
                                       						 <td><input type="checkbox" name="b[]" value="b10" {if strstr($E.obRoom, 'b10')}CHECKED{/if} />&nbsp;&nbsp; Ogrodzenie</td>
                                      						  <td><input type="checkbox" name="b[]" value="b11" {if strstr($E.obRoom, 'b11')}CHECKED{/if} />&nbsp;&nbsp; Parking</td>
                                     					     <td><input type="checkbox" name="b[]" value="b12" {if strstr($E.obRoom, 'b12')}CHECKED{/if} />&nbsp;&nbsp; Kominek</td>
                              						    </tr>
  															<tr>
                                        <td width="180px"><input type="checkbox" name="b[]" value="b13" {if strstr($E.obNearby, 'b13')}CHECKED{/if} />&nbsp;&nbsp; Balkon</td>
                                        <td width="180px"><input type="checkbox" name="b[]" value="b14" {if strstr($E.obNearby, 'b14')}CHECKED{/if} />&nbsp;&nbsp; Altana</td>
                                        <td width="180px"><input type="checkbox" name="b[]" value="b15" {if strstr($E.obNearby, 'b15')}CHECKED{/if} />&nbsp;&nbsp; Piwnica</td>
                                        <td><input type="checkbox" name="b[]" value="b16" {if strstr($E.obNearby, 'b16')}CHECKED{/if} />&nbsp;&nbsp; Suszarnia</td>
                                </tr>
            					 <tr>
                                        <td><input type="checkbox" name="b[]" value="b17" {if strstr($E.obNearby, 'b17')}CHECKED{/if} />&nbsp;&nbsp; Garaż</td>
                                        <td><input type="checkbox" name="b[]" value="b18" {if strstr($E.obNearby, 'b18')}CHECKED{/if} />&nbsp;&nbsp; Ogród</td>
                                        <td><input type="checkbox" name="b[]" value="b19" {if strstr($E.obNearby, 'b19')}CHECKED{/if} />&nbsp;&nbsp; Ogródek</td>
                                        <td><input type="checkbox" name="b[]" value="b20" {if strstr($E.obNearby, 'b20')}CHECKED{/if} />&nbsp;&nbsp; Sad</td>
                                </tr>
								</table
								</td></tr>
                                       
                                                       <tr>
                                                                <td><br /></td>
                                                        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
        <td class="td_1">Okolica:</td>               
		<td class="td_2">
		<table>
								       <tr>
                                        <td width="180px"><input type="checkbox" name="c[]" value="c1" {if strstr($E.obNearby, 'c1')}CHECKED{/if} />&nbsp;&nbsp; Rzeka</td>
                                        <td width="180px"><input type="checkbox" name="c[]" value="c2" {if strstr($E.obNearby, 'c2')}CHECKED{/if} />&nbsp;&nbsp; Góry</td>
                                        <td width="180px"><input type="checkbox" name="c[]" value="c3" {if strstr($E.obNearby, 'c3')}CHECKED{/if} />&nbsp;&nbsp; Łąki</td>
                                        <td width="180px"><input type="checkbox" name="c[]" value="c4" {if strstr($E.obNearby, 'c4')}CHECKED{/if} />&nbsp;&nbsp; Lasy</td>
                                </tr>
								       <tr>
                                        <td><input type="checkbox" name="c[]" value="c5" {if strstr($E.obNearby, 'c5')}CHECKED{/if} />&nbsp;&nbsp; Jezioro</td>
                                        <td><input type="checkbox" name="c[]" value="c6" {if strstr($E.obNearby, 'c6')}CHECKED{/if} />&nbsp;&nbsp; Stawy</td>
                                        <td><input type="checkbox" name="c[]" value="c7" {if strstr($E.obNearby, 'c7')}CHECKED{/if} />&nbsp;&nbsp; Wieś</td>
                                        <td><input type="checkbox" name="c[]" value="c8" {if strstr($E.obNearby, 'c8')}CHECKED{/if} />&nbsp;&nbsp; Miasto</td>
                                </tr>
         </table>
                </td>
        </tr>
                                                       <tr>
                                                                <td><br /></td>
                                                        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
                <td class="td_1">Opis obiektu</td>
                <td class="td_2"><textarea id="editor11"   name="txt" rows="20" cols="60" style="width: 685px; height: 150px;" class="textarea">{$E.obTxt}</textarea>
{literal}
<script type="text/javascript" src="ckeditor/edytor/edytor11.js"></script>
{/literal}
								</td>
        </tr>
        <tr>
                <td></td>
                <td></td>
        </tr>
        <tr>
                <td class="td_1">Zdjęcia obiektu</td>
                <td class="td_2">
                        <table>
                                {assign var='i' value='0'}
                                {foreach from=$photos item=P}
                                {assign var='i' value=$i+1}
                                {if $i%5 == 1}<tr>{/if}
                                <td {if $i != 1 && $i != 6}style="padding-left: 40px;"{/if}><div class="photo"><a href="../files/photo/big/{$P.photoUrl}" rel="../files/photo/sre/{$P.photoUrl}" class="screenshot" target=_blanck><img src="../files/photo/mini/{$P.photoUrl}"    style="border: 3px double #b6c1ce " /></a></div><br /><input type="checkbox" name="delete[]" value="{$P.photoId}" /> usuń zdjęcie</td>
                                {if $i%5 == 0}<tr>{/if}
                                {/foreach}
                        </table>
                </td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="edit" value="" /><input type="submit" class="submit" value="Zapisz zmiany" /></td>
        </tr>
</table>
</form>
{/foreach}
<br />
<form action="administrator.php?mod=edit&id={$id}" method="post" enctype="multipart/form-data">
<table width="100%" cellspacing="2" cellpadding="2">
        <tr>
                <td class="td_1">Nowe zdjęcie</td>
                <td class="td_2"><input type="file" name="photo" value="" style="width: 500px;" /></td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="new_photo" value="" /><input type="submit" value="Dodaj zdjęcie" class="submit" /></td>
        </tr>
</table>
</form>
</div>
{include file="adm-footer.tpl"}
