<input name="active" type="radio" value="Y" <?php echo checked($user->active, "Y"); ?> >Yes <input name="active" type="radio" value="N" <?php echo checked($user->active, "N"); ?> >No </td> </tr> <tr> <td class="form_field_header_cell">Type of User:</td> <td class="form_field_cell"> <select name="user_type_id" class="input_text"> <?php echo SI_UserType::getSelectTags($user->user_type_id); ?> </select> </td> </tr> <tr> <td class="form_field_header_cell">User Rights:</td> <td class="form_field_cell"> <input type="checkbox" name="rights[admin]" value="1" <?php echo $user->hasRight('admin') ? 'CHECKED' : ''; ?> /> Administrative Access<br> <input type="checkbox" name="rights[accounting]" value="1" <?php echo $user->hasRight('accounting') ? 'CHECKED' : ''; ?> /> Accounting Access<br>
* 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * */ require_once('includes/common.php'); require_once('includes/SI_UserType.php'); checkLogin("admin"); $user_type = new SI_UserType(); $user_types = SI_UserType::retrieveSet(); if($user_types === FALSE){ $error_msg = "Error getting user types!\n"; debug_message($user_type->getLastError()); } $title = "User Type Administration"; require('header.php') ?> <div class="tableContainer"> <a href="javascript:;" class="tCollapse" onclick="toggleGrid(this)"><img src="images/arrow_down.jpg" alt="Hide table" />User types</a><div> <div class="gridToolbar"> <a href="user_type.php?mode=add" style="background-image:url(images/new_invoice.png);">New user type</a> </div> <table border="0" cellspacing="0" cellpadding="0">
* 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * */ require_once('includes/common.php'); checkLogin('admin'); require_once('includes/SI_UserType.php'); $title = ''; $user_type = new SI_UserType(); if($_REQUEST['mode'] == 'add'){ $title = "Add User Type"; if($_POST['save']){ $user_type->updateFromAssocArray($_POST); if($user_type->add() !== false){ goBack(); }else{ $error_msg .= "Error adding User Type!\n"; } } }else if($_REQUEST['mode'] == 'edit'){ $title = "Edit User Type"; if(empty($_REQUEST['id'])){
function get($id = NULL){ global $db_conn; if(!isset($id)){ $id = $this->id; } if(!isset($id)){ $this->error = "SI_UserType::get() : UserType id not set\n"; return FALSE; } $UserType = SI_UserType::retrieveSet("WHERE id = $id", TRUE); if($UserType === FALSE){ return FALSE; } if(isset($UserType[0])){ $this->_populateData($UserType[0]); $this->stripSlashes(); }else{ $this->error = "SI_UserType::get() : No data retrieved from query\n"; return FALSE; } return TRUE; }