{strip}

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- BOOTSTRAP3 CSS -->
<link rel="stylesheet" href="layouts/v7/modules/CTWhatsApp/bootstrap.min.css">

<!-- CUSTOM CSS -->
<link rel="stylesheet" href="layouts/v7/modules/CTWhatsApp/assets/css/reset.css">
<link rel="stylesheet" href="layouts/v7/modules/CTWhatsApp/assets/css/style.css">
    
<script src="layouts/v7/modules/CTWhatsApp/assets/js/jquery.emojiarea.js"></script>

<link rel="stylesheet"  type="text/css" href="layouts/v7/modules/CTWhatsApp/WhatsappStyle-RTL.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet">
<div class="modelContainer modal-dialog">
	<body>
		<!-- WHATSAPP FEATURE -->
		<div id="whatsApp">
			<input type="hidden" name='whatsappmainpoupopen' id='whatsappmainpoupopen' value="true">
			<input type="hidden" name='currentdatetime' id='currentdatetime' value="{$CURRENTDATETIME}">
			<input type="hidden" name='whatsappstorageurl' id='whatsappstorageurl' value="{$WHATSAPPSTORAGEURL}">
			<input type="hidden" name='currentusername' id='currentusername' value="{$CURRENUSERNAME}">
			<input type="hidden" name='lasttab_id' id='lasttab_id' value="">
			<div class="container">
				<div class="row">
					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 AllMessageData">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>

						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>

						{foreach item=ALLMESSAGESDATA_VALUE key=ALLMESSAGESDATA_KEY from=$ALLMESSAGESDATA}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile imageprofile">
												
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											
											<h3 class="pName serdername"><span class="user_name">{$ALLMESSAGESDATA_KEY}</span><br/><h3>
											<span class="pRight serderphone"></span>
											<select class="select2 quickcreateWhatsapp" id="quickcreateWhatsapp" name="quickcreateWhatsappRelated" style="width: 240px;margin-left: 69px;">
												<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
												{foreach item=ALLOWMODULESVALUE key=ALLOWMODULESKEY from=$ALLOWMODULES}
													<option value="{$ALLOWMODULESKEY}">{vtranslate('LBL_ADD','CTWhatsApp')} {$ALLOWMODULESVALUE}</option>
												{/foreach}
											</select>
										</div>	
									</div>
									<div class="contChat" style="background-color: #fff0b3;">	
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
					</div>

					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 LeadsData hide">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>
						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>		

						{foreach item=WHATSAPPDATA_VALUE key=WHATSAPPDATA_KEY from=$WHATSAPPDATA}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile">
												<span id="imagename" class="image_name"></span>
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											<h3 class="pName"><label class="moduleRecordURL">{$WHATSAPPDATA_KEY}</label><br/>
											<span class="pRight user_phoneno"></span></h3>
											{if $LEADSMODULERELATED}
												<select class="select2 quickcreateRelated" id="quickcreateRelated" name="quickcreateRelated" style="margin-left: 25px; width: 200px;float: left;">
													<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
													{foreach item=LEADSMODULERELATEDVALUE key=LEADSMODULERELATEDKEY from=$LEADSMODULERELATED}
														<option value="{$LEADSMODULERELATEDKEY}">{vtranslate($LEADSMODULERELATEDVALUE,$LEADSMODULERELATEDVALUE)}</option>
													{/foreach}
												</select>
											{/if}
										</div>	
									</div>
									<div class="contChat" style="background-color: #fff0b3;">	
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
					</div>

					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 ContactsData hide">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>
						
						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>	

						{foreach item=CONTACTSMODULEDATA_VALUE key=CONTACTSMODULEDATA_KEY from=$CONTACTSMODULEDATA}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile imageprofile">
												
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											<h3 class="pName"><label class="moduleRecordURL">{$CONTACTSMODULEDATA_KEY}</label><br/>
											<span class="pRight user_phoneno"></span></h3>
											{if $CONTACTSMODULERELATED}
												<select class="select2 quickcreateRelated" id="quickcreateRelated" name="quickcreateRelated" style="width: 200px;margin-left: 25px;float: left;">
													<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
													{foreach item=CONTACTSMODULERELATEDVALUE key=CONTACTSMODULERELATEDKEY from=$CONTACTSMODULERELATED}
														<option value="{$CONTACTSMODULERELATEDKEY}">{vtranslate($CONTACTSMODULERELATEDVALUE,$CONTACTSMODULERELATEDVALUE)}</option>
													{/foreach}
												</select>
											{/if}
										</div>	
									</div>
									<div class="contChat" style="overflow-y: scroll;height: 500px;scrollbar-width: thin;background-color: #fff0b3;">	  <br>
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
					</div>

					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 VendorsData hide">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>
						
						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>	

						{foreach item=VENDORSMODULEDATA_VALUE key=VENDORSMODULEDATA_KEY from=$VENDORSMODULEDATA}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile">
												<span id="imagename" class="image_name"></span>
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											<h3 class="pName"><label class="moduleRecordURL">{$VENDORSMODULEDATA_KEY}</label><br/>
											<span class="pRight user_phoneno"></span></h3>
											{if $VENSORSMODULERELATED}
												<select class="select2 quickcreateRelated" id="quickcreateRelated" name="quickcreateRelated" style="margin-left: 25px; width: 200px;float: left;">
													<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
													{foreach item=VENSORSMODULERELATEDVALUE key=VENSORSMODULERELATEDKEY from=$VENSORSMODULERELATED}
														<option value="{$VENSORSMODULERELATEDKEY}">{vtranslate($VENSORSMODULERELATEDVALUE,$VENSORSMODULERELATEDVALUE)}</option>
													{/foreach}
												</select>
											{/if}
										</div>	
									</div>
									<div class="contChat" style="overflow-y: scroll;height: 500px;scrollbar-width: thin;background-color: #fff0b3;">	  <br>
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
					</div>

					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 AccountsData hide">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>
						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>			

						{foreach item=ACCOUNTSMODULEDATA_VALUE key=ACCOUNTSMODULEDATA_KEY from=$ACCOUNTSMODULEDATA}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile">
												<span id="imagename" class="image_name"></span>
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											<h3 class="pName"><label class="moduleRecordURL">{$ACCOUNTSMODULEDATA_KEY}</label><br/>
											<span class="pRight user_phoneno"></span></h3>
											{if $ACCOUNTSMODULERELATED}
												<select class="select2 quickcreateRelated" id="quickcreateRelated" name="quickcreateRelated" style="margin-left: 25px; width: 200px;float: left;">
													<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
													{foreach item=ACCOUNTSMODULERELATEDVALUE key=ACCOUNTSMODULERELATEDKEY from=$ACCOUNTSMODULERELATED}
														<option value="{$ACCOUNTSMODULERELATEDKEY}">{vtranslate($ACCOUNTSMODULERELATEDVALUE,$ACCOUNTSMODULERELATEDVALUE)}</option>
													{/foreach}
												</select>
											{/if}
										</div>	
									</div>
									<div class="contChat" style="overflow-y: scroll;height: 500px;scrollbar-width: thin;background-color: #fff0b3;">	  <br>
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
					</div>
					
					<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 UnknownData hide">
						<div class="pull-right" style="margin-left: 10px;"><button type="button" class="close" aria-label="Close" data-dismiss="modal"><span aria-hidden="true" class="fa fa-close"></span></button></div>
						<div id="defaultTab" class="show"style="margin-top: 60px;background-color: #fff0b3;height: 435px;">
							{if $ISADMIN eq 'on'}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
							{else}
								<br>
								<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
								<br>
								<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
								<br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
								<br>
        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
								<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
								<br>
							{/if}
						</div>	

						<input type="hidden" class="avtivetabid" value="">
						{foreach item=UNKNOWNMODULEMESSAGES_VALUE key=UNKNOWNMODULEMESSAGES_KEY from=$UNKNOWNMODULEMESSAGES}
								{assign var=index value=$index+1}
								<div id="tab{$index}" class="tabcontent">
									<input type="hidden" class="phone_no" value="">
									<input type="hidden" class="module_recordid" value="">
									<input type="hidden" class="tabid" value="">
									<div class="contHead">
										<div class="dp">
											<div class="waProfile">
												<img src="layouts/v7/modules/CTWhatsApp/image/AvtarIcon.png"/>
											</div>
											<div class="contactType hide">
												<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
											</div>	
										</div>						
										<div class="dpText" style="margin-top: 10px;">
											<h3 class="pName serdername">{$UNKNOWNMODULEMESSAGES_KEY}</h3><br/>
											<span class="pRight serderphone"></span>
											<select class="select2 quickcreateWhatsapp" id="quickcreateWhatsapp" name="quickcreateWhatsappRelated" style="width: 240px;margin-left: 69px;">
												<option value="">{vtranslate('LBL_SELECTANOPTION','CTWhatsApp')}</option>
												{foreach item=ALLOWMODULESVALUE key=ALLOWMODULESKEY from=$ALLOWMODULES}
													<option value="{$ALLOWMODULESKEY}">{vtranslate('LBL_ADD','CTWhatsApp')} {$ALLOWMODULESVALUE}</option>
												{/foreach}
											</select>
										</div>	
									</div>
									<div class="contChat" style="overflow-y: scroll;height: 500px;scrollbar-width: thin;background-color: #fff0b3;">	  <br>
										{if $ISADMIN eq 'on'}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><span>&nbsp;&nbsp;<button class="btn btn-success newqrcodescan" onclick="window.location.href='{$SCANQRCODE}'">{vtranslate('LBL_SCANQRCODE','CTWhatsApp')}</button></span></center>
										{else}
											<br>
											<center><img src="layouts/v7/modules/CTWhatsApp/images/noconfiguration.png" style="width: 80px;"/></center>
											<br>
											<b><center><p>{vtranslate('LBL_NOTCONFIGURATION1','CTWhatsApp')}</p></center>
											<br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION2','CTWhatsApp')}</p></center>
											<br>
			        												<center>{vtranslate('LBL_NOTCONFIGURATION3','CTWhatsApp')}</center><br>
											<center><p>{vtranslate('LBL_NOTCONFIGURATION4','CTWhatsApp')}</p></center></b>
											<br>
										{/if}
									</div>
								</div>	
						{/foreach}
						
					</div>
					<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
						<div class="waLeft">
							<div class="waLeftHead">
								<div class="waProfile">
									<img src="layouts/v7/modules/CTWhatsApp/image/whatsapp.png" alt="dp"/>
								</div>
								<ul class="waHRight nav navbar-nav">
									<input type="hidden" name="module_name" id="module_name" value="">
									<input type="hidden" name="perpagedata" id="perpagedata" value="10">
									<input type="hidden" name="incresedtabid" id="incresedtabid" value="">
									<li class="dropdown"><span class="fText"><b>{vtranslate('LBL_NEWNUMBER','CTWhatsApp')} ({$UNREADCOUNT})</b></span><a class="dropdown-toggle" data-toggle="dropdown" href="#" style="background-color: #37a000;border-radius: 20px;"><img src="layouts/v7/modules/CTWhatsApp/images/filters.png"/></a>
										<ul class="dropdown-menu">
										  <li><a href="#"><img src="layouts/v7/modules/CTWhatsApp/image/Newmsgicon.png"/><span class="selectedmodulename" data-modulerecordcount={$UNREADCOUNT} data-modulename="New Messages" data-translatemodulename="{vtranslate('LBL_NEWNUMBER','CTWhatsApp')}" style="float: right;"> {vtranslate('LBL_NEWNUMBER','CTWhatsApp')} ({$UNREADCOUNT})</span></a></li>
										  {if $SHOWUNKNOWNMESSAGES eq 1 && $ISADMIN eq 'off'}
											<li><a href="#"><img src="layouts/v7/modules/CTWhatsApp/image/Newmsgicon.png"/><span class="selectedmodulename" data-modulerecordcount={$UNKNOWNNUMBERCOUNT} data-modulename="Unknown Number" data-translatemodulename="{vtranslate('LBL_UNKNOWN_NUMBER','CTWhatsApp')}" style="float: right;">{vtranslate('LBL_UNKNOWN_NUMBER','CTWhatsApp')} ({$UNKNOWNNUMBERCOUNT})</span></a></li>
										  {else if $ISADMIN eq 'on'}
											<li><a href="#"><img src="layouts/v7/modules/CTWhatsApp/image/Newmsgicon.png"/><span class="selectedmodulename" data-modulerecordcount={$UNKNOWNNUMBERCOUNT} data-modulename="Unknown Number" data-translatemodulename="{vtranslate('LBL_UNKNOWN_NUMBER','CTWhatsApp')}" style="float: right;">{vtranslate('LBL_UNKNOWN_NUMBER','CTWhatsApp')} ({$UNKNOWNNUMBERCOUNT})</span></a></li>
										  {/if}
										  {if $LEADSPHONEFIELD && $LEADSMODULEENABLE eq 0}
												<li><a href="#"><img src="layouts/v7/skins/images/Leads.png"/><span class="selectedmodulename" data-modulerecordcount={$LEADSCOUNT} data-modulename="Leads" data-translatemodulename="{vtranslate('Leads','Leads')}" style="float: right;">{vtranslate('Leads','Leads')} ({$LEADSCOUNT})</span></a></li>
											{/if}
											{if $ACCOUNTSPHONEFIELD && $ACCOUNTSMODULEENABLE eq 0}
												<li><a href="#"><img src="layouts/v7/skins/images/Accounts.png"/><span class="selectedmodulename" data-modulerecordcount={$ACCOUNTCOUNT} data-modulename="Accounts" data-translatemodulename="{vtranslate('Accounts','Accounts')}" style="float: right;">{vtranslate('Accounts','Accounts')} ({$ACCOUNTCOUNT})</span></a></li>
											{/if}
											{if $CONTACTSPHONEFIELD && $CONTACTSMODULEENABLE eq 0}
												<li><a href="#"><img src="layouts/v7/skins/images/Contacts.png"/><span class="selectedmodulename" data-modulerecordcount={$CONTACTSCOUNT} data-modulename="Contacts" data-translatemodulename="{vtranslate('Contacts','Contacts')}" style="float: right;">{vtranslate('Contacts','Contacts')} ({$CONTACTSCOUNT})</span></a></li>
											{/if}
											{if $VENDORSPHONEFIELD && $VENSORSMODULEENABLE eq 0}
												<li><a href="#"><img src="layouts/v7/skins/images/Vendors.png"/><span class="selectedmodulename" data-modulerecordcount={$VENDORSCOUNT} data-modulename="Vendors" data-translatemodulename="{vtranslate('Vendors','Vendors')}" style="float: right;">{vtranslate('Vendors','Vendors')} ({$VENDORSCOUNT})</span></a></li>
										   {/if}
										</ul>
									</li>
								</ul>	
								<div id="waForm">
									<input type="text" placeholder="{vtranslate('LBLSEARCH','CTWhatsApp')}" name="search">
									<button id="serachrecord"><img src="layouts/v7/modules/CTWhatsApp/images/search.png"/></button>
								</div>							
							</div>
							<div class="waTabs AllMessagename">
								{if $ALLMESSAGES}
									{foreach item=ALLMESSAGES_VALUE key=ALLMESSAGES_KEY from=$ALLMESSAGES}
										{assign var=counter value=$counter+1}
										<button class="tablinks" data-module_recordid="{$ALLMESSAGES_KEY}"  data-phoneno="{$ALLMESSAGES_KEY}" data-image="{$ALLMESSAGES_VALUE['image']}" data-username="{$ALLMESSAGES_VALUE['name']}" onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$ALLMESSAGES_VALUE['phone_field']}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="recordid" id="recordid" value="{$ALLMESSAGES_KEY}">
											<input type="hidden" name="image" id="image" value="{$ALLMESSAGES_VALUE['image']}">
											<input type="hidden" name="sender_name" id="sender_name" value="{$ALLMESSAGES_VALUE['label']}">
											<div class="dp">
												<div class="waProfile">
													{if $ALLMESSAGES_VALUE['imagetag'] eq '1'}
														<img src="{$ALLMESSAGES_VALUE['image']}" alt="dp"/>
													{else}
														<span id="imagename">{$ALLMESSAGES_VALUE['image']}</span>
													{/if}
												</div>
												<div class="contactType hide">
													<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
												</div>	
											</div>
											<div class="dpText">
												{if $ALLMESSAGES_VALUE['unreadcount'] == 0}
													<h3 class="pName">{if $ALLMESSAGES_VALUE['label']} <b>{$ALLMESSAGES_VALUE['label']}</b> {else} <b>{$ALLMESSAGES_VALUE['name']}</b> {/if}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$ALLMESSAGES_VALUE['message_body']}</span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$ALLMESSAGES_VALUE['createdtime']} </span>
												{else}
													<h3 class="pName">{if $ALLMESSAGES_VALUE['label']} <b>{$ALLMESSAGES_VALUE['label']}</b> {else} <b>{$ALLMESSAGES_VALUE['name']}</b> {/if}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$ALLMESSAGES_VALUE['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$ALLMESSAGES_VALUE['createdtime']} </b></span>
												{/if}	
											</div>	
											{if $ALLMESSAGES_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$ALLMESSAGES_VALUE['unreadcount']}</b></span>
											{/if}
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}
								{if $ALLMESSAGES|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="allloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span><br><br></div></center>
								{/if}			
							</div>
							<div class="waTabs Leadsname hide">
								<input type="hidden" name="leadperpagedata" id="leadperpagedata" value="10">
								<input type="hidden" name="leadincresedtabid" id="leadincresedtabid" value="">
								{if $MODULEDATA}
									{foreach item=MODULEDATA_VALUE key=MODULEDATA_KEY from=$MODULEDATA}
										{assign var=counter value=$counter+1}
										<button class="tablinks" data-module_recordid="{$MODULEDATA_KEY}"  data-phoneno="{$MODULEDATA_VALUE['phone_field']}" data-image="{$MODULEDATA_VALUE['image']}"data-recordurl="{$MODULEDATA_VALUE['recordURL']}" data-recordname="{$MODULEDATA_VALUE['name']}" onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$MODULEDATA_VALUE['phone_field']}">
											<input type="hidden" name="recordid" id="recordid" value="{$MODULEDATA_KEY}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="image" id="image" value="{$MODULEDATA_VALUE['image']}">
											<div class="dp">
												<div class="waProfile">
													<span id="imagename">{$MODULEDATA_VALUE['image']}</span>
												</div>
												<div class="contactType hide">
													<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
												</div>	
											</div>
											<div class="dpText">
												{assign var=leadscount value=$WHATSAPPDATA[$MODULEDATA_VALUE['name']]|@count - 1}
												{if $MODULEDATA_VALUE['unreadcount'] == 0}
													<h3 class="pName">{$MODULEDATA_VALUE['name']}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$WHATSAPPDATA[$MODULEDATA_VALUE['name']][$leadscount]['message_body']} </span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$WHATSAPPDATA[$MODULEDATA_VALUE['name']][$leadscount]['createdtime']} </span>
												{else}
													<h3 class="pName"><b>{$MODULEDATA_VALUE['name']}</b></h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$WHATSAPPDATA[$MODULEDATA_VALUE['name']][$leadscount]['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$WHATSAPPDATA[$MODULEDATA_VALUE['name']][$leadscount]['createdtime']} </b></span>
												{/if}
											</div>
											{if $MODULEDATA_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$MODULEDATA_VALUE['unreadcount']}</b></span>
											{/if}	
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}
								{if $MODULEDATA|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="leadsloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span><br><br></div></center>
								{/if}			
							</div>
							<div class="waTabs Contactsname hide">
								<input type="hidden" name="contactsperpagedata" id="contactsperpagedata" value="10">
								<input type="hidden" name="contactsincresedtabid" id="contactsincresedtabid" value="">
								{if $CONTACTSMODULE}
									{foreach item=CONTACTSMODULE_VALUE key=CONTACTSMODULE_KEY from=$CONTACTSMODULE}
										{assign var=counter value=$counter+1}
										<button class="tablinks" data-module_recordid="{$CONTACTSMODULE_KEY}" data-phoneno="{$CONTACTSMODULE_VALUE['phone_field']}" data-image="{$CONTACTSMODULE_VALUE['image']}" data-recordurl="{$CONTACTSMODULE_VALUE['recordURL']}" data-recordname="{$CONTACTSMODULE_VALUE['name']}"  onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$CONTACTSMODULE_VALUE['phone_field']}">
											<input type="hidden" name="recordid" id="recordid" value="{$CONTACTSMODULE_KEY}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="image" id="image" value="{$CONTACTSMODULE_VALUE['image']}">
											<div class="dp">
												<div class="waProfile">
													{if $CONTACTSMODULE_VALUE['imagetag'] eq '1'}
														<img src="{$CONTACTSMODULE_VALUE['image']}" alt="dp"/>
													{else}
														<span id="imagename">{$CONTACTSMODULE_VALUE['image']}</span>
													{/if}
												</div>
												<div class="contactType hide">
													<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
												</div>	
											</div>
											<div class="dpText">
												{assign var=contactscount value=$CONTACTSMODULEDATA[$CONTACTSMODULE_VALUE['name']]|@count - 1}
												{if $CONTACTSMODULE_VALUE['unreadcount'] == 0}
													<h3 class="pName">{$CONTACTSMODULE_VALUE['name']}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$CONTACTSMODULEDATA[$CONTACTSMODULE_VALUE['name']][$contactscount]['message_body']} </span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$CONTACTSMODULEDATA[$CONTACTSMODULE_VALUE['name']][$contactscount]['createdtime']} </span>
												{else}
													<h3 class="pName"><b>{$CONTACTSMODULE_VALUE['name']}</b></h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$CONTACTSMODULEDATA[$CONTACTSMODULE_VALUE['name']][$contactscount]['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$CONTACTSMODULEDATA[$CONTACTSMODULE_VALUE['name']][$contactscount]['createdtime']} </b></span>
												{/if}
											</div>
											{if $CONTACTSMODULE_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$CONTACTSMODULE_VALUE['unreadcount']}</b></span>					
											{/if}
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}
								{if $CONTACTSMODULE|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="contactsloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span><br><br></div></center>
								{/if}		
							</div>
							<div class="waTabs Vendorsname hide">
								<input type="hidden" name="vendorperpagedata" id="vendorperpagedata" value="10">
								<input type="hidden" name="vendorincresedtabid" id="vendorincresedtabid" value="">
								{if $VENDORSMODULE}
									{foreach item=VENDORSMODULE_VALUE key=VENDORSMODULE_KEY from=$VENDORSMODULE}
										{assign var=counter value=$counter+1}
										<button class="tablinks"  data-module_recordid="{$VENDORSMODULE_KEY}" data-phoneno="{$VENDORSMODULE_VALUE['phone_field']}" data-image="{$VENDORSMODULE_VALUE['image']}" data-recordurl="{$VENDORSMODULE_VALUE['recordURL']}" data-recordname="{$VENDORSMODULE_VALUE['name']}" onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$VENDORSMODULE_VALUE['phone_field']}">
											<input type="hidden" name="recordid" id="recordid" value="{$VENDORSMODULE_KEY}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="image" id="image" value="{$VENDORSMODULE_VALUE['image']}">
											<div class="dp">
												<div class="waProfile">
													<span id="imagename">{$VENDORSMODULE_VALUE['image']}</span>
												</div>
												<div class="contactType hide">
													<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
												</div>	
											</div>
											<div class="dpText">
												{assign var=venndorcount value=$VENDORSMODULEDATA[$VENDORSMODULE_VALUE['name']]|@count - 1}
												{if $VENDORSMODULE_VALUE['unreadcount'] == 0}
													<h3 class="pName">{$VENDORSMODULE_VALUE['name']}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$VENDORSMODULEDATA[$VENDORSMODULE_VALUE['name']][$venndorcount]['message_body']}</span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$VENDORSMODULEDATA[$VENDORSMODULE_VALUE['name']][$venndorcount]['createdtime']}</span>
												{else}
													<h3 class="pName"><b>{$VENDORSMODULE_VALUE['name']}</b></h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$VENDORSMODULEDATA[$VENDORSMODULE_VALUE['name']][$venndorcount]['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$VENDORSMODULEDATA[$VENDORSMODULE_VALUE['name']][$venndorcount]['createdtime']} </b></span>
												{/if}
											</div>	
											{if $VENDORSMODULE_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$VENDORSMODULE_VALUE['unreadcount']}</b></span>
											{/if}
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}	
								{if $VENDORSMODULE|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="vendorsloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span><br><br></div></center>
								{/if}		
							</div>
							<div class="waTabs Accountsname hide">
								<input type="hidden" name="accountperpagedata" id="accountperpagedata" value="10">
								<input type="hidden" name="accountincresedtabid" id="accountincresedtabid" value="">
								{if $ACCOUNTSMODULE}
									{foreach item=ACCOUNTSMODULE_VALUE key=ACCOUNTSMODULE_KEY from=$ACCOUNTSMODULE}
										{assign var=counter value=$counter+1}
										<button class="tablinks" data-module_recordid="{$ACCOUNTSMODULE_KEY}"  data-phoneno="{$ACCOUNTSMODULE_VALUE['phone_field']}" data-image="{$ACCOUNTSMODULE_VALUE['image']}" data-recordurl="{$ACCOUNTSMODULE_VALUE['recordURL']}" data-recordname="{$ACCOUNTSMODULE_VALUE['name']}" onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$ACCOUNTSMODULE_VALUE['phone_field']}">
											<input type="hidden" name="recordid" id="recordid" value="{$ACCOUNTSMODULE_KEY}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="image" id="image" value="{$ACCOUNTSMODULE_VALUE['image']}">
											<div class="dp">
												<div class="waProfile">
													<span id="imagename">{$ACCOUNTSMODULE_VALUE['image']}</span>
												</div>
												<div class="contactType hide">
													<img src="layouts/v7/modules/CTWhatsApp/images/contacts.png" alt="ContactType" />
												</div>	
											</div>
											<div class="dpText">
												{assign var=accountscount value=$ACCOUNTSMODULEDATA[$ACCOUNTSMODULE_VALUE['name']]|@count - 1}
												{if $ACCOUNTSMODULE_VALUE['unreadcount'] == 0}
													<h3 class="pName">{$ACCOUNTSMODULE_VALUE['name']}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$ACCOUNTSMODULEDATA[$ACCOUNTSMODULE_VALUE['name']][$accountscount]['message_body']}</span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$ACCOUNTSMODULEDATA[$ACCOUNTSMODULE_VALUE['name']][$accountscount]['createdtime']}</span>
												{else}
													<h3 class="pName"><b>{$ACCOUNTSMODULE_VALUE['name']}</b></h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$ACCOUNTSMODULEDATA[$ACCOUNTSMODULE_VALUE['name']][$accountscount]['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$ACCOUNTSMODULEDATA[$ACCOUNTSMODULE_VALUE['name']][$accountscount]['createdtime']} </b></span>
												{/if}
											</div>	
											{if $ACCOUNTSMODULE_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$ACCOUNTSMODULE_VALUE['unreadcount']}</b></span>
											{/if}
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}
								{if $ACCOUNTSMODULE|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="accountsloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span><br><br></div></center>
								{/if}		
							</div>
							
							<div class="waTabs Unknownname hide">
								<input type="hidden" name="unknownperpagedata" id="unknownperpagedata" value="10">
								<input type="hidden" name="unknownincresedtabid" id="unknownincresedtabid" value="">
								{if $UNKNOWNMODULE}
									{foreach item=UNKNOWNODULE_VALUE key=UNKNOWNMODULE_KEY from=$UNKNOWNMODULE}
										{assign var=counter value=$counter+1}
										<button class="tablinks" data-sendername="{$UNKNOWNODULE_VALUE['whatsapp_sendername']}" data-module_recordid={$UNKNOWNMODULE_KEY}  data-phoneno="{$UNKNOWNODULE_VALUE['phone_field']}" data-image="{$UNKNOWNODULE_VALUE['image']}" onclick="openTab(this,event, 'tab{$counter}')" id="defaultOpen">
											<input type="hidden" name="mobileno" id="mobileno" value="{$UNKNOWNODULE_VALUE['phone_field']}">
											<input type="hidden" name="recordid" id="recordid" value="{$UNKNOWNMODULE_KEY}">
											<input type="hidden" name="recordidtabid" id="recordidtabid" value="{$counter}">
											<input type="hidden" name="image" id="image" value="{$UNKNOWNODULE_VALUE['image']}">
											<input type="hidden" name="sender_name" id="sender_name" value="{$UNKNOWNODULE_VALUE['whatsapp_sendername']}">
											<div class="dp">
												<div class="waProfile">
													<span id="imagename">
													<img src="layouts/v7/modules/CTWhatsApp/image/AvtarIcon.png"/></span>
												</div>
											</div>
											<div class="dpText">
												{assign var=unknowncount value=$UNKNOWNMODULEMESSAGES[$UNKNOWNODULE_VALUE['name']]|@count - 1}
												{if $UNKNOWNODULE_VALUE['unreadcount'] == 0}
													<h3 class="pName">{$UNKNOWNODULE_VALUE['name']}</h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;">{$UNKNOWNODULE_VALUE['message_body']} </span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$UNKNOWNODULE_VALUE['createdtime']} </span>
												{else}
													<h3 class="pName"><b>{$UNKNOWNODULE_VALUE['name']}</b></h3>
													<span class="pImg" style="white-space: nowrap;width: 120px;overflow: hidden;text-overflow: ellipsis;"><b>{$UNKNOWNODULE_VALUE['message_body']} </b></span>
													<span class="pImg" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b>{$UNKNOWNODULE_VALUE['createdtime']} </b></span>
												{/if}
											</div>	
											{if $UNKNOWNODULE_VALUE['unreadcount'] neq 0}
												<span class="whatsappunreadcount" style="font-size: 10px;padding: 6px 0;display: inline-block;color: #040404;margin: -50px 0px 0px 0px;background-color: #008054;border-radius: 20px 20px 20px 20px;height: 26px;width: 26px;text-align: center;float: left;color: white;"><b>{$UNKNOWNODULE_VALUE['unreadcount']}</b></span>
											{/if}
										</button>
									{/foreach}
								{else}
									<br><br><br>
									<center><span style="font-size: 15px;">{vtranslate('LBL_NODATA','CTWhatsApp')}</span></center>
								{/if}	
								{if $UNKNOWNMODULE|@count eq 10}
									<center><div style="color:green;cursor:pointer" id="loadmore" class="unknownloadmore loadmore"><br><br><span class="button" style="background-color: #4CAF50;color: white;padding: 15px 32px;display: inline-block;">{vtranslate('LBL_LOADMORE','CTWhatsApp')}</span></div></center><br><br>
								{/if}	
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</div>
{/strip}

{literal}
	<!-- VERTICAL TABS -->
	<script>
		function openTab(curobj, evt, tabName) {
		  	var i, tabcontent, tablinks;
		  	var image = $(curobj).data('image');
		  	$('.image_name').text('');
		  	$('.image_name').text(image);
		  	var username = $(curobj).data('username');
		  	$('.user_name').text('');
		  	$('.user_name').text(username);
		  	
		  	$('.avtivetabid').val('');
		  	$('.avtivetabid').val(tabName);
		  	
		  	var sendername = $(curobj).find('#sender_name').val();
		  	$('.serdername').text('');
		  	$('.serdername').text(sendername);
		  	
		  	var unkownphone = $(curobj).data('phoneno');
		  	$('.serderphone').text('');
		  	$('.serderphone').text(unkownphone);
		  	
		  	var label = $(curobj).find('#sender_name').val();
		  	if(label == '' || label == undefined){
				$('.quickcreateWhatsapp').addClass('show');
		  	}else{
				$('.quickcreateWhatsapp').addClass('hide');
		  	}
		  	
		  	if(image.length == 2 || image.length == 3){
		  		var tag = "<span id='imagename' class='image_name'>"+image+"</span>";
		  	}else{
		  		var tag = "<img id='imagename' class='image_name' src='"+image+"'>";
		  	}
		  	
		  	$('.imageprofile').html(tag);

		  	var phone_no = $(curobj).data('phoneno');
		  	$('.phone_no').val(phone_no);
		  	$('.user_phoneno').text(phone_no);
		  	
		  	$('.tabid').val(tabName);

		  	var module_recordid = $(curobj).data('module_recordid');
		  	$('.module_recordid').val(module_recordid);
		  	
		  	var recordurl = $(curobj).data('recordurl');
		  	var recordname = $(curobj).data('recordname');
		  	if(recordname === undefined){
	  			recordname = $(curobj).data('firstname')+' '+$(curobj).data('lastname');
		  	}
		  	$('.moduleRecordURL').html('');
		  	$('.moduleRecordURL').html('<a href='+recordurl+' target="_blank">'+recordname+'</a> <a href='+recordurl+' target="_blank"><i class="fa fa-eye icon"></i></a>');
		  	
		  	tabcontent = document.getElementsByClassName("tabcontent");
		  	for (i = 0; i < tabcontent.length; i++) {
		  		tabcontent[i].style.display = "none";
		  	}
		  	tablinks = document.getElementsByClassName("tablinks");
		  	for (i = 0; i < tablinks.length; i++) {
		  		tablinks[i].className = tablinks[i].className.replace(" active", "");
		  	}
		  	document.getElementById(tabName).style.display = "block";
		  	evt.currentTarget.className += " active";
		  	
		  	$('#'+tabName+' .contChat').animate({scrollTop: $('#'+tabName+' .contChat')[0].scrollHeight}, 0);

			$('.LeadsData #defaultTab').removeClass('show');
		  	$('.LeadsData #defaultTab').addClass('hide');
		  	$('.ContactsData #defaultTab').removeClass('show');
		  	$('.ContactsData #defaultTab').addClass('hide');
		  	$('.VendorsData #defaultTab').removeClass('show');
		  	$('.VendorsData #defaultTab').addClass('hide');
		  	$('.AccountsData #defaultTab').removeClass('show');
		  	$('.AccountsData #defaultTab').addClass('hide');
		  	$('.AllMessageData #defaultTab').removeClass('show');
		  	$('.AllMessageData #defaultTab').addClass('hide');
		  	$('.UnknownData #defaultTab').removeClass('show');
		  	$('.UnknownData #defaultTab').addClass('hide');
		}
		$( document ).ready(function() {
			$('.tabcontent').css('display','none'); 
			$('#defaultTab').css('display',''); 
		});
		
		$('#loadmore').live('click', function(){
			if(jQuery(this).scrollTop() + jQuery(this).innerHeight()>=jQuery(this)[0].scrollHeight){
				var module_name = $('#module_name').val();
				var lasttabid = $(".waTabs button").last().find('#recordidtabid').val();
				if(module_name == "Unknown Number"){
					var perpage_data = $('#unknownperpagedata').val();
					var nexttabid = $('#unknownincresedtabid').val();
				}else if(module_name == "Contacts"){
					var perpage_data = $('#contactsperpagedata').val();
					var nexttabid = $('#contactsincresedtabid').val();
				}else if(module_name == "Accounts"){
					var perpage_data = $('#accountperpagedata').val();
					var nexttabid = $('#accountincresedtabid').val();
				}else if(module_name == "Leads"){
					var perpage_data = $('#leadperpagedata').val();
					var nexttabid = $('#leadincresedtabid').val();
				}else if(module_name == "Vendors"){
					var perpage_data = $('#vendorperpagedata').val();
					var nexttabid = $('#vendorincresedtabid').val();
				}else{
					var perpage_data = $('#perpagedata').val();
					var nexttabid = $('#incresedtabid').val();
				}
				
				var params = {
                    'module' : 'CTWhatsApp',
                    'view' : "WhatsappChat",
                    'mode' : "getLazyLoadData",
                    'module_name' : module_name,
                    'perpagedata' : perpage_data,
					'lasttabid' : lasttabid,
					'nexttabid' : nexttabid
                }
                if(module_name == "Unknown Number"){
					var perpagevalue = parseInt(jQuery('#unknownperpagedata').val()) + 10;
					jQuery('#unknownperpagedata').val(perpagevalue);
                }else if(module_name == "Contacts"){
					var perpagevalue = parseInt(jQuery('#contactsperpagedata').val()) + 10;
					jQuery('#contactsperpagedata').val(perpagevalue);
                }else if(module_name == "Accounts"){
					var perpagevalue = parseInt(jQuery('#accountperpagedata').val()) + 10;
					jQuery('#accountperpagedata').val(perpagevalue);
                }else if(module_name == "Leads"){
					var perpagevalue = parseInt(jQuery('#leadperpagedata').val()) + 10;
					jQuery('#leadperpagedata').val(perpagevalue);
                }else if(module_name == "Vendors"){
					var perpagevalue = parseInt(jQuery('#vendorperpagedata').val()) + 10;
					jQuery('#vendorperpagedata').val(perpagevalue);
                }else{
					var perpagevalue = parseInt(jQuery('#perpagedata').val()) + 10;
					jQuery('#perpagedata').val(perpagevalue);
                }
				app.helper.showProgress();
				AppConnector.request(params).then(
					function(data) { 
					app.helper.hideProgress();
					if(module_name == 'Leads'){
						$('.leadsloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.Leadsname').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.LeadsData').append(msgdata);
						var leadincresedtabid = data.result['incresedtabid'];
						jQuery('#leadincresedtabid').val(leadincresedtabid);
					}else if(module_name == 'Contacts'){
						$('.contactsloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.Contactsname').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.ContactsData').append(msgdata);
						var contactsincresedtabid = data.result['incresedtabid'];
						jQuery('#contactsincresedtabid').val(contactsincresedtabid);
					}else if(module_name == 'Accounts'){
						$('.accountsloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.Accountsname').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.AccountsData').append(msgdata);
						var accountincresedtabid = data.result['incresedtabid'];
						jQuery('#accountincresedtabid').val(accountincresedtabid);
					}else if(module_name == 'Vendors'){
						$('.vendorsloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.Vendorsname').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.VendorsData').append(msgdata);
						var vendorincresedtabid = data.result['incresedtabid'];
						jQuery('#vendorincresedtabid').val(vendorincresedtabid);
					}else if(module_name == 'Unknown Number'){
						$('.unknownloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.Unknownname').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.UnknownData').append(msgdata);
						var unknownincresedtabid = data.result['incresedtabid'];
						jQuery('#unknownincresedtabid').val(unknownincresedtabid);
					}else{
						$('.allloadmore').addClass('hide');
						var sidebardata = data.result['sidebar'];
						jQuery('.AllMessagename').append(sidebardata);
						var msgdata = data.result['msgdata'];
						jQuery('.AllMessageData').append(msgdata);
						var incresedtabid = data.result['incresedtabid'];
						jQuery('#incresedtabid').val(incresedtabid);
					}
				});
			}
		});
	</script>	
{/literal}
