Permalink
Browse files

Imports initial code.

  • Loading branch information...
0 parents commit ec98e2f1a29297b5226495ef0197d2e3c9f0f004 @elplatt committed Jun 19, 2010
674 COPYING

Large diffs are not rendered by default.

Oops, something went wrong.
20 INSTALL
@@ -0,0 +1,20 @@
+
+Seltzer CRM
+Installation Instructions
+
+1. Unpack the package.
+
+2. Import schema.sql into a new MySQL database.
+
+3. Under seltzer/crm/include, copy config.inc.php.sample to config.inc.php,
+and modify it to reflect the settings for your database.
+
+4. Upload the seltzer/crm directory to your webserver.
+
+5. Visit the crm directory in your browser, example:
+http://yourserver.com/crm
+
+6. The default admin credentials are:
+user: admin
+password: admin
+
15 TODO
@@ -0,0 +1,15 @@
+Seltzer CRM
+TODO Items - Highest priority first
+
+Add export to CSV functionality for any table
+Add starting and ending dates to member table and forms
+Create generic report module
+Add dues report
+
+Add password reset feature
+Add role edit page
+
+Add plan add/edit page
+Add user add/edit page
+Add contact listing page
+Add contact add/edit page
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ Copyright 2009-2010 Edward L. Platt <elplatt@alum.mit.edu>
+
+ This file is part of the Seltzer CRM Project
+ action.php - Dispatches actions to the appropriate handlers
+
+ Seltzer is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ any later version.
+
+ Seltzer is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Seltzer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// Include libraries
+require_once('include/crm.inc.php');
+
+// Parse requested command
+$post_command = $_POST['command'];
+$get_command = $_GET['command'];
+$command = !empty($post_command) ? $post_command : $get_command;
+
+// Check if handler exists
+$handler = 'command_' . $command;
+if (function_exists($handler)) {
+
+ // Execute handler
+ $next = $handler();
+} else {
+
+ // Redirect to homepage
+ error_register('No such command: ' . $command);
+ $next = 'index.php';
+}
+
+// Redirect
+header('Location: ' . $next);
+
+?>
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ Copyright 2009-2010 Edward L. Platt <elplatt@alum.mit.edu>
+
+ This file is part of the Seltzer CRM Project
+ delete.php - Displays delete confirmation dialog
+
+ Seltzer is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ any later version.
+
+ Seltzer is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Seltzer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+require_once('include/crm.inc.php');
+
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <link rel="stylesheet" type="text/css" href="style.css"/>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+ <script type="text/javascript" src="script.js"></script>
+ <title>i3 Detroit</title>
+</head>
+<body>
+ <div class="container">
+ <div class="header">
+ <?php print theme_header(); ?>
+ </div>
+ <div class="content">
+ <?php print theme_errors(); ?>
+ <?php print theme_delete_form($_GET['type'], $_GET['id']); ?>
+ </div>
+ <div class="footer">
+ <?php print theme_footer(); ?>
+ </div>
+ </div>
+</body>
+</html>
@@ -0,0 +1,67 @@
+<?php
+
+/*
+ Copyright 2009-2010 Edward L. Platt <elplatt@alum.mit.edu>
+
+ This file is part of the Seltzer CRM Project
+ command.inc.php - Core event handlers
+
+ Seltzer is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ any later version.
+
+ Seltzer is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Seltzer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * Handle login request.
+ */
+function command_login () {
+ global $esc_post;
+
+ // Calculate hash
+ $esc_hash = sha1($_POST['password']);
+
+ // Query database for given user
+ $sql = "
+ SELECT *
+ FROM `user`
+ WHERE `username`='$esc_post[username]' AND `hash`='$esc_hash'";
+ $res = mysql_query($sql);
+ if (!$res) die(mysql_error());
+ $row = mysql_fetch_assoc($res);
+
+ // Check for user
+ if (!empty($row)) {
+ user_id_set($row['uid']);
+ $next = 'index.php';
+ } else {
+ error_register('Invalid username/password');
+ $next = 'login.php';
+ }
+
+ // Redirect to index
+ return $next;
+}
+
+/**
+ * Handle logout request.
+ */
+function command_logout () {
+
+ // Destroy session data
+ session_destroy();
+
+ // Redirect to index
+ return 'index.php';
+}
+
+
+?>
@@ -0,0 +1,113 @@
+<?php
+
+/*
+ Copyright 2009-2010 Edward L. Platt <elplatt@alum.mit.edu>
+
+ This file is part of the Seltzer CRM Project
+ config.inc.php - Sample configuration
+
+ Seltzer is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ any later version.
+
+ Seltzer is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Seltzer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// Database configuration
+$config_db_host = 'localhost';
+$config_db_user = 'seltzer_user';
+$config_db_password = 'seltzer_password';
+$config_db_db = 'seltzer_db';
+
+// Site info
+$config_site_title = 'Seltzer CRM';
+
+// Site map
+$config_sitemap = array(
+ 'index' => array(
+ 'title' => 'Home',
+ 'url' => 'index.php'
+ ),
+ 'members' => array(
+ 'title' => 'Members',
+ 'url' => 'members.php',
+ 'visible' => 'authenticated'
+ ),
+ 'reports' => array(
+ 'title' => 'Reports',
+ 'url' => 'reports.php',
+ 'visible' => 'authenticated'
+ )
+);
+
+// Roles
+$config_roles = array(
+ "member",
+ "director",
+ "president",
+ "vp",
+ "secretary",
+ "treasurer",
+ "webAdmin"
+);
+
+// Permissions (which roles can perform which actions)
+$config_permissions = array(
+ "user_add" => array(
+ "director",
+ "webAdmin"
+ ),
+ "user_edit" => array(
+ "webAdmin",
+ "director"
+ ),
+ "user_delete" => array(
+ "webAdmin",
+ "director"
+ ),
+ "contact_view" => array(
+ "director",
+ "member"
+ ),
+ "contact_add" => array(
+ "webAdmin",
+ "director"
+ ),
+ "contact_edit" => array(
+ "webAdmin",
+ "director"
+ ),
+ "contact_delete" => array(
+ "webAdmin",
+ "director"
+ ),
+ "member_view" => array(
+ "director",
+ "member"
+ ),
+ "member_add" => array(
+ "webAdmin",
+ "director"
+ ),
+ "member_edit" => array(
+ "webAdmin",
+ "director"
+ ),
+ "member_delete" => array(
+ "director"
+ ),
+ "roles_edit" => array(
+ "director",
+ "secretary",
+ "webAdmin"
+ )
+);
+
+?>
Oops, something went wrong.

0 comments on commit ec98e2f

Please sign in to comment.