Show DevBest [Release] Client database manager [l33t]

Status
Not open for further replies.

Macemore

Circumcised pineapples
Aug 26, 2011
1,681
819
I got tired of having my desktop loaded with sticky notes of who pays me when. So this does it for me.
There's no styling yet, but I have the on it.

Download:

Snippets:
admin.php:
PHP:
<?php
session_start();
 
if(isset($_SESSION['username'])) {
define('dbm', '1');
include('./incs/inc.php');
 
    if(isset($_GET['page'])) {
 
        $page = $_GET['page'];
 
        if($page == 'home') {
 
            include('./html/home.html');
 
        } elseif($page == 'loader') {
 
            $loader = $_GET['loader'];
 
            if($loader == 'add_client') {
 
define('varinc', '1');
include('vars.php');
                mysql_query("INSERT INTO clients (name, payamnt, paydate, service, notes) VALUES('{$name}', '{$payamnt}', '{$paydate}', '{$service}', '{$notes}') ") or die(mysql_error());
echo 'Added client<br />';
echo "<a href='admin.php'>Back</a>";
 
            } elseif($loader == 'del_client') {
 
define('varinc', '1');
include('vars.php');
mysql_query("DELETE FROM clients WHERE name='{$name}'") or die(mysql_error());
echo 'Deleted client<br />';
echo "<a href='admin.php'>Back</a>";
 
}
        } elseif ($page == 'delete') {
 
            include('./html/delete.html');
 
        } elseif ($page == 'add') {
 
include('./html/add.html');
 
} elseif ($page == 'check') {
 
include('./incs/date.php');
$cockass = mysql_query("SELECT * FROM clients WHERE paydate='". $date ."'") or die(mysql_error());
if(mysql_num_rows($cockass) == '0') {
echo "No one owes you money today :&#40;<br />";
echo "<a href='admin.php'>Back</a>";
} else {
 
if(mysql_num_rows($cockass) > 0) {
echo "People that owe you monies:<br />";
while($bobbas = mysql_fetch_array($cockass)) {
echo "<b>Name:</b> -- <b>Amount</b> -- <b>Service</b>";
echo "{$bobbas['name']} -- {$bobbas['payamnt']} -- {$bobbas['service']}";
echo "<br />";
}
echo "<a href='admin.php'>Back</a>";
}
}
} else {
 
include('./html/home.html');
 
}
} else {
 
include('./html/home.html');
 
}
}
?>

If you find any injections feel free to tell me.

Credits:
Styling: ??? - team of experts
Coding: 99% - Me, 1% -

EDIT:
Login user and password are both admin, to change this edit them in the SQL database under 'users'

EDIT 2:
Fixed errors I created by changing file structure. Added some features like clients showing in delete page.
 
Status
Not open for further replies.

Users who are viewing this thread

Top