function content_5778af75be41c2_04486561($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        echo smarty_function_js_data(array('gNonce' => lib_nonce::getNonce()), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/js/startup.js'), $_smarty_tpl);
    }
    function content_5778af8a051997_20571009($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        if (!is_callable('smarty_block_mybox')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/block.mybox.php';
        }
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_function_cycle')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.cycle.php';
        }
        if (!is_callable('smarty_modifier_ucwords')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.ucwords.php';
        }
        if (!is_callable('smarty_modifier_money')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.money.php';
        }
        if (!is_callable('smarty_modifier_truncate')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.truncate.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_modifier_date')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date.php';
        }
        echo smarty_function_js_include(array('src' => '/css/calendar.css'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/homepage.css'), $_smarty_tpl);
        ?>


<?php 
        echo '<script';
        ?>
 language="javascript">
	function statAppChange(){
		var statApp=getCtrlValue('statApp');
		el('tblAppProf').style.display= statApp=='Prof'?'':'none';
		el('tblAppVol').style.display= statApp=='Vol'?'':'none';
		el('tblAppNumtrans').style.display= statApp=='Numtrans'?'':'none';

		var statAgent=getCtrlValue('statAgent');
		el('tblAgentAccSub').style.display= statAgent=='AccSub'?'':'none';
		el('tblAgentAcc').style.display= statAgent=='Acc'?'':'none';
		el('tblAgentRes').style.display= statAgent=='Res'?'':'none';
		el('tblAgentCom').style.display= statAgent=='Com'?'':'none';

		var statMca=getCtrlValue('statMca');
		el('tblMcaAmount').style.display= statMca=='Amount'?'':'none';
		el('tblMcaBal').style.display= statMca=='Bal'?'':'none';
		el('tblMcaProf').style.display= statMca=='Prof'?'':'none';

// top 10
		var statTeamleader=getCtrlValue('statTeamleader');
		el('tblTeamleaderLead').style.display= statTeamleader=='Lead'?'':'none';
		el('tblTeamleaderAppt').style.display= statTeamleader=='Appt'?'':'none';
		el('tblTeamleaderSold').style.display= statTeamleader=='Sold'?'':'none';

		var statTm=getCtrlValue('statTm');
		el('tblTmLead').style.display= statTm=='Lead'?'':'none';
		el('tblTmAppt').style.display= statTm=='Appt'?'':'none';
		el('tblTmSold').style.display= statTm=='Sold'?'':'none';

		var statLeadcloser=getCtrlValue('statLeadcloser');
		el('tblLeadcloserLead').style.display= statLeadcloser=='Lead'?'':'none';
		el('tblLeadcloserAppt').style.display= statLeadcloser=='Appt'?'':'none';
		el('tblLeadcloserSold').style.display= statLeadcloser=='Sold'?'':'none';
	}


    $(document).ready(function() {



    });

<?php 
        echo '</script';
        ?>
>
<style>
</style>



<div class="mySortable HomePage">



<?php 
        if (permitted('HOME-DailyQuotes')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-DailyQuotes', 'title' => 'Daily Sales & Motivational Quotes', 'class' => 'box-one box-blue'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-DailyQuotes', 'title' => 'Daily Sales & Motivational Quotes', 'class' => 'box-one box-blue'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

		<?php 
                echo smarty_function_js_data(array('jsQuotes' => $_smarty_tpl->tpl_vars['jsQuotes']->value, 'jsQuotesTimer' => $_smarty_tpl->tpl_vars['confDayquotesTimer']->value), $_smarty_tpl);
                ?>

		<div id="quoteDiv"></div>
		
		<?php 
                echo '<script';
                ?>
>
        var myQuoteI=0;
        myQuoteTimer();
        function myQuoteTimer(){
        	if(jsQuotes.length==0) return;
        	var d=document.getElementById('quoteDiv');
        	if(!d) return;
        	if(!jsQuotes[myQuoteI]){myQuoteI=0;}
        	var s=jsQuotes[myQuoteI]['txt'];
        //	d.innerHTML='Quote #'+(jsQuotes[myQuoteI]['id'])+': '+s;
        	d.innerHTML=s;
        	myQuoteI++;

        //    alert(myFlashTextTag);
        	window.setTimeout("myQuoteTimer()",jsQuotesTimer*1000,"javascript");
        }
		<?php 
                echo '</script';
                ?>
>
		
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-DailyQuotes', 'title' => 'Daily Sales & Motivational Quotes', 'class' => 'box-one box-blue'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>


<?php 
        }
        ?>



<?php 
        if (permitted('HOME-top25App')) {
            ?>

	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top25App', 'title' => 'Top 25 Merchants', 'class' => 'box-three box-1 box-green'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top25App', 'title' => 'Top 25 Merchants', 'class' => 'box-three box-1 box-green'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statApp">
		  <option value="Prof" selected>by Total Profit $</option>
		  <option value="Vol" >by Volume $</option>
		  <option value="Numtrans" >by Avg TXN $</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>
			  <table id="tblAppProf" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAppProfit']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['amount'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblAppVol" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAppVol']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['volume'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblAppNumtrans" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right"># Trans</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAppNumtrans']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['numTrans'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
      </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top25App', 'title' => 'Top 25 Merchants', 'class' => 'box-three box-1 box-green'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>

<?php 
        if (permitted('HOME-top25Agent')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top25Agent', 'title' => 'Top 25  Sales Agents', 'class' => 'box-three box-2 box-green'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top25Agent', 'title' => 'Top 25  Sales Agents', 'class' => 'box-three box-2 box-green'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statAgent">
		  <option value="AccSub" selected>by Account Submitted</option>
		  <option value="Acc" >by Approved Accounts</option>
		  <option value="Res" >by Residuals</option>
		  <option value="Com" >by Commissions</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>

			  <table id="tblAgentAccSub" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAgentAccSub']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>


			  <table id="tblAgentAcc" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAgentAcc']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblAgentRes" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Amount $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAgentRes']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['UserName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['amount'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblAgentCom" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Comm $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topAgentCom']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['UserName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['amount'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
    </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top25Agent', 'title' => 'Top 25  Sales Agents', 'class' => 'box-three box-2 box-green'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>

<?php 
        if (permitted('HOME-top25MCA')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top25MCA', 'title' => 'Top 25 MCA Accounts', 'class' => 'box-three box-3 box-green'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top25MCA', 'title' => 'Top 25 MCA Accounts', 'class' => 'box-three box-3 box-green'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statMca">
		  <option value="Amount" selected>by Funding Amount $</option>
		  <option value="Bal" >by Balance $</option>
		  <option value="Prof" >by Profit $</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>
			  <table id="tblMcaAmount" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topMcaAmount']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['amount'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblMcaBal" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Balance $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topMcaBal']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['bal'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblMcaProf" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">Merchant Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Amount $</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topMcaProf']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['BusinessName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['profit'], 2);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
      </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top25MCA', 'title' => 'Top 25 MCA Accounts', 'class' => 'box-three box-3 box-green'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>
  








<?php 
        if (permitted('HOME-top10Teamleader')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top10Teamleader', 'title' => 'Top 10 Team Leaders', 'class' => 'box-three box-1 box-red'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top10Teamleader', 'title' => 'Top 10 Team Leaders', 'class' => 'box-three box-1 box-red'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statTeamleader">
		  <option value="Lead" selected>by Leads</option>
		  <option value="Appt" >by Appointments</option>
		  <option value="Sold" >by Sold Leads</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>

			  <table id="tblTeamleaderLead" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTeamleaderLead']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>


			  <table id="tblTeamleaderAppt" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTeamleaderAppt']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblTeamleaderSold" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTeamleaderSold']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['UserName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
      </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top10Teamleader', 'title' => 'Top 10 Team Leaders', 'class' => 'box-three box-1 box-red'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>



<?php 
        if (permitted('HOME-top10Tm')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top10Tm', 'title' => 'Top 10 Telemarketers', 'class' => 'box-three box-2 top10box box-red'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top10Tm', 'title' => 'Top 10 Telemarketers', 'class' => 'box-three box-2 top10box box-red'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statTm">
		  <option value="Lead" selected>by Leads</option>
		  <option value="Appt" >by Appointments</option>
		  <option value="Sold" >by Sold Leads</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>

			  <table id="tblTmLead" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTmLead']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>


			  <table id="tblTmAppt" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTmAppt']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblTmSold" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topTmSold']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['UserName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
      </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top10Tm', 'title' => 'Top 10 Telemarketers', 'class' => 'box-three box-2 top10box box-red'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>


<?php 
        if (permitted('HOME-top10Leadcloser')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-top10Leadcloser', 'title' => 'Top 10 Lead Closers', 'class' => 'box-three box-3 top10box box-red'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-top10Leadcloser', 'title' => 'Top 10 Lead Closers', 'class' => 'box-three box-3 top10box box-red'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders" align="center">
		  <select style="width:195px" onchange="statAppChange()" name="statLeadcloser">
		  <option value="Lead" selected>by Leads</option>
		  <option value="Appt" >by Appointments</option>
		  <option value="Sold" >by Sold Leads</option>
		  </select>		  </td>
          </tr>
		  <tr>
		  <td>

			  <table id="tblLeadcloserLead" class="myStat25" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topLeadcloserLead']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>


			  <table id="tblLeadcloserAppt" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topLeadcloserAppt']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['UserName'];
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

			  <table id="tblLeadcloserSold" class="myStat25" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td class="tdListHeaders myDbaHeader">User Name</td>
				  <td class="tdListHeaders myAmtHeader"><div align="right">Total #</div></td>
				</tr>
				<?php 
                echo smarty_function_cycle(array('values' => 'even,odd', 'reset' => true, 'print' => false), $_smarty_tpl);
                ?>

				<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['topLeadcloserSold']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
				<tr class="<?php 
                    echo smarty_function_cycle(array('values' => 'even,odd'), $_smarty_tpl);
                    ?>
" >
				  <td><div class="myDbaCell"><?php 
                    echo smarty_modifier_ucwords($_smarty_tpl->tpl_vars['item']->value['UserName']);
                    ?>
</div></td>
				  <td><div class="myAmtCell"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cnt'], 0);
                    ?>
</div></td>
				</tr>
				<?php 
                }
                ?>
			  </table>

		  </td>
		  </tr>
        
      </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-top10Leadcloser', 'title' => 'Top 10 Lead Closers', 'class' => 'box-three box-3 top10box box-red'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>






<?php 
        if (permitted('HOME-NewMerchBoard')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-NewMerchBoard', 'title' => 'New Merchant Boarding & Underwriting Statistics', 'class' => 'box-one box-yellow'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-NewMerchBoard', 'title' => 'New Merchant Boarding & Underwriting Statistics', 'class' => 'box-one box-yellow'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<table  width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdListHeaders">&nbsp;</td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>Today</strong></td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>MTD</strong></td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>Last Month </strong></td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>YTD</strong></td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>Last Year </strong></td>
          <td align="right" class="tdListHeaders quickStatCell"><strong>Life Time </strong></td>
        </tr>
<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['statList']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
        <tr class="trOut">
          <td align="left" class="tdValueColumn "><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['statusTitle'];
                    ?>
</td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntToday']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntMTD']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntLastMonth']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntYTD']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntLastYear']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
          <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo ($tmp = @$_smarty_tpl->tpl_vars['item']->value['cntALL']) === null || $tmp === '' ? 0 : $tmp;
                    ?>
</div></td>
        </tr>
<?php 
                }
                ?>
        
      </table>			
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-NewMerchBoard', 'title' => 'New Merchant Boarding & Underwriting Statistics', 'class' => 'box-one box-yellow'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>


<?php 
        if (permitted('HOME-ApprovedMerch')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-ApprovedMerch', 'title' => 'Approved Merchants - Bonuses, Commissions, & Lease Funding', 'class' => 'box-one box-green'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'HOME-ApprovedMerch', 'title' => 'Approved Merchants - Bonuses, Commissions, & Lease Funding', 'class' => 'box-one box-green'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<table  width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="tdListHeaders">&nbsp;</td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>Today</strong></td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>MTD</strong></td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>Last Month </strong></td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>YTD</strong></td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>Last Year </strong></td>
                <td align="right" class="tdListHeaders quickStatCell"><strong>Life Time </strong></td>
              </tr>
            <?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['statProfList']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
            <tr class="trOut">
              <td align="left" class="tdValueColumn "><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['statusTitle'];
                    ?>
</td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntToday']);
                    ?>
</div></td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntMTD']);
                    ?>
</div></td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntLastMonth']);
                    ?>
</div></td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntYTD']);
                    ?>
</div></td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntLastYear']);
                    ?>
</div></td>
              <td class="tdValueColumn quickStatCell"><div align="right"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntALL']);
                    ?>
</div></td>
            </tr>
            <?php 
                }
                ?>
          </table>
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'HOME-ApprovedMerch', 'title' => 'Approved Merchants - Bonuses, Commissions, & Lease Funding', 'class' => 'box-one box-green'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>




<?php 
        if ($_smarty_tpl->tpl_vars['trafficEmbedUrl']->value) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'test', 'title' => "Daily Traffic Map Report for " . (string) $_smarty_tpl->tpl_vars['trafficEmbedCity']->value . ", " . (string) $_smarty_tpl->tpl_vars['trafficEmbedState']->value, 'class' => 'box-one box-red'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => 'test', 'title' => "Daily Traffic Map Report for " . (string) $_smarty_tpl->tpl_vars['trafficEmbedCity']->value . ", " . (string) $_smarty_tpl->tpl_vars['trafficEmbedState']->value, 'class' => 'box-one box-red'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<iframe style="height: 500px; width: 100%;" src="<?php 
                echo $_smarty_tpl->tpl_vars['trafficEmbedUrl']->value;
                ?>
" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe>		
	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => 'test', 'title' => "Daily Traffic Map Report for " . (string) $_smarty_tpl->tpl_vars['trafficEmbedCity']->value . ", " . (string) $_smarty_tpl->tpl_vars['trafficEmbedState']->value, 'class' => 'box-one box-red'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>




<?php 
        $_smarty_tpl->tpl_vars['section'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['section']->_loop = false;
        $_smarty_tpl->tpl_vars['sec_code'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sections']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['section']->key => $_smarty_tpl->tpl_vars['section']->value) {
            $_smarty_tpl->tpl_vars['section']->_loop = true;
            $_smarty_tpl->tpl_vars['sec_code']->value = $_smarty_tpl->tpl_vars['section']->key;
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "HOME-Icons-" . (string) $_smarty_tpl->tpl_vars['sec_code']->value, 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => 'box-one box-green'));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => "HOME-Icons-" . (string) $_smarty_tpl->tpl_vars['sec_code']->value, 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => 'box-one box-green'), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<table class="tblIcons" border="0" cellspacing="0" cellpadding="0" width="100%">
    <?php 
                $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['row']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['section']->value['items3'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value) {
                    $_smarty_tpl->tpl_vars['row']->_loop = true;
                    ?>
    <tr> 
	  <?php 
                    $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['item']->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['row']->value;
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                        $_smarty_tpl->tpl_vars['item']->_loop = true;
                        ?>
      <td><?php 
                        if ($_smarty_tpl->tpl_vars['item']->value['img']) {
                            ?>
          <div class="myicon_home"><a href="javascript:;" onclick="window.location.href='<?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['url'];
                            ?>
'"><img border="0" src="<?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['img'];
                            ?>
" />
          <div class="title"><?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['title'];
                            ?>
</div>
          </a></div>
        <?php 
                        }
                        ?>
	  </td>
      <?php 
                    }
                    ?>
	  </tr>
    <?php 
                }
                ?>
  </table>

	<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => "HOME-Icons-" . (string) $_smarty_tpl->tpl_vars['sec_code']->value, 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => 'box-one box-green'), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>
  






<?php 
        if ($_smarty_tpl->tpl_vars['leadstorelocatorCode']->value) {
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "home_storelocator", 'title' => "Store Locator by Zip Code", 'class' => "box-one box-blue"));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => "home_storelocator", 'title' => "Store Locator by Zip Code", 'class' => "box-one box-blue"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<iframe scrolling="no" style='text-align:center;padding:4px;width:100%;height:50px;' frameborder="0" src="/linkcodes.php?cmd=leadstorelocatorCode"
                      OnLoad="var h=this.contentWindow.document.body.scrollHeight+0;this.style.height=h+'px'"></iframe>
<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => "home_storelocator", 'title' => "Store Locator by Zip Code", 'class' => "box-one box-blue"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
  
<?php 
        }
        ?>



