<?php if(!defined('CONST_VALE')) {
 die('You cannot access this file directly!');
}
if($editortrue == '1') {
?>
<script src="scripts/ckeditor/ckeditor.js"></script>
<script src="scripts/ckeditor/config.js"></script>
<?php
}
?>
<div class="ten column">
<div id="vforms">
<form action="postadmin.php" id="incformer" enctype="multipart/form-data" method="post">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<div class="ten column">
<h2><?php echo $lang['183']; ?></h2>
</div>
<div class="ten">
<div class="five column">
<label><?php echo $lang['224']; ?></label>
<input type="text" class="input" name="title" data-validation="length" data-validation-length="5-160" />
</div>
<div class="five column">
<label><?php echo $lang['225']; ?></label>
<?php
$result = "SELECT * FROM categori ORDER by parent, catid ASC";
$an = $conn->Execute($result);
echo "<select name='idblog' class='input' data-validation='length' data-validation-length='1-160'>";
echo "<option value=''></option>";
if(!$an)
 print $conn->ErrorMsg();
else
 while(!$an->EOF) {
   if($an->fields['cord'] == 0) {
    echo "<option value='".$an->fields['catid']."|".$an->fields['name']."|".$an->fields['seoname']."'> ".$an->fields['name']." </option>";
   } else {
    echo "<option value='".$an->fields['catid']."|".$an->fields['name']."|".$an->fields['seoname']."'> - - ".$an->fields['name']." </option>";
   }
  $an->MoveNext();
 }
echo '</select>';
?>
</div>
</div>
<div class="ten marginTop">
<div class="five column">
<label><?php echo $lang['226']; ?></label>
<input type="text" name="brief" class="input" data-validation="length" data-validation-length="max500" data-validation-optional="true" />
</div>
</div>
<div class="ten marginTop">
<div class="five column">
<label><?php echo $lang['227']; ?></label>
<input type="file" name="image" />
</div>
<div class="five column">
<label><?php echo $lang['233']; ?></label>
<input type="radio" class="radios" name="main" id="0" value="0" checked="checked" />&nbsp;<?php echo $lang['228']; ?>
&nbsp;&nbsp;<input type="radio" class="radios" name="main" id="4" value="4" />&nbsp;<?php echo $lang['229']; ?>
</div>
</div>
<div class="ten marginTop">
<div class="ten column">
<label><?php echo $lang['230']; ?>&nbsp;&nbsp;<font class="ckarea" style="display:none;"><?php echo $lang['231']; ?></font></label>
<textarea name="longdesc" id="longdesc" rows="14" class="input" required="required"></textarea>
<?php
if($editortrue == '1') { ?>
<script>
CKEDITOR.replace( 'longdesc' );
</script>
<?php } ?>
</div>
</div>
<div class="ten marginTop">
<div class="ten column">
<input class="button medium blue" type="submit" value="<?php echo $lang['130']; ?>" name="query" />
</div>
</div>
</form>
</div>
</div>
<script src="<?php echo $sitepath; ?>/scripts/jquery.min.js"></script>
<script src="<?php echo $sitepath; ?>/scripts/jquery.form-validator.min.js"></script>
<script src="<?php echo $sitepath; ?>/scripts/jquery.are-you-sure.js"></script>
<script src="<?php echo $sitepath; ?>/scripts/ays-beforeunload-shim.js"></script>
<script>$.validate();</script>
<script>$(function() {$('#incformer').areYouSure({message: "The changes you made will be lost. Are you sure you want to leave this page?"});});</script>
<?php if($editortrue == '1') { ?>
<script>
$("form").submit(function(e) {
    var description = CKEDITOR.instances['longdesc'].getData().replace(/<[^>]*>/gi, '').length;
    if (!description) {
        $(".ckarea").show();
        return false;
    }
});
</script>
<?php } ?>