

<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
{include file="$incpath/other/validate_js.tpl"}
$.validator.setDefaults({ldelim}
	submitHandler: function() 
	{ldelim}
		document.forms['koobiform'].submit();
	{rdelim}
});

$().ready(function() 
{ldelim}
	$("#koobiform").validate({ldelim}
	rules: {ldelim}
				Name: {ldelim}required: true{rdelim}
				{if $smarty.request.langcode<2}
				,
				Webseite :{ldelim}url: true{rdelim} 
				{/if}
				
			{rdelim}, 
	messages: 
			{ldelim}
				Url: {ldelim}url:'{#InserURL#}'{rdelim}
			{rdelim}
	{rdelim});
{rdelim});

$(function() {ldelim}
	 $('#container-options ul').tabs({ldelim} {rdelim});
{rdelim});



function ajaxFileUpload(updir,divid,resize)
{ldelim}
	$("#loading_" + divid)
	.ajaxStart(function(){ldelim}
		$(this).show();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Wait#}';
		document.getElementById('buttonUpload_' + divid).disabled = true;
		
	{rdelim})
	.ajaxComplete(function(){ldelim}
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Upload#}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
	{rdelim});

	if(divid==1) 
		var up = 'index.php?do=gaming&sub=cheaticonupload' + updir + '&divid=' + divid + '&resize=' + resize;
	else
		var up = 'index.php?do=gaming&sub=cheatfileupload' + updir + '&divid=' + divid + '&resize=' + resize;
				
	
	$.ajaxFileUpload
	(
		
		{ldelim}
			url: up,
			secureuri:false,
			fileElementId:'fileToUpload_' + divid,
			dataType: 'json',
			success: function (data, status)
			{ldelim}
				if(typeof(data.error) != 'undefined')
				{ldelim}
					if(data.error != '')
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML  = data.error;
					}else
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML = data.msg;
						document.getElementById('newFile_' + divid).value =  data.html;
						
					{rdelim}
				{rdelim}
			{rdelim},
			error: function (data, status, e)
			{ldelim}
				document.getElementById('UpInf_' + divid).innerHTML = e;
			{rdelim}
		{rdelim})
	return false;
{rdelim}
// -->
</script>


