<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin} : {$language.lblFormList}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/form-list.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
{include file='CommonCustomStyles.tpl'}
<style>
.draft{
	background-color: #F84A4A;
	padding: 1px;
	color: #FFF;
	font-size: 10px;
}
</style>
</head>
<body>
<div class="outer_container"> {include file='CommonTop.tpl'}
  <!--End:Header Container-->
  <!--*****************************************************END HEADER CONTAINER**********************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar">
      <div class="side_wrapper"> {html->anchor priv_href="form/new/" href="form/new/" caption="<strong><span class='add'></span>{$language.lblAddNewForm}</strong>" class="custom-btnt"}
        <ul>
			<li>
				{html->anchor priv_href="form/index/" href="/form/index/" rel="listcontentsection" class="side_menu_a selected" content="{$language.lblListForms}<br /><span>{$language.lblManageForms}</span>"} 
			</li>
			
        </ul>
		
      </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
      <div class="content_wrapper">
        <h2>{$language.lblForms}</h2>
        <div class="clear"></div>
        <div id="common_message" ></div>
		<div class="search_container">
            <div class="inner"> {form->start name="formContentSearch" action="" method="post" }              
            <ul class="clearfix">
            	<li class="column">
                	<p class="label-field01">{$language.lblFormTitleKey}</p>
                    <span class="form-field01"> {form->textbox tabindex="1" class="textbox" name="searchTitle"}</span>
                </li>
                <li class="column">
                	<p class="label-field01">{$language.lblStatus}</p>
                    <span class="form-field01">    {form->select name="statusSearch" class="select-box" options="->{$language.lblSelect}~*draft->{$language.lblDraft}~*publish->{$language.lblPublished}"}</span>
                </li>
                <li class="column">
                	<p class="label-field01">{$language.lblCreatedBy}</p>
                    <span class="form-field01"> {form->select class="select-box width-234px" name="searchCreatedBy" caption="->{$language.lblSelect}" options=$adminUsers value=$searchCreatedBy} </span>
                </li>
                <li class="column">
                        <p class="label-field01">{$language.lblMenuBrands}</p>
                        <span class="form-field01">{form->select class="select-box" name="brandID" caption="->{$language.lblSelect}" options=$listBrand}			                 
                                </span>
                </li>   
                
                <li class="column"> <p class="label-field01">&nbsp;</p>
                	{form->submit name="submitSearch" tabindex="1"  class="button01" value="{$language.lblSearch}"}   {html->anchor href="/form/index/" tabindex="1" caption=$language.lblListAll  class="action-link"}
                </li>
            </ul>
              {form->close}
            </div>
          </div> {assign var="sortby" value=$sortby|default:''}
        <div class="clearfix"> {include file='ContentLanguageOptions.tpl'}
		{if $resultForm}
		<div class="sort_links {if $sortby==''}right-pos{/if}">
       
	   <span class="sortby-list"> 
			{if $sortby==''}  
				<strong>{$language.lblSortby} </strong>
				</span> 
			{else}
				{if $sortby=='sformid'}
					{$language.lblFormID}
				{else if $sortby=='sformtitle'}
					{$language.lblFormTitle}
				{else if $sortby=='ssubmissions'}
					{$language.lblNumbSubmissions}
				{else if $sortby=='screated'}
					{$language.lblCreatedDate}
				{/if}
				</span>
				{html->anchor 
					class="asnd {if $orderby=='asc'}inactive{/if}" 
					href="/form/index/{$links}sortby/{$sortby}/orderby/asc/" 
					content="<span class='arw'></span><span class='line'></span>"}
                {html->anchor  
					class="dsnd {if $orderby=='desc'}inactive{/if}" 
					href="/form/index/{$links}sortby/{$sortby}/orderby/desc/"
					content="<span class='line'></span><span class='arw'></span>"}
			{/if}
		    
				<ul class="sort_links_ul"> 
                <li>
                 {html->anchor href="/form/index/{$link}sortby/sformid/orderby/$orderby/" title="{$language.lblFormID}" content="{$language.lblFormID}"	class=$cproductkey|default:''}
                </li>
                <li>{html->anchor href="/form/index/{$link}sortby/sformtitle/orderby/$orderby/"  title="{$language.lblFormTitle}"	caption="{$language.lblFormTitle}" 		class=$cproducttitle|default:''}</li>
                <li>{html->anchor href="/form/index/{$link}sortby/ssubmissions/orderby/$orderby/" title="{$language.lblNumbSubmissions}"   caption="{$language.lblNumbSubmissions}" 	class=$cbusinessname|default:''} </li>
                <li class="last">{html->anchor href="/form/index/{$link}sortby/screated/orderby/$orderby/"  title="{$language.lblCreatedDate}" 	content="{$language.lblCreatedDate}" class=$cproductcreateddate|default:''}</li>
              </ul>
			  
		  </div>
		  {/if}
		 </div>
        {if $resultForm}
        
          <ul class="form-list">
          <li class="heading clearfix">
          <span class="clm1">
		  
          <div class="chekingdiv">
		  {if $editPrivilege || $deletePrivilege} 
                    <ul>
                      <li class="clearfix"> 
					  {form->checkbox id="ListStatusLinkCheckbox"  class="fixing_left" tabindex="1"} 
                      {html->anchor href="" id="ListStatusLink" class="status-arw fixing_left"}
                        <ul id="ListStatusSelection"  class="check_status">
                          <li>{html->anchor href="" rel="ListActive" content="{$language.lblActive}"}</li>
                          <li>{html->anchor href="" rel="ListInactive" content="{$language.lblInactive}"}</li>
                          <li>{html->anchor href="" rel="ListAll" content="{$language.lblSelectAll}"}</li>
                        </ul>
                      </li>
                    </ul>
					{/if}	
                  </div>
                  </span>
                   <span class="clm2">  
                  {$language.lblForms}</span>
                 
                   <span class="clm2"> 
                   {$language.lblSubmissions}
                   </span>
				    
          </li>
		 
          {form->start name="frmContentList" action="" method="post"}
         
            {assign var ='contentList' value=0}
            {foreach from=$resultForm item="forms"}
            {assign var ='contentList' value=$contentList+1}
            <li class="clearfix">
			{if $editPrivilege || $deletePrivilege} 
				<span class="clm1">
					{form->checkbox name="contentBulkStatus[]" value=$forms.formID class="checkbox01 ListAll List"|cat:$forms.status}
				</span>
			{/if}	
             <span class="clm2">  
			{if $editPrivilege}
				{html->anchor href="form/build/id/{$forms.formID}" class="style2" title="{$forms.formName}" content="{$forms.formName}"}
			{else}
				{$forms.formName} 
			{/if}	{if $forms.formStatus=='draft'}<span class="{$forms.formStatus}"> {$language.lblDraft}</span>{/if}
			 <br />
             <span class="fade-txt">{$language.lblModifiedBy} {$forms.adminname} {$language.lblOn}   {$forms.formModifiedDate|date_format:$date_format}</span>  <br />
			  <span class="fade-txt">{$language.lblCreatedOn} {$forms.formCreatedDate|date_format:$date_format}</span>
                          {if $forms.brandName|default:'' neq ''}<br /><span class="fade-txt">{$language.lblMenuBrands}: {$forms.brandName}</span>{/if}
            
             </span>
                          
			 <span class="clm2"> 
					{if $submissionPrivilege}
						{html->anchor href="form/submission/id/{$forms.formID}" class="style01" title="{$language.lblSubmissions}" content="<strong>{$forms.submissions}</strong> {$language.lblSubmissions}"}
					{else}
						<strong>{$forms.submissions}</strong> {$language.lblSubmissions}
					{/if}
				   {if $forms.submissions>0}
				   <br />
                   <span class="fade-txt">{$language.lblLastSubmissionon} {$forms.lastSubmitted|date_format:$date_format}</span>
				  
				   {/if}
				   
			</span>	
            <span class="clm3">
				{if $editPrivilege || $deletePrivilege} 
					{if $editPrivilege}
						{if $forms.status=='Active'}
							{html->anchor title="{$language.lblActive}" href="form/changeformstatus/id/{$forms.formID}/status/Inactive/"  class="status-active icon-set"}
						{else}
							{html->anchor title="{$language.lblInactive}" href="form/changeformstatus/id/{$forms.formID}/status/Active/"  class="status-inactive icon-set"}
						{/if}
						{html->anchor href="form/build/id/{$forms.formID}/" title="{$language.lblEdit}" history="yes" class="edit02 icon-set" content=""}
					{/if}
					{if $deletePrivilege}
						{html->anchor href="form/destroy/id/{$forms.formID}/" title="{$language.lblDelete} "  history="yes" content="" class="delete02 icon-set" confirm="{$language.msgSelectAtleastOne}" confirm_head="{$language.lblDelete}"}
					{/if}	
				{/if}	
                <span class="tooltip-style01">
                	<span class="head1">{$language.lblMore}</span>
                    <span class="cnt-box">
						{html->anchor href="../form/key/{$forms.formID}" target="_blank" content='<span class="icon-set preview" >&nbsp;</span>'|cat:$language.lblPreview}
						{*}{html->anchor href="/form/clone/id/{$forms.formID}/"  content='<span class="icon-set preview" >&nbsp;</span>'|cat:$language.lblCloneForm}
						{html->anchor content='<span class="icon-set preview" >&nbsp;</span>'|cat:$language.lblRenameForms}{*}
						{if $editPrivilege}
						{html->anchor href="/form/build/id/{$forms.formID}/settings/" content='<span class="icon-set preview" >&nbsp;</span>'|cat:$language.lblMenuSettings}
						{/if}
						{if $submissionPrivilege && $forms.submissions>0}
						{html->anchor href="/form/export/type/submission/id/{$forms.formID}/" content="<span class='icon-set export' >&nbsp;</span>{$language.lblExport}"}
						{/if}
                    </span>
                </span>
                </span>
           </li>
            {/foreach}
         </ul>
		{if $editPrivilege || $deletePrivilege} 
			{assign var="bulkStatusOptions" value="->{$language.lblDonotchange}"}
			{if $editPrivilege}
				{assign var="bulkStatusOptions" value="{$bulkStatusOptions}~*Active->{$language.lblActivate}~*Inactive->{$language.lblInactivate}"}
			{/if}
			{if $deletePrivilege}
				{assign var="bulkStatusOptions" value="{$bulkStatusOptions}~*Deleted->{$language.lblDelete}"}
			{/if}  

        <div class="fixing_left">{form->select name="formStatus" class="select-box width-auto" options=$bulkStatusOptions}
          {form->submit name="submitBulkStatus" id="submitBulkStatus" class="update_btn_table button04" value=$language.lblUpdate} </div>
        
        {form->close}
        <div class="clear"></div>
		{/if} 
        {else}
        <div class="message_info" id="common_message">{$language.msgNoRecords}</div>
        {/if}
        <!--End:From Listing-->
      </div>
    </div>
    <!--End: left Block-->
    <div class="clear"></div>
  </div>
  <!--End:Content Container-->
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container-->
{include file='CommonJavaScriptBottom.tpl'}
{html->messages_script id="common_message"}
{form->rootpath_script}
{form->basepath_script}
<script type="text/javascript">
var lblSelectAction	= '{$language.lblSelectAction}';
var lblSelectStatus	= '{$language.lblSelectStatus}';
var msgSelectItem	= '{$language.msgSelectItem}';
var lblSelectItem	= '{$language.lblSelectItem}';
var msgDeleteItem	= '{$language.msgDeleteItem}';
var msgSelectSearchCriteria="{$language.msgSelectSearchCriteria}";
$(document).ready(function(e) {
	$(".tooltip-style01 .head1").click(function() {
	if($(this).siblings(".cnt-box").is(':visible'))
	{
	$(this).parent(".tooltip-style01").removeClass("active");
	$(".cnt-box").hide();
	}
	else{
		$(".cnt-box").hide();
	$(this).siblings(".cnt-box").slideDown("fast");
	$(".tooltip-style01").removeClass("active");
	$(this).parent(".tooltip-style01").addClass("active");	
	}
});
$(".sortby-list").click(function(){ 
	if($(this).siblings(".sort_links_ul").is(':visible'))
	{
	$(this).removeClass("active");
	$(".sort_links_ul").hide();
	}
	else{
	$(this).siblings(".sort_links_ul").slideDown("fast");
	$(this).addClass("active");	
	}  
});
$("#frmContentList").submit(function(){
	if($("[name='contentBulkStatus[]']:checked").length>0){
		if($("#formStatus").val()!=''){
			return true;
		}else{
			jAlert(lblSelectStatus);
			return false;
		}
	}else{
		jAlert(msgSelectItem);
		return false;
	}
});


$('body').click(function (e) {
        if ($(".tooltip-style01").has(e.target).length === 0) {
           $(".tooltip-style01").removeClass('active');
		   $(".cnt-box").hide();
        }
		if ($(".sort_links ").has(e.target).length === 0) {
		   $(".sort_links_ul").hide();
		   $(".sortby-list").removeClass('active');
        }
    });
	
	$("#submitBulkStatus").click(function () {
		var ListAllCheckedCount = $(".ListAll:checked").size();
		var status = $('#formStatus').val();
		if ($(".ListAll:checked").size() == 0) {
			jAlert(msgSelectItem);
			return false;
		} else if (status == "") {
			jAlert(lblSelectAction);
			return false;
		}
		if (status == 'Deleted') {
			jConfirm(msgDeleteItem, lblAlert, function (r) {
				if (r == true) {
					$('#frmContentList').submit();
				}
			});
		} else {
			return true;
		}
		return false;
	});	
	
	
	
});
</script>
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.multiselect.widget.js"></script> 

</body>
</html>
