コード例 #1
0
 function display_menu($current_menu = '')
 {
     $nav_menu_str = '';
     $menu_array = $this->menu_engie->menu_bucket();
     if (check_user_access($this, 'manage_reports')) {
     }
     if (!empty($menu_array)) {
         echo '<div class="span3"> <ul>';
         foreach ($menu_array as $text => $link) {
             $parent_links_html = '<li class="' . (!empty($link['child']) ? ' has-sub' : '') . ($text == $current_menu || $text == $this->find_my_parent($current_menu) ? ' active open' : '') . '">' . '<a href="' . $link['attr']['url'] . '" id="' . $link['attr']['id'] . '" class="sed">' . '<span class="icon-box"><i class="' . $link['attr']['classes'] . '"></i></span>' . $link['attr']['text'] . (!empty($link['child']) ? '<span class="arrow"></span>' : '') . '</a>';
             $child_links_html = '';
             if (!empty($link['child'])) {
                 foreach ($link['child'] as $child_text => $child_link) {
                     if (check_user_access($this, $child_text) || in_array($child_text, array('my_profile', 'log_out', 'home'))) {
                         $child_links_html .= '<li class="' . ($child_text == $current_menu ? 'active' : '') . '">' . '<a href="' . $child_link['url'] . '" class="">' . $child_link['text'] . '</a>' . '</li>';
                     }
                 }
             }
             if (!empty($child_links_html)) {
                 print $parent_links_html . '<ul id="' . $link['attr']['id'] . '-child" class="sub">' . $child_links_html . '</ul></li>';
             }
         }
         echo "</ul> </div>";
     }
 }
コード例 #2
0
ファイル: action_menu.php プロジェクト: nwtug/academia
    $menu_array['users']['section'] = array('title' => 'Users', 'url' => base_url() . 'admin/manage_users');
    $menu_array['users']['Add a New User'] = base_url() . 'admin/load_user_form';
    $menu_array['users']['Manage Users'] = base_url() . 'admin/manage_users';
} else {
    $menu_array['news']['section'] = array('title' => 'News', 'url' => base_url() . 'news/user_news_list');
    if (check_user_access($this, 'view_news_feed')) {
        $menu_array['news']['News Feed'] = base_url() . 'news/user_news_list';
    }
    if (check_user_access($this, 'view_news_archive')) {
        $menu_array['news']['News Archive'] = base_url() . 'news/user_news_list/t/' . encryptValue('archive');
    }
    $menu_array['invitations']['section'] = array('title' => 'Invitations', 'url' => 'javascript:void(0)');
    if (check_user_access($this, 'view_invitations')) {
        $menu_array['invitations']['Your Invitations'] = base_url() . 'deal/user_invitations_list';
    }
    if (check_user_access($this, 'view_invitation_archive')) {
        $menu_array['invitations']['Invitations Archive'] = base_url() . 'deal/user_invitations_list/t/' . encryptValue('archive');
    }
}
if (!empty($section) && $subsection != 'settings') {
    $section_array = $menu_array[$section];
}
?>