<?php 
        if (permitted('HOME-TopNews')) {
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "home_toparticles", 'title' => "Most Recent News Articles", 'class' => "box-one box-gray"));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => "home_toparticles", 'title' => "Most Recent News Articles", 'class' => "box-one box-gray"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<?php 
                echo smarty_function_js_include(array('src' => '/css/articles.css'), $_smarty_tpl);
                ?>

<div class="articles-page">
    <div class="container clearfix">
        <?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['articles']->value['list'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
            <div class="vid-box <?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['color'];
                    ?>
" onclick="myRedirect('<?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['url'];
                    ?>
')">
                <div class="vid">
                    <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['img']) {
                        ?>
                    <img border="0" order="0" widthX="200" heightX="170" src="<?php 
                        echo $_smarty_tpl->tpl_vars['item']->value['img'];
                        ?>
" />
                    <?php 
                    }
                    ?>
                </div>
                
                <div class="info">
                    <div class="title"><?php 
                    echo smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['item']->value['news']), 100);
                    ?>
</div>
                    <div class="cntviews"> 
                 Article #<?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['news_id'];
                    ?>
 </div>
                    <div class="date"><?php 
                    echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['post_date'], "%m/%d/%Y %H:%M %p");
                    ?>
</div>
                </div>
            </div>            
        <?php 
                }
                ?>
    
    </div>
</div>
<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => "home_toparticles", 'title' => "Most Recent News Articles", 'class' => "box-one box-gray"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
  
<?php 
        }
        ?>



