<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */




function headermenu($dep,$type) {
if (!isset($_SESSION['user']
 )) {
$url = 'login.php';
ob_end_clean();
header("Location: $url");
exit();
}

if(($dep==2||$dep==4)&&$type=='SALES'){

echo '<ul class="art-hmenu">
 <li>
                      <a href="indexxx.php" ><img src="images/HOME_W.PNG" class="icons"/>Home</a>
                    </li>
<li>
                        <a href="#" class="active">CASHIER '.$_SESSION['user'].'  TILL &nbsp;&nbsp;&nbsp;'. teller(get_client_ip()).' </a>
                    </li>
					

                   		<li>
                        <a href="tables.php" >Retail</a>
						
                   
					<li>
                        <a href="creditorss.php" >Credit</a>
						
                    </li>
					<li>
                        <a href="cuu.php" >Daily report</a>
						
                    </li>
			
<li>
                                <a href="#">Customers</a> <ul class="active">
											
									<li>
                                <a href="customers.php">Add Customers</a>
                            </li>		
								
							  <li>
                                <a href="debtor_payment.php">Record Customer Payments</a>
                            </li>
							
							
							 <li>
                                <a href="get_customer.php">Customer Statements</a>
                            </li>
							
							
							
							</ul>
                            </li>
				
					 
                  
                    <li>
                        <a href="login.php" class="active"><img src="images/logout.png" class="icons"/>Log Out</a>
                    </li>
                </ul>';
}

if(($dep==4)&&$type=='ADMIN'){

echo '<ul class="art-hmenu">
 <li>
                        <a href="admin.php" class="active"><img src="images/HOME_W.PNG" class="icons"/>Home</a>
                    </li>

<li>
                        <a href="#" class="active">ADMIN &nbsp;&nbsp;&nbsp;'.$_SESSION['user'].'   </a>
                    </li>
					

                    <li>
                        <a href="user_accounts.php" >CREATE USER ACCOUNTS</a>
                    </li>
					 <li>
                        <a href="administer_users.php" >ADMINISTER USER ACCOUNTS</a>
							<ul class="active">
									
					
					 <li>
                        <a href="change_pass.php"  >CHANGE PASSWORD</a>
							  <ul class="active">
                         
							
                        </ul>
                    </li>
					 
                  
                    <li>
                        <a href="logout.php" class="active"><img src="images/logout.png" class="icons"/>Log Out</a>
                    </li>
                </ul>';
}
if(($dep==3||$dep==4)&&$type=='BACK OFFICE'){
    echo '<ul class="art-hmenu">
                    <li>
                        <a href="indexx.php" class="active"><img src="images/HOME_W.PNG" class="icons"/>Home</a>
                    </li>
							
                   
					 <li>
                        <a href="#">Master Files</a>
						<ul class="active">
								<li>
                                <a href="products_view.php">Add Products</a>
                            </li>
									<li>
                                <a href="categories.php">Add Categories</a>
                            </li>
							<li>
                                <a href="return_r.php">Create Credit NOte</a>
                            </li>
				<li>
                                <a href="stff.php">Add Staff</a>
                            </li>
							<li>
                                <a href="adv.php">Salary Advance</a>
                            </li>
                            	<li>
                                <a href="loans.php">Staff Loans</a>
                            </li>
                            <li>
                                <a href="loan_payments.php">Record Loan Payments</a>
                            </li>
                             <li>
                                <a href="loann.php">Outstanding Loan Balances</a>
                            </li>
							<li>
                                <a href="adv_rep.php">Salary Advance Reports</a>
                            </li>
                            	<li>
                                                        <a href="reverse_l.php">Reverse Credit Sales</a>
                                                    </li>
                                                   <li>
                                                        <a href="reverse_r.php">Reverse Cash Sales</a>
                                                    </li>
				 <li>
                                                        <a href="ed_pri.php">Edit Receipt</a>
                                                    </li> 
					</ul></li>
					
                    <li>
                        <a href="#">Transactions</a>
						<ul class="active">
									
					<li>
                                <a href="stockk.php">Add Stock</a>
                            </li>
	
                            <li>
                                <a href="reps.php">Delivery reports</a>
                            </li>
	  
							 <li>
                                <a href="cancel_t.php">Cancel Transactions</a>
                            </li>
	
				<li>
                                <a href="get_dail.php">Backdate Z Report</a>
                            </li>
			
							<li>
                                <a href="lists.php">Customers And Suppliers List</a>
                            </li>				
							<li>
                                <a href="active_cc.php">Deactivated Customer Accounts</a>
                            </li>
	
							
								
							
							
							
							
							
								 
							
							
								 
							</ul></li> 
							 <li>
                        <a href="#">Reports</a>
						<ul class="active">
									
					<li>
                                <a href="sales.php">Sales</a>
                            </li>
							 <li>
                                <a href="properties.php">Stock Properties</a>
                            </li>
							
							<li>
                                <a href="stock.php">Stock Left</a>
                            </li> 
							<li>
                                <a href="st_val.php">Stock Valuation</a>
                            </li> 
													 <li>
                                <a href="supplier_invoices.php">Supplier Invoices</a>
                            </li>
							
								 
							
								
							
							
							
							
							
								 
							
							
								 
							</ul></li>
										 <li>
                        <a href="#">Detailed Reports</a>
							 <ul class="active">
							  <li>
                                <a href="get_sales.php">Product Cash Sales</a>
                            </li>
							
								<li>
                                <a href="get_salesr.php">Sales bASED ON RECEIPTS</a>
                            </li>
							<li>
                                <a href="cumulative.php">Cumulative Sales</a>
                            </li>

							
								<li>
                                <a href="get_popular.php">Popular Products</a>
                            </li> 
							 	<li>
                                <a href="sale_p.php">Sales Person Report</a>
                            </li> 
						
								<li>
                                <a href="sale_pp.php">Overall Sales Persons Report</a>
                            </li> 
							 
							
							
							
							
							
                        </ul>
                    </li>
							 
				
					
					     

                

					
					
			
                    <li>
                        <a href="logout.php"><img src="images/logout.png" class="icons"/>Log Out</a>
                    </li>
                </ul> ';
}
if(($dep==1||$dep==4)&&$type=='ACCOUNTS'){
    echo '<ul class="art-hmenu">
                    <li>
                        <a href="index.php" class="active"><img src="images/HOME_W.PNG" class="icons"/>Home</a>
                    </li>
							
                    
                   
			 <li>
                        <a href="" >Transactions</a>
						 <ul class="active">
						  <li>
                                <a href="doulble_entry.php">double entry</a>
                            </li>
								 
							 <li>
                                <a href="funds_transfer.php">Funds Transfer</a>
                            </li>
							 <li>
                                <a href="cancel_t.php">Cancel Transactions</a>
                            </li>
							
							</ul>
                    </li>
				
					
                   
			
					     
                    <li>
                        <a href="income.php">Finance</a>
							 <ul class="active">
							  <li>
                                <a href="add_accounts.php">Add ledger Accounts</a>
                            </li>
								 
							
						
							 

							 <li>
                                <a href="record_exp.php">Record Expenses</a>
                            </li>
							
							
							
							
							
							
                        </ul>
                    </li>
					<li>
                                <a href="#">Customer Accounts</a> <ul class="active">
										
										<li>
                                <a href="customers.php">Add Customers</a>
                            </li>						
							
							  <li>
                                <a href="debtor_payment.php">Record Customer Payments</a>
                            </li>
							
							
							 <li>
                                <a href="get_customer.php">Customer Statements</a>
                            </li>
							<li>
                                <a href="cust_age.php">Customer Ageing Invoices</a>
                            </li>
						
							
						
							</ul>
                            </li>
						<li>
                                <a href="#">Suppliers Accounts</a> <ul class="active">
										<li>
                                <a href="suppliers.php">Add Suppliers</a>
                            </li>						
								
							
							  <li>
                                <a href="payments.php">Record Supplier Payments</a>
                            </li>
							
							
							 <li>
                                <a href="get_supplier.php">Supplier Statements</a>
                            </li>
							
						
							
							</ul>
                            </li>
                 <li>
                        <a href="#">FINANCE REPORTS</a>
						 <ul class="active">
                            
							
						
							<li>
                                <a href="get_ledger.php">View Ledger</a>
                            </li>
							
							  <li>
                                <a href="get_general.php">View General Ledger</a>
                            </li>
							<li>
                                <a href="get_profit.php">View Profit</a>
                            </li>
							<li>
                                <a href="get_balance.php">View Balance Sheet</a>
                            </li>
							<li>
                                <a href="get_trial.php">View Trial Balance</a>
                            </li>
							  
							 
							
							
							
							
							  
                        </ul>
						
                    </li>
                


			
                    <li>
                        <a href="logout.php"><img src="images/logout.png" class="icons"/>Log Out</a>
                    </li>
                </ul> ';
}
}