<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php 
#Include only if there are other pages
if (!empty($section_array) && !empty($subsection) || !empty($subsection) && $subsection == 'settings') {
    if (!empty($section_array)) {
コード例 #3
0
ファイル: manage_help_view.php プロジェクト: nwtug/academia
              </tr>
</table>
</td>
              </tr>
            <tr>
              <td>
<div id="searchresults">
<?php 
#Show search results
if (!empty($page_list)) {
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader'>&nbsp;</td>\r\r\n\t\t\t<td class='listheader'>Help Topic</td>\r\r\n           \t<td class='listheader' nowrap>Last Updated</td>\r\r\n\t\t\t</tr>";
    $counter = 0;
    foreach ($page_list as $row) {
        #Show one row at a time
        echo "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t\t\t<td width='1%'>";
        if (check_user_access($this, 'update_help_topic')) {
            echo "<a href='" . base_url() . "help/add_help_topic/i/" . encryptValue($row['topiccode']) . "' title=\"Click to edit this help topic.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
        }
        echo "</td>\r\r\n\t\t\t\t\r\r\n\t\t\t\t<td width='1%' valign='top' nowrap><a href='" . base_url() . "help/view_help_topic/i/" . encryptValue($row['topiccode']) . "' class='fancybox fancybox.ajax bluelink'>" . $row['helptopic'] . "</a></td>\r\r\n\t\t\t\t\r\r\n                <td width='98%'>" . date('m/d/Y h:iA', strtotime($row['lastupdateddate'])) . "</td>\r\r\n\t\t\t</tr>";
        $counter++;
    }
    echo "<tr>\r\r\n\t<td colspan='3' align='center'  class='layer_table_pagination' nowrap>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "help/manage_help/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
    echo format_notice("There is no help at the moment.");
}
?>
</div>
              </td>
              </tr>

        </table></td>
コード例 #4
0
    foreach ($page_list as $row) {
        #Show one row at a time
        if ($row['type'] == 'DEBIT') {
            $debit = $row['amount'];
            $credit = 0;
            $balance -= $debit;
            $total_debit += $debit;
        } else {
            $debit = 0;
            $credit = $row['amount'];
            $balance += $credit;
            $total_credit += $credit;
        }
        $fee = get_fee_lines($this, $row['fee']);
        echo "<tr class='listrow' style='" . get_row_color($counter, 2, 'row_borders') . "'>\r\r\n\t\t<td valign='top' nowrap>";
        if (check_user_access($this, 'delete_deal')) {
            echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "finances/delete_fee/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this fee? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this fee.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
        }
        #if(check_user_access($this,'update_deals')){
        echo " &nbsp;&nbsp; <a href='#' title=\"Click to print this transaction details.\"><img src='" . base_url() . "images/small_pdf.png' border='0'/></a>";
        #}
        echo "</td>\r\r\n\t\t \t\t<td valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\r\r\n\t\t\t\t<td valign='top'>" . $fee['fee'] . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($debit, 0, '.', ',') . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($credit, 0, '.', ',') . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($balance, 0, '.', ',') . "</td>\r\r\n\t\t\t</tr>";
        $counter++;
    }
    echo "<tr>\r\r\n\t\t  <td colspan='3'></td>\r\r\n\t\t  <td><div class='sum'>" . number_format($total_debit, 0, '.', ',') . "</div></td>\r\r\n\t\t  <td><div class='sum'>" . number_format($total_credit, 0, '.', ',') . "</div></td>\r\r\n\t\t  <td style='padding-right:0'><div class='sum'>" . number_format(-($total_debit - $total_credit), 0, '.', ',') . "</div></td>\r\r\n\t\t </tr>";
    echo "<tr>\r\r\n\t<td colspan='6' align='right'  class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "classes/manage_classes/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
    echo "<div>No transactions have been added.</div";
}
?>
コード例 #5
0
            if (check_user_access($this, 'update_access_group')) {
                ?>

						  <a href="<?php 
                echo base_url();
                ?>
admin/access_group_form/i/<?php 
                echo encryptValue($row['groupid']);
                ?>
" title="Click to update this access group."><img src="<?php 
                echo base_url();
                ?>
images/edit.png" border="0"/></a> 
						 <?php 
            }
            if (check_user_access($this, 'manage_access_permissions')) {
                ?>

						  <a href="<?php 
                echo base_url();
                ?>
admin/update_permissions/i/<?php 
                echo encryptValue($row['groupid']);
                ?>
" title="Click to update this access group's permissions"><img src="<?php 
                echo base_url();
                ?>
images/patient_history.png" border="0" height="18"/></a>
						  <?php 
            }
            ?>
コード例 #6
0
ファイル: manage_users_view.php プロジェクト: nwtug/academia
          <tr>
            <td valign="top">
            
            
            <?php 
#$page_list = array();
if (!empty($page_list)) {
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader'>&nbsp;</td>\r\r\n           \t<td class='listheader' nowrap>User</td>\r\r\n\t\t\t<td class='listheader' nowrap>Username</td>\r\r\n           \t<td class='listheader' nowrap>Phone</td>\r\r\n\t\t\t<td class='listheader' nowrap>Email</td>\r\r\n\t\t\t<td class='listheader' nowrap>Date Added</td>\r\r\n\t\t\t</tr>";
    $counter = 0;
    foreach ($page_list as $row) {
        #Show one row at a time
        echo "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t<td valign='top' nowrap>";
        if (check_user_access($this, 'delete_deal')) {
            echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "admin/delete_user/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this user? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this user.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
        }
        if (check_user_access($this, 'update_deals')) {
            echo " &nbsp;&nbsp; <a href='" . base_url() . "admin/load_user_form/i/" . encryptValue($row['id']) . "' title=\"Click to edit this user details.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
        }
        echo "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['firstname'] . " " . $row['lastname'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['username'] . "</td>\r\r\n\t\t\t\t\r\r\n\t\t<td valign='top' nowrap>" . $row['telephone'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['emailaddress'] . "</td>\r\r\n\t\t<td valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\t\t\r\r\n\t\t</tr>";
        $counter++;
    }
    echo "<tr>\r\r\n\t<td colspan='5' align='right'  class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "deal/manage_deals/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
    echo "<div>No schools have been registered.</div";
}
?>

            
            
            </td>
            </tr>
コード例 #7
0
ファイル: add_ons.php プロジェクト: newwavetechug/gpp
								 <li class="divider"></li>
								 <li>' . $completion_str . '</li>
							 </ul>
							</div>';
                            print '<tr>' . '<td>' . $delete_str . '&nbsp;&nbsp;' . $edit_str . '&nbsp;&nbsp;' . $more_actions . '</td>' . '<td>' . custom_date_format('d M, Y', $row['date_signed']) . '</td>' . '<td>' . format_to_length($row['procurement_ref_no'], 30) . '</td>' . '<td>' . format_to_length($row['subject_of_procurement'], 30) . '</td>' . '<td>' . $status_str . '</td>' . '<td style="text-align:right; font-family:Georgia; font-size:14px">' . addCommas($row['total_price'], 0) . '</td>' . '<td>' . custom_date_format('d M, Y', $row['dateadded']) . ' by ' . format_to_length($row['authorname'], 10) . '</td>' . '</tr>';
                        }
                        print '</tbody></table>';
                    } else {
                        print format_notice('WARNING: Your search criteria does not match any contracts');
                    }
                } else {
                    if (!empty($area) && $area == 'procurement_entries') {
                        if (!empty($page_list)) {
                            print '<table class="table table-striped table-hover">' . '<thead>' . '<tr>' . '<th width="5%"></th>' . '<th>Procurement Ref. No</th>' . '<th class="hidden-480">Subject of procurement</th>' . '<th class="hidden-480">Source of funding</th>' . '<th class="hidden-480">Estimated amount</th>' . '<th>Author</th>' . '<th>Date Added</th>' . '</tr>' . '</thead>' . '</tbody>';
                            $delete_rights = check_user_access($this, 'delete_procurement_entry');
                            $edit_rights = check_user_access($this, 'edit_procurement_entry');
                            $delete_str = '';
                            $edit_str = '';
                            foreach ($page_list as $row) {
                                if ($delete_rights) {
                                    $delete_str = '<a title="Delete entry" href="javascript:void(0);" onclick="confirmDeleteEntity(\'' . base_url() . 'procurement/delete_entry/i/' . encryptValue($row['entryid']) . '\', \'Are you sure you want to delete this entry?\\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.\')"><i class="icon-trash"></i></a>';
                                }
                                if ($edit_rights) {
                                    $edit_str = '<a title="Edit entry details" href="' . base_url() . 'procurement/load_procurement_entry_form/i/' . encryptValue($row['entryid']) . '"><i class="icon-edit"></i></a>';
                                }
                                print '<tr>' . '<td>' . $delete_str . '&nbsp;&nbsp;' . $edit_str . '</td>' . '<td>' . $row['procurement_ref_no'] . '</td>' . '<td>' . format_to_length($row['subject_of_procurement'], 50) . '</td>' . '<td>' . $row['funding_source'] . '</td>' . '<td>' . (is_numeric($row['estimated_amount']) ? number_format($row['estimated_amount'], 0, '.', ',') . ' ' . $row['currency_abbr'] : $row['estimated_amount']) . '</td>' . '<td>' . (empty($row['authorname']) ? 'N/A' : $row['authorname']) . '</td>' . '<td>' . custom_date_format('d M, Y', $row['dateadded']) . '</td>' . '</tr>';
                            }
                            print '</tbody></table>';
                            print '<div class="pagination pagination-mini pagination-centered">' . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "bids/manage_bid_invitations/p/%d") . '</div>';
                        } else {
                            print format_notice('ERROR: Your search criteria does not match any records');
コード例 #8
0
ファイル: admin.php プロジェクト: newwavetechug/gpp
 function save_user()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'a', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     #check user access
     if (!empty($data['i'])) {
         check_user_access($this, 'edit_user_details', 'redirect');
     } else {
         check_user_access($this, 'add_users', 'redirect');
     }
     if ($this->input->post('cancel')) {
         redirect("admin/manage_users");
     } else {
         if ($this->input->post('save')) {
             $data['userdetails'] = $_POST;
             $required_fields = array('firstname', 'lastname', 'gender', 'emailaddress*EMAILFORMAT', 'telephone', 'username');
             $_POST = clean_form_data($_POST);
             $validation_results = validate_form('', $_POST, $required_fields);
             #Only proceed if the validation for required fields passes
             if ($validation_results['bool']) {
                 #User's added by non admins have PDE of author
                 if ($this->session->userdata('isadmin') == 'N') {
                     #should also NEVER try adding system admins, under any circumstances!
                     if (!empty($_POST['roles']) && $_POST['roles'] == 14) {
                         $this->session->set_userdata('usave', "ERROR: Invalid action");
                         redirect("user/dashboard/m/usave");
                     }
                     $userdata = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
                     $_POST['pde'] = $userdata[0]['pde'];
                 }
                 if (!empty($data['i'])) {
                     $userid = decryptValue($data['i']);
                     $data['msg'] = '';
                     #test if email is unique to user being edited
                     $user_details = $this->Query_reader->get_row_as_array('search_user_list', array('searchstring' => 'emailaddress="' . $_POST['emailaddress'] . '" AND userid != "' . $userid . '"', 'limittext' => ''));
                     if (!empty($user_details)) {
                         $data['msg'] = "ERROR: A user with the specified email address already exists. <br />";
                     }
                     if (!empty($_POST['password']) || !empty($_POST['repeatpassword'])) {
                         $passwordmsg = $this->user1->check_password_strength($_POST['password']);
                         if (!$passwordmsg['bool']) {
                             $data['msg'] .= "ERROR: " . $passwordmsg['msg'];
                         } elseif ($_POST['password'] == $_POST['repeatpassword']) {
                             $update_string = ", password = '" . sha1($_POST['password']) . "'";
                         } else {
                             $data['msg'] .= "ERROR: The passwords provided do not match.";
                         }
                     } else {
                         $update_string = "";
                     }
                     if (empty($data['msg'])) {
                         $result = $this->db->query($this->Query_reader->get_query_by_code('update_user_data', array_merge($_POST, array('updatecond' => $update_string, 'editid' => $userid))));
                         #update the user's roles
                         if (empty($_POST['roles'])) {
                             $this->db->update('roles', array('isactive' => 'N'), array('userid' => $userid, 'isactive' => 'Y'));
                         } else {
                             #get the user's current roles
                             $current_user_roles = $this->db->get_where('roles', array('userid' => $userid, 'isactive' => 'Y'))->result_array();
                             foreach ($current_user_roles as $current_user_role) {
                                 if (in_array($current_user_role['groupid'], $_POST['roles'])) {
                                     foreach ($_POST['roles'] as $role_key => $role_value) {
                                         if ($role_value == $current_user_role['groupid']) {
                                             unset($_POST['roles'][$role_key]);
                                             break;
                                         }
                                     }
                                 } else {
                                     $this->db->update('roles', array('isactive' => 'N'), array('id' => $current_user_role['id']));
                                 }
                             }
                             if (!empty($_POST['roles'])) {
                                 $this->db->insert('roles', array('userid' => $userid, 'groupid' => $_POST['roles'], 'author' => $this->session->userdata('userid')));
                             }
                         }
                         #echo $this->Query_reader->get_query_by_code('update_user_data', array_merge($_POST, array('updatecond'=>$update_string, 'editid'=>decryptValue($data['i']))));
                         #exit();
                     }
                 } else {
                     #check if a similar username already exists
                     $username_error = "";
                     $usernames = $this->db->query($this->Query_reader->get_query_by_code('get_existing_usernames', array('searchstring' => ' username = "' . $_POST['username'] . '"')));
                     #Check if adding a new user and the email added has already been used
                     if (!empty($data['userdetails']['emailaddress']) && empty($data['i'])) {
                         $user_details = $this->Query_reader->get_row_as_array('get_any_user_by_email', array('emailaddress' => $data['userdetails']['emailaddress']));
                     }
                     #determine password strength
                     $passwordmsg = $this->user1->check_password_strength($_POST['password']);
                     if (strlen($_POST['username']) < 5) {
                         $data['msg'] = "ERROR: The username must be at least 5 characters long";
                         $data['errormsgs']['username'] = "The username must be at least 5 characters long";
                         $data['requiredfields'] = array('username');
                     } elseif (count($usernames->result_array())) {
                         $data['msg'] = "ERROR: The username is already being used by another user.";
                         $data['errormsgs']['username'] = "The username is already being used by another user";
                         $data['requiredfields'] = array('username');
                     } elseif (!$passwordmsg['bool']) {
                         $data['msg'] = "ERROR: " . $passwordmsg['msg'];
                         $data['errormsgs']['password'] = $passwordmsg['msg'];
                         $data['requiredfields'] = array('password');
                     } elseif ($_POST['password'] == $_POST['repeatpassword'] && !empty($_POST['password'])) {
                         $result = $this->db->query($this->Query_reader->get_query_by_code('add_user_data', array_merge($_POST, array('password' => sha1($_POST['password']), 'author' => $this->session->userdata('userid')))));
                         #exit($this->db->last_query());
                         $last_added_user = $this->db->insert_id();
                         #Add the user roles if specified
                         if (!empty($_POST['roles'])) {
                             $this->db->insert('roles', array('userid' => $last_added_user, 'groupid' => $_POST['roles'], 'author' => $this->session->userdata('userid')));
                         }
                     } else {
                         $data['msg'] = "ERROR: The passwords provided do not match.";
                         $data['errormsgs']['password'] = $data['errormsgs']['repeatpassword'] = "The passwords provided do not match.";
                         $data['requiredfields'] = array('password', 'repeatpassword');
                     }
                 }
                 #Format and send the errors
                 if (!empty($result) && $result) {
                     #Notify user by email on creation of an account
                     if (empty($data['editid'])) {
                         $send_result = $this->sysemail->email_form_data(array('fromemail' => NOREPLY_EMAIL), get_confirmation_messages($this, array('emailaddress' => $_POST['emailaddress'], 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'username' => $_POST['username'], 'password' => $_POST['password']), 'registration_confirm'));
                     }
                     $this->session->set_userdata('usave', "The user data has been successfully saved.");
                     redirect("admin/manage_users/m/usave");
                 } else {
                     if (empty($data['msg'])) {
                         $data['msg'] = "ERROR: The user could not be saved or was not saved correctly.";
                     }
                 }
             } else {
                 if (empty($data['i']) && !empty($user_details)) {
                     /*
                     $addn_msg = (!empty($user_details['isactive']) && $user_details['isactive'] == 'N')? "<a href='".base_url()."admin/load_user_form/i/".encryptValue($user_details['id'])."/a/".encryptValue("reactivate")."' style='text-decoration:underline;font-size:17px;'>Click here to  activate and  edit</a>": "<a href='".base_url()."admin/load_user_form/i/".encryptValue($user_details['userid'])."' style='text-decoration:underline;font-size:17px;'>Click here to edit</a>";
                     */
                     $data['msg'] = "ERROR: The emailaddress has already been used by another user";
                     $data['errormsgs']['emailaddress'] = "The emailaddress has already been used by another user";
                     $data['requiredfields'] = array('emailaddress');
                 }
             }
             if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
                 if (!empty($validation_results['errormsgs'])) {
                     $data['msg'] = "WARNING: " . end($validation_results['errormsgs']);
                     $data['errormsgs'] = $validation_results['errormsgs'];
                 } else {
                     $data['msg'] = "WARNING: The highlighted fields are required.";
                 }
                 $data['requiredfields'] = $validation_results['requiredfields'];
             }
         }
     }
     $data['page_title'] = !empty($data['i']) ? 'Edit user details' : 'Add user';
     $data['current_menu'] = 'add_users';
     $data['view_to_load'] = 'users/user_form_v';
     $data['view_data']['form_title'] = $data['page_title'];
     $data['view_data']['formdata'] = $_POST;
     #Get access groups
     $data['usergroups'] = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array('searchstring' => 'UG.isactive="Y" ' . ($this->session->userdata('isadmin') == 'N' ? ' AND UG.id != 14 ' : ''), 'orderby' => 'ORDER BY UG.groupname', 'limittext' => '')))->result_array();
     #Get pdes
     $this->db->order_by("pdename", "asc");
     $data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
     $this->load->view('dashboard_v', $data);
 }