<?php 
        if (permitted('HOME-TopVideos')) {
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "home_toptrainvideo", 'title' => "Most Recent Training Videos", 'class' => "box-one box-gray"));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => "home_toptrainvideo", 'title' => "Most Recent Training Videos", 'class' => "box-one box-gray"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

	<?php 
                echo smarty_function_js_include(array('src' => '/css/trainingvideo.css'), $_smarty_tpl);
                ?>

<div class="training-vid">
    <div class="container">
        <?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['TrainingVideos']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
            <div class="vid-box <?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['color'];
                    ?>
" onclick="myRedirect('<?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['link'];
                    ?>
')">
                <div class="vid">
                    <img src="http://i1.ytimg.com/vi/<?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['youtube_code'];
                    ?>
/default.jpg" width="120" height="90" border="0"/>
                </div>
                
                <div class="info">
                    <div class="title"><?php 
                    echo $_smarty_tpl->tpl_vars['item']->value['name'];
                    ?>
</div>
                    <div class="cntviews"><?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['cntViews'], 0);
                    ?>
 views</div>
                    <div class="date"><?php 
                    echo smarty_modifier_date($_smarty_tpl->tpl_vars['item']->value['time_created'], 'datetime');
                    ?>
</div>
                </div>
            </div>            
        <?php 
                }
                ?>
    
    </div>
</div>
<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => "home_toptrainvideo", 'title' => "Most Recent Training Videos", 'class' => "box-one box-gray"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>


</div>







<?php 
        echo '<script';
        ?>
 language="javascript">


mybox_sortableInit('.mySortable.HomePage');

<?php 
        echo '</script';
        ?>
>




<?php 
        echo $_smarty_tpl->tpl_vars['speakpipeCode']->value;
        ?>

<?php 
        echo $_smarty_tpl->tpl_vars['olarkCode']->value;
        ?>

<?php 
        echo $_smarty_tpl->tpl_vars['phpliveCode']->value;
        ?>




<?php 
    }
    function content_5778b60fce8eb1_02009448($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_modifier_money')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.money.php';
        }
        ?>
<!--in production
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,r-2.0.0/datatables.min.css"/>
 
<?php 
        echo '<script';
        ?>
 type="text/javascript" src="https://cdn.datatables.net/s/dt/pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,r-2.0.0/datatables.min.js"><?php 
        echo '</script';
        ?>
>
-->


<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,r-2.0.0/datatables.css"/>


<?php 
        echo '<script';
        ?>
 type="text/javascript" src="https://cdn.datatables.net/s/dt/pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,r-2.0.0/datatables.js"><?php 
        echo '</script';
        ?>
>
<?php 
        echo smarty_function_js_data(array('url_data' => $_smarty_tpl->tpl_vars['url_data']->value), $_smarty_tpl);
        ?>

<style>

div.dt-button-collection a.dt-button.active:not(.disabled) {
    background-color: #B74949;
    background-image: -webkit-linear-gradient(top, #7489D6 0%, #dadada 100%);
	}
.dataTables_wrapper .dataTables_filter {
    position: absolute;
    left: 400px;
	float: left;
	margin-left:20px;
	margin-top: 15px;
}
a.dt-button.buttons-collection {
    margin-left: 10px;
    margin-top: 10px;
	margin-buttom: 10px;
    margin-right: 10px;
}
a.dt-button.buttons-collection.buttons-colvis.checklist-btn {
    margin: inherit;
    border: blue;
	visibility: hidden;
}
.dt-button-collection.fixed.two-column.columns-delete::before {
    content: "choose format file you do want to export";
}
.dt-button-collection::before {
    content: "Delete columns you don't want to export";
}
.dt-button-collection.sec-checklist::before {
    content: "select checklist section ";
}
/*#example_paginate {
    position: relative;
    right: 94%;
}*/
</style>

<?php 
        echo '<script';
        ?>
  type="text/javascript">



$(document).ready(function() {

	var url=url_data;//"&owner_uid=1&lender_uid=&FundingType=&status=&date1=&date2=";
	
	var i=0;
    var colVisArr =i;
	for (i+1; i<=40; i++){
	 colVisArr=colVisArr+","+i;
	 icolVisArr=i;
	}

	//var j=<?php 
        echo $_smarty_tpl->tpl_vars['index_cl']->value;
        ?>
;
	var checklistColVisArr1 =icolVisArr+1;
	for (icolVisArr; i<=(icolVisArr+<?php 
        echo $_smarty_tpl->tpl_vars['SEC_1']->value;
        ?>
); i++){
	 checklistColVisArr1=checklistColVisArr1+","+i;
	 ichecklistColVisArr1=i;
	}
	
	var checklistColVisArr2 =ichecklistColVisArr1+1;
	for (ichecklistColVisArr1; i<=(ichecklistColVisArr1+<?php 
        echo $_smarty_tpl->tpl_vars['SEC_2']->value;
        ?>
); i++){
	 checklistColVisArr2=checklistColVisArr2+","+i;
	 ichecklistColVisArr2=i;
	}
	var checklistColVisArr3 =ichecklistColVisArr2+1;
	for (ichecklistColVisArr2; i<=(ichecklistColVisArr2+<?php 
        echo $_smarty_tpl->tpl_vars['SEC_3']->value;
        ?>
); i++){
	 checklistColVisArr3=checklistColVisArr3+","+i;
	 ichecklistColVisArr3=i;
	}
	var checklistColVisArr4 =ichecklistColVisArr3+1;
	for (ichecklistColVisArr3; i<=(ichecklistColVisArr3+<?php 
        echo $_smarty_tpl->tpl_vars['SEC_4']->value;
        ?>
); i++){
	 checklistColVisArr4=checklistColVisArr4+","+i;
	 ichecklistColVisArr4=i;
	}

	
    $('#example').DataTable({
		dom: 'Bfrtpli',
		columnDefs: [
            {
                "targets": [ <?php 
        echo $_smarty_tpl->tpl_vars['allcol']->value;
        ?>
 ],
                "visible": false,
                "searchable": false
            }
        ],
		buttons:[
			
			{	
				extend: 'collection',
				collectionLayout: 'sec-checklist',
				text: 'Checklist',
				buttons:[
					{
					text: 'Underwriting Supporting Documents',
					action: function ( e, dt, node, config ) {
                    $(".checklist-btn")[0].click();}
					},
					{
					text: 'Credit Card Processing Switch',
					action: function ( e, dt, node, config ) {
                    $(".checklist-btn")[1].click();}
					},
					{
					text: 'Funding Tasks',
					action: function ( e, dt, node, config ) {
                    $(".checklist-btn")[2].click();}
					},
					{
					text: 'Other Tasks',
					action: function ( e, dt, node, config ) {
                    $(".checklist-btn")[3].click();}
					},
				]
			},
			
			{
				extend:'colvis',
				text: 'select colums',
				collectionLayout: 'fixed three-column ',
				columns: [colVisArr]
			},
			{
				text: 'Export',
                action: function ( e, dt, node, config ) {
                   window.location = "../cashadvance.php?"+url+"&format=export";
				   // window.location ('../cashadvance.php?cmd=cashadv_list&owner_uid=110&lender_uid=&FundingType=&status=&date1=&date2=&cmd=repcolumns&format=export');
                }
			},
			{
				extend:'colvis',
				className: 'checklist-btn',
				text: 'Underwriting Supporting Documents',
				collectionLayout: 'fixed two-column',
				columns: [checklistColVisArr1]
			},
			{
				extend:'colvis',
				className: 'checklist-btn',
				text: 'Credit Card Processing Switch',
				collectionLayout: 'fixed two-column',
				columns: [checklistColVisArr2]
			},
			{
				extend:'colvis',
				text: 'Funding Tasks',
				className: 'checklist-btn',
				collectionLayout: 'fixed three-column',
				columns: [checklistColVisArr3]
			},
			{
				extend:'colvis',
				text: 'Other Tasks',
				className: 'checklist-btn',
				collectionLayout: 'fixed three-column',
				columns: [checklistColVisArr4]
			}
			
			
			
        ]
	});

} );

<?php 
        echo '</script';
        ?>
>

<table id="example" class="display" cellspacing="0" width="100%">
       <thead>
			<tr>
				<th> Receive Date </th>
                <th> Approval Date </th>
                <th>Funding Date</th>
                <th>First ACH Withdrawal</th>
                <th>Lead Source</th>
                <th>Status</th>
				<th>Sales Rep</th>
                <th>Lender</th>
				<th>Contract #</th>
                <th>DBA Name</th>
				<th>Address</th>
                <th>City</th>
                <th>State</th>
				<th>Zip Code</th>
                <th>Owner Name 1</th>
				<th>Owner Phone 1</th>
				<th>Owner Address 1</th>
				<th>Owner City 1</th>
				<th>Owner Name 2</th>
				<th>Owner Phone 2</th>
				<th>Owner Address 2</th>
				<th>Owner City 2</th>
                <th>Phone</th>
				<th>Fax</th>
				<th>Email</th>
                <th>Funding Amt Requested</th>
                <th>Payback Amount</th>
				<th>Factor Rate</th>
				<th># ACH Payments</th>
				<th>Bank Name</th>
				<th>Bank Account #</th>
				<th>Routing #</th>
				<th>Commission</th>
				<th>Daily Residual %</th>
				<th>Business Start Date</th>
				<th>Total Monthly Bank Deposits $</th>
				<th>Avg Daily Bank Balance $</th>
				<th>Monthly Avg Credit Card Vol $</th>
				<th>Monthly Avg Credit Card Trans #</th>
				<th>Federal Tax ID #</th>
				<th>Social Security #</th>
				<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['checklist']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
				<th><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['title'];
            ?>
</th>
				<?php 
        }
        ?>
			
				</tr>
        </thead>
        <tfoot>
            <tr>
				<th>Receive Date</th>
                <th>Approval Date</th>
                <th>Funding Date</th>
                <th>First ACH Withdrawal</th>
                <th>Lead Source</th>
                <th>Status</th>
				<th>Sales Rep</th>
                <th>Lender</th>
				<th>Contract #</th>
                <th>DBA Name</th>
				<th>Address</th>
                <th>City</th>
                <th>State</th>
				<th>Zip Code</th>
                <th>Owner Name 1</th>
				<th>Owner Phone 1</th>
				<th>Owner Address 1</th>
				<th>Owner City 1</th>
				<th>Owner Name 2</th>
				<th>Owner Phone 2</th>
				<th>Owner Address 2</th>
				<th>Owner City 2</th>
                <th>Phone</th>
				<th>Fax</th>
				<th>Email</th>
                <th>Funding Amt Requested</th>
                <th>Payback Amount</th>
				<th>Factor Rate</th>
				<th># ACH Payments</th>
				<th>Bank Name</th>
				<th>Bank Account #</th>
				<th>Routing #</th>
				<th>Commission</th>
				<th>Daily Residual %</th>
				<th>Business Start Date</th>
				<th>Total Monthly Bank Deposits $</th>
				<th>Avg Daily Bank Balance $</th>
				<th>Monthly Avg Credit Card Vol $</th>
				<th>Monthly Avg Credit Card Trans #</th>
				<th>Federal Tax ID #</th>
				<th>Social Security #</th>
				<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['checklist']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
				<th><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['title'];
            ?>
