<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<?php	echo $javascript->link('jquery.js'); ?>
<script>
function chk(thisform)
{
   var i=0;
   var fcs_fld=new Array();
   var errorstr = '';
   var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";	
   if($.trim($('#ProductPdctfile').val())=='')
   {
		errorstr += "- Please upload a file.";
		fcs_fld[i]='ProductPdctfile'; i++;
		msgstr = msgstr + errorstr;	
		alert(msgstr);
		$('#'+fcs_fld[0]+'').focus();
		return false;
   }	
   var filepath=$('#ProductPdctfile').val();  
   if(filepath.lastIndexOf(".zip")==-1)
   {
   	  errorstr += "- Please upload a file with .zip extention.";
	  fcs_fld[i]='ProductPdctfile'; i++;
	  msgstr = msgstr + errorstr;	
	  alert(msgstr);
	  $('#'+fcs_fld[0]+'').focus();
      return false;
   }
   else
   {
 	  document.Product.submit();
      return true;
   }  
 }
</script>
 <div align="center" class="subheading">
              <div align="left">Import Product Images</div>
            </div>
            <br />
            <div align="left" id="item_details_admin">
			<?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>
              <div align="center" id="items_display_area_admin">
                <div align="left" class="inner_content_area_admin">
                <?php echo $form->create('Product', array('type' => 'file','name' =>'Product','action' => 'bulkuploadimage')); ?>
                  <div id="admin_heading"></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Upload zip File</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                       <?php echo $form->input('pdctfile', array('type' => 'file','label' => "",'class' => 'buttn_admin1')); ?>
                      
                        </span>
                        <div align="left">
                            Note: For each product upload a zip file with the product images and the zip file name should be same as product name.<br>
                            The Zip file can have many no of product images as needed.<br><br>
                            Product image format include : jpg, png, gif.<br>

                        </div>
                      
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                 <div id="admin_bottom">
									<div align="left" id="inner_leftcontent">
						  			<p class="maintext_inner"><span class="toplinks"> </span> </p>
							  </div>
							
									<div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                        <input type="button" class="buttn_admin" value="Upload" onclick="return chk(document.Product);"/>
                        <input type="button" value="Cancel" onClick="javascript:history.go(-1);" class="buttn_admin">
						
</span>
                     
                    </div>
							
							
							
							</div>
                </div>
               <?php echo $form->end(); ?>
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