コード例 #9
0
ファイル: reports.php プロジェクト: newwavetechug/gpp
 function suspended_providers()
 {
     check_user_access($this, 'suspended_provider_reports', 'redirect');
     $data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
     $data['pdes'] = array_merge(array(array('pdeid' => 'ALL', 'pdename' => 'View All')), $data['pdes']);
     $data['financial_years'] = $this->financial_years;
     $data['page_title'] = 'Best Evaluated Bids awarded to suspended providers ' . date('Y') . '-' . (date('Y') + 1);
     $data['current_menu'] = 'suspended_provider_reports';
     $data['view_to_load'] = 'reports/suspended_providers/suspended_provider_reports_v';
     $data['view_data']['form_title'] = $data['page_title'];
     $data['search_url'] = '';
     $data['rop_suspended_providers'] = $this->remoteapi_m->providers_suspended();
     $data['report_form'] = 'reports/suspended_providers/forms/suspended_providers_f';
     $data['report_view'] = 'reports/suspended_providers/suspended_providers_home';
     if ($this->input->post('generate_ppms')) {
         //print_array($_POST);
         $data['page_title'] = 'Best Evaluated Bids awarded to suspended providers ' . $this->input->post('financial_year');
         $start_year = substr($this->input->post('financial_year'), 0, 4);
         $end_year = substr($this->input->post('financial_year'), 5, 4);
         $where = array('isactive' => 'Y', 'datereceived >=' => date('Y-m-d', strtotime($start_year . '-01-01')), 'datereceived <=' => date('Y-m-d', strtotime($end_year . '-01-01')), 'beb' => 'Y');
         $data['month'] = $this->input->post('month');
         //if there are where variables
         if (isset($where)) {
             $data['results'] = $this->receipts_m->get_where($where);
         }
         //print_array($this->db->last_query());
     } else {
         $data['month'] = custom_date_format('M', mysqldate());
         $where = array('isactive' => 'Y', 'datereceived >=' => date('Y-m-d', strtotime(date('Y') . '-01-01')), 'datereceived <=' => date('Y-m-d', strtotime(date('Y') + 1 . '-01-01')), 'beb' => 'Y');
     }
     $data['results'] = $this->receipts_m->get_where($where);
     $this->load->view('dashboard_v', $data);
 }