</th>
				<?php 
        }
        ?>
			

			</tr>
        </tfoot>
        	<tbody>
		<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['list']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
			<tr>
				<td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['Receive Date'], '%b %d, %Y');
            ?>
</td>
                <td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['Approval Date'], '%b %d, %Y');
            ?>
</td>
                <td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['Funding Date'], '%b %d, %Y');
            ?>
</td>
				<td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['First ACH Withdrawal'], '%b %d, %Y');
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['LeadSource'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Status'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Sales Rep'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Lender'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['cashadv_idStr'];
            ?>
</td><!--cashadv_idStr; title:contract-->
                <td><a href="/cashadvance.php?cmd=cashadv_edit&app_id=<?php 
            echo $_smarty_tpl->tpl_vars['item']->value['app_id'];
            ?>
&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['item']->value['cashadv_idStr'];
            ?>
&tab=dba"><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['DBA Name'];
            ?>
</a></td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Address'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['City'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['State'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Zip Code'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Name 1'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Phone 1'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Address 1'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner City 1'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Name 2'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Phone 2'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner Address 2'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Owner City 2'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Phone'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Fax'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Email'];
            ?>
</td>
                <td>$<?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Funding Amount'], 2);
            ?>
</td>
                <td>$<?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Payback Amount'], 2);
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Factor Rate'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['# ACH Payments'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Bank Name'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Bank Account #'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Routing #'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Commission'];
            ?>
</td>
				<td><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Daily Residual %'], 2);
            ?>
%</td>
                <td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['Business Start Date'], '%b %d, %Y');
            ?>
</td>
                <td>$<?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Total Monthly Bank Deposits '], 2);
            ?>
</td>
				<td>$<?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Avg Daily Bank Balance $'], 2);
            ?>
</td>
                <td>$<?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['item']->value['Monthly Avg Credit Card Vol $'], 2);
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['Monthly Avg Credit Card Trans #'];
            ?>
</td>
                <!--<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['MonthlyGrossSales'];
            ?>
</td>
                <td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['OkToEmail'];
            ?>
</td>-->
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['TaxID'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['OwnerSSN'];
            ?>
</td>
				<?php 
            $_smarty_tpl->tpl_vars['checkListItem'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['checkListItem']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['checklist']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['checkListItem']->key => $_smarty_tpl->tpl_vars['checkListItem']->value) {
                $_smarty_tpl->tpl_vars['checkListItem']->_loop = true;
                ?>
				<td><?php 
                echo $_smarty_tpl->tpl_vars['item']->value[$_smarty_tpl->tpl_vars['checkListItem']->value['name']];
                ?>
</td>
				<?php 
            }
            ?>
			</tr>
		<?php 
        }
        ?>
 
		</tbody>	
				
          
         </table>
	<?php 
    }
    function content_5778b6e5db1a50_97898098($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_block_mybox')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/block.mybox.php';
        }
        if (!is_callable('smarty_modifier_cut')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.cut.php';
        }
        if (!is_callable('smarty_modifier_money')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.money.php';
        }
        if (!is_callable('smarty_function_html_options')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.html_options.php';
        }
        if (!is_callable('smarty_modifier_num')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.num.php';
        }
        if (!is_callable('smarty_function_my_call')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.my_call.php';
        }
        ?>
<style>
	.statBlock em { 
		color:blue;
	}
	.statBlock a {
		font-weight:bold;
	}
</style>