<div class="popbox">
<div class="header">{#Gaming_cheats_edit#}</div>
<div class="subheaders">{#News_lang_inf#}</div>
<div class="header_inf">
<form onsubmit="" method="post" action="">
<select class="input" onchange="eval(this.options[this.selectedIndex].value)" name="langcode" id="langcode">
<option id="l_1" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=gaming&sub=editcheat&id={$smarty.request.id}&noframes=1&pop=1&langcode=1';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.langcode}').selected=true;{rdelim}" {if $smarty.request.langcode=='1'}selected="selected"{/if}>{#Gaming_cheats_editIn#}  - {$language_long_1|upper} - {#Shop_articles_editinb#}</option>
<option id="l_2" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=gaming&sub=editcheat&id={$smarty.request.id}&noframes=1&pop=1&langcode=2';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.langcode}').selected=true;{rdelim}" {if $smarty.request.langcode=='2'}selected="selected"{/if}>{#Gaming_cheats_editIn#}  - {$language_long_2|upper} - {#Shop_articles_editinb#}</option>
<option id="l_3" value="if(confirm('{#Global_changeLangDoc#}')){ldelim} location.href='index.php?do=gaming&sub=editcheat&id={$smarty.request.id}&noframes=1&pop=1&langcode=3';{rdelim}else{ldelim}document.getElementById('l_{$smarty.request.langcode}').selected=true;{rdelim}"  {if $smarty.request.langcode=='3'}selected="selected"{/if}>{#Gaming_cheats_editIn#} - {$language_long_3|upper} - {#Shop_articles_editinb#}</option>
</select>
<img class="absmiddle" src="{$imgpath}/arrow_right.png" alt="" />
</form>
</div>

<form method="post" action="" enctype="multipart/form-data"  name="koobiform" id="koobiform">

{if $smarty.request.langcode<2}
<div id="container-options">
<ul>
<li><a href="#opt-1"><span>{#Gaming_cheats_tab1#}</span></a></li>
{if $smarty.request.langcode==1}
<li><a href="#opt-2"><span>{#Gaming_cheats_tab2#}</span></a></li>
<li><a href="#opt-3"><span>{#Download_tabDownload#}</span></a></li>
<li><a href="#opt-4"><span>{#Gaming_cheats_tab4#}</span></a></li>
{/if}
</ul>
</div>
{/if}


<div id="opt-1">
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<td>
<fieldset>
<legend><label for="t">{#Global_Name#}</label></legend>
<input name="Name" type="text" class="input" id="t" style="width:250px" value="{$res->Name}" /> 
</fieldset></td>
{if $smarty.request.langcode==1}
<td>
<fieldset>
<legend><label for="c">{#Gaming_plattform#}</label></legend>
<select class="input" style="width:150px" name="Plattform">
{foreach from=$Categs item=c}{if $c->Parent_Id==0}<option style="font-weight:bold" value="{$c->Id}" {if $c->Id==$res->Plattform}selected="selected"{/if}>{$c->Name}</option>{else}<option value="{$c->Id}" {if $c->Id==$res->Kategorie}selected="selected"{/if}>{$c->visible_title}</option>{/if}{/foreach}
</select>
</fieldset></td>

<td><fieldset>
    <legend>{#News_Status#}</legend>
    <label><input type="radio" name="Aktiv" value="1" {if $res->Aktiv=='1'}checked="checked"{/if}/>{#Global_online#}</label>
    <label><input type="radio" name="Aktiv" value="0" {if $res->Aktiv=='0'}checked="checked"{/if}/>{#Global_offline#}</label>
    </fieldset></td>
<td><fieldset>
    <legend><label for="spr">{#Links_ccode#}</label><span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Links_ccodeInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span></legend>
    <input name="Sprache" type="text" class="input" id="spr" style="width:50px" value="{$res->Sprache}" maxlength="2" /> 
    </fieldset>
    </td>
 {/if}
 </tr>
</table>

{if $smarty.request.langcode==1}
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td>
  <fieldset>
  <legend>{#Manufacturer#}</legend>
 <select class="input" style="width:150px" name="Hersteller">
 <option value="">-</option>
 {foreach from=$manuf item=m}
 <option value="{$m->Id}" {if $res->Hersteller==$m->Id}selected="selected" {/if}>{$m->Name}</option>
 {/foreach}
</select>
</fieldset>
  </td>
  
  <td>
  <fieldset>
  <legend>{#Gaming_cheats_product#}</legend>
  <select class="input" style="width:150px" name="CheatProdukt">
 <option value="">-</option>
 {foreach from=$products item=m}
 <option value="{$m->Id}" {if $res->CheatProdukt==$m->Id}selected="selected" {/if}>{$m->Name}</option>
 {/foreach}
</select>
  </fieldset>
  </td>
  <td>
  <fieldset>
  <legend>{#Gaming_cheats_webseite#}</legend>
  <input name="Webseite" type="text" class="input" id="t" style="width:250px" value="{$res->Webseite}" /> 
  </fieldset>
  </td>
  <td>&nbsp;</td>
</tr>
</table>
{/if}


<fieldset>
<legend>{#Content_text#}</legend>
{$Beschreibung}
</fieldset>
</div>



{if $smarty.request.langcode==1}
<div id="opt-2">
{if $res->Bild!=''}
<fieldset>
<legend>{#Global_imgCurrent#}</legend>
 <div id="Vorschau_1"><img src="../uploads/cheats/{$res->Bild}"></div>
 <label><input type="checkbox" name="NoImg" value="1" /> {#Global_ImgDel#}</label>
</fieldset>
{/if}
<fieldset>
<legend>{#Global_imgNew#}</legend>


{if $wrietable_img==1}
<div id="UpInf_1"></div><div id="loading_1" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
<input id="fileToUpload_1" type="file" size="30" name="fileToUpload_1" class="input" />
<input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('','1','{#Cheats_maxwidth_img#}');" value="{#Global_Upload#}" />
<input type="hidden" name="newImg_1" id="newFile_1" />
{else}
<strong style="color:#FF0000">{#Gaming_cheats_nwIMG#}</strong>
{/if}
<!-- Uploadform -->  
</fieldset>
</div>


<div id="opt-3">
  <table width="100%" border="0" cellpadding="2" cellspacing="0">
    <tr>
      <td valign="top">
        <fieldset style="height:160px">
          <legend>{#Download_upn#} </legend>
			{if $res->Download!=''}
          <strong>{#Download_upnCurrent#}:</strong> <em>{$res->Download}</em>
          <br />
          <br />
          {/if}
          
          <strong>{#Download_upnew#} (max. {$post_maxMb})</strong>
          
          <span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Gaming_cheats_upnewInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
          
          {if $wrietable==1}
          <div id="UpInf_2"></div><div id="loading_2" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
    		<input id="fileToUpload_2" type="file" size="38" name="fileToUpload_2" class="input" />
          <input type="button" class="button" id="buttonUpload_2" onclick="return ajaxFileUpload('','2','0');" value="{#Global_Upload#}" />
          <input type="hidden" name="newImg_2" id="newFile_2" />
          {else}
          <br />
          <strong style="color:#FF0000">{#Gaming_cheats_nwFILE#}</strong>
          {/if}
          <!-- Uploadform -->  
          
          <br /><br />
          <strong>{#Download_manu#}</strong> 
          <span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Gaming_cheats_manuInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
          <br />
          <input class="input" name="q" type="text" id="q" style="width:300px" value="" /> 
          </fieldset></td>
    
<td width="50%" valign="top">
  
  
  <fieldset style="height:160px">
    <legend>{#Download_manu2#}</legend>
{#Download_manu2Inf#}
    <br />
    <br />
    <table width="100%" border="0" cellspacing="1" cellpadding="1">
      <tr>
        <td>{#Download_url#}:</td>
        <td><input name="Url_Direct" type="text" class="input" style="width:200px" value="{$res->DownloadLink}" /></td>
        </tr>
      </table>
    </fieldset>    
    </td>
    </tr>
   </table>
<label><input type="checkbox" name="deldl" value="1" />{#Gaming_cheats_dlremove#}</label>
</div>



{if $smarty.request.langcode==1}
<div id="opt-4">
<fieldset>
<legend>
<span {popup sticky=$config_vars.POPSTICKY  width=450 text=$config_vars.Gal_incl_info}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
{#Global_mergeGalleries#}</legend>
      <select name="Galerien[]" size="10" multiple  class="input" id="select" style="width:250px">
     {foreach from=$Gallery item=ng}
       <optgroup label="{$ng->CategName}"></optgroup>
       {foreach from=$ng->Gals item=g}
       <option value="{$g->GalId}" {if in_array($g->GalId,$res->Galerien)}selected="selected"{/if}>{$g->GalName}</option>
        {/foreach}
       {/foreach}
      </select>
</fieldset>

  <fieldset>
  <legend>{#Gaming_cheats_links#}</legend>
  {#Gaming_cheats_links_inf#}
  <br />
  <br />
<textarea name="CheatLinks" style="width:99%; height:77px">{$res->CheatLinks}</textarea>
  </fieldset>
</div>
{/if}
{/if}



{if $smarty.request.langcode==1}
<label><input type="checkbox" name="saveAllLang" value="1" /> {#SavDataAllLangs#}</label><br />
{/if}


<input onclick="$('#container-options > ul').tabs('select', 0);" type="submit" class="button big" value="{#Save#}" />
<input type="button" onclick="window.close();" class="button big" value="{#Close#}" />
<input type="hidden" name="save" value="1" />
<input type="hidden" name="langcode" value="{$smarty.request.langcode|default:1}" />
</form>


</div>