コード例 #10
0
ファイル: bids.php プロジェクト: newwavetechug/gpp
 function load_approve_bid_invitation_form()
 {
     #check user access
     check_user_access($this, 'approve_invitation_for_bids', 'redirect');
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $app_select_str = ' procurement_plan_entries.isactive="Y" ';
     if ($this->session->userdata('isadmin') == 'N') {
         $userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
         $app_select_str .= ' AND procurement_plans.pde_id ="' . $userdetails[0]['pde'] . '"';
     }
     $data['procurement_plan_entries'] = $this->db->query($this->Query_reader->get_query_by_code('procurement_plan_details', array('searchstring' => $app_select_str, 'limittext' => '', 'orderby' => ' procurement_plan_entries.dateadded ')))->result_array();
     #exit($this->db->last_query());
     if (!empty($data['i'])) {
         $app_select_str = ' procurement_plan_entries.isactive="Y" ';
         if ($this->session->userdata('isadmin') == 'N') {
             $userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
             $app_select_str .= ' AND procurement_plans.pde_id ="' . $userdetails[0]['pde'] . '"';
         }
         $bid_id = decryptValue($data['i']);
         $data['formdata'] = $this->Query_reader->get_row_as_array('search_table', array('table' => 'bidinvitations', 'limittext' => '', 'orderby' => 'id', 'searchstring' => ' id="' . $bid_id . '" AND isactive="Y"'));
         #get procurement plan details
         if (!empty($data['formdata']['procurement_ref_no'])) {
             $data['formdata']['procurement_details'] = $this->Query_reader->get_row_as_array('procurement_plan_details', array('searchstring' => $app_select_str . ' AND procurement_plan_entries.procurement_ref_no="' . $data['formdata']['procurement_ref_no'] . '"', 'limittext' => '', 'orderby' => ' procurement_plan_entries.dateadded '));
         }
     }
     if (!empty($data['formdata']['approval_comments'])) {
         $data['formdata']['approval_comments'] = $_POST['approval_comments'];
     }
     $data['page_title'] = 'Approve bid invitation';
     $data['current_menu'] = 'manage_bid_invitations';
     $data['view_to_load'] = 'bids/approve_bid_invitation_form';
     $data['view_data']['form_title'] = $data['page_title'];
     $this->load->view('dashboard_v', $data);
 }
コード例 #11
0
ファイル: contracts.php プロジェクト: newwavetechug/gpp
 function delete_contract()
 {
     #check user access
     check_user_access($this, 'delete_contract', 'redirect');
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 's', 'i', 'b'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item' => 'contracts', 'id' => decryptValue($data['i']))));
     }
     if (!empty($result) && $result) {
         #deactivate the contract prices as well
         $this->db->update('contract_prices', array('isactive' => 'Y'), array('contract_id' => decryptValue($data['i'])));
         $this->session->set_userdata('dbid', "The contract details have been successfully deleted.");
     } else {
         if (empty($data['msg'])) {
             $this->session->set_userdata('dbid', "ERROR: The contract details could not be deleted or were not deleted correctly.");
         }
     }
     redirect(base_url() . "contracts/manage_contracts/m/dbid/");
 }
コード例 #12
0
ファイル: manage_reports.php プロジェクト: nwtug/academia
        if (check_user_access($this, 'update_report')) {
            ?>

						<a href="<?php 
            echo base_url();
            ?>
reports/add_report/i/<?php 
            echo encryptValue($row['id']);
            ?>
" title="Click to update this report"><img src="<?php 
            echo base_url();
            ?>
images/edit.png" border="0"/></a>
						<?php 
        }
        if (check_user_access($this, 'update_report_access')) {
            ?>

						  <a  href="<?php 
            echo base_url();
            ?>
reports/report_access_control/i/<?php 
            echo encryptValue($row['id']);
            ?>
" title="Click to update this report's access permissions"><img src="<?php 
            echo base_url();
            ?>
images/patient_history.png" border="0"/></a>
                          
                          <?php 
        }
コード例 #13
0
ファイル: procurement.php プロジェクト: newwavetechug/gpp
 function delete_entry()
 {
     #check user access
     check_user_access($this, 'delete_procurement_entry', 'redirect');
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 's', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $redirect_url = '';
     if (!empty($data['i'])) {
         $search_str = '';
         if ($this->session->userdata('isadmin') == 'N') {
             $userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
             $search_str .= ' AND PP.pde_id ="' . $userdetails[0]['pde'] . '"';
         }
         $entry_details = $this->Query_reader->get_row_as_array('procurement_entries', array('table' => 'procurement_plan_entries', 'searchstring' => ' AND PPE.id = "' . decryptValue($data['i']) . '" AND PPE.isactive="Y" ' . $search_str, 'orderby' => 'PPE.id', 'limittext' => ''));
         if (!empty($entry_details)) {
             $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item' => 'procurement_plan_entries', 'id' => $entry_details['entryid'])));
             $redirect_url = "procurement/procurement_plan_entries/v/" . encryptValue($entry_details['procurement_plan_id']) . "/m/dbid";
         } else {
             $msg = "ERROR: Invalid function access";
             $this->session->set_userdata('dbid', $msg);
             $redirect_url = "user/dashboard/m/dbid";
             exit('hmm');
         }
     }
     if (!empty($result) && $result) {
         $this->session->set_userdata('dbid', "The procurement entry has been successfully deleted.");
     } else {
         if (empty($msg)) {
             $this->session->set_userdata('dbid', "ERROR: The procurement entry could not be deleted or were not deleted correctly.");
         }
     }
     redirect(base_url() . $redirect_url);
 }
コード例 #14
0
function auth_user($loc = null)
{
    if (!is_user_logged_in()) {
        if (is_null($loc)) {
            auth_redirect();
        } else {
            wp_redirect(site_url($loc));
            exit;
        }
    }
    if (!check_user_access(get_current_user_id(), get_the_ID())) {
        wp_redirect(site_url('/members-only'));
        exit;
    }
}
コード例 #15
0
ファイル: user.php プロジェクト: newwavetechug/gpp
 function load_user_form()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'a'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     #check user access
     if (!empty($data['i'])) {
         check_user_access($this, 'edit_user_details', 'redirect');
     } else {
         check_user_access($this, 'add_users', 'redirect');
     }
     #Get access groups
     $data['usergroups'] = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array('searchstring' => 'UG.isactive="Y" ' . ($this->session->userdata('isadmin') == 'N' ? ' AND UG.id != 14  AND UG.groupname not like "%PPDA Administrator%"' : ''), 'orderby' => 'ORDER BY UG.groupname', 'limittext' => '')))->result_array();
     #Get pdes
     $this->db->order_by("pdename", "asc");
     $data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
     #user is editing
     if (!empty($data['i'])) {
         $userid = decryptValue($data['i']);
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_user_by_id', array('id' => $userid));
         #get the user's roles
         $user_roles = $this->db->query($this->Query_reader->get_query_by_code('get_roles_by_user', array('userid' => $userid)))->result_array();
         #format role IDs into simple array
         $data['formdata']['roles'] = array();
         foreach ($user_roles as $user_role) {
             array_push($data['formdata']['roles'], $user_role['groupid']);
         }
         #If the user is to be reactivated
         if (!empty($data['a']) && decryptValue($data['a']) == 'reactivate' && $this->session->userdata('isadmin') == 'Y') {
             $result = $this->db->query($this->Query_reader->get_query_by_code('reactivate_user', array('id' => $userid)));
             if ($result) {
                 $send_result = $this->sysemail->email_form_data(array('fromemail' => NOREPLY_EMAIL), get_confirmation_messages($this, $data['userdetails'], 'account_reactivated_notice'));
             } else {
                 $data['msg'] = "ERROR: There was an error activating the user.";
             }
         }
         #Check if the user is simply viewing
         if (!empty($data['a']) && decryptValue($data['a']) == 'view') {
             $data['isview'] = "Y";
             #get the access group name
             $data['access_group_info'] = $this->Query_reader->get_row_as_array('get_group_by_id', array('groupid' => $data['userdetails']['accessgroup']));
         }
     }
     $data['page_title'] = !empty($data['i']) ? 'Edit user details' : 'Add user';
     $data['current_menu'] = 'add_users';
     $data['view_to_load'] = 'users/user_form_v';
     $data['view_data']['form_title'] = $data['page_title'];
     $this->load->view('dashboard_v', $data);
 }