<!--add tehila -->
<?php 
        echo smarty_function_js_include(array('src' => '/js/form_validator.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/css/jquery.fileupload-ui.css'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/vendor/jquery.ui.widget.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/jquery.iframe-transport.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/jquery.fileupload.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/upload.css'), $_smarty_tpl);
        ?>

<!--end tehila -->

<?php 
        echo smarty_function_js_include(array('src' => '/js/lead.js'), $_smarty_tpl);
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate('calendar.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>



<?php 
        echo smarty_function_js_include(array('src' => '/js/form_validator.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_data(array('approveValidationErr' => $_smarty_tpl->tpl_vars['approveValidationErr']->value, 'tab' => $_smarty_tpl->tpl_vars['tab']->value, 'jsFundingProduct' => $_smarty_tpl->tpl_vars['FundingProduct']->value, 'totalPerc' => $_smarty_tpl->tpl_vars['totalPerc']->value, 'cntLenders' => $_smarty_tpl->tpl_vars['cntLenders']->value, 'BusinessEmail' => $_smarty_tpl->tpl_vars['BusinessEmail']->value, 'cashadv_id' => $_smarty_tpl->tpl_vars['cashadv_id']->value, 'cntMissingDocs' => $_smarty_tpl->tpl_vars['cntMissingDocs']->value, 'permittedSA' => $_smarty_tpl->tpl_vars['permittedSA']->value), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/statusColorBox.css'), $_smarty_tpl);
        ?>



<style>
.notesTable .v1{color:#3282e6}
</style>



<style>
.inpMinimal{background:#DDFFFF}
input.decFld{width:95%}

.HLred{color:red;}
.HLgreen{color:green;}

.financialBanksTable .tdListHeaders{font-size:8pt;}
.financialBanksTable input[type="text"] {text-align:right;width:100%}

.graySummary{
	background-color:#ccc;
	padding:4px;
	margin:8px 0px;
	font-size:12px;
}

</style>
<?php 
        echo '<script';
        ?>
 language="javascript">
//add tehila
var Attachments=[];
$(function () {
	$('#fileupload').fileupload({
        dataType: 'json',
        start: function (e) {
			$('#progress').show();
        },
        stop: function (e) {
			//alert('TEST - it will refresh page to save uploaded files');
			//$('#progress').hide();
			document.form1.jAttachments.value=JSON.stringify(Attachments);
			document.form1.submit();
        },
        done: function (e, data) {
			var origname=data.files[0].name;		
			var size=data.result.files[0].size;
			var file=data.result.files[0].name;
			Attachments.push({name:origname,size:size,file:file});
			showAttachments();
        },
        progressall: function (e, data) {
               var progress = parseInt(data.loaded / data.total * 100, 10);
               $('#progress .bar').css(
                   'width',
                   progress + '%'
               );
        },
    });
	

});

function showAttachments(){
//	alert(print_r(Attachments));
	var ss='';
	for(i in Attachments){
			var v=Attachments[i];
			var title=v.name;
			ss=ss+(ss?'<br>':'')+title
	}
	$('#uploadFilesList').html(ss);
}

//end tehila*/

function emailACHBalanceClick(){
	if(BusinessEmail){
		//alert('Open PDF');
		myRedirect('/pdf/index.php?doc=MCADailyACHPayment&cashadv_id='+cashadv_id);
	}else{
		alert('This report cannot be emailed to the merchant because the email is missing on the DBA page.');
	}
}

function emailACHCCClick(){
	if(BusinessEmail){
		//alert('Open PDF');
		myRedirect('/pdf/index.php?doc=MCACreditCardBatchPayment&cashadv_id='+cashadv_id);
	}else{
		alert('This report cannot be emailed to the merchant because the email is missing on the DBA page.');
	}
}

var savedStatusCL=getCtrlValue('Status'); // add tehila
function myInit(){
	
	var e=el('OfficeCommPerc'); if(e) e.disabled=true;
	var blueitems=['AmountRequested','FactorRate',/*'OfficeCommPerc',*/'RepCommPerc','monthDeposit1','monthDeposit2','monthDeposit3','monthDeposit4','monthDeposit5','monthDeposit6','monthDeposit7','monthDeposit8','monthDeposit9','monthDeposit10','monthDeposit11','monthDeposit12','ManagementFeePerc','DailyResidualPerc','DeductCommissionsFrom','WithdrawalAmt'];
	var grayitems=['TotalPayback','TotalProfit','OfficeComm','RepComm','TotalCorpProfit','MonthlyBankDeposits', 'achPaybackMonths'];
	var i, o;
	for(i=0;i<blueitems.length;i++){
		o=el(blueitems[i]);
		if(!o) continue;
		o.className= o.className+' inpField';
		o.onchange=myOnChangeInputField;
		//alert(o.className);
	}
	for(i=0;i<grayitems.length;i++){
		o=el(grayitems[i]);
		if(!o) continue;
		o.className= o.className+' calcField';
		o.readOnly=true;
		//alert(o.className);
	}
	
	o=el('FundingProduct');
	if(o) o.onchange=function(){document.form1.submit()};
	myOnChangeInputField();
	
	
	var credMinItems=['cred1BorName','cred1BorLastName','cred1BorSSN','cred1CurAddress','cred1CurCity','cred1CurState','cred1CurZip','cred1BorSSN'];
	for(i=0;i<credMinItems.length;i++){
		o=el(credMinItems[i]);
		if(!o) continue;
		o.className= o.className+' inpMinimal';
	}
	

	o=el('Status');
	
	var savedStatus=getCtrlValue('Status');
	if(o){
		o.onchange=function(event){
			var err='';
			var errCL='';
			var s=getCtrlValue('Status');
			if(s=='Participation'||s=='Approved'||s=='Lender Debit'||s=='Merchant Credit'||s=='Agent Credit'
			||s=='Merchant Daily Debit'||s=='Lender Daily Credit'||s=='Completed'||s=='NSF Reject'){
				err='The CRM system will automatically change status of contract to Participation, Approved, and any of the ACH Billing status levels only after you add lenders to contract, add approval date, and add first daily ACH withdrawal date to the contract.';
			}
			
			if(savedStatus=='Lender Debit'||savedStatus=='Merchant Credit'||savedStatus=='Agent Credit'
			||savedStatus=='Merchant Daily Debit'||savedStatus=='Lender Daily Credit'||savedStatus=='Completed'||savedStatus=='NSF Reject'){
				err='You cannot change the status when this contract is active in the ACH Billing system';
			}
			 
			 //add tehila
			if(getCtrlValue('Status')=='Approved'&& !getCtrlValue('checkListDone')){
				errCL='The checkList is not complete!';
				}
				//end tehila
				
				
			if(err /*add tehila*/|| errCL/*end tehila*/){
				if (err) alert(err);
				/*add tehila*/
				if (errCL) alert (errCL);
				/*end tehila*/
				if(permittedSA && confirm('Allow Sysadmin user to change status manually?')){
				}else{
					setCtrlValue('Status',savedStatus);	
				}
			}
			
			myStatusChange2();			
		};
		myStatusChange2();
		//o.onchange();
	}


	o=el('InceptionDate');
	if(o) o.onchange=function(event){
		if(jsFundingProduct=='Fixed Daily ACH' || jsFundingProduct=='CCFixed'){
			var InceptionDate=getCtrlValue('InceptionDate');
	
			var s='';
			for(var i in approveValidationErr){
				s=s+ (s?', ':'')+ approveValidationErr[i];
			}

			if(InceptionDate && s){
				setCtrlValue('InceptionDate','');	
				alert('You cannot add an approval date until the following fields are completed:\n\n'+s);
			}
		}
		
		if(o.value && strToMoney(totalPerc)!=100.0){
			setCtrlValue('InceptionDate','');	
			alert('You cannot add Approval Date or First Withdrawal Date until you have added Syndicate Lender(s) to fund 100% of this contract.');
		}
		
	};


	o=el('achFirstWithdrawalDate');
	if(o) o.onchange=function(event){
			if(o.value && strToMoney(totalPerc)!=100.0){
				o.value='';
				el('f_achFirstWithdrawalDate_1').value='';
				alert('You cannot set-up the first ACH payment until you have added Syndicate Lender(s) to fund 100% of this contract.');
			}
			
			
	};



	
}


function myStatusChange2(){
			if(getCtrlValue('Status')=='Declined'){
					el('DeclineReason').disabled=false;
					el('DealLostReason').disabled=false;
			}else{
					el('DeclineReason').disabled=true;
					el('DealLostReason').disabled=true;
			}
			//tehila for task: substatus
			if(getCtrlValue('Status')=='Pre-Approved'){
					el('PreApprovedSubStatus').disabled=false;
			}else{
					el('PreApprovedSubStatus').disabled=true;
			}
			if(getCtrlValue('Status')=='Merchant Daily Debit'){
					el('PreDailyDebitSubStatus').disabled=false;
			}else{
					el('PreDailyDebitSubStatus').disabled=true;
			}
			if(getCtrlValue('Status')=='Contract IN'){
					el('PreContractINSubStatus').disabled=false;
			}else{
					el('PreContractINSubStatus').disabled=true;
			}
			if(getCtrlValue('Status')=='Underwriting'){
					el('PreUnderwritingSubStatus').disabled=false;
			}else{
					el('PreUnderwritingSubStatus').disabled=true;
			}
			//end
}

function myOnChangeInputField(){
	
	if(el('AmountRequested')){
		var AmountRequested= strToMoney(getCtrlValue('AmountRequested'));
	
		var TotalPayback = AmountRequested * strToMoney(getCtrlValue('FactorRate'));
		var TotalProfit  = TotalPayback - AmountRequested;
		if(getCtrlValue('DeductCommissionsFrom')=='FUNDING'){
			var OfficeComm = AmountRequested * strToMoney(getCtrlValue('OfficeCommPerc'))/100.0 ;
			var RepComm = AmountRequested * strToMoney(getCtrlValue('RepCommPerc'))/100.0 ;
		}else{
			var OfficeComm = TotalPayback * strToMoney(getCtrlValue('OfficeCommPerc'))/100.0 ;
			var RepComm = TotalPayback * strToMoney(getCtrlValue('RepCommPerc'))/100.0 ;
		}
		var TotalCorpProfit = TotalProfit - OfficeComm - RepComm;
		
		var aSum=0; var aCnt=0; var i; var a;
		for(i=1;i<=12;i++){
			a=strToMoney(getCtrlValue('monthDeposit'+i));
			if(a!=0){aSum+=a;aCnt++};
		}
		var MonthlyBankDeposits=aCnt? aSum/aCnt : 0;
		
		setCtrlValue('AmountRequested',formatCurrency(AmountRequested,''));
		setCtrlValue('TotalPayback',formatCurrency(TotalPayback,''));
		setCtrlValue('TotalProfit',formatCurrency(TotalProfit,''));
		setCtrlValue('OfficeComm',formatCurrency(OfficeComm,''));
		setCtrlValue('RepComm',formatCurrency(RepComm,''));
		setCtrlValue('TotalCorpProfit',formatCurrency(TotalCorpProfit,''));
		setCtrlValue('MonthlyBankDeposits',formatCurrency(MonthlyBankDeposits,''));
		
		if(getCtrlValue('FundingProduct')=='MCA'){
		}
		
		if(getCtrlValue('FundingProduct')=='Fixed Daily ACH' || getCtrlValue('FundingProduct')=='CCFixed'){
			var days= sDiv(TotalPayback,  strToMoney(getCtrlValue('WithdrawalAmt')));
			var days1=Math.ceil(days);
//			var days1=parseInt(getCtrlValue('achPaybackMonths'));
//			var WithdrawalAmt=sDiv(TotalPayback,  days1);
						
			var DailyResidualPerc=strToMoney(getCtrlValue('DailyResidualPerc'));
			var DailyResidualPercAmt=TotalPayback * DailyResidualPerc / 100;
			var DailyResidualPercAmtDaily= sDiv(DailyResidualPercAmt, days1);
			var ManagementFeePerc=strToMoney(getCtrlValue('ManagementFeePerc'));
			var ManagementFeePercAmt=TotalPayback * ManagementFeePerc / 100;
			var ManagementFeePercAmtDaily= sDiv(ManagementFeePercAmt , days1);
			
			
			
			//out
			setCtrlValue('achPaybackMonths',days1);
			//setCtrlValue('WithdrawalAmt',formatCurrency(WithdrawalAmt,'$'));
			el('spDailyRes').innerHTML= formatCurrency(DailyResidualPercAmt,'$') + ' / ' + formatCurrency(DailyResidualPercAmtDaily,'$') +' ('+days1+')' ; 
			el('spManFee').innerHTML= formatCurrency(ManagementFeePercAmt,'$') + ' / ' + formatCurrency(ManagementFeePercAmtDaily,'$') +' ('+days1+')' ;
		}
	}	
	
}

function myFormSubmit(f){
//	if(el('InceptionDate') && getCtrlValue('InceptionDate') && cntMissingDocs>0){
//		alert('You cannot add approval date for this merchant because '+cntMissingDocs+' required documentations are missing.');
//		return false;
//	}

	if(!el('DeclineReason').disabled && !getCtrlValue('DeclineReason')){
		alert('Underwriting Decline Reason Is Required');
		return false;
	}

	/*add tehila
	var err='';
	if(getCtrlValue('Status')=='Approved'&& !getCtrlValue('checkListDone')){
		err='The checkList is not complete!';
		}
	if (err){
	alert(err);
	if(permittedSA && confirm('Allow Sysadmin user to change status manually?'))
	{}
	else{
		setCtrlValue('Status',savedStatusCL);
		return false;	
		}
	}
	//end tehila*/
	myXXX_SaveBeep();
	return true;
}


function AddSyndClick(){
	var obj=el('newSynd[perc]');
	var val=obj.value*1;
//	alert(obj.value+','+syndTotalperc*1);
	if(val + syndTotalperc*1>100.0){
		alert('The funding '+val*1+'% you entered has exceeded the amount needed to fund this account.  Please select correct funding % ');
		obj.focus();
		return false;
	}		
	return true;
}


function checklistModified(name){
	//alert(name);
	setCtrlValue('checklist['+name+'][isModified]','1');
}


function mySendClick(cashadv_id,creditOptionsValid){
		if(creditOptionsValid){
	  		if(myCreditValidate() && confirm('Are you sure to send request?')){
				  document.form1.subcmd.value='postCredit';
				  myXXX_SaveBeep();
				  document.form1.submit();
				 //myRedirect('/creditreport.php?cmd=post&cashadv_id='+cashadv_id);
			}				 
		}else{
			alert('You do not have an account setup and activated with ACRAnet credit reporting company.  Please contact ACRAnet.com to setup a new account and add your new account info in the CRM\'s administrative setup/configuration section.');
		}

}

function myCreditValidate(){
	if(!getCtrlValue('cred1BorName')){alert('Borrower Name is Required'); return false;}
	if(!getCtrlValue('cred1BorLastName')){alert('Borrower Last Name is Required'); return false;}
	if(!getCtrlValue('cred1BorSSN')){alert('Borrower SSN is Required'); return false;}
	e=checkSSN(getCtrlValue('cred1BorSSN'),true);
	if (e){alert('Borrower SSN is Invalid'); return false;}
		
	return true;
}


function checkAllLenders(cb){
		var e=document.getElementsByName('selLender[]');
		for(i=0;i<e.length;i++) e[i].checked=cb.checked;;
}

var decTrackChange=false;
function decOnChange(trackChange){
		var decAmountRequested = strToMoney(getCtrlValue('decAmountRequested'));
		var decFactorRate = strToMoney(getCtrlValue('decFactorRate'));
		var decACHDays= strToMoney(getCtrlValue('decACHDays'));
		var decPaybackAmt=decAmountRequested*decFactorRate;
		var decDailyACH=sDiv(decPaybackAmt,decACHDays);
		setCtrlValue('decPaybackAmt',formatCurrency(decPaybackAmt,''));
		setCtrlValue('decDailyACH',formatCurrency(decDailyACH,''));
	
		
		var readonly=getCtrlValue('decSelection')=='2'?false:true;
		var fields=['decAmountRequested','decFactorRate','decACHDays'];
		for(var i in fields){
			if(o=el(fields[i])){
				o.readOnly=readonly;
				myRemoveClass(o,readonly?'inpField':'calcField');
				myAddClass(o,readonly?'calcField':'inpField');
			}
		}
		
		switch(getCtrlValue('decSelection')){
			case '1':
				el('trDecNotes').style.display='none';
				break;
			case '2':
				el('trDecNotes').style.display='';
				el('divDecNotesTitle1').style.display='';
				el('divDecNotesTitle2').style.display='none';
				break;
			case '3':
				el('trDecNotes').style.display='';
				el('divDecNotesTitle1').style.display='none';
				el('divDecNotesTitle2').style.display='';
				break;
		}
		

		if(trackChange) decTrackChange=true;	
}


function decSubmitResponse(){
	if(getCtrlValue('decSelection')=='2' && decTrackChange==false){
		alert('You must first make a change to the funding amount, factor rate, and/or # days of ACH withdrawal fields first before you can submit your response.');
		return;
	}
	
  myXXX_SaveBeep();
  document.form1.submit();
}



function selLenderClick(obj){
	//var a=getCtrlValue('selLender['+uid+']');
	//alert(obj.value+','+obj.checked);
	var uid=obj.value;
	el('trSelLender_'+uid).style.display=obj.checked?'':'none';
}



<?php 
        echo '</script';
        ?>
>
<style>
SPAN.spMCALoan{font-size:12pt;font-weight:bold;color:#3366cc;}
</style>




<form name="form1" method="post" enctype="multipart/form-data" onsubmit="return myFormSubmit(this)">
    <input type=hidden name="cashadv_id" value="<?php 
        echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
        ?>
">
    <input type=hidden name="app_id" value="<?php 
        echo $_smarty_tpl->tpl_vars['app_id']->value;
        ?>
">
    <input type=hidden name="tab" value="<?php 
        echo $_smarty_tpl->tpl_vars['tab']->value;
        ?>
">
    <input type=hidden name="cmd" value="cashadv_submit">
    <input type=hidden name="subcmd" value="">
	<!--add tehila-->
	<input type=hidden name="checkListDone" value="<?php 
        echo $_smarty_tpl->tpl_vars['checkListDone']->value;
        ?>
">
	<input type="hidden" name="jAttachments" />
	<!--end tehila-->

<?php 
        echo $_smarty_tpl->getSubTemplate('status/cashadv_header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => 'MCA Application Summary'), 0);
        ?>




<div class="mySortable mca_dba">


<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "mca_dbasummarystat", 'title' => "Summary", 'class' => "box-one"));
        $_block_repeat = true;
        echo smarty_block_mybox(array('node' => "mca_dbasummarystat", 'title' => "Summary", 'class' => "box-one"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<div class="statBlock">

<div class="graySummary">Approved Funding $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['Lenders']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['Lenders'], 430);
                ?>
</em><?php 
            }
            ?>

<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['ApprovedFunding']);
            ?>
</a></div></div>

<div class="graySummary">Payback Amount $ <div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['PaybackAmount']);
            ?>
</a></div></div>

<div class="graySummary">Total Paid Back $ <div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['TotalPaidBack']);
            ?>
</a></div></div>

<div class="graySummary">PaidBack Balance Due$ <div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['PaybackBalance']);
            ?>
</a></div></div>

<div class="graySummary">Fixed Daily ACH Amount $ <div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['FixedDailyACH']);
            ?>
