<?php echo $header; ?>
<div id="content" >
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a>
	  <a onclick="location = '<?php echo $ExcelUpdate; ?>';" class="button">Update all Products</a>
	  <a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a>
	  </div>
    </div>
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="form">
		
          <tr>
            <td><span class="required">*</span> <?php echo $entry_gem; ?></td>
            <td><input type="text" name="gemname" value="<?php echo $gemname; ?>" />
              <?php if ($error_gem) { ?>
              <span class="error"><?php echo $error_gem; ?></span>
              <?php  } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_gemdescr; ?></td>
            <td><textarea type="text" name="gemdescr" cols="60" rows="1"><?php echo $gemdescr; ?></textarea>
              </td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_gemdetail; ?></td>
            <td><textarea type="text" name="gemdetail" cols="100" rows="5"><?php echo $gemdetail; ?></textarea>
              </td>
          </tr>
		   <tr>
            <td><?php echo $entry_image; ?></td>
            <td valign="top"><div class="image"><img src="<?php echo $thumb; ?>" alt="" id="thumb" />
                <input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
                <br /><a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a></div>
              <?php if ($error_image) { ?>
              <span class="error"><?php echo $error_image; ?></span>
              <?php } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_birthstone; ?></td>
            <td><input type="text" name="birthstone" value="<?php echo $birthstone; ?>" />
              <?php if ($error_birthstone) { ?>
              <span class="error"><?php echo $error_birthstone; ?></span>
              <?php  } ?></td>
          </tr>
		   <tr>
            <td><span class="required">*</span> <?php echo $entry_anniversary; ?></td>
            <td><input type="text" name="anniversary" value="<?php echo $anniversary; ?>" />
              <?php if ($error_anniversary) { ?>
              <span class="error"><?php echo $error_anniversary; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_species; ?></td>
            <td><input type="text" name="species" value="<?php echo $species; ?>" />
              <?php if ($error_species) { ?>
              <span class="error"><?php echo $error_species; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_zodiac; ?></td>
            <td><input type="text" name="zodiac" value="<?php echo $zodiac; ?>" />
              <?php if ($error_zodiac) { ?>
              <span class="error"><?php echo $error_zodiac; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_months; ?></td>
            <td><input type="text" name="months" value="<?php echo $months; ?>" />
              <?php if ($error_months) { ?>
              <span class="error"><?php echo $error_months; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_mohshardness; ?></td>
            <td><input type="text" name="mohshardness" value="<?php echo $mohshardness; ?>" />
              <?php if ($error_mohshardness) { ?>
              <span class="error"><?php echo $error_mohshardness; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_specificgravity; ?></td>
            <td><input type="text" name="specificgravity" value="<?php echo $specificgravity; ?>" />
              <?php if ($error_specificgravity) { ?>
              <span class="error"><?php echo $error_specificgravity; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_refractiveindex; ?></td>
            <td><input type="text" name="refractiveindex" value="<?php echo $refractiveindex; ?>" />
              <?php if ($error_refractiveindex) { ?>
              <span class="error"><?php echo $error_refractiveindex; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_birefringence; ?></td>
            <td><input type="text" name="birefringence" value="<?php echo $birefringence; ?>" />
              <?php if ($error_birefringence) { ?>
              <span class="error"><?php echo $error_birefringence; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_opticsign; ?></td>
            <td><input type="text" name="opticsign" value="<?php echo $opticsign; ?>" />
              <?php if ($error_opticsign) { ?>
              <span class="error"><?php echo $error_opticsign; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_icacode; ?></td>
            <td><input type="text" name="icacode" value="<?php echo $icacode; ?>" />
              <?php if ($error_icacode) { ?>
              <span class="error"><?php echo $error_icacode; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_treatment; ?></td>
            <td><input type="text" name="treatment" value="<?php echo $treatment; ?>" />
              <?php if ($error_treatment) { ?>
              <span class="error"><?php echo $error_treatment; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_incidence; ?></td>
            <td><input type="text" name="incidence" value="<?php echo $incidence; ?>" />
              <?php if ($error_incidence) { ?>
              <span class="error"><?php echo $error_incidence; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_purpose; ?></td>
            <td><input type="text" name="purpose" value="<?php echo $purpose; ?>" />
              <?php if ($error_purpose) { ?>
              <span class="error"><?php echo $error_purpose; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_durability; ?></td>
            <td><input type="text" name="durability" value="<?php echo $durability; ?>" />
              <?php if ($error_durability) { ?>
              <span class="error"><?php echo $error_durability; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_detection; ?></td>
            <td><input type="text" name="detection" value="<?php echo $detection; ?>" />
              <?php if ($error_detection) { ?>
              <span class="error"><?php echo $error_detection; ?></span>
              <?php  } ?></td>
          </tr>
		  <tr>
            <td><span class="required">*</span> <?php echo $entry_specialcare; ?></td>
            <td><input type="text" name="specialcare" value="<?php echo $specialcare; ?>" />
              <?php if ($error_specialcare) { ?>
              <span class="error"><?php echo $error_specialcare; ?></span>
              <?php  } ?></td>
          </tr>
	  <tr>
           <td><span class="required">*</span> <?php echo $entry_limitations; ?></td>
            <td><input type="text" name="limitations" value="<?php echo $limitations; ?>" />
              <?php if ($error_limitations) { ?>
              <span class="error"><?php echo $error_limitations; ?></span>
              <?php  } ?></td>
          </tr>
          
	  <tr>
           <td><span class="required">*</span> Category Display</td>
             <td><select name="category_display">
                  <option value="*"></option>
                  <?php if ($category_display) { ?>
                  <option value="1" selected="selected">No</option>
                  <?php } else { ?>
                  <option value="1">No</option>
                  <?php } ?>
                  <?php if (!is_null($category_display) && !$category_display) { ?>
                  <option value="0" selected="selected">Yes</option>
                  <?php } else { ?>
                  <option value="0">Yes</option>
                  <?php } ?>
                </select></td>
          </tr>
          
           <tr>
            <td><span class="required">*</span> <?php echo $entry_sort_order; ?></td>
            <td><input type="text" name="sort_order" value="<?php echo $sort_order; ?>" />
             </td>
          </tr>
        </table>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
function image_upload(field, thumb) {
	$('#dialog').remove();
	
	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
	
	$('#dialog').dialog({
		title: '<?php echo $text_image_manager; ?>',
		close: function (event, ui) {
			if ($('#' + field).attr('value')) {
				$.ajax({
					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
					dataType: 'text',
					success: function(text) {
						$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 800,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script> 
<?php echo $footer; ?>