コード例 #16
0
ファイル: deal.php プロジェクト: nwtug/academia
 function add_deal()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!check_user_access($this, 'add_new_deal') && check_user_access($this, 'add_new_issue')) {
         $data['t'] = encryptValue('issue');
     }
     if (!empty($data['i'])) {
         $editid = decryptValue($data['i']);
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_deal_by_id', array('id' => $editid));
         $data['formdata']['starthr'] = substr($data['formdata']['starttime'], 0, 2);
         $data['formdata']['startmins'] = substr($data['formdata']['starttime'], 2, 2);
         $data['formdata']['endhr'] = substr($data['formdata']['endtime'], 0, 2);
         $data['formdata']['endmins'] = substr($data['formdata']['endtime'], 2, 2);
         $userdetails = $this->Query_reader->get_row_as_array('get_user_by_id', array('id' => $data['formdata']['generalpartner']));
         $data['formdata']['generalpartnerview'] = !empty($userdetails) ? $userdetails['firstname'] . " " . $userdetails['lastname'] : "";
     }
     #Check if the user is simply viewing the deal
     #TODO: Add the force-users-without-other-permissions-to-view condition
     if (!empty($data['a']) && decryptValue($data['a']) == 'view') {
         $data['isview'] = "Y";
     }
     #Get the document details
     if ($this->input->post('savedeal')) {
         $required_fields = array('dealtype', 'deskid', 'displaydealtype', 'dealdescription', 'dealamount', 'fundsymbol', 'startdate', 'enddate');
         $_POST = clean_form_data($_POST);
         $validation_results = validate_form('', $_POST, $required_fields);
         $_POST['startdate'] = empty($_POST['startdate']) ? "" : date('Y-m-d', strtotime($_POST['startdate']));
         $_POST['enddate'] = empty($_POST['enddate']) ? "" : date('Y-m-d', strtotime($_POST['enddate']));
         $_POST['keydate'] = empty($_POST['keydate']) ? "" : date('Y-m-d', strtotime($_POST['keydate']));
         $_POST['lastrevised'] = empty($_POST['lastrevised']) ? "" : date('Y-m-d', strtotime($_POST['lastrevised']));
         $_POST['starttime'] = str_pad($_POST['starthr'], 2, "0", STR_PAD_LEFT) . str_pad($_POST['startmins'], 2, "0", STR_PAD_LEFT);
         $_POST['endtime'] = str_pad($_POST['endhr'], 2, "0", STR_PAD_LEFT) . str_pad($_POST['endmins'], 2, "0", STR_PAD_LEFT);
         $_POST['dealamount'] = removeCommas($_POST['dealamount']);
         #Only proceed if the validation for required fields passes
         if ($validation_results['bool']) {
             #First remove the document record and file from the system
             if (!empty($data['formdata']) && !empty($data['i'])) {
                 $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_deal', array_merge($_POST, array('editid' => $editid))));
             } else {
                 $save_result = $this->db->query($this->Query_reader->get_query_by_code('save_new_deal', array_merge($_POST, array('createdby' => $this->session->userdata('userid')))));
             }
             if ($save_result) {
                 $dealid = !empty($editid) ? $editid : mysql_insert_id();
                 $docs = $this->db->query($this->Query_reader->get_query_by_code('get_deal_documents', array('dealid' => $dealid)));
                 $deal_docs = $docs->result_array();
                 $data['msg'] = "The deal has been saved.";
                 $data['msg'] .= empty($deal_docs) ? "<br><span class='error' style='padding:0px;'>Please add the deal documents before sending invitations.</span>" : "";
                 $this->session->set_userdata('sres', $data['msg']);
                 redirect(base_url() . "deal/manage_deals/m/sres");
             } else {
                 $data['msg'] = "ERROR: The deal was not saved. Please contact your administrator.";
             }
         }
         #VALIDATION end
         if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
             $data['msg'] = "WARNING: The highlighted fields are required.";
         }
         $data['requiredfields'] = $validation_results['requiredfields'];
         $data['formdata'] = $_POST;
     }
     $this->load->view('deals/new_deal_view', $data);
 }
コード例 #17
0
          
    	  </table>
		 </td>
          </tr>
          <tr>
            <td valign="top">
            
            <div id="searchresults">
            <?php 