</a></div></div>

<div class="graySummary">User Commissions $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['Users']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['Users'], 430);
                ?>
</em><?php 
            }
            ?>
<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['UserCommissions']);
            ?>
</a></div></div>

<div class="graySummary">Additional User Commissions $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['UsersA']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['UsersA'], 430);
                ?>
</em><?php 
            }
            ?>
<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['AdditionalUserCommissions']);
            ?>
</a></div></div>

<div class="graySummary">Merchant Administrative & Underwriting Fees <div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=funding"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['MerchAdmFees']);
            ?>
</a></div></div>

<div class="graySummary">Lender One-Time Mgmt Fees $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['Lenders1']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['Lenders1'], 430);
                ?>
</em><?php 
            }
            ?>
<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=synd"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['LendOneTimeFee']);
            ?>
</a></div></div>

<div class="graySummary">Lender Daily Mgmt Fees $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['Lenders2']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['Lenders2'], 430);
                ?>
</em><?php 
            }
            ?>
<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=synd"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['LendDailyFee']);
            ?>
</a></div></div>

<div class="graySummary">Lender One-Time Admin Fees $ <?php 
            if ($_smarty_tpl->tpl_vars['stat']->value['Lenders3']) {
                ?>
<em><?php 
                echo smarty_modifier_cut($_smarty_tpl->tpl_vars['stat']->value['Lenders3'], 430);
                ?>
</em><?php 
            }
            ?>
<div class="toright"><a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
            echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
            ?>
&tab=synd"><?php 
            echo smarty_modifier_money($_smarty_tpl->tpl_vars['stat']->value['LendAdmFee']);
            ?>
