<?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>
                 <li>
                        <a href="wholesale.php" >Wholesales</a>
						
                    </li>   
                   	
					<li>
                        <a href="creditorss.php" >Credit Sales</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=""  >TRANSACTIONS</a>
							<ul class="active"> 
							         <
					 <li>
                        <a href="unhold.php" >Un-Hold Retail  Transactions</a>
                    </li>
							       
						<li>
                        <a href="unholdw.php" >Un-Hold Wholesale  Transactions</a>
                    </li>
				
						 <li>
                        <a href="unholdc.php" >Un-Hold Credit  Transactions</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>
							
									
					
					 <li>
                        <a href="change_pass.php"  >CHANGE PASSWORD</a>
							  <ul class="active">
                         
							
                        </ul>
                    </li>
					</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">Return Inwards</a>
                            </li>
				<li>
                                <a href="cancel_t.php">Cancel Suppliers Transaction</a>
                            </li>
								<li>
                                <a href="cancel_tt.php">Cancel Customers Transaction</a>
                            </li>
							<li>
                                <a href="ad_cash.php">Opening Balance</a>
                            </li>
				<li>
                                <a href="cuuu.php">Today Z-Report</a>
                            </li>
							<li>
                                <a href="get_dail.php">Backdate Z-Report</a>
                            </li>
                            	<li>
                                <a href="ed_pri.php">Edit Cash Receipt</a>
                            </li>
                            	<li>
                                <a href="edd_pri.php">Edit Invoice Receipt</a>
                            </li>
                            
                                                      <li>  <a href="rep.php">Reprint Cash Receipt</a>
                                                    </li>
                                                    <li>
                                                        <a href="reprint.php">Reprint Invoice Receipt</a>
                                                    </li>
                                                     <li>
                                                        <a href="trans.php">Today Transactions Break Down</a>
                                                    </li>
                                                    <li>
                                                        <a href="get_transc.php">Transactions Break Down Over Dates</a>
                                                    </li>
					</ul></li>
					
                    <li>
                        <a href="#">Transactions</a>
						<ul class="active">
									
					<li>
                                <a href="stockk.php">Add Stock</a>
                            </li>
	
                           
								<li>
                        <a href="cuu.php" >Daily report</a>
						
                    </li>
				
				
						<li>
                                <a href="whole.php">Backdate Retail Sales</a>
                            </li>		
							
							
							<li>
                                <a href="wholee.php">Backdate Wholesale Sales</a>
                            </li>		
							
										
							<li>
                                <a href="get_expes.php">Expense Reports</a>
                            </li>		
							
								
								
							
							
								
							
							
							
							
							
								 
							
							
								 
							</ul></li> 
							 <li>
                        <a href="#">Reports</a>
						<ul class="active">
									
					<li>
                                <a href="sales.php">Cash Sales</a>
                            </li>
							 <li>
                                <a href="get_invoices.php">Product Invoice 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>
							
							 <li>
                                <a href="reorder.php">Goods With Reorder Level Limits</a>
                            </li>	 
							
								 <li>
                                <a href="reorderr.php">Goods With Approaching Reorder Level Limits</a>
                            </li>	 
								 <li>
                                <a href="purchases.php">Purchases Report</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_saless.php">All Product Sales</a>
                            </li>
							  <li>
                                <a href="cat.php">Graph Report Per Product</a>
                            </li>
                            <li>
                                <a href="mon.php">Sales Report Over Months</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_dead.php">Dead Stock</a>
                            </li> 
								<li>
                                <a href="svat_report.php">Sales Vat Analysis</a>
                            </li> 
							<li>
                                <a href="vat_report.php">Supplier Vat Analysis</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="double.php">Multiple 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="add_sub.php">Add ledger Sub Accounts</a>
                            </li>
							
						
						
							 <li>
                                <a href="invoice_p.php">Produce Invoice</a>
                            </li>
							 <li>
                                <a href="record_exp.php">Record Expenses</a>
                            </li>
							
							
							
                        </ul>
                    </li>
                   
				<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>
							
													 <li>
                                <a href="supplier_invoices.php">Supplier Invoices</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_ledgers.php">View Summarised 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>';
}
?>
 
