<?php
$CI =& get_instance();
$CI->lang->load('header', $CI->session->userdata('language'));
$_c = strtolower($CI->router->fetch_class());
$_a = strtolower($CI->router->fetch_method());
    /*$CI =& get_instance();
    $CI->load->model('company/company_info_model');
    $company = $CI->company_info_model->companyById(element('compID', $this->session->userdata('logged_in')));*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />    
        <link rel="shortcut icon" href="<?php echo base_url()?>img/salihin_logo.png">
        <title><?php echo $rptTitle; ?></title>

<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/fonts/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/fonts/ionicons.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/fonts/Roboto/Roboto.css">

<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/adminlte/AdminLTE.css">
<!-- <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/common.css"/> -->
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/extension.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/hover.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/animate.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/admin/main.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/admin/dashboard.css"/>

<link rel="stylesheet" href="<?php echo base_url(); ?>dist/js/jquery/jquery-ui.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/vendors/validationengine/validationEngine.css">

<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-2.1.1.min.js"></script>
<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-easing.js"></script>
<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-ui.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/touch-punch/jquery.ui.touch-punch.min.js"></script>
<script src="<?php echo base_url(); ?>dist/js/modernizr-2.6.2.min.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/debounce/debounce.js"></script>
         
        <style>
            .thPrint tr{
                height: 41px;
                border-style: solid;
                border-color: #CCCCCC #fff;
            }
            
             .tr_amnt{
                 margin-top: 10px;
                 height: 41px;
				 border: 1px solid;
                /*border-style: solid;*/
                border-color: #000000 #fff #fff #fff;
                
            }
            
             .value{
                border-color: #CCCCCC;
                border-style: solid;
                margin-top: 10px;
                padding: 5px;
             }
             
               .amount_td{
		            font-size: 20px;
		            font-weight: 500;
		            margin-top: 10px;
		        }
	
            
            .table thead th{
                  vertical-align: middle;
            }

			@media print {     .no-print, 	.no-print *, #scrollUp {         display: none !important;     } }
            @media print {
                .td-print,.td-print*{display:none !important;}
				.printTbl hr{
					margin:0 !important;
				}
				.thPrint th{
					/*background:url(<?php echo base_url() ?>img/rptPaymentAdvice.png) !important;*/
                	/*-webkit-print-color-adjust: exact;*/
					
				}
                /*body{overflow:visible !important;}*/
                @page{ 
                    size: auto;   /* auto is the initial value */ 

                    /* this affects the margin in the printer settings */ 
                    margin: 10px 10px 10px 10px;  
                } 

                /*table { page-break-after:always; }
                p     { page-break-inside:avoid; page-break-after:avoid; }
                tr    { page-break-inside:avoid; page-break-after:auto; }
                td    { page-break-inside:avoid; page-break-after:auto }
                thead { display:inline; }
                tfoot { display:inline; }*/
                .compLogo{
                    width: 150px;
                }

            }

            .table th,.table td{
                line-height:10px;
            }
            .table1 td{
                border:2px solid #CCCCCC ; 
                padding:5px;
                
            }
            .paid_paid{
                font-weight:700;
                font-size:46px;
                
            }
            .paid_date{
                font-size: 20px;
                font-weight: 700;
                letter-spacing: 2px;
                margin-top: -20px;
            }
            .div_paid{
                -webkit-transform: rotate(312deg);
                -moz-transform: rotate(312deg);
                -o-transform: rotate(312deg);
            }
            
            
            
            
            .btn-icon{
		background-color:#5ebe3a;		
		border: 2px solid #5ebe3a;	
		color: #fff !important;
		display:inline-block;
		*display:inline;*zoom:1;
		padding: 4px;
		margin-bottom:0;
		font-size:11px;
		line-height:20px;
		text-align:center;
		vertical-align:middle;
		cursor:pointer;			
		opacity: .9; 
		filter: alpha(opacity=90); 	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;
		
	}
	.btn-icon:hover,.btn-icon:focus,.btn-icon:active,.btn-icon.active,.btn-icon.disabled,.btn-icon[disabled]{color: #5ebe3a !important; background-color: transparent !important; }
	.btn-icon:active,.btn-icon.active{background-color: transparent !important;}
	.btn-icon:first-child{*margin-left:0;}
	.btn-icon:hover,.btn-icon:focus{
		color: #5ebe3a !important;
		text-decoration:none;
		background-position:0 -15px;
		-webkit-transition:background-position 0.1s linear;
		-moz-transition:background-position 0.1s linear;
		-o-transition:background-position 0.1s linear;
		transition:background-position 0.1s linear;
	}
	
	/** button form		 **/
	
	.btn-form, .ui-dialog-buttonset button{
		background:#5ebe3a;		
		border: 2px solid #5ebe3a;	
		color: #fff !important;
		display:inline-block;
		*display:inline;*zoom:1;
		padding:4px 6px;
		margin: 0px 0 0 2px;
		font-size:11px;
		line-height:20px;
		text-align:center;
		vertical-align:middle;
		cursor:pointer;		
		opacity: .9; 
		filter: alpha(opacity=90); 		
		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;
		
	}
	.btn-form:hover,.btn-form:focus,.btn-form:active,.btn-form.active,.btn-form.disabled,.btn-form[disabled]{color: #5ebe3a !important; background-color: transparent !important; }
	.btn-form:active,.btn-form.active{background-color: transparent !important;}
	.btn-form:first-child{*margin-left:0;}
	.btn-form:hover,.btn-form:focus,
	.ui-dialog-buttonset button:hover,
    .ui-dialog-buttonset button:active,
	.ui-dialog-buttonset button:focus	{
		color: #5ebe3a !important;
		text-decoration:none;
		background-position:0 -15px;
		-webkit-transition:background-position 0.1s linear;
		-moz-transition:background-position 0.1s linear;
		-o-transition:background-position 0.1s linear;
		transition:background-position 0.1s linear;
	}	
	
	/** button primary		 **/
	
	.btn-primary-form.active,.btn-warning-form.active,.btn-danger-form.active,.btn-success-form.active,.btn-info-form.active,.btn-inverse-form.active{color:rgba(255, 255, 255, 0.75);}
	.btn-primary-form{
		background-color:#5ebe3a;
		border: 2px solid #5ebe3a;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;				
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;		
	}
	.btn-primary-form:hover,.btn-primary-form:focus,.btn-primary-form:active,.btn-primary-form.active,.btn-primary-form.disabled,.btn-primary-form[disabled]{
		background-color: transparent !important; 
		color: #5ebe3a !important; 
		text-decoration: none;
		text-align: center;		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button warning		 **/
	
	.btn-warning-form{
		background:#faa732;
		border: 2px solid #faa732;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;		
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
		
	.btn-warning-form:hover,.btn-warning-form:focus,.btn-warning-form:active,.btn-warning-form.active,.btn-warning-form.disabled,.btn-warning-form[disabled]{
		background-color: transparent !important; 
		color: #faa732 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button danger		 **/
	
	.btn-danger-form{
		background:#da4f49;
		border: 2px solid #da4f49;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
	.btn-danger-form:hover,.btn-danger-form:focus,.btn-danger-form:active,.btn-danger-form.active,.btn-danger-form.disabled,.btn-danger-form[disabled]{
		background-color: transparent !important; 
		color: #da4f49 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button success		 **/
		
	.btn-success-form{
		background:#51a351;
		border: 2px solid #51a351;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;	
				
		}
		
	.btn-success-form:hover,.btn-success-form:focus,.btn-success-form:active,.btn-success-form.active,.btn-success-form.disabled,.btn-success-form[disabled]{
		background-color: transparent !important; 
		color: #51a351 !important; 
		text-decoration: none;
		text-align: center;	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
		}
	
	/** button info		 **/
	
	.btn-info-form{
		background:#2f96b4;
		border: 2px solid #2f96b4;		
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
	.btn-info-form:hover,.btn-info-form:focus,.btn-info-form:active,.btn-info-form.active,.btn-info-form.disabled,.btn-info-form[disabled]{
		background-color: transparent !important; 
		color: #2f96b4 !important; 
		text-decoration: none;
		text-align: center; 	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
	}
	
	/** button inverse		 **/
		
	.btn-inverse-form{
		background:#363636;
		border: 2px solid #363636;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;		
	}
	.btn-inverse-form:hover,.btn-inverse-form:focus,.btn-inverse-form:active,.btn-inverse-form.active,.btn-inverse-form.disabled,.btn-inverse-form[disabled]{
		background-color: transparent !important; 
		color: #363636 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
	}	
        
        
      #btnprintandclose{ 
	  
	  	position:fixed; 
		top:2%; 
		right:2%;
		z-index:999; 
		max-width: 100%;
		
	  }
      
	  @media print {
      	#btnprintandclose{display:none !important;}
	  }
            
        </style>

        <script>
			$(document).ready(function(){
				$('.image').height($('.thPrint').height());
				$('.image').width($('.thPrint').width());
			});
        
            function do_print() {
                window.print();
            }

//             function getExcelFile() {
                var url = '<?php echo base_url(); echo isset($myUrl) ? $myUrl:''; echo '/'; echo isset($id)?$id:''; ?>"';
                //var url = "<?php echo base_url() ?>ApTransactionReport/printPaymentAdviceRptExel/<?php echo isset($id)?$id:''; ?>";
//                         window.location.href = url;
//                     }
            function downloadExcel(){
				var url = "<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'/'.true; ?>";
				window.location.href = url;
            }
        </script>

    </head>

    <body>
        
        <table  style="width:97%; margin-top:20px; margin:auto;" class="printTbl">
            <tbody>
                        
                        <tr>
                            <td align="center" colspan="2" class="no-print">
                                <!--<button title="Print" class="btn-icon btn-success-form btn-mini Print" onclick="do_print()" type="button" name="Print"><span class="glyphicon glyphicon-print"></span></button>
                                <button title="Download" class="btn-icon btn-warning-form btn-mini EXCEL" onclick="downloadExcel()" type="button" name="EXCEL"><span class="glyphicon glyphicon-download"></span></button>
                                <button type='button' title="Back" class="btn-icon btn-danger-form btn-mini Close" onclick="history.go(-1);" type="button" name="Close"><span class="glyphicon glyphicon-off"></span></button>-->      
                            </td>
                        </tr>
                        <tr>
                        	<td>&nbsp;</td>
                        </tr>
                        <tr>
                        	<td>&nbsp;</td>
                        </tr>
                        <tr>
                        	<td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2" class="container-fluid">
                            <table id="btnprintandclose">
                            	<tr>
                                	<td><button type="button" onclick="do_print()" class="btn btn-warning btn-md" title="Print"><span class="glyphicon glyphicon glyphicon-print"></span> <?php echo $this->lang->line('print');?></button></td>
                                    <td>&nbsp;</td>
                                    <td>
																		<a href="javascript:void(0);" onclick="return window.close();" class="btn btn-md btn-danger"><i class="fa fa-backward"></i> <?php echo $this->lang->line('back');?></a>
																		<!--<button type="button" class="btn btn-md bg-olive" onclick="history.go(-1);"><i class="fa fa-close fa-fw"></i> <?php echo $this->lang->line('close');?></button>-->
																		</td>
                                </tr>
                            </table>
                            
                            
                            
                            
                            <!--<p style="text-align: left; margin:0; padding-right: 10px; font-weight: 500; line-height: 2; padding-bottom: 0px; padding-top: 0px; color: black; font-size: 30px; color:#F0F; font-family:roboto"><b>
                                e-Voting System
                            </b></p>-->
                            <?php										
														// GET COMPANY LOGO
														$CI->load->model('account/accountmain','accmain');
														$CI->load->model('project/projectmain','projmain');
														
														$projectID = $this->session->userdata('projectID');
														$projectTitle = $CI->projmain->getProjectTitle($projectID);
														
														$user = $this->session->userdata('logged_in');
														$userID = $user['userID'];
														$logo = $CI->accmain->getUserOrganizationLogo($userID);
														
														$abso = str_replace("\\","/", FCPATH);
														$virt = str_replace("\\","/", base_url());													
														$logoImage = $virt."dist/img/logo/logo_xs.png"; //bypass for PEKEMA
														// $logoImage = $virt."dist/img/logo/LOGO-PEKEMA-LONG.jpeg";
														if($logo && file_exists($abso."img/logos/".$logo)) {
															$logoImage = $virt."img/logos/".$logo;
														}
														?>
														
														<div class="row" style="padding: 0; margin: 0; height: 100px;">
															<div class="col-md-2" style="padding: 0; margin: 0; height: 100px; text-align: center;">
																<img src="<?php echo $logoImage; ?>" style="height: 100px; width: auto;" />
															</div>
															<div class="col-md-10" style="padding: 0; margin: 0; height: 100px; text-align: center;">
																<h1 style="padding: 0; margin: 0; height: 50px; width: 100%; text-align: center;"><?php echo $projectTitle; ?></h1>
																<h3 style="padding: 0; margin: 0; height: 50px; width: 100%; text-align: right; color: #999;"><?php if(isset($rptTitle)) echo $rptTitle; ?></h3>
															</div>
														</div>
                            		
                            	
                            	

                            </td>
                        </tr>
                        <?php if(isset($leftContentHeader) || isset($leftContent) || isset($rightContentHeader) || isset($rightContent)): ?>
                        <tr>
                            <td>
                                <?php
                                if (isset($leftContentHeader)){
                                    echo "<p class='modPrint' style='padding-left:10px; margin:0; font-size:11px; '>"
                                    . "<strong>".$leftContentHeader."</strong></p>";
                                }
                                 
                                 if (isset($leftContent)){
                                   echo '<p style="padding-left:10px; margin:0; line-height:1.4;">';
                                    foreach ($leftContent as $value) {
                                         echo $value != ''?"<span>".$value."</span><br />":'';
                                     }
                                      if (isset($sale_invoice_date)){
                                   echo '<div class="div_paid modPrint" style="padding-left: 10px; line-height: 1.4; position: relative; width: 100px; height: 0px; float: right; margin-top: -80px; margin-right: 30%;">';
                                        echo '<div class="paid_paid">PAID</div><div class="paid_date">'.$sale_invoice_date.'</div>';
                                  echo '</div>';
                                 }
                                  echo '</p>';
                                 }
                                 
                                 
                                
                                ?>
                                
                            </td>
                                
                            <td valign="top">
                                <?php if(isset($rightContentHeader) || isset($rightContent)): ?>
                                <div style="line-height:1.4; text-align:left; float:right">
                                    <?php
                                        if (isset($rightContentHeader)){
                                        	echo "<p class='modPrint' style='padding-right:10px; margin:0; font-size:11px; '>"
                                        			. "<strong>".$rightContentHeader."</strong></p>";
                                        } 
                                        if (isset($rightContent)){
                                             foreach ($rightContent as $value) {
                                                echo $value != ''?"<span>".$value."</span><br />":'';
                                            }
                                        }
                                    ?>
                                </div>
                                <?php endif; ?>
                              </td>
                        </tr>
                        <?php endif; ?>

