<?php use_helper('Validation') ?>
<?php use_stylesheet('/sf/sf_admin/css/main') ?>
<?php use_helper('I18N');?>
<?php echo form_tag('document/edit', array(
  'id'        => 'sf_admin_edit_form',
  'name'      => 'sf_admin_edit_form',
  'multipart' => true,
)) ?>


<fieldset id="sf_fieldset_document" class="">
<h2><?php echo __('Document') ?></h2>


<div class="form-row">
  <?php echo label_for('tbldocument[doc_name]', __('tbldocument{doc_name}'), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_name}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_name}')): ?>
    <?php echo form_error('tbldocument{doc_name}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($tbldocument, 'getDocName', array (
  'size' => 80,
  'control_name' => 'tbldocument[doc_name]',
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_category]', __($labels['tbldocument{doc_category}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_category}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_category}')): ?>
    <?php echo form_error('tbldocument{doc_category}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = get_partial('doc_category', array('type' => 'edit', 'tbldocument' => $tbldocument)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[media]', __($labels['tbldocument{media}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{media}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{media}')): ?>
    <?php echo form_error('tbldocument{media}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = get_partial('media', array('type' => 'edit', 'tbldocument' => $tbldocument)); echo $value ? $value : '&nbsp;' ?>
  <div class="sf_admin_edit_help"><?php echo __('Click "Tao thumbnail" if want to create new thumbnail!.') ?></div>  </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_filename]', __($labels['tbldocument{doc_filename}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_filename}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_filename}')): ?>
    <?php echo form_error('tbldocument{doc_filename}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_admin_input_file_tag($tbldocument, 'getDocFilename', array (
  'control_name' => 'tbldocument[doc_filename]',
  'size' => 50,
)); echo $value ? $value : '&nbsp;' ?>
  <div class="sf_admin_edit_help"><?php echo __('Chon duong dan cho tu lieu (JPG, SWF)') ?></div>  </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_desc]', __($labels['tbldocument{doc_desc}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_desc}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_desc}')): ?>
    <?php echo form_error('tbldocument{doc_desc}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_textarea_tag($tbldocument, 'getDocDesc', array (
  'size' => '30x3',
  'control_name' => 'tbldocument[doc_desc]',
  'rich' => true,
  'tinymce_options' => 'height:300,width:580',
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_keyword]', __($labels['tbldocument{doc_keyword}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_keyword}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_keyword}')): ?>
    <?php echo form_error('tbldocument{doc_keyword}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_textarea_tag($tbldocument, 'getDocKeyword', array (
  'control_name' => 'tbldocument[doc_keyword]',
  'size' => '50x2',
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

</fieldset>
<fieldset id="sf_fieldset_infomation" class="">
<h2><?php echo __('Infomation') ?></h2>


<div class="form-row">
  <?php echo label_for('tbldocument[doc_source]', __($labels['tbldocument{doc_source}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_source}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_source}')): ?>
    <?php echo form_error('tbldocument{doc_source}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($tbldocument, 'getDocSource', array (
  'size' => 80,
  'control_name' => 'tbldocument[doc_source]',
)); echo $value ? $value : '&nbsp;' ?>
  <div class="sf_admin_edit_help"><?php echo __('Ghi ro nguon goc') ?></div>  </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_hit]', __($labels['tbldocument{doc_hit}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_hit}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_hit}')): ?>
    <?php echo form_error('tbldocument{doc_hit}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($tbldocument, 'getDocHit', array (
  'size' => 7,
  'control_name' => 'tbldocument[doc_hit]',
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('tbldocument[doc_status]', __($labels['tbldocument{doc_status}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_status}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_status}')): ?>
    <?php echo form_error('tbldocument{doc_status}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = get_partial('doc_status', array('type' => 'edit', 'tbldocument' => $tbldocument)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

</fieldset>
<fieldset id="sf_fieldset_comments" class="">
<h2><?php echo __('Comments') ?></h2>


<div class="form-row">
  <?php echo label_for('tbldocument[doc_comments]', __($labels['tbldocument{doc_comments}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('tbldocument{doc_comments}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('tbldocument{doc_comments}')): ?>
    <?php echo form_error('tbldocument{doc_comments}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = get_partial('doc_comments', array('type' => 'edit', 'tbldocument' => $tbldocument)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

</fieldset>

<?php include_partial('edit_actions', array('tbldocument' => $tbldocument)) ?>

</form>