#$page_list = array();
if (!empty($page_list)) {
    echo "<table class='datatable' width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader' width='1%'>&nbsp;</td>\r\r\n           \t<td class='listheader' nowrap>Student &nbsp;<a class='fancybox fancybox.ajax' href='" . base_url() . "students/load_student_form' title='Click to add a student'><img src='" . base_url() . "images/add_item.png' border='0'/></a></td>\r\r\n\t\t\t<td class='listheader' nowrap>Sponsor</td>\r\r\n\t\t\t<td class='listheader' nowrap>Student No</td>\r\r\n           \t<td class='listheader' nowrap>Age</td>" . ($view_leave ? "<td class='listheader' nowrap>Current Class</td>" . "<td class='listheader' nowrap>Leaves taken</td></tr>" : "<td class='listheader' nowrap>Admission Class</td>\r\r\n\t\t\t<td class='listheader' nowrap>Current Class</td>\r\r\n\t\t\t<td class='listheader' nowrap>Date Added</td>\r\r\n\t\t\t</tr>");
    $counter = 0;
    $current_student = 0;
    #check if user has delete rights
    $delete_students = check_user_access($this, 'delete_students');
    foreach ($page_list as $row) {
        #Show one row at a time
        #Get the admission term title and year
        if (!$view_leave) {
            $admitterminfo = get_term_name_year($this, $row['admissionterm']);
            #Get the admission class
            $admitclass = get_class_title($this, $row['admissionclass']);
        }
        #Get the current class details
        $current_class = current_class($this, $row['id']);
        echo "<tr class='listrow " . ($counter % 2 ? '' : 'grey_list_row') . "' id='student-list-row-" . $row['id'] . "'>\r\r\n\t\t<td class='leftListCell rightListCell' valign='top' nowrap>";
        if ($view_leave) {
            echo " &nbsp;&nbsp; <a href='" . base_url() . "students/load_leave_form/s/" . encryptValue($row['id']) . "' title=\"Click to assign " . $row['firstname'] . " leave.\">Assign leave</a>";
        } else {
            #if(check_user_access($this,'delete_deal')){
コード例 #18
0
ファイル: addons.php プロジェクト: nwtug/academia
         $table_HTML .= "</table>";
     } else {
         $table_HTML .= format_notice("<span class='error'>No help meets your search.</span>");
     }
 } else {
     if (!empty($area) && $area == 'message_list') {
         $table_HTML .= $combined_js_HTML . $combined_css_HTML;
         if (!empty($page_list)) {
             $table_HTML .= "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader' width='1%'>&nbsp;</td>\r\r\n           \t<td class='listheader' width='1%' nowrap>Message</td>\r\r\n           \t<td class='listheader' width='98%' nowrap>Date</td>\r\r\n\t\t\t</tr>";
             $counter = 0;
             foreach ($page_list as $row) {
                 $bold_start = $row['isread'] == 'N' ? "<b>" : "";
                 $bold_end = $row['isread'] == 'N' ? "</b>" : "";
                 #Show one row at a time
                 $table_HTML .= "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t\t<td valign='top' nowrap>";
                 if (check_user_access($this, 'delete_message')) {
                     $table_HTML .= "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "messages/deactivate_message/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this message? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this message.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
                 }
                 $table_HTML .= "</td>\r\r\n\r\r\n\t\t\t<td valign='top' nowrap><a href='" . base_url() . "messages/load_form/i/" . encryptValue($row['id']) . "/a/" . encryptValue('view') . "' class='contentlink'>" . $bold_start . wordwrap($row['subject'], 80, "<BR>") . $bold_end . "</a></td>\r\r\n\r\r\n\t\t\t<td valign='top' nowrap>" . $bold_start . date("d-M-Y h:iA", strtotime($row['datesent'])) . $bold_end . "</td>\r\r\n\t\t\t</tr>";
                 $counter++;
             }
             $table_HTML .= "</table>";
         } else {
             $table_HTML .= format_notice("<span class='error'>No messages meet your search.</span>");
         }
     } else {
         if (!empty($area) && $area == 'selected_receiver_list') {
             $table_HTML .= $combined_js_HTML . $combined_css_HTML;
             if ($this->session->userdata('exclusers')) {
                 $excl_users = $this->session->userdata('exclusers');
                 $page_result = $this->db->query($this->Query_reader->get_query_by_code('get_users_in_list', array('idlist' => "'" . implode("','", $excl_users) . "'")));
コード例 #19
0
ファイル: user_left_menu.php プロジェクト: nwtug/academia
    $menu['finances'] .= '</li>' . $finances['close_link'];
}
#Manage library
if ($this->session->userdata('isschooladmin') == 'Y' || check_user_access($this, 'access_library')) {
    $menu['library'] = $library['open_link'] . '<li ' . $library['selected'] . ' > 
					 <table id="table_library">
						<tr>
						<td width="50"><img src="' . base_url() . 'images/library.jpg" /></td>
						<td class="menu_vertical_separator"><img src="' . base_url() . 'images/menu_vertical_separator.jpg" /></td>
						<td>LIBRARY</td>
						</tr>
					  </table>';
    $menu['library'] .= '</li>' . $library['close_link'];
}
#Manage Inventory
if ($this->session->userdata('isschooladmin') == 'Y' || check_user_access($this, 'access_inventory')) {
    $menu['inventory'] = $inventory['open_link'] . '<li ' . $inventory['selected'] . ' > 
					 <table id="table_inventory">
						<tr>
						<td width="50"><img src="' . base_url() . 'images/store.jpg" /></td>
						<td class="menu_vertical_separator"><img src="' . base_url() . 'images/menu_vertical_separator.jpg" /></td>
						<td>STORE</td>
						</tr>
					  </table>';
    $menu['inventory'] .= '</li>' . $inventory['close_link'];
}
#Remove selected link from main stack
if (!empty($mselected) && $mselected != 'schools') {
    #store menu items in temp array
    //$temp_array = array();
    //$temp_array[$mselected] = $menu[$mselected];
コード例 #20
0
ファイル: report_archives.php プロジェクト: nwtug/academia
            ?>

						  <a  href="javascript:void(0)" onclick="confirmDeleteEntity('<?php 
            echo base_url();
            ?>
reports/delete_report/i/<?php 
            echo encryptValue($row['id']);
            ?>
', 'Are you sure you want to delete this report ? The report will be deleted permanently.\nClick OK to confirm, \nCancel to cancel this operation and stay on this page.')" title="Click to delete this report item"><img src="<?php 
            echo base_url();
            ?>
images/delete.png" border="0"/></a>
                          
                          <?php 
        }
        if (check_user_access($this, 'restore_report')) {
            ?>

						  <a  href="javascript:void(0)" onclick="confirmDeleteEntity('<?php 
            echo base_url();
            ?>
reports/unarchive_report/i/<?php 
            echo encryptValue($row['id']);
            ?>
', 'Are you sure you want to restore this report ? The report will be visible in the report list.\nClick OK to confirm, \nCancel to cancel this operation and stay on this page.')" title="Click to restore this report"><img src="<?php 
            echo base_url();
            ?>
images/restore.png" border="0"/></a>	<?php 
        }
        echo "</td><td>";
        echo "</td>" . "<td nowrap=\"nowrap\"><a href='" . base_url() . "documents/force_download/f/" . encryptValue('reports') . "/u/" . encryptValue($row['fileurl']) . "' class='contentlink' >" . $row['reportname'] . "</a></td>" . "<td nowrap=\"nowrap\"><a href='" . base_url() . "reports/report_access_list/i/" . encryptValue($row['id']) . "' class='contentlink' >View list</a></td>" . "</tr>";
コード例 #21
0
ファイル: admin.php プロジェクト: rmuyinda/dms-1
 function delete_user()
 {
     check_user_access($this, 'delete_user', 'redirect');
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_user', array('id' => decryptValue($data['i']))));
     }
     if (!empty($result) && $result) {
         $this->session->set_userdata('duser', "The user data has been successfully deleted.");
     } else {
         if (empty($data['msg'])) {
             $this->session->set_userdata('duser', "ERROR: The user could not be deleted or was not deleted correctly.");
         }
     }
     if (!empty($data['t']) && $data['t'] == 'super') {
         $tstr = "/t/super";
     } else {
         $tstr = "";
     }
     redirect("admin/manage_users/m/duser" . $tstr);
 }
コード例 #22
0
</script><div class="widget">
    <div class="widget-title">
        <h4><i class="fa fa-reorder"></i>&nbsp;<?php 
echo $page_title;
?>
</h4>
            <span class="tools">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javascript:;" class="fa fa-remove"></a>
            </span>
    </div>
    <div class="widget-body" id="results">
    	<?php 
#$ros = mysqli_fetch_array($suspended_proviers);
#print_r($ros);
$xv = check_user_access($this, 'edit_provider', 'returnbool');
if (!empty($suspended_proviers)) {
    print '<table class="table table-striped table-hover">' . '<thead>' . '<tr>' . '<th width="5%"> </th>' . '<th>Organisation</th>' . '<th class="hidden-480">Date of Suspension</th>' . '<th class="hidden-480">Date of End of Suspension</th>' . '<th class="hidden-480">Days Remaining</th>' . '<th class="hidden-480"> Date Added</th>' . '<th class="hidden-480">Author</th>' . '<th> </th>' . '</tr>' . '</thead>' . '</tbody>';
    while ($row = mysqli_fetch_array($suspended_proviers)) {
        # code...
        //   	<a href="<?=base_url().'receipts/load_edit_receipt_form/'.encryptValue($value['receiptid']);  "> <i class="fa fa-edit"></i></a>
        $date = date('Y-m-d');
        $diff = abs(strtotime($row['endsuspension']) - strtotime($date));
        $years = floor($diff / (365 * 60 * 60 * 24));
        $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
        $days = floor($diff / (60 * 60 * 24));
        print '<tr>' . '<td>';
        if ($xv == true) {
            print '<a href="' . base_url() . 'providers/load_edit_provider_form/' . encryptValue($row['recordid']) . '"> <i class="fa fa-edit"></i></a>' . '<a href="#" id="archive_' . $row['recordid'] . '" class="savedelprovider"> <i class="fa fa-trash"></i></a>';
        }
        print '</td>';
コード例 #23
0
ファイル: providers.php プロジェクト: newwavetechug/gpp
 function delproviders_ajax()
 {
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     print_r($data);
     check_user_access($this, 'del_provider', 'redirect');
     //check_user_access($this, 'del_receipts', 'redirect');
     $deltype = $this->uri->segment(3);
     $receiptid = $this->uri->segment(4);
     $result = $this->Remoteapi_m->remove_restore_provider($deltype, $data['archive']);
     echo $result;
 }
コード例 #24
0
                                            <td>Contract award and signature</td>
                                            <td><?php 
echo custom_date_format('l, d M, Y', $formdata['contract_award_date']);
?>
</td>
                                        </tr>
                                    </table>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                </div>
            
            <?php 
if (($formdata['isapproved'] == 'N' || empty($formdata['cc_approval_date'])) && check_user_access($this, 'publish_invitation_for_bids') && empty($v)) {
    ?>
                <div class="form-actions">
                    <button id="approve-bid-invitation" type="submit" name="save" value="save" class="btn blue">
                        <i class="fa fa-ok"></i> Publish IFB
                    </button>
                    <button type="button" name="cancel" value="cancel" class="btn"><i class="fa fa-remove"></i> Cancel</button>
                </div>
            <?php 
} elseif (empty($v)) {
    ?>
                <div class="form-actions">
                    <button id="approve-bid-invitation" type="submit" name="view_pdf" value="view_pdf" class="btn blue">
                        <i class="fa fa-file"></i> View PDF
                    </button>
                    <button type="button" name="cancel" value="cancel" class="btn"><i class="fa fa-remove"></i> Cancel</button>
コード例 #25
0
ファイル: reports.php プロジェクト: newwavetechug/gpp
 function monthly_procurement_reports()
 {
     check_user_access($this, 'monthly_procurement_reports', 'redirect');
     $data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
     $data['pdes'] = array_merge(array(array('pdeid' => 'ALL', 'pdename' => 'View All')), $data['pdes']);
     $data['financial_years'] = $this->financial_years;
     //if form is posted
     if ($this->input->post('generate_report')) {
         //print_array($_POST);
         /*
         *      [report_type] =>
                [pde] =>
                [financial_year] =>
                [from_date] =>
                [to_date] =>
                [generate_report] => view-report
         )
         */
         //derive financial year
         if ($this->input->post('financial_year')) {
             $data['financial_year'] = $this->input->post('financial_year');
         } else {
             //if no financial is chosen assume current year
             $data['financial_year'] = date('Y') . '-' . (date('Y') + 1);
         }
         $config = array(array('field' => 'report_type', 'label' => 'Report type', 'rules' => 'required'));
         $this->form_validation->set_rules($config);
         if ($this->form_validation->run() == FALSE) {
             $data['errors'] = validation_errors();
         } else {
             //PRELIMINARY CALCULATIONS
             //if a report type is chosen
             $data['all_post_params'] = $_POST;
             //determine selected pde
             if ($this->session->userdata('isadmin') == 'Y') {
                 //if admin has selected pde
                 if ($this->input->post('pde')) {
                     $data['selected_pde'] = $this->input->post('pde');
                 } else {
                     //if no pde is selected
                     $data['selected_pde'] = '';
                 }
             } else {
                 //for regular users pde is derived from session
                 $data['selected_pde'] = $this->session->userdata('pdeid');
             }
             //handling date ranges
             //if from is chosen
             if ($this->input->post('from_date') && !$this->input->post('to_date')) {
                 $data['errors'] = 'Select an end date range';
             }
             if ($this->input->post('to_date') && !$this->input->post('from_date')) {
                 $data['errors'] = 'Select a start date range';
             }
             //if both date ranges are selected
             if ($this->input->post('to_date') && $this->input->post('from_date')) {
                 //ensure that end date is not greater than start range
                 if (strtotime($this->input->post('to_date')) < $this->input->post('to_date')) {
                     $data['errors'] = 'End date range can not be less that start date range';
                 } else {
                     $data['from_date'] = $this->input->post('from_date');
                     $data['to_date'] = $this->input->post('to_date');
                 }
             }
             $from = $this->input->post('from_date');
             $to = $this->input->post('to_date');
             //SWITCH BY SELECTED REPORT TYPE
             switch ($this->input->post('report_type')) {
                 //case of contracts awarded except micro procurement
                 case 'contracts_awarded':
                     $micro_procurement_limit = 5000000;
                     $data['notes'] = 'Only contracts whose value is above <b><small>UGX</small> ' . number_format($micro_procurement_limit) . '</b> were considered';
                     $data['page_title'] = 'Contracts Awarded (except Micro Procurement) ';
                     $data['report_heading'] = $data['page_title'];
                     $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b> &nbsp<i> to </i> <b>  &nbsp &nbsp' . custom_date_format('d M, Y', $to) . '</b>';
                     $data['current_menu'] = 'monthly_procurement_reports';
                     $data['view_data']['form_title'] = $data['page_title'];
                     $data['report_view'] = 'reports/monthly_procurement_reports/contracts_awarded_v';
                     //results depending on who is logged in
                     //get_contracts_awarded_except_micro_procurements($from,$to,$pde='',$micro_limit)
                     if ($this->session->userdata('isadmin') == 'Y') {
                         //if admin has selected pde
                         if ($this->input->post('pde')) {
                             $data['selected_pde'] = $this->input->post('pde');
                         } else {
                             //if no pde is selected
                             $data['selected_pde'] = '';
                         }
                         $pde = $this->input->post('pde');
                         $data['results'] = $this->contracts_m->get_contracts_awarded_except_micro_procurements($from, $to, $pde, $micro_procurement_limit);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     } else {
                         $data['selected_pde'] = $this->session->userdata('pdeid');
                         //for regular users pde is derived from session
                         $pde = $this->session->userdata('pdeid');
                         $data['results'] = $this->contracts_m->get_contracts_awarded_except_micro_procurements($from, $to, $pde, $micro_procurement_limit);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     }
                     break;
                     //case of contracts awarded except micro procurement
                 //case of contracts awarded except micro procurement
                 case 'micro_procurements':
                     $micro_procurement_limit = 5000000;
                     $data['notes'] = 'Only contracts whose value is below <b><small>UGX</small> ' . number_format($micro_procurement_limit) . '</b> were considered';
                     $data['page_title'] = 'Report On Micro Procurements ';
                     $data['report_heading'] = $data['page_title'];
                     $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b> &nbsp<i> to </i> <b>  &nbsp &nbsp' . custom_date_format('d M, Y', $to) . '</b>';
                     $data['current_menu'] = 'monthly_procurement_reports';
                     $data['view_data']['form_title'] = $data['page_title'];
                     $data['report_view'] = 'reports/monthly_procurement_reports/micro_procurements_v';
                     //results depending on who is logged in
                     //get_contracts_awarded_except_micro_procurements($from,$to,$pde='',$micro_limit)
                     if ($this->session->userdata('isadmin') == 'Y') {
                         //if admin has selected pde
                         if ($this->input->post('pde')) {
                             $data['selected_pde'] = $this->input->post('pde');
                         } else {
                             //if no pde is selected
                             $data['selected_pde'] = '';
                         }
                         $pde = $this->input->post('pde');
                         $data['results'] = $this->contracts_m->get_contracts_awarded_only_micro_procurements($from, $to, $pde, $micro_procurement_limit);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     } else {
                         $data['selected_pde'] = $this->session->userdata('pdeid');
                         //for regular users pde is derived from session
                         $pde = $this->session->userdata('pdeid');
                         $data['results'] = $this->contracts_m->get_contracts_awarded_only_micro_procurements($from, $to, $pde, $micro_procurement_limit);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     }
                     break;
                     //case of contracts awarded except micro procurement
                 //case of contracts awarded except micro procurement
                 case 'contracts_completed':
                     $data['notes'] = 'Only awarded contracts whose  <b>Actual date of completion less than today <span>' . date('d.F.Y', now()) . '</span></b> were considered';
                     $data['page_title'] = 'Contracts Completed ';
                     $data['report_heading'] = $data['page_title'];
                     $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b> &nbsp<i> to </i> <b>  &nbsp &nbsp' . custom_date_format('d M, Y', $to) . '</b>';
                     $data['current_menu'] = 'monthly_procurement_reports';
                     $data['view_data']['form_title'] = $data['page_title'];
                     $data['report_view'] = 'reports/monthly_procurement_reports/contracts_completed_v';
                     //results depending on who is logged in
                     //get_contracts_awarded_except_micro_procurements($from,$to,$pde='',$micro_limit)
                     if ($this->session->userdata('isadmin') == 'Y') {
                         //if admin has selected pde
                         if ($this->input->post('pde')) {
                             $data['selected_pde'] = $this->input->post('pde');
                         } else {
                             //if no pde is selected
                             $data['selected_pde'] = '';
                         }
                         $pde = $this->input->post('pde');
                         $data['results'] = $this->contracts_m->get_completed_contracts($from, $to, $pde);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     } else {
                         $data['selected_pde'] = $this->session->userdata('pdeid');
                         //for regular users pde is derived from session
                         $pde = $this->session->userdata('pdeid');
                         $data['results'] = $this->contracts_m->get_completed_contracts($from, $to, $pde);
                         $data['all_contracts'] = $this->contracts_m->get_contracts_all_awarded($from, $to, $pde);
                     }
                     break;
                 default:
                     $data['page_title'] = 'Monthly Report On Procurement ';
                     $data['current_menu'] = 'monthly_procurement_reports';
                     $data['view_data']['form_title'] = $data['page_title'];
                     $data['report_view'] = 'reports/monthly_procurement_reports/monthly_procurement_reports_home_v';
             }
         }
     } else {
         //by default show splash page
         $data['page_title'] = 'Monthly Report On Procurement ';
         $data['current_menu'] = 'monthly_procurement_reports';
         $data['view_data']['form_title'] = $data['page_title'];
         $data['report_view'] = 'reports/monthly_procurement_reports/monthly_procurement_reports_home_v';
     }
     $data['report_form'] = 'reports/monthly_procurement_reports/forms/monthly_procurement_reports_f';
     $data['view_to_load'] = 'reports/monthly_procurement_reports/monthly_procurement_reports_v';
     $this->load->view('dashboard_v', $data);
 }
コード例 #26
0
              </tr>
            <tr>
              <td>
<div id="searchresults">
<?php 
#Show search results
if (!empty($page_list)) {
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n          \t<tr>\r\r\n\t\t\t<td class='listheader'>&nbsp;</td>\r\r\n           \t<td class='listheader' nowrap>Organization</td>\r\r\n\t\t\t<td class='listheader' nowrap>Symbol</td>\r\r\n\t\t\t<td class='listheader' nowrap>Contact Email</td>\r\r\n\t\t\t<td class='listheader' nowrap>Contact Phone</td>\r\r\n\t\t\t</tr>";
    $counter = 0;
    foreach ($page_list as $row) {
        #Show one row at a time
        echo "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t<td valign='top' nowrap>";
        if (check_user_access($this, 'delete_organization')) {
            echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "user/deactivate_organization/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this organization? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this organization.\"><img src='" . base_url() . "images/delete.png' border='0'/></a> ";
        }
        if (check_user_access($this, 'update_organization')) {
            echo "<a href='" . base_url() . "user/add_organization/i/" . encryptValue($row['id']) . "' title=\"Click to edit this organization.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
        }
        echo "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'><a href='" . base_url() . "user/add_organization/i/" . encryptValue($row['id']) . "/a/" . encryptValue('view') . "' title=\"Click to view this organization's details.\" class='contentlink'>" . wordwrap($row['organizationname'], 50, "<BR>") . "</a></td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['symbol'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['contactemail'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>(" . substr_replace(substr_replace($row['contactphone'], ') ', 3, 0), '-', 8, 0) . "</td>\r\r\n\t\t\r\r\n\t\t</tr>";
        $counter++;
    }
    echo "<tr>\r\r\n\t<td colspan='5' align='right'  class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "user/manage_organizations/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
    echo format_notice("There are no organizations at the moment.");
}
?>
</div>
              </td>
              </tr>

        </table></td>
コード例 #27
0
ファイル: mod_jual_barang.php プロジェクト: januri/AhadPOS2
<?php

/* mod_jual_barang.php ------------------------------------------------------
  version: 1.01

  Part of AhadPOS : http://ahadpos.com
  License: GPL v2
  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  http://vlsm.org/etc/gpl-unofficial.id.html

  This program 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 v2 (links provided above) for more details.
  ---------------------------------------------------------------- */
check_user_access(basename($_SERVER['SCRIPT_NAME']));
//HS javascript untuk menampilkan popup
?>

<SCRIPT TYPE="text/javascript">
<!--
   function popupform(myform, windowname)
   {
      if (!window.focus)
         return true;
      window.open('', windowname, 'type=fullWindow,fullscreen=yes,scrollbars=yes');
      myform.target = windowname;
      return true;
   }
//-->
</SCRIPT>
コード例 #28
0
$status = "";
$status2 = "";
if ($this->session->userdata('isadmin') == 'N') {
    $status = 'hidden';
}
if ($this->session->userdata('isadmin') == 'Y') {
    $status2 = 'hidden';
}
?>
            <div class="widget-body">
                <?php 
if (!empty($procurement['page_list'])) {
    print '<table class="table table-striped table-hover">' . '<thead>' . '<tr>' . '<th width="5%" class="' . $status2 . '"></th>' . '<th class="' . $status . '">Procurement and Disposal Entity</th>' . '<th class="hidden-480">Financial year</th>' . '<th class="hidden-480">Entries</th>' . '<th>Author</th>' . '<th>Date Added</th>' . '</tr>' . '</thead>' . '</tbody>';
    $delete_rights = check_user_access($this, 'delete_procurement_plan');
    $edit_rights = check_user_access($this, 'edit_procurement_plan');
    $create_entry_rights = check_user_access($this, 'add_procurement_entry');
    $delete_str = '';
    $edit_str = '';
    $create_entry_str = '';
    foreach ($procurement['page_list'] as $row) {
        if ($delete_rights) {
            $delete_str = '<a title="Delete plan" href="javascript:void(0);" onclick="confirmDeleteEntity(\'' . base_url() . 'procurement/delete_plan/i/' . encryptValue($row['plan_id']) . '\', \'Are you sure you want to delete this plan?\\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.\')"><i class="fa fa-trash"></i></a>';
        }
        if ($edit_rights) {
            $edit_str = '<a title="Edit plan details" href="' . base_url() . 'procurement/procurement_plan_form/i/' . encryptValue($row['plan_id']) . '"><i class="fa fa-edit"></i></a>';
        }
        if ($create_entry_rights) {
            $create_entry_str = '&nbsp;|&nbsp;' . '<a href="' . base_url() . 'procurement/load_procurement_entry_form/v/' . encryptValue($row['plan_id']) . '">' . 'Create entry' . '</a>';
        }
        $status_str = '';
        $addenda_str = '[NONE]';