<?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 $html->css('ui.datepicker.css');
	echo $javascript->link('jquery.js');		
	echo $javascript->link('alphanumeric.js'); 
	echo $javascript->link('ui.datepicker.js');
    echo $javascript->link('tooltip.js');
?>
<script>
	//Code for the project		
	$(document).ready(function()	
	{	
	$('#FeedbackDate').datepick({minDate: '' , maxDate:'', 
	dateFormat: 'mm-dd-yy',closeAtTop: false, showStatus: true,  showOn: 'both', buttonImageOnly: true,
	 buttonImage: '<?php echo $cnfg["sitebasefolder"]."/img/calendar.gif";?>' });	
	});	
</script>
<script language="javascript" type="text/javascript">
function chk(){
     	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($('#FeedbackProductId').val()) == '') { errorstr += "- Please Select the Product name.\n";  fcs_fld[i]='FeedbackCname'; i++;}
		if ($.trim($('#FeedbackType').val()) == '') { errorstr += "- Please Select the Feedback Type.\n";  fcs_fld[i]='FeedbackType'; i++;}
		if ($.trim($('#FeedbackUserId').val())== '') { errorstr += "- Please Select a Users.\n"; fcs_fld[i]='GiftcardDescr'; i++;}	
		if ($.trim($('#FeedbackComment').val())== '') { errorstr += "- Please Enter the Feedback Contents.\n"; fcs_fld[i]='GiftcardDescr'; i++;}	

	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		$('#'+fcs_fld[0]+'').focus();
		return false;
	}
	else
	{
		return true;
	}		
} 
</script>
<div align="center" class="subheading">
              <div align="left">Feedbacks</div>
            </div>
            <br />
			
            <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">
				
				
                  <!--form area start -->
			<?php echo $form->create('Feedback'); ?>
                  <div id="admin_heading">Edit Product Feedback </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">
						        <?php echo $form->input('product_id', array('options' => $prod,'label' => ' ', 'class' => 'box2_admin')); ?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						  
						  
						    <div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">Feedback Type<span class="required_field">*</span></p>
							</div>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
                               <span class="toplinks">
						        <?php echo $form->input('type', array('options' => $opt,'label' => ' ', 'class' => 'box2_admin')); ?>
                               </span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						  
						  
						  	<div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">User Name <span class="required_field">*</span></p>
							</div>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
						        <?php echo $form->input('user_id', array('options' => $users,'label' => ' ', 'class' => 'box2_admin')); ?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						  
						   <div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">Date</p>
							</div>
							<?php
							 if(isset($feedback["Feedback"]["date"]))
							 {
								 $fdate=explode('-', $feedback["Feedback"]["date"]);
								 $fbate=$fdate[1].'-'.$fdate[2].'-'.$fdate[0];		
							  }
							  else
							  $fbate='';	 
							?>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
								<?php echo $form->input('date', array('size' => '10','label' => '','readonly' =>TRUE,'value' => $fbate));?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						  
						      <div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">Comment<span class="required_field">*</span></p>
							</div>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
								<?php echo $form->input('comment', array('type' => 'textarea','label' => ' ','class'=>'box2_admin','size'=>27, 'value' => $feedback["Feedback"]["comment"])); ?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						   
						  
				  
				
                   
							<div id="admin_bottom">
								<div align="left" id="inner_leftcontent">
								  <p class="maintext_inner">&nbsp;</p>
								</div>
								<div align="right" id="inner_rightcontent">
									<span class="toplinks">								
									<input type="submit" value="Update" class="buttn_admin"   onClick="return chk();">
									<input type="button" value="Cancel" class="buttn_admin"  onClick="javascript:history.go(-1);">
									</span>
								</div>
								<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
								
				 <?php echo $form->end(); ?> 
                  <!--form area end -->			  
				  
                </div>
                <!--form area end -->
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
            <br /> <br /> 
			<!-- End of Add Area -->
			
   <script>
	$('#GiftcardGiftAmnt').numeric({allow:"."});	
	$('#GiftcardStock').numeric({allow:"."});	
	</script>