<?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>             		  |
// +----------------------------------------------------------------------+
?>
<script language="javascript" type="text/javascript">
function chk(){
   
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	with(document.Product)
	{ 	
		/*var Product = document.Product;
		if (ProductPname.value == "") { errorstr += "- Please Enter Product Name.\n"; ProductPname.focus();}
		if (ProductPrice.value == "") { errorstr += "- Please enter price.\n"; ProductPrice.focus();}
                if (Product.pname.value == "") { errorstr += "- Please Enter Product Name.\n"; ProductPname.focus();}
		if (Product.retail_price.value == "") { errorstr += "- Please enter price.\n"; ProductPrice.focus();}*/
		
	}	
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
           return true;
	}
} 
function chkdigit(di){
if(di == 'Digital'){
 	 document.getElementById('nondigit').style.display = 'none';
	 document.getElementById('digit').style.display = 'inline';
}else{
	 document.getElementById('digit').style.display = 'none';
 	 document.getElementById('nondigit').style.display = 'inline';
}
return true;
}
</script>
  <div align="center" class="subheading">
              <div align="left">Import Products</div>
            </div>
            <br />
            
			<?php if($session->check('Message.flash')) { ?><div id="okbox"><?php $session->flash(); ?></div><?php } ?>
            <div align="left" id="item_details_admin">
              <!--items display area start -->
              <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' => 'checkbulkupload/'.$filename)); ?>
                  <div id="admin_heading">Match Data Fields</div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Category <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      
                        <span class="toplinks">
                       
                       <select name="category" class="box2_admin">


<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='0') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  
            
                 
				 
				      <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Name  <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                       <select name="pname" class="box2_admin">


<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>" <?php if($key=='1') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				  
				  
				       <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Description</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                      <select name="pdescr" class="box2_admin">

<option value=" ">Ignore</option>
<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='2') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                    
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				          <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Wholesale Price <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      
                        <span class="toplinks">
                       
                       <select name="wholesale_price" class="box2_admin">


<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='3') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				 
        <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Retail Price <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      
                        <span class="toplinks">
                       
                       <select name="retail_price" class="box2_admin">


<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>" <?php if($key=='4') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  
            
                 
				      <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Weight(lbs)</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                       <select name="weight" class="box2_admin">

<option value=" ">Ignore</option>
<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='5') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				  
				  
				       <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Stock <span class="required_field">*</span> (Enter numeric values only)</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                      <select name="stock" class="box2_admin">


<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='6') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                 <input type="hidden" name="filename" value="<?php echo $filename; ?>">       </span>
                    
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				   <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Product Re Order Level</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                       <select name="reorder" class="box2_admin">

<option value=" ">Ignore</option>
<?php foreach($header as $key => $val){
?>
<option value="<?php echo $key; ?>"<?php if($key=='7') echo "selected='selected'"; ?>><?php echo $val; ?></option>
<?php
} ?>
</select>
                        </span>
                     
                    </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">
						  			
									</div>
							
									<div align="right" id="inner_rightcontent">
                    
                        <span class="toplinks">
						<input type="submit" class="buttn_admin" value="Save Data" onClick="return chk();">
						<input type="button" class="buttn_admin" value="Cancel" onClick="javascript:history.go(-1);">
                        
</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>
