<?php
	$rn = 'finance_report_'.date('Y_m_d').'_'.SableGeneralFunctions::getClassNameFormat(SableGeneralFunctions::getFullUserName(false), '_');
?>
<form id="frmUser" name="frmUser" autocomplete="on">
    <input type="hidden" id="hddnHardwareReportFile" value=""/>
    <div class="forms">
        <div class="container">
            <div class="row forms-grid">
                <div class="col-md-12">
                    <h3 class="title"><i class="fa fa-funnel-dollar" aria-hidden="true"></i>&nbsp;Client Report</h3>
                    <p></p>
                </div>
            </div>
        	<p></p>
        
        	<!--// edtReportName -->
            <div class="row forms-grid">
                <div class="col-md-5">
                    <input name="edtReportName" type="text" id="edtReportName" placeholder="Report Name"
                    onfocus="showHint('edtReportName');" onblur="hideHint('edtReportName'); validate_edtReportName()"
                    onkeypress="handleEnter(this, event)" value="<?php echo($rn); ?>"/>	
                </div>
            </div>
            <div class="row forms-grid_">
                <div class="col-md-5">
                	<div class="fieldHint" id="hint_edtReportName">Report Name</div>
                </div>
            </div>            
        	<p></p>
        	<!-- edtReportName //-->                                            
        
        	<!--// edtStartDate + edtEndDate -->
            <div class="row forms-grid">
                <div class="col-md-5">
                    <input name="edtStartDate" type="date" id="edtStartDate" placeholder="Start Date"
                    onfocus="showHint('edtStartDate');" onblur="hideHint('edtStartDate'); validate_edtStartDate()"
                    onkeypress="handleEnter(this, event)" value="<?php echo($sd); ?>"/>	
                </div>
                <div class="col-md-5">
                    <input name="edtEndDate" type="date" id="edtEndDate" placeholder="End Date"
                    onfocus="showHint('edtEndDate');" onblur="hideHint('edtEndDate'); validate_edtEndDate()"
                    onkeypress="handleEnter(this, event)" value="<?php echo($ed); ?>" />	
                </div>            
            </div>
            <div class="row forms-grid_">
                <div class="col-md-5">
                	<div class="fieldHint" id="hint_edtStartDate">Date From</div>
                </div>                
                <div class="col-md-5">
                	<div class="fieldHint" id="hint_edtEndDate">Date Until</div>
                </div>
            </div>
        	<p></p>
        	<!-- edtStartDate + edtEndDate //--> 
			
			
			<!--// edtClientName -->
			<div class="row forms-grids">
				<div class="col-md-5 forms-grid">
					<input type="text" id="edtClientName" name="edtClientName" placeholder="SEARCH..." onKeyUp="doClientRefinement(this)" style="border-bottom: none;" autocomplete="off"/>
				</div>
				<div class="col-md-7">
					<div class="fieldHint" id="hint_edtClientName">Search by name or cell no.</div>
				</div>   
			</div>
			<!-- edtClientName //-->		
			<!--// selClientId -->
			<div class="row forms-grid">
				<div class="col-md-5 forms-grid">
					<div class="dropdown">
						<select name="selClientId" type="select" id="selClientId" onfocus="showHint('selClientId');" onblur="hideHint('selClientId');"
								onkeypress="handleEnter(this, event)" placeholder="Client" size="6" class="noArrow"  onClick="setClientName()" >
						<?php echo(SableDBFunctions::getOptions("client", "client_id", "concat(client_name, ' ', client_surname, ' [', client_cell, ']')", -1)); ?>
						</select>
					</div>
				</div>
				<div class="col-md-7">
				</div>
			</div>
			<div class="row forms-grid">
				<div class="col-md-5 forms-grid">
					<div class="fieldHint hintUnder" id="hint_selClientId">Client</div>
				</div>
				<div class="col-md-7">
					
				</div>
			</div>			
			<p></p>
			<!-- selClientId //-->
			
			
        
			<!--// selCompanyId + selPmId -->
			<div class="row forms-grid">
				<div class="col-md-5 forms-grid">
					<div class="dropdown">
						<?php
                            $params							= [];
                            $params['table_name']			= 'txn_type';
                            $params['value_field_name']		= 'txn_type_id';
                            $params['caption_field_name']	= 'txn_type_name';
                            $params['selected_value']		= 0;
                            $params['select_title']			= 'Transaction Type';
                            $params['where_clause']			= '';
                        ?>                    
						<select name="selTxnTypeId" type="select" id="selTxnTypeId" onfocus="showHint('selTxnTypeId');" onblur="hideHint('selTxnTypeId'); validate_selTxnTypeId()" onkeypress="handleEnter(this, event)" placeholder="Transaction Type">
						<?php echo(SableDBFunctions::getOptionsAdv($params)); ?>
						</select>
					</div>				
				</div>
				<div class="col-md-5 forms-grid">
					<div class="dropdown">
						<?php
                            $params							= [];
                            $params['table_name']			= 'payment_method';
                            $params['value_field_name']		= 'pm_id';
                            $params['caption_field_name']	= 'pm_name';
                            $params['selected_value']		= 0;
                            $params['select_title']			= 'Select Payment Method';
                            $params['where_clause']			= '';
                        ?>                    
						<select name="selPmId" type="select" id="selPmId" onfocus="showHint('selPmId');" onblur="hideHint('selPmId'); validate_selPmId()" onkeypress="handleEnter(this, event)" placeholder="Payment Method">
						<?php echo(SableDBFunctions::getOptionsAdv($params)); ?>
						</select>
					</div>				</div>                
			</div>
			<div class="row forms-grid_">
				<div class="col-md-5">
					<div class="fieldHint" id="hint_selTxnTypeId">Transaction Type</div>
				</div>                
				<div class="col-md-5">
					<div class="fieldHint" id="hint_selPmId">Payment Method</div>
				</div>
			</div>
			<p></p>
			<!-- selCompanyId + selPmId //-->			

        	<!--// buttons -->
            <div class="row forms-grid">
                <div class="col-md-2 forms-grid">
                	<input id="btnOk" type="button" onclick="runClientReport()" value="Run" class="submit"/>
                </div>
            </div>
            <!-- buttons //-->
        </div>
    </div>
</form>