function headerinfo() {
    $Rows = mysql_query('SELECT * FROM saccodetails');

    $Row = mysql_fetch_array($Rows);
    $lqry = mysql_query('select * from saccodetails') or die(mysql_error());
    $rslt = mysql_fetch_array($lqry);
    $logo = 'photos/' . base64_decode($rslt['logo']);

    echo '<div class="art-shapes">
                    <h1 class="art-headline" data-left="48.85%">
                        <a href="#">' . base64_decode($Row['compname']) . '</a>
                    </h1>
                    <h2 class="art-slogan" data-left="47.26%">' . base64_decode($Row['slogan']) . '</h2>

                    <div class="art-object2132829940" data-left="2.74%">
<img src="' . $logo . '" style="width: 100%; max-width: 150px; min-width: 100px; max-height: 47px;" />
</div>

                </div>';
}

function footer() {

    echo '<footer class="art-footer clearfix">
                   <p>Copyright © ' . date("Y") . ' , All Rights Reserved.<br>
                                        <span id="art-footnote-links"><a href="" target="_blank">NeuroData Systems</a> Product</span>

                        <br></p>
                </footer>';
}

function adminmenu() {

    echo '
     
<div class="art-vmenublockcontent">
    <ul class="art-vmenu">
        <li>
                                                <a href="">Settings</a>
                                                <ul class="active">
                                                    <li>
                                                        <a href="saccodetails.php"><img src="images/settings.png" class="icons"/>Sacco Details</a>
                                                    </li>
                                                    <li>
                                                        <a href="backup.php"><img src="images/blue_external_drive_backup.png" class="icons"/>Backups</a>
                                                    </li>
                                                    <li>
                                                        <a href="audit.php"><img src="images/log_pencil.png" class="icons"/>User Activities</a>
                                                    </li>
                                                </ul>
                                            </li>
                                            </ul>
                                            </div>';
}

function admintop() {
    echo '<ul class="art-hmenu">
                    <li>
                        <a href="admingroups.php"><img src="images/usergroups.png" class="icons"/>User Groups</a>
                    </li>
                    <li>
                        <a href="adminpermissions.php"><img src="images/userpermissions.png" class="icons"/>Permissions</a>
                    </li>
                    <li>
                        <a href="adminusers.php"><img src="images/users.png" class="icons"/>Users</a>
                    </li>
                    <li>
                        <a href="adminprofile.php"><img src="images/profile.png" class="icons"/>Profile</a>
                    </li>
                    <li>
                        <a href="logout.php"><img src="images/logout.png" class="icons"/>Log Out</a>
                    </li>
                </ul>';
}
?>
 