</a></div></div>
</div>
<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_mybox(array('node' => "mca_dbasummarystat", 'title' => "Summary", 'class' => "box-one"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


   <!--add tehila -add note-->
<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "mcanotes_add", 'title' => "Add a Note", 'class' => "box-one box-blue"));
        $_block_repeat = true;
        echo smarty_block_mybox(array('node' => "mcanotes_add", 'title' => "Add a Note", 'class' => "box-one box-blue"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<table width="100%" >       
        <input type="hidden" name="cmd2" value="submit_note" />
        <input type="hidden" name="contact_id" value="<?php 
            echo $_smarty_tpl->tpl_vars['contact_id']->value;
            ?>
" />

<?php 
            if (permitted('ADMIN-RIGHTS')) {
                ?>
       <tr >
          <td align="center" class="tdValueColumn">
          
          <select name="note_vis">
          <?php 
                echo smarty_function_html_options(array('options' => $_smarty_tpl->tpl_vars['selVis']->value), $_smarty_tpl);
                ?>

          </select>
          
          </td>
        </tr>
<?php 
            }
            ?>
        
        
        <tr >
          <td align="center" class="tdValueColumn"><span class="nobr">
            <textarea name="note_text" rows="5" class="w_3_3"></textarea>
          </span></td>
        </tr>
      </table>
	<div class="footer"><input type="submit" name="btnAddNote" value="Submit Note" /></div>
<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_mybox(array('node' => "mcanotes_add", 'title' => "Add a Note", 'class' => "box-one box-blue"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<!--end tehila-->


<!--add tehila docs uplodeed-->
<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "mcadocs_docpwupl", 'title' => "Documents/Paperwork Uploaded", 'class' => "box-one box-blue"));
        $_block_repeat = true;
        echo smarty_block_mybox(array('node' => "mcadocs_docpwupl", 'title' => "Documents/Paperwork Uploaded", 'class' => "box-one box-blue"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

    <table  border="0"  cellspacing="0" cellpadding="0" width="100%">
      <tr >
        <td colspan="5" class="tdValueColumn">

		<table class="tblMultipleUpload">
            <tr><td class="c1">
            <span class="fileinput-button" style=''>
                <input type="button" value="Upload Multiple Docs" class="std"> 
                <input id="fileupload" type="file" name="files[]" data-url="/uploader/server/" multiple>
            </span>
            </td>
            <td class="c2"><div id="progress" class="progressBar"><div class="bar"></div></div></td></tr>
            <tr>
              <td colspan="2" class="c3"><div id="uploadFilesList"></div></td>
            </tr>
        </table>
            
            
            </td>
      </tr>
     
    </table>
  <div class="footer">
	  <div class="toleft">
        <?php 
            if (permitted('ADMIN-RIGHTS')) {
                ?>
		<input type="button" value="Show All Docs" class="std" onclick="myRedirect('/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
                echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                ?>
&tab=userdoc')"> 
		<?php 
            }
            ?>
  
    </div>
        <?php 
            if (permitted('ADMIN-RIGHTS')) {
                ?>
            <input  type="submit" value="Save" />
        <?php 
            }
            ?>
  
    </div>
<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_mybox(array('node' => "mcadocs_docpwupl", 'title' => "Documents/Paperwork Uploaded", 'class' => "box-one box-blue"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 




<!--end tehila-->




<?php 
        $_smarty_tpl->tpl_vars['section'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['section']->_loop = false;
        $_smarty_tpl->tpl_vars['k_sec'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['sections']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['section']->key => $_smarty_tpl->tpl_vars['section']->value) {
            $_smarty_tpl->tpl_vars['section']->_loop = true;
            $_smarty_tpl->tpl_vars['k_sec']->value = $_smarty_tpl->tpl_vars['section']->key;
            ?>
        

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "mcadba_" . (string) $_smarty_tpl->tpl_vars['section']->value['section_code'], 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => "box-one box-" . (string) $_smarty_tpl->tpl_vars['section']->value['color']));
            $_block_repeat = true;
            echo smarty_block_mybox(array('node' => "mcadba_" . (string) $_smarty_tpl->tpl_vars['section']->value['section_code'], 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => "box-one box-" . (string) $_smarty_tpl->tpl_vars['section']->value['color']), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>



<?php 
                if ($_smarty_tpl->tpl_vars['section']->value['section_code'] == 'DBA_STATUS') {
                    ?>
    
<TABLE width="100%" class="tblFields">
    <tr>
		<TD class="tdListHeaders">
		<div class="toleft">Required Docs for Underwriting: <a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
&tab=checklist"><?php 
                    echo smarty_modifier_num($_smarty_tpl->tpl_vars['checklistStat']->value['cntTotal'], 2);
                    ?>
</a> Total  |  <a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
&tab=checklist"><?php 
                    echo smarty_modifier_num($_smarty_tpl->tpl_vars['checklistStat']->value['cntReceived'], 2);
                    ?>
</a> Received | <a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
&tab=checklist"><?php 
                    echo smarty_modifier_num($_smarty_tpl->tpl_vars['checklistStat']->value['cntMissing'], 2);
                    ?>
</a> Missing</div>
		<div class="toright"><a href="javascript:;" onclick="showPopUp('/cashadvance.php?cmd=checklist_required_popup&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
',700,600);">View All Req'd Docs</a> 
        | <a href="/cashadvance.php?cmd=cashadv_edit&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
&tab=checklist">Manage</a></div>

					</TD>
	</tr>	
</TABLE>    
<?php 
                }
                ?>




	
	<?php 
                if ($_smarty_tpl->tpl_vars['section']->value['type'] == 'fields') {
                    ?>
    
	<div>
    	<?php 
                    echo $_smarty_tpl->tpl_vars['section']->value['html'];
                    ?>
		
    </div>
<?php 
                }
                ?>

 

<?php 
                if ($_smarty_tpl->tpl_vars['section']->value['type'] == 'lead') {
                    $_smarty_tpl->tpl_vars['leadsec'] = new Smarty_variable($_smarty_tpl->tpl_vars['section']->value['leadSection'], null, 0);
                    ?>
	<table width="100%">
    <TR colspan="3"  id="tr_lead_section_body_<?php 
                    echo $_smarty_tpl->tpl_vars['leadsec']->value['section_code'];
                    ?>
">
      <TD>
	  
	    <div class="boxHolder">
		<?php 
                    $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['item']->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['leadsec']->value['list'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                        $_smarty_tpl->tpl_vars['item']->_loop = true;
                        ?>
			<?php 
                        if ($_smarty_tpl->tpl_vars['item']->value['cellHTML']) {
                            ?>
				<?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['cellHTML'];
                            ?>

			<?php 
                        } else {
                            ?>
				
            	<div class="box_<?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['size'];
                            ?>
_<?php 
                            echo $_smarty_tpl->tpl_vars['leadsec']->value['numCol'];
                            ?>
">
          		<?php 
                            echo $_smarty_tpl->tpl_vars['item']->value['html'];
                            ?>

		    	</div>	
			<?php 
                        }
                        ?>
	
		<?php 
                    }
                    ?>
        
		</div>

	  </TD>
	</TR>
    </table>
<?php 
                }
                ?>


	<div class="footer">
		<?php 
                if ($_smarty_tpl->tpl_vars['section']->value['section_code'] == 'DBA_STATUS') {
                    ?>
		<div class="toleft">
      <a href="javascript:;" onclick="if(confirm('You have chosen to close out Contract # <?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_idStr']->value;
                    echo $_smarty_tpl->tpl_vars['cashadv_idModifier']->value;
                    ?>
,  with an active payback balance of $<?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['Balance']->value, 2);
                    ?>
 still outstanding.  The MCA system will create a new contract and apply the balance of $<?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['Balance']->value, 2);
                    ?>
 to this new contract.  When the Renewal Contract is ready to deposit the approved funding amount to the merchant, the outstanding balance of $<?php 
                    echo smarty_modifier_money($_smarty_tpl->tpl_vars['Balance']->value, 2);
                    ?>
 will be deducted from the funding amount to be deposited to the merchants bank account to close out the old contract.\n\nThe old contract status will remain in its current ACH billing status until the new renewal contract status has changed to \'Approved\'. When the new contract status is \'Approved\', the old contract will close with a status of \'Completed\'.\n\nAre you sure you want to proceed?')) myRedirect('/cashadvance.php?cmd=do_renew&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
')" title="Renew Contract">Renew</a>
		|


      <a href="javascript:;" onclick="if(confirm('You have chosen to duplicate Contract # <?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_idStr']->value;
                    echo $_smarty_tpl->tpl_vars['cashadv_idModifier']->value;
                    ?>
.  The MCA system will create a new contract. \n\nAre you sure you want to proceed?')) myRedirect('/cashadvance.php?cmd=do_clone&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
')">Duplicate</a>
		|


	  <a href="/cashadvance.php?cmd=manpay&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
"   >Early Payoff</a>
        </div>
        
        
	  <a href="javascript:;" onclick="emailACHBalanceClick()"  title="Email ACH Balance Report to Client" >Email ACH Report</a>
		|

	  <a href="javascript:;" onclick="emailACHCCClick()"   title="Email CC Batch Balance Report to Client">Email CC Report</a>
		|
        
        
        <?php 
                }
                ?>
  




		<?php 
                if ($_smarty_tpl->tpl_vars['section']->value['section_code'] == 'DBA_INFO') {
                    ?>
        	<a href="javascript:;" 
		onclick="showPopUp('/dymo/popup.php?type=mca&id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
',700,700)">Print Dymo Label</a>     
        |
        
        
        <?php 
                }
                ?>
        
      
      <?php 
                if ($_smarty_tpl->tpl_vars['section']->value['isEdit']) {
                    ?>
		
      	<a href="javascript:;" onclick="if(myFormSubmit(document.form1)) document.form1.submit()">Save</a>
      <?php 
                } else {
                    ?>
      	
			<a href="javascript:;" 
          onclick="document.location.href='/cashadvance.php?cmd=cashadv_edit&app_id=<?php 
                    echo $_smarty_tpl->tpl_vars['app_id']->value;
                    ?>
&cashadv_id=<?php 
                    echo $_smarty_tpl->tpl_vars['cashadv_id']->value;
                    ?>
&tab=dba&mode=edit'">Edit</a>
      <?php 
                }
                ?>
      
	</div>
<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_mybox(array('node' => "mcadba_" . (string) $_smarty_tpl->tpl_vars['section']->value['section_code'], 'title' => $_smarty_tpl->tpl_vars['section']->value['title'], 'class' => "box-one box-" . (string) $_smarty_tpl->tpl_vars['section']->value['color']), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>





<?php 
        }
        ?>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => "cashadv_dba_leadusers", 'title' => "Users Involved in this MCA Contract (from Lead to MCA Contract Boarding)", 'class' => "box-one"));
        $_block_repeat = true;
        echo smarty_block_mybox(array('node' => "cashadv_dba_leadusers", 'title' => "Users Involved in this MCA Contract (from Lead to MCA Contract Boarding)", 'class' => "box-one"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<table width="100%">
    <tr>
	<td class="tdListHeaders">User Name</td>
	<td class="tdListHeaders">User Type</td>
	<td class="tdListHeaders">Email</td>
	<td class="tdListHeaders">Phone</td>
    </tr>
  	<?php 
            $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['item']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['leadusers']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                $_smarty_tpl->tpl_vars['item']->_loop = true;
                ?>
    <tr>
	<td class="tdValueColumn"><a href="/user.php?cmd=edit_user&uid=<?php 
                echo $_smarty_tpl->tpl_vars['item']->value['uid'];
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['item']->value['name'];
                ?>
</a></td>
	<td class="tdValueColumn"><?php 
                echo $_smarty_tpl->tpl_vars['item']->value['type'];
                ?>
</td>
	<td class="tdValueColumn"><?php 
                echo $_smarty_tpl->tpl_vars['item']->value['phone'];
                ?>
 <?php 
                echo smarty_function_my_call(array('phone' => $_smarty_tpl->tpl_vars['item']->value['phone']), $_smarty_tpl);
                ?>
</td>
	<td class="tdValueColumn"><a href="mailto:<?php 
                echo $_smarty_tpl->tpl_vars['item']->value['email'];
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['item']->value['email'];
                ?>
</a></td>
    </tr>
    <?php 
            }
            ?>
  </table>
<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_mybox(array('node' => "cashadv_dba_leadusers", 'title' => "Users Involved in this MCA Contract (from Lead to MCA Contract Boarding)", 'class' => "box-one"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>




</div>
<?php 
        echo '<script';
        ?>
>mybox_sortableInit('.mySortable.mca_dba');<?php 
        echo '</script';
        ?>
>


</form>


<?php 
        echo '<script';
        ?>
 language="javascript">myInit();
<?php 
        echo '</script';
        ?>
>
<?php 
    }
    function content_5778bc577a1a79_93645878($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        echo smarty_function_js_include(array('src' => '/css/listboxes.css'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/statslots.css'), $_smarty_tpl);
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate("jqChart.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

<?php 
        echo smarty_function_js_data(array('chart1' => $_smarty_tpl->tpl_vars['chart1']->value, 'chart2' => $_smarty_tpl->tpl_vars['chart2']->value), $_smarty_tpl);
        ?>






<?php 
        echo '<script';
        ?>
 language="javascript">

function myInit(){
}

function myFormSubmit(f){
	return true;
}

function onDel(f){
	var dd=document.getElementsByName('sel[]');
	var i;
	var c=0;
	for(i=0;i<dd.length;i++) if(dd[i].checked) c=1;
	if(!c){alert('No items selected');return false;}

	return confirm('Are you sure you want to delete selected items?')
}


$(document).ready(function() {

        var background = {
            type: 'linearGradient',
            x0: 0,
            y0: 0,
            x1: 0,
            y1: 1,
            colorStops: [{offset: 0, color: '#d2e6c9'},
                {offset: 1, color: 'white'}]
        };

        $('#jqChart1').jqChart({
            title: {text: 'Merchant Cash Advance Account Status by Month'},
            border: {strokeStyle: '#6ba851'},
            background: background,
            animation: {duration: 1},
            shadows: {
                enabled: true
            },
            axes: [
                {
                    type: 'linear',
                    location: 'left',
					minimum: 0

                }
            ],
            series: [
                {
                    title: 'Approved',
                    type: 'column',
                    data: [
						[chart1[0].month, chart1[0].a], 
						[chart1[1].month, chart1[1].a], 
						[chart1[2].month, chart1[2].a], 
						[chart1[3].month, chart1[3].a], 
						[chart1[4].month, chart1[4].a], 
						[chart1[5].month, chart1[5].a], 
						[chart1[6].month, chart1[6].a], 
						[chart1[7].month, chart1[7].a], 
						[chart1[8].month, chart1[8].a], 
						[chart1[9].month, chart1[9].a], 
						[chart1[10].month, chart1[10].a], 
						[chart1[11].month, chart1[11].a]
						]
                },
                {
                    title: 'Underwriting',
                    type: 'column',
                    data: [
						[chart1[0].month, chart1[0].u], 
						[chart1[1].month, chart1[1].u], 
						[chart1[2].month, chart1[2].u], 
						[chart1[3].month, chart1[3].u], 
						[chart1[4].month, chart1[4].u], 
						[chart1[5].month, chart1[5].u], 
						[chart1[6].month, chart1[6].u], 
						[chart1[7].month, chart1[7].u], 
						[chart1[8].month, chart1[8].u], 
						[chart1[9].month, chart1[9].u], 
						[chart1[10].month, chart1[10].u], 
						[chart1[11].month, chart1[11].u]
						]
                },
                {
                    title: 'Declined',
                    type: 'column',
                    data: [
						[chart1[0].month, chart1[0].d], 
						[chart1[1].month, chart1[1].d], 
						[chart1[2].month, chart1[2].d], 
						[chart1[3].month, chart1[3].d], 
						[chart1[4].month, chart1[4].d], 
						[chart1[5].month, chart1[5].d], 
						[chart1[6].month, chart1[6].d], 
						[chart1[7].month, chart1[7].d], 
						[chart1[8].month, chart1[8].d], 
						[chart1[9].month, chart1[9].d], 
						[chart1[10].month, chart1[10].d], 
						[chart1[11].month, chart1[11].d]
						]
                }
				
				
            ]
        });
        $('#jqChart2').jqChart({
            title: {text: 'Total Approved Merchant Funding by Month'},
            border: {strokeStyle: '#6ba851'},
            background: background,
            animation: {duration: 1},
            shadows: {
                enabled: true
            },
            axes: [
                {
                    type: 'linear',
                    location: 'left',
					minimum: 0

                }
            ],
            series: [
                {
                    title: 'Funding Amount',
                    type: 'column',
                    data: [
						[chart1[0].month, chart2[0].a], 
						[chart1[1].month, chart2[1].a], 
						[chart1[2].month, chart2[2].a], 
						[chart1[3].month, chart2[3].a], 
						[chart1[4].month, chart2[4].a], 
						[chart1[5].month, chart2[5].a], 
						[chart1[6].month, chart2[6].a], 
						[chart1[7].month, chart2[7].a], 
						[chart1[8].month, chart2[8].a], 
						[chart1[9].month, chart2[9].a], 
						[chart1[10].month, chart2[10].a], 
						[chart1[11].month, chart2[11].a]
						]
                }
				
            ]
        });





});



<?php 
        echo '</script';
        ?>
>
















<div class="TitleRow">
	MCA/Funding Services 
  	  <div class="toright">
		
		
              
        <?php 
        echo $_smarty_tpl->getSubTemplate('status/mca_instr.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

      </div>	  	   
</div>



<div id="jqChart1" style=" height: 220px;margin-bottom:8px"></div>
<div id="jqChart2" style=" height: 220px;margin-bottom:8px"></div>


<TABLE ID="Table9" BORDER="0"  CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
  <TR >
  <TD>
  
  <?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['stat']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
  <div class="statSlot">
	<?php 
            if ($_smarty_tpl->tpl_vars['item']->value['title']) {
                ?>
	<div class='statBox'>
    	<div class="body body_<?php 
                echo $_smarty_tpl->tpl_vars['item']->value['color'];
                ?>
">
        <?php 
                echo $_smarty_tpl->tpl_vars['item']->value['value'];
                ?>

        </div>
        <div class="boxfooter">
        <?php 
                echo $_smarty_tpl->tpl_vars['item']->value['title'];
                ?>

        </div>
    </div>
    <?php 
            }
            ?>
  </div>
  <?php 
        }
        ?>
  
  </TD>
  </TR>
  <TR >
    <TD><div class="instructions">
    
    All statistics above will show company wide totals for ALL contracts with any of the following statuses:  Approved, Funded, 
Lender Debit, Merchant Credit, Agent Credit, Merchant Daily Debit, Lender Daily Credit, or Completed
    
    </div></TD>
  </TR>
</TABLE>
<?php 
    }