<?php /* Smarty version 2.6.28, created on 2016-11-29 14:54:08
         compiled from /home/solusito/public_html/templates/eco-net-v3-5/viewticket.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'replace', '/home/solusito/public_html/templates/eco-net-v3-5/viewticket.tpl', 129, false),)), $this); ?>
<?php if ($this->_tpl_vars['error']): ?>
	<div class="notice notice-error">
		<div class="inside">
			<p><?php echo $this->_tpl_vars['LANG']['supportticketinvalid']; ?>
</p>
		</div>
	</div>
<?php else: ?>

<?php echo '
<script language="javascript">
jQuery(document).ready(function(){
    jQuery("#addfileupload").click(function () {
        jQuery("#fileuploads").append("<input type=\\"file\\" name=\\"attachments[]\\" size=\\"50\\"><br />");
        return false;
    });
});
function rating_hover(id) {
  var selrating=id.split(\'_\');
  for(var i=1; i<=5; i++){
    if(i<=selrating[1]) document.getElementById(selrating[0]+\'_\'+i).style.background="url(images/rating_pos.png)";
    if(i>selrating[1]) document.getElementById(selrating[0]+\'_\'+i).style.background="url(images/rating_neg.png)";
  }
}
function rating_leave(id){
  for(var i=1; i<=5; i++){
    document.getElementById(id+\'_\'+i).style.background="url(images/rating_neg.png)";
  }
}
function rating_select(id){
  '; ?>
window.location='viewticket.php?tid=<?php echo $this->_tpl_vars['tid']; ?>
&c=<?php echo $this->_tpl_vars['c']; ?>
&rating='+id;<?php echo '
}
</script>
'; ?>


		<div class="bigheader">
			<h2><?php echo $this->_tpl_vars['LANG']['supportticketsviewticket']; ?>
 #<?php echo $this->_tpl_vars['tid']; ?>
</h2>
		</div><!-- .bigheader --> 	

<?php if ($this->_tpl_vars['errormessage']): ?>
	<div class="notice notice-error">
		<div class="inside">
			<p><?php echo $this->_tpl_vars['errormessage']; ?>
</p>
		</div>
	</div>
<?php endif; ?>

<div class="table-responsive table-grey">
<table>
        <tr>
          <th><?php echo $this->_tpl_vars['LANG']['supportticketsdepartment']; ?>
</th>
          <th><?php echo $this->_tpl_vars['LANG']['supportticketsdate']; ?>
</th>
          <th><?php echo $this->_tpl_vars['LANG']['supportticketssubject']; ?>
</th>
          <th><?php echo $this->_tpl_vars['LANG']['supportticketsstatus']; ?>
</th>
          <th><?php echo $this->_tpl_vars['LANG']['supportticketsticketurgency']; ?>
</th>
        </tr>
        <tr>
          <td><?php echo $this->_tpl_vars['department']; ?>
</td>
          <td><?php echo $this->_tpl_vars['date']; ?>
</td>
          <td><?php echo $this->_tpl_vars['subject']; ?>
</td>
          <td><?php echo $this->_tpl_vars['status']; ?>
</td>
          <td><?php echo $this->_tpl_vars['urgency']; ?>
</td>
        </tr>
        
<?php if ($this->_tpl_vars['customfields']): ?>

		<tr>
			<th colspan="1"><?php echo $this->_tpl_vars['LANG']['newticket_required']; ?>
</th>
			<th colspan="4"><?php echo $this->_tpl_vars['LANG']['newticket_answer']; ?>
</th>
		</tr>

	    <?php $_from = $this->_tpl_vars['customfields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['customfield']):
?>
        <tr>
        	<td colspan="1"><?php echo $this->_tpl_vars['customfield']['name']; ?>
</td>
        	<td colspan="4"><?php echo $this->_tpl_vars['customfield']['value']; ?>
&nbsp;</td>
        </tr>
        <?php endforeach; endif; unset($_from); ?>

<?php endif; ?>        
        
        
</table>
</div>

<div class="ticketreply">
	<div class="user">
		<div class="left">
			<?php echo $this->_tpl_vars['user']; ?>

		</div>
		
		<div class="right">
			<?php echo $this->_tpl_vars['date']; ?>

		</div>
	</div>
	
	<div class="body">
	
		<?php 
		    $userdetails = getclientsdetails($GLOBALS['clientsdetails']['id']);   
		    $email = $userdetails['email'];
		    $ticket_gravatar = 'https://www.gravatar.com/avatar/' . md5($email) . '?s=100';
			echo '<img src="' . $ticket_gravatar . '" alt="My gravitar" class="avatar" />';
		 ?>	
	
	
		<?php echo $this->_tpl_vars['message']; ?>

		
		
		<?php if ($this->_tpl_vars['attachments']): ?>
		<br /><br />
 		<p><strong><?php echo $this->_tpl_vars['LANG']['supportticketsticketattachments']; ?>
</strong></p>
 		
		  <?php $_from = $this->_tpl_vars['attachments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['attachment']):
?> <img src="images/article.gif" class="absmiddle" border="0" alt="<?php echo $this->_tpl_vars['attachment']; ?>
" /> <a href="dl.php?type=a&id=<?php echo $this->_tpl_vars['id']; ?>
&i=<?php echo $this->_tpl_vars['num']; ?>
"><?php echo $this->_tpl_vars['attachment']; ?>
</a><br />
		  <?php endforeach; endif; unset($_from); ?>
  		<?php endif; ?>
		
		
		<div class="clear">&nbsp;</div>
		
	</div>
	
</div>

  
<?php $_from = $this->_tpl_vars['replies']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['reply']):
?>  
  
 <div class="ticketreply">
	<div class="user user-<?php if ($this->_tpl_vars['reply']['admin']): ?>admin<?php else: ?>client<?php endif; ?>">
		<div class="left">
			<?php echo ((is_array($_tmp=$this->_tpl_vars['reply']['user'])) ? $this->_run_mod_handler('replace', true, $_tmp, "<br />
      ", " || ") : smarty_modifier_replace($_tmp, "<br />
      ", " || ")); ?>

		</div>
		
		<div class="right">
			<?php echo $this->_tpl_vars['reply']['date']; ?>

		</div>
	</div>
	
	<div class="body">
	
		<?php if ($this->_tpl_vars['reply']['admin']): ?>
		
		<img src="templates/<?php echo $this->_tpl_vars['template']; ?>
/images/ticketavatar.png" alt="<?php echo $this->_tpl_vars['companyname']; ?>
" class="avatar" />
		
		<?php else: ?>
	
		<?php 
			echo '<img src="' . $ticket_gravatar . '" alt="My gravitar" class="avatar" />';
		 ?>
		
		<?php endif; ?>	
	
	
		<?php echo $this->_tpl_vars['reply']['message']; ?>

		
		
<?php if ($this->_tpl_vars['reply']['attachments']): ?>

<br /><br />
  
  
  
  <p><strong><?php echo $this->_tpl_vars['LANG']['supportticketsticketattachments']; ?>
</strong></p>
  
  
  
  <?php $_from = $this->_tpl_vars['reply']['attachments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['attachment']):
?> <img src="images/article.gif" class="absmiddle" border="0" alt="<?php echo $this->_tpl_vars['attachment']; ?>
" /> <a href="dl.php?type=ar&id=<?php echo $this->_tpl_vars['reply']['id']; ?>
&i=<?php echo $this->_tpl_vars['num']; ?>
"><?php echo $this->_tpl_vars['attachment']; ?>
</a><br />
  <?php endforeach; endif; unset($_from); ?><?php endif; ?>  
  
		<div class="clear">&nbsp;</div>
		
	</div>
	
</div>  
  
<?php endforeach; endif; unset($_from); ?>
		

<?php if ($this->_tpl_vars['showclosebutton']): ?>
<p class="center">
	<a href="<?php echo $_SERVER['PHP_SELF']; ?>
?tid=<?php echo $this->_tpl_vars['tid']; ?>
&amp;c=<?php echo $this->_tpl_vars['c']; ?>
&amp;closeticket=true" class="button1 color1"><?php echo $this->_tpl_vars['LANG']['supportticketsstatuscloseticket']; ?>
</a>
</p>
<?php endif; ?>

		<div class="bigheader">
			<h2><?php echo $this->_tpl_vars['LANG']['supportticketsreply']; ?>
</h2>
		</div><!-- .bigheader --> 

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>
?tid=<?php echo $this->_tpl_vars['tid']; ?>
&amp;c=<?php echo $this->_tpl_vars['c']; ?>
&amp;postreply=true" enctype="multipart/form-data">



		<div class="feildset">
		
			<div class="col1">
		
				<div>
					<label>
						<span><?php echo $this->_tpl_vars['LANG']['supportticketsclientname']; ?>
:<?php if ($this->_tpl_vars['loggedin']): ?><?php else: ?> (<?php echo $this->_tpl_vars['LANG']['required']; ?>
)<?php endif; ?></span>
						<?php if ($this->_tpl_vars['loggedin']): ?><?php echo $this->_tpl_vars['clientname']; ?>
<?php else: ?>
              				<input type="text" name="replyname" placeholder="<?php echo $this->_tpl_vars['LANG']['newticket_name']; ?>
" value="<?php echo $this->_tpl_vars['replyname']; ?>
" />
              			<?php endif; ?>
					</label>
				</div>
				
				<div>
					<label>
						<span><?php echo $this->_tpl_vars['LANG']['supportticketsclientemail']; ?>
:<?php if ($this->_tpl_vars['loggedin']): ?><?php else: ?> (<?php echo $this->_tpl_vars['LANG']['required']; ?>
)<?php endif; ?></span>
						<?php if ($this->_tpl_vars['loggedin']): ?><?php echo $this->_tpl_vars['email']; ?>
<?php else: ?>
              				<input type="text" name="replyemail" placeholder="<?php echo $this->_tpl_vars['LANG']['newticket_email']; ?>
" value="<?php echo $this->_tpl_vars['replyemail']; ?>
" />
              			<?php endif; ?>
					</label>
				</div>
				
				<div>
					<label>
						<span><?php echo $this->_tpl_vars['LANG']['ticketreply_title_message']; ?>
 (<?php echo $this->_tpl_vars['LANG']['required']; ?>
)</span>
						<textarea name="replymessage" placeholder="<?php echo $this->_tpl_vars['LANG']['newticket_message']; ?>
"><?php echo $this->_tpl_vars['replymessage']; ?>
</textarea>
					</label>
				</div>
				
				
				<div>
					<label>
						<span><?php echo $this->_tpl_vars['LANG']['supportticketsticketattachments']; ?>
</span>
						<input type="file" name="attachments[]" size="50" />
              			<a href="#" id="addfileupload"><img src="images/add.gif" class="absmiddle" alt="" border="0" /> <?php echo $this->_tpl_vars['LANG']['addmore']; ?>
</a><br />
              			<div id="fileuploads"></div>
              			(<?php echo $this->_tpl_vars['LANG']['supportticketsallowedextensions']; ?>
: <?php echo $this->_tpl_vars['allowedfiletypes']; ?>
)
					</label>
				</div>									
			          
			  <p class="center">
			    <input type="submit" value="<?php echo $this->_tpl_vars['LANG']['supportticketsticketsubmit']; ?>
" class="button1 color2" />
			  </p>
			  
			  </div>
		
		</div>	  
  
</form>
<?php endif; ?>