<script type="text/javascript">



function validate_testimonial(){

	var slug_filter = /^[a-z0-9-]+$/ ;
		
	if($("#testimonial_title").val()==''){
		$("#msg_testimonial_title").html('Please enter testimonial title');
		$("#testimonial_title").addClass('jquery_err');
		$("#testimonial_title").focus();
		return false;
	}else{
		$("#msg_testimonial_title").html('');
		$("#testimonial_title").removeClass('jquery_err');
	}
	
	
	
	
	document.testimonialFrm.submit();
}

</script>

<!-- Content (Right Column) -->
		<div id="content" class="box">

			<h1>Community insights &raquo; Add Community insights</h1>

    <?php if(isset($successMsg) && $successMsg!=''){ ?>
				<p class="msg done"><?php echo $successMsg; ?></p>
			<?php } ?>
			
			<?php if(isset($failedMsg) && $failedMsg!=''){ ?>
				<p class="msg error"><?php echo $failedMsg; ?></p>
			<?php } ?>

			<form action="addtestimonial.php" method="post" id="testimonialFrm" name="testimonialFrm" enctype="multipart/form-data" >

				<?php if(isset($_REQUEST['testimonial_id']) && $_REQUEST['testimonial_id']!=''){ ?>
					<input type="hidden" id="testimonial_id" name="testimonial_id" value="<?php echo $testimonialDetail->testimonial_id ?>" >
				<?php } ?>
				
				<!-- Login -->
				<fieldset>
					<legend>Insights Details</legend>
					<p class="nomt">
						<label for="inp-01" class="req">Author :</label><br />
						<input type="text" size="50" name="testimonial_title" id="testimonial_title" value="<?php echo $testimonialDetail->testimonial_title; ?>" class="input-text-02" /><br/>
						<span class="smaller low message" id="msg_testimonial_title">&nbsp;</span>
					</p>

					
                    
                    <p class="nomt">
						<label for="inp-01" class="req"> Organization :</label><br />
						<input type="text" size="50" name="testimonial_company" id="testimonial_company" value="<?php echo $testimonialDetail->testimonial_company; ?>" class="input-text-02" /><br/>
						<span class="smaller low message" id="msg_testimonial_company">&nbsp;</span>
					</p>

					<p class="nomt">
						<label for="inp-01" class="req">Insights Text :</label><br />
						<textarea name="testimonial_desc" id="testimonial_desc"  cols="58" rows="5" ><?php echo $testimonialDetail->testimonial_desc; ?></textarea><br/>
												  
						<span class="smaller low message" id="msg_testimonial_desc">&nbsp;</span>
					</p>
                    
					
					<p class="nomt">
      <label for="inp-01" class="req">Profile Image :</label>
      <br />
      <input type="file" size="50"  name="testimonial_image" id="testimonial_image" class="input-text-02"   />
      <?php if($testimonialDetail->testimonial_image!='' && file_exists(DIR_UPLOAD_BANNER.$testimonialDetail->testimonial_image)) {?>
      <img src="<?php echo DIR_UPLOAD_BANNER_SHOW.$testimonialDetail->testimonial_image ?>" height="110" width="90"  />
      <input type="hidden" id="uploaded_file" name="uploaded_file" value="<?php echo $testimonialDetail->testimonial_image;  ?>" />
      <?php } ?>
      <br/>
      <span class="smaller low message" id="msg_testimonial_image">&nbsp;</span> </p>
							
					
					<p class="nomb">
						<label for="inp-03" class="req">Status :</label><br />
						<select id="testimonial_status" name="testimonial_status" class="input-text-02">
							<option value="0" <?php echo ($testimonialDetail->testimonial_status==0) ? "selected='selected'" : "" ?>>Inactive</option>
							<option value="1" <?php echo (!isset($testimonialDetail->testimonial_status) || $testimonialDetail->testimonial_status==1) ? "selected='selected'" : "" ?>>Active</option>
						</select><br/>
						<span class="smaller low message" id="msg_testimonial_status">&nbsp;</span>
					</p>

				</fieldset>
				
				<?php if(isset($testimonialDetail->testimonial_id) && $testimonialDetail->testimonial_id!=''){ ?>
					<p><input type="button" value="Edit testimonial" id="submittestimonial" name="submittestimonial" class="input-submit" onclick="return validate_testimonial();" /></p>
				<?php }else{ ?>
					<p><input type="button" value="Add testimonial" id="submittestimonial" name="submittestimonial" class="input-submit" onclick="return validate_testimonial();" /></p>
				<?php } ?> <input type="button" value="Cancel" id="cancel" name="cancel" class="input-submit" onclick="javascript:window.location='testimoniallist.php'" />
				<input type="hidden" name="testimonial_image" id="testimonial_image" value="" />
				<input type="hidden" id="hiddenSubmit" name="hiddenSubmit" value="submit" />
				
			</form>

		</div> <!-- /content -->
